<commit_before><?php
/**
 *  ocs-webserver
 *
 *  Copyright 2016 by pling GmbH.
 *
 *    This file is part of ocs-webserver.
 *
 *    This program is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU Affero General Public License as
 *    published by the Free Software Foundation, either version 3 of the
 *    License, or (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU Affero General Public License for more details.
 *
 *    You should have received a copy of the GNU Affero General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 **/

$helperFetchMainCategories = new Default_View_Helper_FetchMainCategories();
$helperRatingWidget = new Default_View_Helper_PrintRatingWidget();

$categories = $helperFetchMainCategories->fetchMainCategories();

$helperAddDefaultScheme = new Default_View_Helper_AddDefaultScheme();
$helperBuildProductUrl = new Default_View_Helper_BuildProductUrl();
$helperTruncate = new Default_View_Helper_Truncate();
$helperImage = new Default_View_Helper_Image();
$helperPrintDate = new Default_View_Helper_PrintDate();
$textCountryCity = $this->member->city;
$textCountryCity .= $this->member->country ? ', ' . $this->member->country : '';
$helperMemberScore = new Default_View_Helper_FetchMemberScore();

$isSupporter = $this->stat['donationIssupporter'];

$config = Zend_Registry::get('config');
$plingcatid = $config->settings->member->plingcat->id;
?>
    <main class="about-me-page">

        <section class="head-wrap">

            <!-- HEADER -->

            <section class="wrapper">
                
 
                <!-- banner -->

                <section class="header">

                    <!-- about me summary -->
                    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 summary" style=" padding-top:65px" >
                        <article class="well" style="width: 100%;">
                            <div class="about-title">
                                <figure class="relative inline profile-image-container">
                                    <?php if( $isSupporter) { ?><span class="supporter-badge">S</span>                                                  
                                    <?php }?>
                                    <img src="<?php echo $helperImage->Image($this->member->profile_image_url,array('width' => 110, 'height' => 110, 'crop' => 2)); ?>"
                                         alt="profile-image"
                                         width="110"
                                         height="110">
                                </figure>
                                <h1><span class="lightblue"><?php echo $this->member->username; ?></span></h1>
                                <?php if($this->member->firstname ) :?>
                                <span class="glyphicon glyphicon-user"></span>
                                <span class="text"><?php echo $this->member->firstname; ?>&nbsp;<?php echo $this->member->lastname; ?> </span>
                                <?php endif; ?>

                               <?php if($textCountryCity):?>
                                <span class="glyphicon glyphicon-map-marker"></span>
                                <span class="text"><?php echo $textCountryCity ?></span>
                               <?php endif; ?>
                            </div>
                            <div class="about-footer">                                                            
                             
                               

                            <div class="col-container" >
                            <div class="details stat" >
                                <h3>Statistics</h3>
                                <div  class="statContent" >
                                    <div class="row ">
                                       <span class="cnt"><?=$this->stat['cntProducts']?> </span> Products
                                    </div>
                                    <div class="row">
                                       <span class="cnt"><?=$this->stat['cntComments']?> </span> Comments
                                    </div>

                                    <?php if($this->member->member_id != $plingcatid):?>
                                    <div class="row">
                                       Plinged <span class="cnt"> <?=$this->stat['cntPlingsHeGave']?> </span>Products
                                    </div>
                                    <div class="row">
                                       Got <span class="cnt"> <?=$this->stat['cntPlingsHeGot']?> </span><img  src="/images/system/pling-btn-active.png" style="width:20px; height:20px" />
                                    </div>
                                <?php endif; ?>

                                    <div class="row">
                                       Likes <span class="cnt"> <?=$this->stat['cntLikesHeGave']?> </span>Products
                                    </div>
                                    <div class="row">
                                       Got <span class="cnt"> <?=$this->stat['cntLikesHeGot']?> </span>Likes <i class="fa fa-heart" style="color:#8e44ad" aria-hidden="true"></i>

                                    </div>
                                    <?php /*
                                     <div class="row">
                                       <span class="cnt"><?=$this->stat['cntPageviews']?> </span> Pageviews
                                    </div>
                                    */
                                    ?>
                                  <?php 
                                      if($this->stat['donationMax'] !=null && !$isSupporter){ // inactive supporter
                                  ?>
                                   <div class="row">
                                     <span class="cnt">Inactive supporter since: <?=$helperPrintDate->printDate(date('Y-m-d H:i:s', strtotime($this->stat['donationMax'] . ' +1 year')))?></span> 
                                  </div>
                                  <?php } ?>

                                    <?php 
                                        if($isSupporter){
                                    ?>                                     
                                     <div class="row">                                     
                                       <span>Supporter since: <?=$helperPrintDate->printDate($this->stat['donationMin'])?> </span> 
                                    </div>
                                      <div class="row">                                     
                                       <span>Supporter until: <?=$helperPrintDate->printDate(date('Y-m-d H:i:s', strtotime($this->stat['donationMax'] . ' +1 year')))?> </span> 
                                    </div>                                     
                                    <?php } ?>
                                     <div class="row">                                     
                                       <span class="">Last time active : <?=$helperPrintDate->printDate($this->stat['userLastActiveTime'])?> </span> 
                                    </div>
                                     <div class="row">                                                                            
                                        <span class="text">Joined : <?=$helperPrintDate->printDate($this->member->created_at);?></span>                                       
                                    </div>
                                    
                                   
                                </div>
                            </div>
                        </div>

                             
                            </div>
                            <?php
                            $helperUserRole = new Backend_View_Helper_UserRole();
                            $userRoleName = $helperUserRole->userRole();
                            ?>

                            <?php if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) : ?>
                                <div class="pull-right">
                                <span class="page-views">
                                <a id="linktohive" target="_blank" href="http://cp1.hive01.com/usermanager/search.php?username=<?= $this->member->username ?>">link to hive</a>
                                <a id="delete-this" href="/backend/user/delete?member_id=<?= $this->member->member_id ?>">delete user</a>
                                </span>
                                <span class="page-views" style="color: red;">
                                    <input type="checkbox" id="pling-excluded-checkbox" <?php echo $this->member->pling_excluded == 1 ? ' checked=\'checked\' ' : ''; ?> />  pling-excluded
                                </span>
                                <script>
                                    $('#delete-this').on('click', function (event) {

                                        event.stopPropagation();
                                        var target = $(this).attr('href');

                                        $.ajax({
                                            url: target,
                                            success: function (results) {
                                                alert('User deleted successfully');<commit_msg>member<commit_after><?php
/**
 *  ocs-webserver
 *
 *  Copyright 2016 by pling GmbH.
 *
 *    This file is part of ocs-webserver.
 *
 *    This program is free software: you can redistribute it and/or modify
 *    it under the terms of the GNU Affero General Public License as
 *    published by the Free Software Foundation, either version 3 of the
 *    License, or (at your option) any later version.
 *
 *    This program is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *    GNU Affero General Public License for more details.
 *
 *    You should have received a copy of the GNU Affero General Public License
 *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
 **/

$helperFetchMainCategories = new Default_View_Helper_FetchMainCategories();
$helperRatingWidget = new Default_View_Helper_PrintRatingWidget();

$categories = $helperFetchMainCategories->fetchMainCategories();

$helperAddDefaultScheme = new Default_View_Helper_AddDefaultScheme();
$helperBuildProductUrl = new Default_View_Helper_BuildProductUrl();
$helperTruncate = new Default_View_Helper_Truncate();
$helperImage = new Default_View_Helper_Image();
$helperPrintDate = new Default_View_Helper_PrintDate();
$textCountryCity = $this->member->city;
$textCountryCity .= $this->member->country ? ', ' . $this->member->country : '';
$helperMemberScore = new Default_View_Helper_FetchMemberScore();

$isSupporter = $this->stat['donationIssupporter'];

$config = Zend_Registry::get('config');
$plingcatid = $config->settings->member->plingcat->id;
?>
    <main class="about-me-page">

        <section class="head-wrap">

            <!-- HEADER -->

            <section class="wrapper">
                
 
                <!-- banner -->

                <section class="header">

                    <!-- about me summary -->
                    <div class="col-lg-4 col-md-4 col-sm-4 col-xs-12 summary" style=" padding-top:65px" >
                        <article class="well" style="width: 100%;">
                            <div class="about-title">
                                <figure class="relative inline profile-image-container">
                                    <?php if( $isSupporter) { ?><span class="supporter-badge">S</span>                                                  
                                    <?php }?>
                                    <img src="<?php echo $helperImage->Image($this->member->profile_image_url,array('width' => 110, 'height' => 110, 'crop' => 2)); ?>"
                                         alt="profile-image"
                                         width="110"
                                         height="110">
                                </figure>
                                <h1><span class="lightblue"><?php echo $this->member->username; ?></span></h1>
                                <?php if($this->member->firstname ) :?>
                                <span class="glyphicon glyphicon-user"></span>
                                <span class="text"><?php echo $this->member->firstname; ?>&nbsp;<?php echo $this->member->lastname; ?> </span>
                                <?php endif; ?>

                               <?php if($textCountryCity):?>
                                <span class="glyphicon glyphicon-map-marker"></span>
                                <span class="text"><?php echo $textCountryCity ?></span>
                               <?php endif; ?>
                            </div>
                            <div class="about-footer">                                                            
                             
                               

                            <div class="col-container" >
                            <div class="details stat" >
                                <h3>Statistics</h3>
                                <div  class="statContent" >
                                    <div class="row ">
                                       <span class="cnt"><?=$this->stat['cntProducts']?> </span> Products
                                    </div>
                                    <div class="row">
                                       <span class="cnt"><?=$this->stat['cntComments']?> </span> Comments
                                    </div>

                                    <?php if($this->member->member_id != $plingcatid):?>
                                    <div class="row">
                                       Plinged <span class="cnt"> <?=$this->stat['cntPlingsHeGave']?> </span>Products
                                    </div>
                                    <div class="row">
                                       Got <span class="cnt"> <?=$this->stat['cntPlingsHeGot']?> </span><img  src="/images/system/pling-btn-active.png" style="width:20px; height:20px" />
                                    </div>
                                <?php endif; ?>

                                    <div class="row">
                                       Likes <span class="cnt"> <?=$this->stat['cntLikesHeGave']?> </span>Products
                                    </div>
                                    <div class="row">
                                       Got <span class="cnt"> <?=$this->stat['cntLikesHeGot']?> </span>Likes <i class="fa fa-heart" style="color:#8e44ad" aria-hidden="true"></i>

                                    </div>
                                    <?php /*
                                     <div class="row">
                                       <span class="cnt"><?=$this->stat['cntPageviews']?> </span> Pageviews
                                    </div>
                                    */
                                    ?>
                                  <?php 
                                      if($this->stat['donationMax'] !=null && !$isSupporter){ // inactive supporter
                                  ?>
                                   <div class="row">
                                     <span class="cnt">Inactive supporter since: <?=$helperPrintDate->printDate(date('Y-m-d H:i:s', strtotime($this->stat['donationMax'] . ' +1 year')))?></span> 
                                  </div>
                                  <?php } ?>

                                    <?php 
                                        if($isSupporter){
                                    ?>                                     
                                     <div class="row">                                     
                                       <span>Supporter since: <?=$helperPrintDate->printDate($this->stat['donationMin'])?> </span> 
                                    </div>
                                      <div class="row">                                     
                                       <span>Supporter until: <?=$helperPrintDate->printDate(date('Y-m-d H:i:s', strtotime($this->stat['donationMax'] . ' +1 year')))?> </span> 
                                    </div>                                     
                                    <?php } ?>
                                     <div class="row">                                     
                                       <span class="">Last time active : <?=$helperPrintDate->printDate($this->stat['userLastActiveTime'])?> </span> 
                                    </div>
                                     <div class="row">                                                                            
                                        <span class="text">Joined : <?=$helperPrintDate->printDate($this->member->created_at);?></span>                                       
                                    </div>
                                    
                                   
                                </div>
                            </div>
                        </div>

                             
                            </div>
                            <?php
                            $helperUserRole = new Backend_View_Helper_UserRole();
                            $userRoleName = $helperUserRole->userRole();
                            ?>

                            <?php if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) : ?>
                                <div class="pull-right">
                                <span class="page-views">
                                <a id="linktohive" target="_blank" href="http://cp1.hive01.com/usermanager/search.php?username=<?= $this->member->username ?>">link to hive</a>
                                <a id="delete-this" href="/backend/user/delete?member_id=<?= $this->member->member_id ?>">delete user</a>
                                </span>
                                <br>
                                <span class="page-views" style="color: red;">
                                    <input type="checkbox" id="pling-excluded-checkbox" <?php echo $this->member->pling_excluded == 1 ? ' checked=\'checked\' ' : ''; ?> />  pling-excluded
                                </span>
                                <script>
                                    $('#delete-this').on('click', function (event) {

                                        event.stopPropagation();
                                        var target = $(this).attr('href');

                                        $.ajax({
                                            url: target,
                                            success: function (results) {
                                                alert('User deleted successfully');
{'fraction_non_alphanumeric': 0.12004899959167006, 'fraction_numerical': 0.004593711719069008, 'mean_word_length': 0.9715234453612397, 'pattern_counts': {'":': 0, '<': 278, '<?xml version=': 0, '>': 386, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 200, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3313471', 'n_tokens_mistral': 4440, 'n_tokens_neox': 4118, 'n_words': 862}