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

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     .inline {
0026         display: inline-block;
0027     }
0028     
0029     .cell-default {
0030         line-height: 2em;
0031         vertical-align: middle;
0032     }
0033     .row-total {
0034         border-top: #1595ee solid thin;
0035         padding-top: 1em;
0036         padding-bottom: 1em;
0037         line-height: 30px;
0038     }
0039     
0040     .popover {
0041         min-width:350px;
0042     }
0043     
0044     .popover-title { 
0045         text-transform: none;
0046         font-size: 11pt;
0047     }
0048     
0049     .popover-content { 
0050         text-transform: none;
0051         font-size: 11pt;
0052     }
0053 </style>
0054 
0055 <ul class="nav nav-tabs margin-bottom-10 tabs-up" id="plingtabs">
0056 <?php
0057 
0058 $helperUserRole = new Backend_View_Helper_UserRole();
0059 $userRoleName = $helperUserRole->userRole();
0060 
0061 $isForAdmin = (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName);
0062     
0063 $isCurrentMonth = false;
0064 $currentYear = date("Y",time());
0065 
0066 if($this->year) {
0067     $currentYear = $this->year;
0068 }
0069 
0070 
0071 $currentDate = date("Ym",time());
0072 $currentMonth = '';
0073 $monthlyDownload = null;
0074 $allSections = array();
0075 $css_active = 'active';
0076 
0077 $printCurrentMonth = new DateTime($currentDate.'01');
0078 
0079 $modelDownload = new Default_Model_Section();
0080 $downloadMonths = $modelDownload->getAllDownloadMonths($currentYear, $isForAdmin);
0081 $countDownloadsOverall = count($downloadMonths);
0082 $minDate = null;
0083 
0084 if ($countDownloadsOverall > 0) {  
0085     foreach ($downloadMonths as $download) {
0086         $printMonth = new DateTime($download['yearmonth'].'01');
0087         if($minDate == null) {
0088             $minDate = $download['yearmonth'];
0089         }
0090         
0091         $printDate = $printMonth->format('M Y');
0092         $printDateNow = $printCurrentMonth->format('M Y');
0093         
0094         if($printDateNow == $printDate) {
0095             $printDate = 'Current month';
0096             $isCurrentMonth = true;
0097         } else {
0098             $isCurrentMonth = false;
0099         }
0100         
0101         if ($printDate != $currentMonth) {
0102             $monthlyDownload = array();
0103             $currentMonth = $printDate;
0104         
0105     ?>
0106     
0107     <?php if($isCurrentMonth) {?>
0108     
0109     <li class="media_node span <?=$css_active?> ">
0110         <a href="/funding/plingsmonthajax?yearmonth=<?= $download['yearmonth'] ?>" data-toggle="tabajax" data-target="#pling-tab-content" id="tab_<?= $download['yearmonth'] ?>"><?= $printDate ?></a>
0111     </li>
0112     
0113     <?php } else { ?>
0114     
0115     <li class="media_node span <?=$css_active?> ">
0116         <a href="/funding/plingsmonthajax?yearmonth=<?= $download['yearmonth'] ?>" data-toggle="tabajax" data-target="#pling-tab-content" id="tab_<?= $download['yearmonth'] ?>"><?= $printDate ?></a>
0117     </li>
0118     
0119     <?php } ?>
0120     
0121     <?php
0122         }
0123         $css_active = '';
0124         $monthlyDownload[] = $download;
0125         $allSections[$download['yearmonth']] = $monthlyDownload;
0126     }
0127      
0128 } else {
0129     $currentMonth = '';
0130     $currentDate = date("Ym",time());
0131     $printMonth = new DateTime($currentDate.'01');
0132     
0133     $printDate = $printMonth->format('M Y');
0134     $printDate = 'Current month';
0135     
0136     $minDate = $currentDate;
0137     
0138     ?>
0139     <li class="in active">
0140         <a href="/funding/plingsmonthajax?yearmonth=<?= $currentDate  ?>" data-toggle="tabajax" data-target="#pling-tab-content" id="tab_<?= $currentDate  ?>"><?= $printDate ?></a>
0141     </li>
0142 <?php
0143 }
0144 ?>
0145 </ul>
0146 
0147 
0148 
0149 <div class="container-fluid margin-bottom-12" style="padding-left: 0; padding-right: 0; padding-bottom: 10px;">
0150     <div class="row">
0151         <div class="col-md-2 text-left text-uppercase nowrap" style="white-space: nowrap;"><strong>Section</strong></div>
0152         <div class="col-md-1 text-right text-uppercase nowrap" style="white-space: nowrap;"><strong>Supporters</strong></div>
0153         <div class="col-md-1 text-right text-uppercase nowrap" style="white-space: nowrap;"><strong>Donations</strong><div class="inline" style="margin-left:.2em;" data-placement="top" data-toggle="popover" title="" data-trigger="hover" data-html="true" data-content="Sum of all supporter donations for this month." data-original-title="Donations"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></div></div>
0154         <?php if (Default_Model_DbTable_MemberRole::ROLE_NAME_ADMIN == $userRoleName) : ?>
0155         <div class="col-md-1 text-right text-uppercase nowrap" style="white-space: nowrap;"><strong>Potential (A)</strong><div class="inline" style="margin-left:.2em;" data-placement="top" data-toggle="popover" title="" data-trigger="hover" data-html="true" data-content="Potential Payout Amount for this month." data-original-title="Potential Payout"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></div></div>
0156         <?php endif; ?> 
0157         <!--<div class="col-md-1 text-right text-uppercase nowrap" style="white-space: nowrap;"><strong>Downloads</strong><div class="inline" style="margin-left:.2em;" data-placement="top" data-toggle="popover" title="" data-trigger="hover" data-html="true" data-content="Sum of all downloads of all files (active or archived) within this month." data-original-title="Downloads"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></div></div>-->
0158         <div class="col-md-1 text-right text-uppercase nowrap" style="white-space: nowrap;"><strong>Payout</strong><div class="inline" style="margin-left:.2em;" data-placement="top" data-toggle="popover" title="" data-trigger="hover" data-html="true" data-content="Real Payout Amount for this month." data-original-title="Payout"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></div></div>
0159         <div class="col-md-1 text-right text-uppercase nowrap" style="white-space: nowrap;"><strong>Pling-Factor</strong><div class="inline" style="margin-left:.2em;" data-placement="top" data-toggle="popover" title="" data-trigger="hover" data-html="true" data-content="Donations/Payout = Pling-Factor" data-original-title="Pling-Factor"><span class="glyphicon glyphicon-question-sign" aria-hidden="true"></span></div></div>
0160         <?php /*<div class="col-md-1 text-right text-uppercase nowrap" style="white-space: nowrap;"><strong>Target</strong></div>*/ ?>
0161         <div class="col-md-4 text-left text-uppercase nowrap" style="white-space: nowrap;"><strong>Supporters</strong></div>
0162         
0163     </div>
0164 </div>
0165 
0166 
0167 
0168 <div class="tab-content" id="pling-tab-content"><i class="fa fa-spinner"></i></div>