File indexing completed on 2025-05-04 05:29:29

0001 <?php 
0002 /**
0003  *  ocs-webserver
0004  *
0005  *  Copyright 2016 by pling GmbH.
0006  *
0007  *    This file is part of ocs-webserver.
0008  *
0009  *    This program is free software: you can redistribute it and/or modify
0010  *    it under the terms of the GNU Affero General Public License as
0011  *    published by the Free Software Foundation, either version 3 of the
0012  *    License, or (at your option) any later version.
0013  *
0014  *    This program is distributed in the hope that it will be useful,
0015  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
0016  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
0017  *    GNU Affero General Public License for more details.
0018  *
0019  *    You should have received a copy of the GNU Affero General Public License
0020  *    along with this program.  If not, see <http://www.gnu.org/licenses/>.
0021  **/
0022 
0023 ?>
0024 <style>
0025     .cell-default {
0026         line-height: 4em;
0027         vertical-align: middle;
0028     }
0029     .row-total {
0030         border-top: #1595ee solid thin;
0031         padding-top: 1em;
0032         padding-bottom: 1em;
0033         line-height: 30px;
0034     }
0035     
0036     .popover {
0037         min-width:350px;
0038     }
0039     
0040     .popover-title { 
0041         text-transform: none;
0042         font-size: 11pt;
0043     }
0044     
0045     .popover-content { 
0046         text-transform: none;
0047         font-size: 11pt;
0048     }
0049 </style>
0050 
0051 <ul class="nav nav-tabs margin-bottom-10 tabs-up" id="plingtabs">
0052 <?php
0053 
0054 $helperUserRole = new Backend_View_Helper_UserRole();
0055 $userRoleName = $helperUserRole->userRole();
0056     
0057 $isCurrentMonth = false;
0058 $currentYear = date("Y",time());
0059 
0060 $member = $this->view_member;
0061 
0062 if($this->year) {
0063     $currentYear = $this->year;
0064 }
0065 
0066 
0067 $currentDate = date("Ym",time());
0068 $currentMonth = '';
0069 $monthlyDownload = null;
0070 $allDownloads = array();
0071 $css_active = 'active';
0072 
0073 $printCurrentMonth = new DateTime($currentDate.'01');
0074 
0075 $modelDownload = new Default_Model_StatDownload();
0076 $downloadMonths = $modelDownload->getUserDownloadMonths($this->member->member_id, $currentYear);
0077 $countDownloadsOverall = count($downloadMonths);
0078 $minDate = null;
0079 
0080 if ($countDownloadsOverall > 0) {  
0081     foreach ($downloadMonths as $download) {
0082         $printMonth = new DateTime($download['yearmonth'].'01');
0083         if($minDate == null) {
0084             $minDate = $download['yearmonth'];
0085         }
0086         
0087         $printDate = $printMonth->format('M Y');
0088         $printDateNow = $printCurrentMonth->format('M Y');
0089         
0090         if($printDateNow == $printDate) {
0091             $printDate = 'Current month';
0092             $isCurrentMonth = true;
0093         } else {
0094             $isCurrentMonth = false;
0095         }
0096         
0097         if ($printDate != $currentMonth) {
0098             $monthlyDownload = array();
0099             $currentMonth = $printDate;
0100         
0101     ?>
0102     
0103     <?php   
0104         $showDiv = false;
0105         $infoTextLinkToPaypal = "";
0106         
0107         if(isset($download['payment_transaction_id'])) {
0108             $infoTextLinkToPaypal = ' Your PayPal TransactionId:'.$download['payment_transaction_id'].'.';
0109         }
0110         $payoutStatusTable = new Default_Model_DbTable_PayoutStatus();
0111         $payoutStatus = $payoutStatusTable->find($download['status'])->current();
0112         
0113         $infoTitle = $payoutStatus['title'];
0114         $infoText = $payoutStatus['description'];
0115         $infoIconStyle = "color: ".$payoutStatus['color']." ";
0116         $infoClass = $payoutStatus['type'];
0117         $infoIcon = $payoutStatus['icon'];
0118         
0119         $infoText .= $infoTextLinkToPaypal;
0120         
0121         $popover = "";
0122         if(isset($download['status']) && isset($infoText)) {
0123             $popover = '<div class="inline payout-popover-'.$infoClass.'" style="margin-left:.2em;" data-placement="top" data-toggle="popover" title="'.$infoTitle.'" data-trigger="hover" data-html="true" data-content="'.$infoText.'"><span style="'. $infoIconStyle .'" class="glyphicon '.$infoIcon.'" aria-hidden="true"></span></div>';
0124         }
0125     ?>
0126     
0127     <?php if($isCurrentMonth) {?>
0128     
0129     <li class="media_node span <?=$css_active?> ">
0130         <a href="/member/<?= $member->member_id ?>/plingsmonthajax?yearmonth=<?= $download['yearmonth'] ?>" data-toggle="tabajax" data-target="#pling-tab-content" id="tab_<?= $download['yearmonth'] ?>"><?= $printDate ?><?= $popover ?></a>
0131     </li>
0132     
0133     <?php } else { ?>
0134     
0135     <li class="media_node span <?=$css_active?> ">
0136         <a href="/member/<?= $member->member_id ?>/plingsmonthajax?yearmonth=<?= $download['yearmonth'] ?>" data-toggle="tabajax" data-target="#pling-tab-content" id="tab_<?= $download['yearmonth'] ?>"><?= $printDate ?><?= $popover ?></a>
0137     </li>
0138     
0139     <?php } ?>
0140     
0141     <?php
0142         }
0143         $css_active = '';
0144         $monthlyDownload[] = $download;
0145         $allDownloads[$download['yearmonth']] = $monthlyDownload;
0146     }
0147      
0148 } else {
0149     $currentMonth = '';
0150     $currentDate = date("Ym",time());
0151     $printMonth = new DateTime($currentDate.'01');
0152     
0153     $printDate = $printMonth->format('M Y');
0154     $printDate = 'Current month';
0155     
0156     $minDate = $currentDate;
0157     
0158     ?>
0159     <li class="in active">
0160         <a href="/member/<?= $member->member_id ?>/plingsmonthajax?yearmonth=<?= $currentDate  ?>" data-toggle="tabajax" data-target="#pling-tab-content" id="tab_<?= $currentDate  ?>"><?= $printDate ?></a>
0161     </li>
0162 <?php
0163 }
0164 ?>
0165 </ul>
0166 
0167 
0168 
0169 <div class="container-fluid margin-bottom-12" style="padding-left: 0; padding-right: 0;">
0170     <div class="row">
0171         <div class="col-md-1" style="min-width: 150px;"></div>
0172         <?php if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) : ?>
0173         <div class="col-md-2 text-left text-uppercase nowrap" style="white-space: nowrap; min-width: 190px;"><strong>Products</strong></div>
0174         <?php else: ?>
0175         <div class="col-md-3 text-left text-uppercase nowrap" style="white-space: nowrap; min-width: 190px;"><strong>Products</strong></div>
0176         <?php endif; ?>
0177         <?php if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) : ?>
0178         <div class="col-md-1 text-right text-uppercase nowrap" style="white-space: nowrap; min-width: 190px;"><strong>Downloads Old</strong><div class="inline" style="margin-left:.2em;" data-placement="top" data-toggle="popover" title="Downloads" data-trigger="hover" data-html="true" data-content="Sum of all downloads of all files (active or archived of this product within this month."><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></div></div>
0179         <?php endif; ?>
0180         <div class="col-md-1 text-right text-uppercase nowrap" style="white-space: nowrap; min-width: 190px;"><strong>Downloads</strong><div class="inline" style="margin-left:.2em;" data-placement="top" data-toggle="popover" title="Downloads" data-trigger="hover" data-html="true" data-content="Sum of all downloads of all files (active or archived of this product within this month."><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></div></div>
0181         <div class="col-md-1 text-right text-uppercase nowrap" style="white-space: nowrap; min-width: 190px;"><strong>Pling-Factor</strong><div class="inline" style="margin-left:.2em;" data-placement="top" data-toggle="popover" title="Pling-Factor" data-trigger="hover" data-html="true" data-content="The Pling-Factor's base is $-cent and depends on the product category.<br>A factor of '1' means:<br>1 Download equals 1 $-cent."><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></div></div>
0182         <div class="col-md-1 text-right text-uppercase nowrap" style="white-space: nowrap; min-width: 190px;"><strong style="color: #BBB">Potential Payout</strong></div>
0183 
0184         <?php if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) : ?>
0185         <div class="col-md-1 text-right text-uppercase nowrap" style="white-space: nowrap; min-width: 190px;"><strong>Section-Factor</strong><div class="inline" style="margin-left:.2em;" data-placement="top" data-toggle="popover" title="Section-Factor" data-trigger="hover" data-html="true" data-content="This is the factor for this section. The factor per section is not fixed until the month has really ended. For more information please see: https://www.pling.com/funding"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></div></div>
0186         <?php endif; ?>
0187         
0188         
0189         <?php if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) : ?>
0190         <div class="col-md-1 text-right text-uppercase nowrap" style="white-space: nowrap; min-width: 190px;"><strong>Actual Payout Old</strong><div class="inline" style="margin-left:.2em;" data-placement="top" data-toggle="popover" title="Payout" data-trigger="hover" data-html="true" data-content="This shows the amount that will be paid out to you until May 2019."><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></div></div>
0191         <?php endif; ?>
0192         <div class="col-md-1 text-right text-uppercase nowrap" style="white-space: nowrap; min-width: 190px;"><strong>Actual Payout</strong><div class="inline" style="margin-left:.2em;" data-placement="top" data-toggle="popover" title="Payout" data-trigger="hover" data-html="true" data-content="This shows the amount that will be paid out to you until May 2019."><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></div></div>
0193 
0194     </div>
0195 </div>
0196 
0197 
0198 
0199 <div class="tab-content" id="pling-tab-content"><i class="fa fa-spinner"></i></div>