Esempio n. 1
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);
 }
Esempio n. 2
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;
}
Esempio n. 3
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);
 }
function get_month($number)
{
    $month = '';
    foreach (months_array() as $key => $value) {
        if ($key == $number) {
            $month = $value;
        }
    }
    return $month;
}
Esempio n. 5
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;
 }
            <select id="financial_year" class="input-large m-wrap" name="financial_year" tabindex="2">
                <?php 
echo get_select_options($financial_years, 'fy', 'label', !empty($formdata['financial_year']) ? $formdata['financial_year'] : '');
?>
            </select>
        </div>
    </div>

    <div class="control-group">
        <label class="control-label">Month:</label>
        <div class="controls">
            <select id="month" class="input-large m-wrap" name="months" tabindex="2">


                <?php 
$months = months_array();
foreach ($months as $key => $value) {
    ?>
                    <option value="<?php 
    echo $key;
    ?>
"><?php 
    echo $value;
    ?>
</option>
                <?php 
}
?>
            </select>
        </div>
    </div>
Esempio n. 7
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;
 }
Esempio n. 8
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);
}
Esempio 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);
}
Esempio n. 10
0
/**
 * Returns graph of planned tasks in taskmanager
 * 
 * @param int $year
 * @return string
 */
function web_AnalyticsTaskmanMonthGraph($year)
{
    $allmonths = months_array();
    $yearcount = zb_AnalyticsTaskmanGetCountYear($year);
    $chartData = array(0 => array(__('Month'), __('Jobs')));
    $chartOptions = "\n            'focusTarget': 'category',\n                        'hAxis': {\n                        'color': 'none',\n                            'baselineColor': 'none',\n                    },\n                        'vAxis': {\n                        'color': 'none',\n                            'baselineColor': 'none',\n                    },\n                        'curveType': 'function',\n                        'pointSize': 5,\n                        'crosshair': {\n                        trigger: 'none'\n                    },";
    foreach ($yearcount as $eachmonth => $count) {
        $chartData[] = array($year . '-' . $eachmonth, $count);
    }
    $result = wf_gchartsLine($chartData, __('Task manager activity during the year'), '100%', '400px', $chartOptions) . wf_delimiter();
    return $result;
}
Esempio n. 11
0
/**
 * Returns graph of planned tasks in taskmanager
 * 
 * @param int $year
 * @return string
 */
function web_AnalyticsTaskmanMonthGraph($year)
{
    $allmonths = months_array();
    $yearcount = zb_AnalyticsTaskmanGetCountYear($year);
    $data = __('Month') . ',' . __('Jobs') . "\n";
    foreach ($yearcount as $eachmonth => $count) {
        $data .= $year . '-' . $eachmonth . '-' . '-01,' . $count . "\n";
    }
    $result = wf_tag('div', false, '', '') . __('Task manager activity during the year');
    $result .= wf_Graph($data, '800', '300', false) . wf_tag('div', true);
    return $result;
}
Esempio n. 12
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;
     }
 }
Esempio n. 13
0
 @($payment['summ_exp'] = explode('.', $payment['summ']));
 @($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'] : '';