Exemplo n.º 1
0
 function returnCalendar()
 {
     global $system;
     $return = '<table width="100%" border="0" cellspacing="1" cellpadding="0">';
     $return .= '<tr>';
     $return .= '<th align="center" colspan="7">' . rcms_date_localise(date('F Y', $this->_temp['first_day_stamp'])) . '</th>';
     $return .= '</tr>';
     $return .= '<tr>';
     $return .= rcms_date_localise('<th align="center">Mon</th><th align="center">Tue</th><th align="center">Wed</th><th align="center">Thu</th><th align="center">Fri</th><th align="center">Sat</th><th align="center">Sun</th>');
     $return .= '</tr>';
     $days_showed = 1;
     $cwpos = $this->_temp['first_day_week_pos'];
     if ($cwpos == 0) {
         $cwpos = 7;
     }
     while ($days_showed <= $this->_temp['number_of_days']) {
         $return .= '<tr>';
         if ($cwpos > 1) {
             $return .= '<td colspan="' . ($cwpos - 1) . '">&nbsp;</td>';
         }
         $inc = 0;
         for ($i = $days_showed; $i < $days_showed + 7 && $i <= $this->_temp['number_of_days'] && $cwpos <= 7; $i++) {
             $class = '';
             if (!empty($this->_highlight[$i])) {
                 $class = 'special ';
             }
             if (empty($this->_events[$i])) {
                 $class .= 'row2';
             } else {
                 $class .= 'row3';
             }
             if (empty($this->_events[$i])) {
                 $return .= '<td align="center" class="' . $class . '">' . $i . '</td>';
             } else {
                 $return .= '<td align="center" class="' . $class . '"><a href="' . $this->_events[$i] . '"  class="' . $class . '">' . $i . '</a></td>';
             }
             $cwpos++;
             $inc++;
         }
         $days_showed = $days_showed + $inc;
         $cwpos = 0;
         $return .= '</tr>';
     }
     $return .= '</table>';
     return $return;
 }
Exemplo n.º 2
0
 /**
  * Shows user signups by year with funny bars
  * 
  * @global object $ubillingConfig
  * @param int $year
  * 
  * @return void
  */
 function web_SignupsGraphYear($year)
 {
     global $ubillingConfig;
     $altCfg = $ubillingConfig->getAlter();
     $cemeteryEnabled = @$altCfg['CEMETERY_ENABLED'] ? true : false;
     if ($cemeteryEnabled) {
         $cemetery = new Cemetery();
     }
     $year = vf($year);
     $yearcount = zb_SignupsGetCountYear($year);
     $maxsignups = max($yearcount);
     $allmonths = months_array();
     $totalcount = 0;
     $tablecells = wf_TableCell('');
     $tablecells .= wf_TableCell(__('Month'));
     $tablecells .= wf_TableCell(__('Signups'));
     if ($cemeteryEnabled) {
         $tablecells .= wf_TableCell(__('Dead souls'));
         $tablecells .= wf_TableCell('', '10%');
     }
     $tablecells .= wf_TableCell(__('Visual'), '50%');
     $tablerows = wf_TableRow($tablecells, 'row1');
     foreach ($yearcount as $eachmonth => $count) {
         $totalcount = $totalcount + $count;
         $tablecells = wf_TableCell($eachmonth);
         $tablecells .= wf_TableCell(wf_Link('?module=report_signup&month=' . $year . '-' . $eachmonth, rcms_date_localise($allmonths[$eachmonth])));
         $tablecells .= wf_TableCell($count);
         if ($cemeteryEnabled) {
             $deadDateMask = $year . '-' . $eachmonth . '-';
             $deadCount = $cemetery->getDeadDateCount($deadDateMask);
             $deadBar = web_barTariffs($count, $deadCount);
             $tablecells .= wf_TableCell($deadCount);
             $tablecells .= wf_TableCell($deadBar);
         }
         $tablecells .= wf_TableCell(web_bar($count, $maxsignups), '', '', 'sorttable_customkey="' . $count . '"');
         $tablerows .= wf_TableRow($tablecells, 'row3');
     }
     $result = wf_TableBody($tablerows, '100%', '0', 'sortable');
     $result .= wf_tag('b', false) . __('Total') . ': ' . $totalcount . wf_tag('b', true);
     show_window(__('User signups by year') . ' ' . $year, $result);
 }
Exemplo n.º 3
0
/**
 *
 * Return Month select Web From element 
 *
 * @param   $name name of element
 * @param   $label text label for input
 * @param   $selected selected $value for selector
 * @param   $br append new line - bool
 * @return  string
 *
 */
function la_MonthSelector($name, $label, $selected = '', $br = false)
{
    $allmonth = months_array();
    $params = array();
    //localize months
    foreach ($allmonth as $monthnum => $monthname) {
        $params[$monthnum] = rcms_date_localise($monthname);
    }
    $inputid = la_InputId();
    if ($br) {
        $newline = '<br>';
    } else {
        $newline = '';
    }
    $result = '<select name="' . $name . '" id="' . $inputid . '">';
    if (!empty($params)) {
        foreach ($params as $value => $eachparam) {
            $sel_flag = '';
            if ($selected != '') {
                if ($selected == $value) {
                    $sel_flag = 'SELECTED';
                }
            }
            $result .= '<option value="' . $value . '" ' . $sel_flag . '>' . $eachparam . '</option>' . "\n";
        }
    }
    $result .= '</select>' . "\n";
    if ($label != '') {
        $result .= '<label for="' . $inputid . '">' . __($label) . '</label>';
    }
    $result .= $newline . "\n";
    return $result;
}
Exemplo n.º 4
0
 /**
  * renders users signup report
  * 
  * @return void
  */
 public function reportSignup()
 {
     $regdates = array();
     $months = months_array();
     $monthCount = array();
     $showYear = wf_CheckPost(array('showyear')) ? vf($_POST['showyear'], 3) : curyear();
     $showMonth = wf_CheckGet(array('month')) ? mysql_real_escape_string($_GET['month']) : curmonth();
     $yearCount = 0;
     if (!empty($this->users)) {
         foreach ($this->users as $io => $each) {
             if (!empty($each['regdate'])) {
                 $dateTime = explode(' ', $each['regdate']);
                 $regdates[$dateTime[0]][] = $each['id'];
             }
         }
     }
     // show year selector
     $yearInputs = wf_YearSelector('showyear', ' ', false);
     $yearInputs .= wf_Submit(__('Show'));
     $yearForm = wf_Form('', 'POST', $yearInputs, 'glamour');
     show_window(__('Year'), $yearForm);
     //extract year signup count data
     foreach ($months as $eachMonth => $monthName) {
         $sigcount = 0;
         if (!empty($regdates)) {
             foreach ($regdates as $eachRegDate => $userIds) {
                 $dateMark = $showYear . '-' . $eachMonth;
                 if (ispos($eachRegDate, $dateMark)) {
                     $sigcount = $sigcount + count($regdates[$eachRegDate]);
                 }
                 $monthCount[$eachMonth] = $sigcount;
             }
             $yearCount = $yearCount + $sigcount;
         }
     }
     //render per year grid
     $cells = wf_TableCell('');
     $cells .= wf_TableCell(__('Month'));
     $cells .= wf_TableCell(__('Signups'));
     $cells .= wf_TableCell(__('Visual'));
     $rows = wf_TableRow($cells, 'row1');
     foreach ($months as $eachMonth => $monthName) {
         $cells = wf_TableCell($eachMonth);
         $monthLink = wf_Link(self::URL_REPORTS_MGMT . 'reportSignup&month=' . $showYear . '-' . $eachMonth, rcms_date_localise($monthName), false);
         $cells .= wf_TableCell($monthLink);
         $cells .= wf_TableCell($monthCount[$eachMonth]);
         $cells .= wf_TableCell(web_bar($monthCount[$eachMonth], $yearCount));
         $rows .= wf_TableRow($cells, 'row3');
     }
     $result = wf_TableBody($rows, '100%', 0, 'sortable');
     $result .= __('Total') . ': ' . $yearCount;
     show_window(__('User signups by year') . ' ' . $showYear, $result);
     //render per month registrations
     $cells = wf_TableCell(__('ID'));
     $cells .= wf_TableCell(__('Date'));
     $cells .= wf_TableCell(__('Full address'));
     $cells .= wf_TableCell(__('Real Name'));
     $cells .= wf_TableCell(__('Tariff'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($regdates)) {
         foreach ($regdates as $eachRegDate => $eachRegUsers) {
             if (ispos($eachRegDate, $showMonth)) {
                 foreach ($eachRegUsers as $ix => $eachUserId) {
                     $cells = wf_TableCell($eachUserId);
                     $cells .= wf_TableCell($this->users[$eachUserId]['regdate']);
                     $userLink = wf_Link(self::URL_USERS_PROFILE . $eachUserId, web_profile_icon() . ' ', false);
                     $cells .= wf_TableCell($userLink . $this->userGetFullAddress($eachUserId));
                     $cells .= wf_TableCell($this->users[$eachUserId]['realname']);
                     $cells .= wf_TableCell(@$this->tariffs[$this->users[$eachUserId]['tariffid']]['tariffname']);
                     $rows .= wf_TableRow($cells, 'row3');
                 }
             }
         }
     }
     $result = wf_TableBody($rows, '100%', '0', 'sortable');
     if ($showMonth == curmonth()) {
         $monthTitle = __('Current month user signups');
     } else {
         $monthTitle = __('User signups by month') . ' ' . $showMonth;
     }
     show_window($monthTitle, $result);
 }
Exemplo n.º 5
0
/**
 * Returns FullCalendar widget
 * 
 * @param string $data prepeared data to show
 * @return string
 *  
 */
function wf_FullCalendar($data)
{
    $elementid = wf_InputId();
    $calendar = "<script type='text/javascript'>\r\n\r\n\t\$(document).ready(function() {\r\n\t\r\n\t\tvar date = new Date();\r\n\t\tvar d = date.getDate();\r\n\t\tvar m = date.getMonth();\r\n\t\tvar y = date.getFullYear();\r\n         \r\n\t\t\$('#" . $elementid . "').fullCalendar({\r\n\t\t\teditable: false,\r\n                        theme: true,\r\n                        weekends: true,\r\n                        monthNamesShort: [\r\n                        '" . rcms_date_localise('Jan') . "',\r\n                        '" . rcms_date_localise('Feb') . "',\r\n                        '" . rcms_date_localise('Mar') . "',\r\n                        '" . rcms_date_localise('Apr') . "',\r\n                        '" . rcms_date_localise('May') . "',\r\n                        '" . rcms_date_localise('Jun') . "',\r\n                        '" . rcms_date_localise('Jul') . "',\r\n                        '" . rcms_date_localise('Aug') . "',\r\n                        '" . rcms_date_localise('Sep') . "',\r\n                        '" . rcms_date_localise('Oct') . "',\r\n                        '" . rcms_date_localise('Nov') . "',\r\n                        '" . rcms_date_localise('Dec') . "'\r\n                        ],\r\n\r\n                        monthNames: [\r\n                        '" . rcms_date_localise('January') . "',\r\n                        '" . rcms_date_localise('February') . "',\r\n                        '" . rcms_date_localise('March') . "',\r\n                        '" . rcms_date_localise('April') . "',\r\n                        '" . rcms_date_localise('May') . "',\r\n                        '" . rcms_date_localise('June') . "',\r\n                        '" . rcms_date_localise('July') . "',\r\n                        '" . rcms_date_localise('August') . "',\r\n                        '" . rcms_date_localise('September') . "',\r\n                        '" . rcms_date_localise('October') . "',\r\n                        '" . rcms_date_localise('November') . "',\r\n                        '" . rcms_date_localise('December') . "'\r\n                        ],\r\n                        \r\n                        dayNamesShort: [\r\n                        '" . rcms_date_localise('Sun') . "',\r\n                        '" . rcms_date_localise('Mon') . "',\r\n                        '" . rcms_date_localise('Tue') . "',\r\n                        '" . rcms_date_localise('Wed') . "',\r\n                        '" . rcms_date_localise('Thu') . "',\r\n                        '" . rcms_date_localise('Fri') . "',\r\n                        '" . rcms_date_localise('Sat') . "'\r\n                        ],\r\n                        \r\n                        dayNames: [\r\n                        '" . rcms_date_localise('Sunday') . "',\r\n                        '" . rcms_date_localise('Monday') . "',\r\n                        '" . rcms_date_localise('Tuesday') . "',\r\n                        '" . rcms_date_localise('Wednesday') . "',\r\n                        '" . rcms_date_localise('Thursday') . "',\r\n                        '" . rcms_date_localise('Friday') . "',\r\n                        '" . rcms_date_localise('Saturday') . "'\r\n                        ],\r\n                        \r\n                        buttonText: {\r\n                            today:    '" . __('Today') . "',\r\n                            month:    '" . __('Month') . "',\r\n                            week:     '" . __('Week') . "',\r\n                            day:      '" . __('Day') . "'\r\n                        },\r\n\r\n                        header: {\r\n\t\t\t\tleft: 'prev,next today',\r\n\t\t\t\tcenter: 'title',\r\n\t\t\t\tright: 'month,basicWeek,basicDay'\r\n\t\t\t},\r\n                   \r\n\t\t\tevents: [\r\n\t\t\t\t" . $data . "\r\n\t\t\t\r\n\t\t\t]\r\n                        \r\n\t\t});\r\n\t\t\r\n\t});\r\n\r\n</script>\r\n<div id='" . $elementid . "'></div>\r\n";
    return $calendar;
}
Exemplo n.º 6
0
 /**
  * Returns corpsacts table headers
  * 
  * @param string $year
  * @param string $month
  * 
  * @return string
  */
 public function renderCorpsFlowsHeaders($year, $month)
 {
     $monthArr = months_array();
     $month = $monthArr[$month];
     $month = rcms_date_localise($month);
     $cd = wf_tag('p', false, '', 'align="center"') . wf_tag('b');
     $cde = wf_tag('b', true) . wf_tag('p', true);
     $result = wf_tag('tr', false, 'row2');
     $result .= wf_TableCell($cd . __('Num #') . $cde, '15', '', 'rowspan="3"');
     $result .= wf_TableCell($cd . __('Organisation') . $cde, '141', '', 'rowspan="3"');
     $result .= wf_TableCell('', '62', '', '');
     $result .= wf_TableCell('', '62', '', '');
     $result .= wf_TableCell($cd . $month . ' ' . $year . $cde, '240', '', 'colspan="4"');
     $result .= wf_tag('tr', true);
     $result .= wf_tag('tr', false, 'row2');
     $result .= wf_TableCell($cd . __('Contract') . $cde, '62', '', 'rowspan="2"');
     $result .= wf_TableCell($cd . __('Fee') . $cde, '62', '', 'rowspan="2"');
     $result .= wf_TableCell($cd . __('Income') . $cde, '84', '', 'colspan="2"');
     $result .= wf_TableCell($cd . __('Current deposit') . $cde, '68', '', 'rowspan="2"');
     $result .= wf_TableCell($cd . __('Expenditure') . $cde, '84', '', 'rowspan="2"');
     $result .= wf_tag('tr', true);
     $result .= wf_tag('tr', false, 'row2');
     $result .= wf_TableCell($cd . __('on deposit') . $cde, '41');
     $result .= wf_TableCell($cd . __('corr.') . $cde, '41');
     $result .= wf_tag('tr', true);
     return $result;
 }
Exemplo n.º 7
0
function catv_PaymentsShowGraph($year)
{
    $months = months_array();
    $result = '<table width="100%" class="sortable" border="0">';
    $year_summ = catv_PaymentsGetYearSumm($year);
    $result .= '
            <tr class="row1">
                <td></td>
                <td>' . __('Month') . '</td>
                <td>' . __('Payments count') . '</td>
                <td>' . __('ARPU') . '</td>
                <td>' . __('Cash') . '</td>
                <td width="50%">' . __('Visual') . '</td>
            </tr>
            ';
    foreach ($months as $eachmonth => $monthname) {
        $month_summ = catv_PaymentsGetMonthSumm($year, $eachmonth);
        $paycount = catv_PaymentsGetMonthCount($year, $eachmonth);
        $result .= '
            <tr class="row3">
                <td>' . $eachmonth . '</td>
                <td><a href="?module=catv&action=reports&showreport=finance&month=' . $year . '-' . $eachmonth . '">' . rcms_date_localise($monthname) . '</a></td>
                <td>' . $paycount . '</td>
                <td>' . @round($month_summ / $paycount, 2) . '</td> 
                <td>' . $month_summ . '</td>
                <td>' . web_bar($month_summ, $year_summ) . '</td>
            </tr>
            ';
    }
    $result .= '</table>';
    show_window(__('Payments by') . ' ' . $year, $result);
}
Exemplo n.º 8
0
 /**
  * Returns date remains report header
  * 
  * @param int    $year selected year
  * @param string $monthNumber selected month with leading zero
  * 
  * @return string
  */
 protected function reportDateRemainsHeader($year, $monthNumber)
 {
     $monthArr = months_array();
     $monthName = rcms_date_localise($monthArr[$monthNumber]);
     $result = '';
     $result .= wf_tag('table', false, '', 'border="0" cellspacing="2" width="100%" class="printable"');
     $result .= wf_tag('colgroup', false, '', 'span="4" width="80"');
     $result .= wf_tag('colgroup', true);
     $result .= wf_tag('colgroup', false, '', 'width="79"');
     $result .= wf_tag('colgroup', true);
     $result .= wf_tag('colgroup', false, '', 'span="6" width="80"');
     $result .= wf_tag('colgroup', true);
     $result .= wf_tag('tbody', false);
     $result .= wf_tag('tr', false, 'row2');
     $result .= wf_tag('td', false, '', 'colspan="3" rowspan="3" align="center" valign="bottom"');
     $result .= __('Warehouse item types');
     $result .= wf_tag('td', true);
     $result .= wf_tag('td', false, '', 'colspan="2" rowspan="2" align="center" valign="bottom"');
     $result .= __('Remains at the beginning of the month');
     $result .= wf_tag('td', true);
     $result .= wf_tag('td', false, '', 'colspan="4" align="center" valign="bottom"') . $monthName . ' ' . $year . wf_tag('td', true);
     $result .= wf_tag('td', false, '', 'colspan="2" rowspan="2" align="center" valign="bottom"');
     $result .= __('Remains at end of the month');
     $result .= wf_tag('td', true);
     $result .= wf_tag('tr', true);
     $result .= wf_tag('tr', false, 'row2');
     $result .= wf_tag('td', false, '', 'colspan="2" align="center" valign="bottom"') . __('Incoming') . wf_tag('td', true);
     $result .= wf_tag('td', false, '', 'colspan="2" align="center" valign="bottom"') . __('Outcoming') . wf_tag('td', true);
     $result .= wf_tag('tr', true);
     $result .= wf_tag('tr', false, 'row2');
     $result .= wf_TableCell(__('Count'));
     $result .= wf_TableCell(__('Sum'));
     $result .= wf_TableCell(__('Count'));
     $result .= wf_TableCell(__('Sum'));
     $result .= wf_TableCell(__('Count'));
     $result .= wf_TableCell(__('Sum'));
     $result .= wf_TableCell(__('Count'));
     $result .= wf_TableCell(__('Sum'));
     $result .= wf_tag('tr', true);
     $result .= wf_tag('tr', false);
     return $result;
 }
Exemplo n.º 9
0
/**
 * Shows list of NDS users payments per year
 * 
 * @param int $year
 * 
 * @return void
 */
function web_NdsPaymentsShowYear($year)
{
    $months = months_array();
    $year_summ = zb_PaymentsGetYearSumm($year);
    $cells = wf_TableCell(__('Month'));
    $rows = wf_TableRow($cells, 'row1');
    foreach ($months as $eachmonth => $monthname) {
        $month_summ = zb_PaymentsGetMonthSumm($year, $eachmonth);
        $paycount = zb_PaymentsGetMonthCount($year, $eachmonth);
        $cells = wf_TableCell(wf_Link('?module=nds&month=' . $year . '-' . $eachmonth, rcms_date_localise($monthname), false));
        $rows .= wf_TableRow($cells, 'row3');
    }
    $result = wf_TableBody($rows, '30%', '0');
    show_window(__('Payments by') . ' ' . $year, $result);
}
Exemplo n.º 10
0
/**
 * Generates user's traffic statistic module content
 * 
 * @param   str     $login  User's login, for whitch generate module content
 * @return  str             Module content
 */
function web_UserTraffStats($login)
{
    $login = vf($login);
    $dirs = zb_DirectionsGetAll();
    // Current month traffic stats:
    $cells = wf_TableCell(__('Traffic classes'));
    $cells .= wf_TableCell(__('Downloaded'));
    $cells .= wf_TableCell(__('Uploaded'));
    $cells .= wf_TableCell(__('Total'));
    $rows = wf_TableRow($cells, 'row1');
    if (!empty($dirs)) {
        foreach ($dirs as $dir) {
            $query_downup = "SELECT `D" . $dir['rulenumber'] . "`,`U" . $dir['rulenumber'] . "` FROM `users` WHERE `login` = '" . $login . "'";
            $downup = simple_query($query_downup);
            $cells = wf_TableCell($dir['rulename']);
            $cells .= wf_TableCell(stg_convert_size($downup['D' . $dir['rulenumber']]), '', '', 'sorttable_customkey="' . $downup['D' . $dir['rulenumber']] . '"');
            $cells .= wf_TableCell(stg_convert_size($downup['U' . $dir['rulenumber']]), '', '', 'sorttable_customkey="' . $downup['U' . $dir['rulenumber']] . '"');
            $cells .= wf_TableCell(stg_convert_size($downup['U' . $dir['rulenumber']] + $downup['D' . $dir['rulenumber']]), '', '', 'sorttable_customkey="' . ($downup['U' . $dir['rulenumber']] + $downup['D' . $dir['rulenumber']]) . '"');
            $rows .= wf_TableRow($cells, 'row3');
        }
    }
    $result = wf_tag('h3') . __('Current month traffic stats') . wf_tag('h3', true);
    $result .= wf_TableBody($rows, '100%', '0', 'sortable');
    // End of current month traffic stats
    // Per-user graphs buttons:
    $ip = zb_UserGetIP($login);
    $bandwidthd = zb_BandwidthdGetUrl($ip);
    if (!empty($bandwidthd)) {
        $bwd = zb_BandwidthdGenLinks($ip);
        // Dayly graph button:
        $daybw = wf_img($bwd['dayr'], __('Downloaded'));
        if (!empty($bwd['days'])) {
            $daybw .= wf_delimiter() . wf_img($bwd['days'], __('Uploaded'));
        }
        // Weekly graph button:
        $weekbw = wf_img($bwd['weekr'], __('Downloaded'));
        if (!empty($bwd['weeks'])) {
            $weekbw .= wf_delimiter() . wf_img($bwd['weeks'], __('Uploaded'));
        }
        // Monthly graph button:
        $monthbw = wf_img($bwd['monthr'], __('Downloaded'));
        if (!empty($bwd['months'])) {
            $monthbw .= wf_delimiter() . wf_img($bwd['months'], __('Uploaded'));
        }
        // Yearly graph button:
        $yearbw = wf_img($bwd['yearr'], __('Downloaded'));
        if (!empty($bwd['years'])) {
            $yearbw .= wf_delimiter() . wf_img($bwd['years'], __('Uploaded'));
        }
        // Modal window sizes:
        if (!empty($bwd['days'])) {
            //bandwidthd
            $width = 920;
            $heidht = 640;
            $graphLegend = wf_tag('br') . wf_img('skins/bwdlegend.gif');
        } else {
            //mikrotik
            $width = 530;
            $heidht = 230;
            $graphLegend = '';
        }
        $result .= wf_delimiter();
        $result .= wf_tag('h3') . __('Graphs') . wf_tag('h3', true);
        $bwcells = wf_TableCell(wf_modal(__('Graph by day'), __('Graph by day'), $daybw . $graphLegend, 'ubButton', $width, $heidht));
        $bwcells .= wf_TableCell(wf_modal(__('Graph by week'), __('Graph by week'), $weekbw . $graphLegend, 'ubButton', $width, $heidht));
        $bwcells .= wf_TableCell(wf_modal(__('Graph by month'), __('Graph by month'), $monthbw . $graphLegend, 'ubButton', $width, $heidht));
        $bwcells .= wf_TableCell(wf_modal(__('Graph by year'), __('Graph by year'), $yearbw . $graphLegend, 'ubButton', $width, $heidht));
        $bwrows = wf_TableRow($bwcells);
        // Adding graphs buttons to result:
        $result .= wf_TableBody($bwrows, '', '0', '');
        $result .= wf_delimiter();
    } else {
        $result .= __('No user graphs because no NAS with bandwidthd for his network');
    }
    // End of per-user graphs buttons
    // Traffic statistic by previous months:
    $monthNames = months_array_wz();
    $result .= wf_tag('h3') . __('Previous month traffic stats') . wf_tag('h3', true);
    $cells = wf_TableCell(__('Year'));
    $cells .= wf_TableCell(__('Month'));
    $cells .= wf_TableCell(__('Traffic classes'));
    $cells .= wf_TableCell(__('Downloaded'));
    $cells .= wf_TableCell(__('Uploaded'));
    $cells .= wf_TableCell(__('Total'));
    $cells .= wf_TableCell(__('Cash'));
    $rows = wf_TableRow($cells, 'row1');
    if (!empty($dirs)) {
        foreach ($dirs as $dir) {
            $query_prev = "SELECT `D" . $dir['rulenumber'] . "`, `U" . $dir['rulenumber'] . "`, `month`, `year`, `cash` FROM `stat` WHERE `login` = '" . $login . "' ORDER BY `year`, `month`";
            $prevmonths = simple_queryall($query_prev);
            if (!empty($prevmonths)) {
                foreach ($prevmonths as $prevmonth) {
                    $cells = wf_TableCell($prevmonth['year']);
                    $cells .= wf_TableCell(rcms_date_localise($monthNames[$prevmonth['month']]));
                    $cells .= wf_TableCell($dir['rulename']);
                    $cells .= wf_TableCell(stg_convert_size($prevmonth['D' . $dir['rulenumber']]), '', '', 'sorttable_customkey="' . $prevmonth['D' . $dir['rulenumber']] . '"');
                    $cells .= wf_TableCell(stg_convert_size($prevmonth['U' . $dir['rulenumber']]), '', '', 'sorttable_customkey="' . $prevmonth['U' . $dir['rulenumber']] . '"');
                    $cells .= wf_TableCell(stg_convert_size($prevmonth['U' . $dir['rulenumber']] + $prevmonth['D' . $dir['rulenumber']]), '', '', 'sorttable_customkey="' . ($prevmonth['U' . $dir['rulenumber']] + $prevmonth['D' . $dir['rulenumber']]) . '"');
                    $cells .= wf_TableCell(round($prevmonth['cash'], 2));
                    $rows .= wf_TableRow($cells, 'row3');
                }
            }
        }
    }
    // End of traffic statistic by previous months
    // Generate table:
    $result .= wf_TableBody($rows, '100%', '0', 'sortable');
    // Return result:
    return $result;
}
Exemplo n.º 11
0
 protected function loadMonthData()
 {
     $months = months_array();
     $year = $this->curyear;
     $this->loadYearPayments($year);
     $yearSumm = $this->getYearSumm($year);
     $this->chartdata = __('Month') . ',' . __('Count') . ',' . __('Cash') . "\n";
     $cells = wf_TableCell('');
     $cells .= wf_TableCell(__('Month'));
     $cells .= wf_TableCell(__('Payments count'));
     $cells .= wf_TableCell(__('Our final profit'));
     $cells .= wf_TableCell(__('Visual'));
     $this->tabledata = wf_TableRow($cells, 'row1');
     foreach ($months as $eachmonth => $monthname) {
         $month_summ = $this->getMonthSumm($year, $eachmonth);
         $paycount = $this->getMonthCount($year, $eachmonth);
         $this->chartdata .= $year . '-' . $eachmonth . '-01,' . $paycount . ',' . $month_summ . "\n";
         $cells = wf_TableCell($eachmonth);
         $cells .= wf_TableCell(rcms_date_localise($monthname));
         $cells .= wf_TableCell($paycount);
         $cells .= wf_TableCell($month_summ);
         $cells .= wf_TableCell(web_bar($month_summ, $yearSumm));
         $this->tabledata .= wf_TableRow($cells, 'row3');
         $this->yearsumm = $this->yearsumm + $month_summ;
     }
 }
Exemplo n.º 12
0
 @($payment['summ_cels'] = !empty($payment['summ_exp'][0]) ? $payment['summ_exp'][0] : '0');
 @($payment['summ_cops'] = !empty($payment['summ_exp'][1]) ? $payment['summ_exp'][1] : '00');
 @($payment['daypayid'] = zb_PrintCheckGetDayNum($payment['id'], $payment['date']));
 @($user['login'] = $payment['login']);
 @($user['realname'] = zb_UserGetRealName($user['login']));
 @($user['address'] = zb_UserGetFullAddress($user['login']));
 @($user['contract'] = zb_UserGetContract($user['login']));
 @($user['email'] = zb_UserGetEmail($user['login']));
 @($user['phone'] = zb_UserGetPhone($user['login']));
 @($user['mobile'] = zb_UserGetMobile($user['login']));
 @($user['agent'] = zb_AgentAssignedGetDataFast($user['login'], $user['address']));
 @($cashier = zb_PrintCheckLoadCassNames(true));
 @($current['day'] = date('d'));
 @($current['month'] = date('m'));
 @($current['monty_lit'] = months_array($current['month']));
 @($current['month_loc'] = rcms_date_localise($current['monty_lit']));
 @($current['year'] = date('Y'));
 // Forming parse template:
 $template['PAYID'] = !empty($payment['id']) ? $payment['id'] : '';
 $template['PAYIDENC'] = !empty($payment['idenc']) ? $payment['idenc'] : '';
 $template['AGENTEDRPO'] = !empty($user['agent']['edrpo']) ? $user['agent']['edrpo'] : '';
 $template['AGENTNAME'] = !empty($user['agent']['contrname']) ? $user['agent']['contrname'] : '';
 $template['PAYDATE'] = !empty($payment['date']) ? $payment['date'] : '';
 $template['PAYSUMM'] = !empty($payment['summ']) ? $payment['summ'] : '';
 $template['PAYSUMM_CELS'] = !empty($payment['summ_cels']) ? $payment['summ_cels'] : '';
 // rev. 3179 +
 $template['PAYSUMM_COPS'] = !empty($payment['summ_cops']) ? $payment['summ_cops'] : '';
 // rev. 3179 +
 $template['PAYSUMM_LIT'] = !empty($payment['summ_lit']) ? $payment['summ_lit'] : '';
 $template['PAYNOTE'] = !empty($payment['note']) ? $payment['note'] : '';
 $template['LOGIN'] = !empty($user['login']) ? $user['login'] : '';