Esempio n. 1
0
 function web_CardShowDateForm()
 {
     $curmonth = date("m");
     $inputs = wf_YearSelector('yearsel');
     $inputs .= wf_MonthSelector('monthsel', 'Month', $curmonth, false);
     $inputs .= wf_Submit('Show');
     $form = wf_Form("", 'POST', $inputs, 'glamour');
     show_window(__('Date'), $form);
 }
Esempio n. 2
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);
 }
Esempio n. 3
0
<?php

// check for right of current admin on this module
if (cfr('CATVSTATS')) {
    catv_GlobalControlsShow();
    if (wf_CheckGet(array('userid'))) {
        $userid = vf($_GET['userid'], 3);
        $userdata = catv_UserGetData($userid);
        $realname = $userdata['realname'];
        $address = $userdata['street'] . ' ' . $userdata['build'] . '/' . $userdata['apt'];
        //target year selection
        $yearforminputs = wf_YearSelector('yearselect', 'Year', false);
        $yearforminputs .= ' ';
        $yearforminputs .= wf_Submit('Show');
        $yearform = wf_Form('', 'POST', $yearforminputs, 'glamour', '');
        show_window($address . ' ' . $realname, $yearform . '<div style="clear: both;"></div>');
        if (wf_CheckPost(array('yearselect'))) {
            $target_year = $_POST['yearselect'];
        } else {
            $target_year = curyear();
        }
        catv_UserStatsByYear($userid, $target_year);
        catv_DecoderShowAllChanges($userid);
        catv_ActivityShowAll($userid);
        catv_ProfileBack($userid);
    }
} else {
    show_error(__('You cant control this module'));
}
Esempio n. 4
0
 /**
  * Returns openpayz search form
  * 
  * @return string
  */
 public function renderSearchForm()
 {
     $inputs = wf_YearSelector('searchyear', __('Year'), false) . ' ';
     $inputs .= wf_MonthSelector('searchmonth', __('Month'), '', false) . ' ';
     $inputs .= wf_Selector('searchpaysys', $this->allPaySys, __('Payment system'), '', false) . ' ';
     $inputs .= wf_Submit(__('Search'));
     $result = wf_Form("", 'POST', $inputs, 'glamour');
     return $result;
 }
Esempio n. 5
0
         foreach ($tcount as $sigtariff => $eachcount) {
             $tablecells = wf_TableCell($sigtariff);
             $tablecells .= wf_TableCell($eachcount);
             $tablecells .= wf_TableCell(web_bar($eachcount, sizeof($allsignups)), '', '', 'sorttable_customkey="' . $eachcount . '"');
             $tablerows .= wf_TableRow($tablecells, 'row3');
         }
     }
     $result = wf_TableBody($tablerows, '100%', '0', 'sortable');
     show_window(__('Tariffs report'), $result);
 }
 if (!isset($_POST['yearsel'])) {
     $year = curyear();
 } else {
     $year = $_POST['yearsel'];
 }
 $yearinputs = wf_YearSelector('yearsel');
 $yearinputs .= wf_Submit(__('Show'));
 $yearform = wf_Form('?module=report_signup', 'POST', $yearinputs, 'glamour');
 $yearform .= wf_CleanDiv();
 web_SignupsShowToday();
 show_window(__('Year'), $yearform);
 web_SignupsGraphYear($year);
 web_SignupGraph();
 if ($altercfg['CEMETERY_ENABLED']) {
     $cemetery = new Cemetery();
     show_window('', $cemetery->renderChart());
 }
 if (!wf_CheckGet(array('month'))) {
     web_SignupsShowCurrentMonth();
 } else {
     web_SignupsShowAnotherYearMonth($_GET['month']);
Esempio n. 6
0
 /**
  * Returns year/month selectors form
  * 
  * @return string
  */
 public function renderCorpsFlowsDateForm()
 {
     $allagents = zb_ContrAhentGetAllData();
     $tmpArr = array();
     $tmpArr[''] = __('Any');
     if (!empty($allagents)) {
         foreach ($allagents as $io => $eachagent) {
             $tmpArr[$eachagent['id']] = $eachagent['contrname'];
         }
     }
     /**
      * Again and again we're drowning in this web
      * Again and again we make the same mistake
      * Always hunting the same lamb
      * All we get is the same crap....
      */
     $inputs = wf_YearSelector('yearsel', __('Year'), false) . ' ';
     $inputs .= wf_MonthSelector('monthsel', __('Month'), '', false) . ' ';
     $inputs .= wf_Selector('agentsel', $tmpArr, __('Contrahent name'), '', false);
     $inputs .= wf_Submit(__('Show'));
     $result = wf_Form('', 'POST', $inputs, 'glamour');
     return $result;
 }
Esempio n. 7
0
 /**
  * Renders tags assign report
  * 
  * @return void
  */
 public function renderReport()
 {
     $result = $this->panel();
     $messages = new UbillingMessageHelper();
     $months = months_array_localized();
     $reportTmp = array();
     $totalCount = 0;
     if (!empty($this->allnames)) {
         $result .= wf_tag('br');
         $inputs = wf_YearSelector('reportyear', __('Year'), false) . ' ';
         $curTagid = wf_CheckPost(array('reporttagid')) ? vf($_POST['reporttagid'], 3) : '';
         $inputs .= wf_Selector('reporttagid', $this->allnames, __('Tag'), $curTagid, false) . ' ';
         $inputs .= wf_Submit(__('Show'));
         $result .= wf_Form('', 'POST', $inputs, 'glamour');
     } else {
         $result .= $messages->getStyledMessage(__('Nothing found'), 'info');
     }
     if (wf_CheckPost(array('reportyear', 'reporttagid'))) {
         $tagid = vf($_POST['reporttagid'], 3);
         $year = vf($_POST['reportyear'], 3);
         $datemask = $year . '-%';
         $query = "SELECT * from `weblogs` WHERE `date` LIKE '" . $datemask . "' AND `event` LIKE 'TAGADD (%' AND `event` LIKE '%TAGID%';";
         $raw = simple_queryall($query);
         if (!empty($raw)) {
             foreach ($raw as $io => $each) {
                 $eventtagid = preg_match("/\\[[^\\]]*\\]/", $each['event'], $matches);
                 @($eventtagid = vf($matches[0], 3));
                 if (!empty($eventtagid)) {
                     if ($eventtagid == $tagid) {
                         $eventTime = strtotime($each['date']);
                         $eventMonth = date("m", $eventTime);
                         if (!isset($reportTmp[$eventMonth])) {
                             $reportTmp[$eventMonth] = 1;
                         } else {
                             $reportTmp[$eventMonth]++;
                         }
                         $totalCount++;
                     }
                 }
             }
         }
         $cells = wf_TableCell($year);
         $cells .= wf_TableCell(__('Month'));
         $cells .= wf_TableCell($this->allnames[$tagid]);
         $cells .= wf_TableCell(__('Visual'));
         $rows = wf_TableRow($cells, 'row1');
         foreach ($months as $monthNumber => $monthName) {
             $cells = wf_TableCell($monthNumber);
             $cells .= wf_TableCell($monthName);
             $monthData = isset($reportTmp[$monthNumber]) ? $reportTmp[$monthNumber] : 0;
             $cells .= wf_TableCell($monthData);
             $cells .= wf_TableCell(web_bar($monthData, $totalCount), '', '', 'sorttable_customkey="' . $monthData . '"');
             $rows .= wf_TableRow($cells, 'row3');
         }
         $result .= wf_TableBody($rows, '100%', '0', 'sortable');
         $result .= wf_tag('b') . __('Total') . ':' . wf_tag('b', true) . ' ' . $totalCount;
     }
     show_window(__('Tags'), $result);
 }
Esempio n. 8
0
function catv_CashEditForm($paymentid)
{
    $catvconf = catv_LoadConfig();
    $paymentdata = catv_PaymentsGetData($paymentid);
    $userid = $paymentdata['userid'];
    $userdata = catv_UserGetData($userid);
    $usertariff = $userdata['tariff'];
    $tariffdata = catv_TariffGetData($usertariff);
    $tariffprice = $tariffdata['price'];
    $tariffname = $tariffdata['name'];
    $currentbalance = $userdata['cash'];
    $allmonth = months_array();
    $localized_month = array();
    $curyear = curyear();
    $curmonth = date("m");
    $curdatetime = curdatetime();
    //rebuild months array
    foreach ($allmonth as $io => $eachmonth) {
        $localized_month[$io] = rcms_date_localise($eachmonth);
    }
    //build cash adding form
    $editcashinputs = '
            <table width="300" border="0">
            <tr>
            <td  class="row2">' . __('Balance') . '</td>
            <td  class="row3">' . $currentbalance . '</td>
            </tr>
            <tr>
            <td  class="row2">' . __('Current tariff') . '</td>
            <td  class="row3">' . $tariffname . '</td>
            </tr>
            <tr>
            <td  class="row2">' . __('Fee') . '</td>
            <td  class="row3">' . $tariffprice . ' ' . $catvconf['CURRENCY'] . '</td>
            </tr>
            </table>
            <br>
            ';
    $editcashinputs .= '<div>' . wf_TextInput('editpayment', 'Cash', $paymentdata['summ'], true, '5') . '</div>';
    $editcashinputs .= wf_Selector('editfrom_month', $localized_month, 'From month', $paymentdata['from_month'], false);
    $editcashinputs .= wf_YearSelector('editfrom_year', 'From year', true);
    $editcashinputs .= '<hr>';
    $editcashinputs .= __('You can also specify the following options if you wish') . '<br>';
    $editcashinputs .= wf_TextInput('editdate', 'Payment date', $paymentdata['date'], true, 20);
    $editcashinputs .= wf_Selector('editto_month', $localized_month, 'To month', $paymentdata['to_month'], false);
    $editcashinputs .= wf_YearSelector('editto_year', 'To year', true);
    $editcashinputs .= wf_TextInput('editnotes', 'Notes', $paymentdata['notes'], true, 50);
    $editcashinputs .= wf_Submit('Edit');
    $casheditform = wf_Form('', 'POST', $editcashinputs, 'glamour', '');
    return $casheditform;
}
Esempio n. 9
0
 public function yearSelectorAlerts()
 {
     $inputs = wf_YearSelector('alertsyearsel', __('Year') . ' ', false);
     $inputs .= wf_Submit(__('Show'));
     $result = wf_Form("", 'POST', $inputs, 'glamour');
     $result .= wf_tag('br');
     return $result;
 }
Esempio n. 10
0
        $lasuseractivity = catv_ActivityGetLastByUser($userid);
        $lasuseractivitytime = catv_ActivityGetTimeLastByUser($userid);
        $userdata = catv_UserGetData($userid);
        $curyear = curyear();
        $curmonth = date("m");
        $curday = date("d");
        $curtime = curtime();
        $address = $userdata['street'] . ' ' . $userdata['build'] . '/' . $userdata['apt'];
        //if creating new activity
        if (wf_CheckPost(array('newacttime', 'newactday'))) {
            $customdate = $_POST['newactyear'] . '-' . $_POST['newactmonth'] . '-' . $_POST['newactday'] . ' ' . $_POST['newacttime'];
            deb($customdate);
            catv_ActivityCreateCustomDate($userid, $_POST['newactivity'], $customdate);
            rcms_redirect('?module=catv_useractivity&userid=' . $userid);
        }
        //edit form construct
        $actinputs = '';
        $actinputs .= wf_Trigger('newactivity', 'Connected', $lasuseractivity, true) . '<hr>';
        $actinputs .= wf_TextInput('newactday', 'Day', $curday, false, '2');
        $actinputs .= wf_MonthSelector('newactmonth', 'Month', $curmonth, false);
        $actinputs .= wf_YearSelector('newactyear', 'Year', true) . '<br>';
        $actinputs .= wf_HiddenInput('newacttime', $curtime);
        $actinputs .= wf_Submit('Change');
        $actform = wf_Form('', 'POST', $actinputs, 'glamour');
        show_window(__('User activity') . ' ' . $address, $actform);
        catv_ActivityShowAll($userid);
        catv_ProfileBack($userid);
    }
} else {
    show_error(__('You cant control this module'));
}
Esempio n. 11
0
 /**
  * Renders date remains report
  * 
  * @return string
  */
 public function reportDateRemains()
 {
     $result = '';
     $curyear = wf_CheckPost(array('yearsel')) ? vf($_POST['yearsel'], 3) : date("Y");
     $curmonth = wf_CheckPost(array('monthsel')) ? vf($_POST['monthsel'], 3) : date("m");
     $inputs = wf_YearSelector('yearsel', __('Year')) . ' ';
     $inputs .= wf_MonthSelector('monthsel', __('Month'), $curmonth) . ' ';
     $inputs .= wf_CheckInput('printmode', __('Print'), false, false);
     $inputs .= wf_Submit(__('Show'));
     $searchForm = wf_Form('', 'POST', $inputs, 'glamour');
     $searchForm .= wf_CleanDiv();
     //append form to result
     if (!wf_CheckPost(array('printmode'))) {
         $result .= $searchForm;
     }
     $lowerOffset = strtotime($curyear . '-' . $curmonth . '-01');
     $upperOffset = strtotime($curyear . '-' . $curmonth . '-01');
     $upperOffset = date("t", $upperOffset);
     $upperOffset = strtotime($curyear . '-' . $curmonth . '-' . $upperOffset);
     $incomingLower = array();
     $outcomingLower = array();
     if (!empty($this->allIncoming)) {
         foreach ($this->allIncoming as $io => $each) {
             $incomingDate = strtotime($each['date']);
             if ($incomingDate < $lowerOffset) {
                 if ($each['contractorid'] != 0) {
                     //ignoring move ops
                     $incomingLower[$each['id']] = $each;
                 }
             }
         }
     }
     if (!empty($this->allOutcoming)) {
         foreach ($this->allOutcoming as $io => $each) {
             $outcomingDate = strtotime($each['date']);
             if ($outcomingDate < $lowerOffset) {
                 if ($each['desttype'] != 'storage') {
                     // ignoring move ops
                     $outcomingLower[$each['id']] = $each;
                 }
             }
         }
     }
     $lowerIncome = array();
     if (!empty($incomingLower)) {
         foreach ($incomingLower as $io => $each) {
             if (isset($lowerIncome[$each['itemtypeid']])) {
                 $lowerIncome[$each['itemtypeid']]['count'] = $lowerIncome[$each['itemtypeid']]['count'] + $each['count'];
                 $lowerIncome[$each['itemtypeid']]['price'] = $lowerIncome[$each['itemtypeid']]['price'] + $each['count'] * $each['price'];
             } else {
                 $lowerIncome[$each['itemtypeid']]['count'] = $each['count'];
                 $lowerIncome[$each['itemtypeid']]['price'] = $each['count'] * $each['price'];
             }
         }
     }
     $lowerOutcome = array();
     if (!empty($outcomingLower)) {
         foreach ($outcomingLower as $io => $each) {
             if ($each['price'] == 0) {
                 $each['price'] = $this->getIncomeMiddlePrice($each['itemtypeid']);
             }
             if (isset($lowerOutcome[$each['itemtypeid']])) {
                 $lowerOutcome[$each['itemtypeid']]['count'] = $lowerOutcome[$each['itemtypeid']]['count'] + $each['count'];
                 $lowerOutcome[$each['itemtypeid']]['price'] = $lowerOutcome[$each['itemtypeid']]['price'] + $each['count'] * $each['price'];
             } else {
                 $lowerOutcome[$each['itemtypeid']]['count'] = $each['count'];
                 $lowerOutcome[$each['itemtypeid']]['price'] = $each['count'] * $each['price'];
             }
         }
     }
     //first report column here
     $lowerRemains = array();
     if (!empty($incomingLower)) {
         foreach ($incomingLower as $io => $each) {
             $outcomeCount = isset($lowerOutcome[$each['itemtypeid']]) ? $lowerOutcome[$each['itemtypeid']]['count'] : 0;
             $outcomePrice = isset($lowerOutcome[$each['itemtypeid']]) ? $lowerOutcome[$each['itemtypeid']]['price'] : 0;
             $lowerRemains[$each['itemtypeid']]['count'] = $lowerIncome[$each['itemtypeid']]['count'] - $outcomeCount;
             $lowerRemains[$each['itemtypeid']]['price'] = $lowerIncome[$each['itemtypeid']]['price'] - $outcomePrice;
         }
     }
     //second column
     $upperIncome = array();
     if (!empty($this->allIncoming)) {
         foreach ($this->allIncoming as $io => $each) {
             $incomeDate = strtotime($each['date']);
             if ($incomeDate >= $lowerOffset and $incomeDate <= $upperOffset) {
                 if ($each['contractorid'] != 0) {
                     //ignoring move ops
                     if (isset($upperIncome[$each['itemtypeid']])) {
                         $upperIncome[$each['itemtypeid']]['count'] = $upperIncome[$each['itemtypeid']]['count'] + $each['count'];
                         $upperIncome[$each['itemtypeid']]['price'] = $upperIncome[$each['itemtypeid']]['price'] + $each['count'] * $each['price'];
                     } else {
                         $upperIncome[$each['itemtypeid']]['count'] = $each['count'];
                         $upperIncome[$each['itemtypeid']]['price'] = $each['count'] * $each['price'];
                     }
                 }
             }
         }
     }
     //third column
     $upperOutcome = array();
     if (!empty($this->allOutcoming)) {
         foreach ($this->allOutcoming as $io => $each) {
             $outcomeDate = strtotime($each['date']);
             if ($outcomeDate >= $lowerOffset and $outcomeDate <= $upperOffset) {
                 if ($each['desttype'] != 'storage') {
                     //ignoring move ops
                     if ($each['price'] == 0) {
                         $each['price'] = $this->getIncomeMiddlePrice($each['itemtypeid']);
                     }
                     if (isset($upperOutcome[$each['itemtypeid']])) {
                         $upperOutcome[$each['itemtypeid']]['count'] = $upperOutcome[$each['itemtypeid']]['count'] + $each['count'];
                         $upperOutcome[$each['itemtypeid']]['price'] = $upperOutcome[$each['itemtypeid']]['price'] + $each['count'] * $each['price'];
                     } else {
                         $upperOutcome[$each['itemtypeid']]['count'] = $each['count'];
                         $upperOutcome[$each['itemtypeid']]['price'] = $each['count'] * $each['price'];
                     }
                 }
             }
         }
     }
     //mixing earlier non exists items into lower remains array
     if (!empty($upperIncome)) {
         foreach ($upperIncome as $io => $each) {
             if (!isset($lowerRemains[$io])) {
                 $lowerRemains[$io]['count'] = 0;
                 $lowerRemains[$io]['price'] = 0;
             }
         }
     }
     $result .= $this->reportDateRemainsHeader($curyear, $curmonth);
     if (!empty($lowerRemains)) {
         $firstColumnTotal = 0;
         $secondColumnTotal = 0;
         $thirdColumnTotal = 0;
         $fourthColumnTotal = 0;
         foreach ($lowerRemains as $io => $each) {
             $itemtypeId = $io;
             $firstColumnCount = isset($lowerRemains[$itemtypeId]) ? $lowerRemains[$itemtypeId]['count'] : 0;
             $firstColumnPrice = isset($lowerRemains[$itemtypeId]) ? $lowerRemains[$itemtypeId]['price'] : 0;
             $secondColumnCount = isset($upperIncome[$itemtypeId]) ? $upperIncome[$itemtypeId]['count'] : 0;
             $secondColumnPrice = isset($upperIncome[$itemtypeId]) ? $upperIncome[$itemtypeId]['price'] : 0;
             $thirdColumnCount = isset($upperOutcome[$itemtypeId]) ? $upperOutcome[$itemtypeId]['count'] : 0;
             $thirdColumnPrice = isset($upperOutcome[$itemtypeId]) ? $upperOutcome[$itemtypeId]['price'] : 0;
             $fourthColumnCount = $lowerRemains[$itemtypeId]['count'] + $secondColumnCount - $thirdColumnCount;
             $fourthColumnPrice = $lowerRemains[$itemtypeId]['price'] + $secondColumnPrice - $thirdColumnPrice;
             $result .= $this->reportDateRemainsAddRow($itemtypeId, array($firstColumnCount, round($firstColumnPrice, 2), $secondColumnCount, round($secondColumnPrice, 2), $thirdColumnCount, round($thirdColumnPrice, 2), $fourthColumnCount, round($fourthColumnPrice, 2)));
             $firstColumnTotal += $firstColumnPrice;
             $secondColumnTotal += $secondColumnPrice;
             $thirdColumnTotal += $thirdColumnPrice;
             $fourthColumnTotal += $firstColumnPrice;
         }
         $result .= $this->reportDateRemainsAddRow('', array('', $firstColumnTotal, '', $secondColumnTotal, '', $thirdColumnTotal, '', $fourthColumnTotal));
     }
     $result .= wf_tag('tbody', true);
     $result .= wf_tag('table', true);
     if (wf_CheckPost(array('printmode'))) {
         die($this->reportPrintable(__('Date remains'), $result));
     }
     return $result;
 }
Esempio n. 12
0
 /**
  * Returns 
  * 
  * @return string
  */
 public function timesheetRenderPrintableForm()
 {
     $result = '';
     $inputs = wf_YearSelector('tsheetprintyear', __('Year') . ' ', false);
     $inputs .= wf_MonthSelector('tsheetprintmonth', __('Month') . ' ', date('m'), false);
     $inputs .= wf_Submit(__('Show'));
     $result = wf_Form('', 'POST', $inputs, 'glamour');
     return $result;
 }
Esempio n. 13
0
/**
 * Retuns year selector. Is here, only for backward compatibility with old modules.
 * use only wf_YearSelector() in new code.
 * 
 * @return string
 */
function web_year_selector()
{
    $selector = wf_YearSelector('yearsel');
    return $selector;
}
Esempio n. 14
0
 /**
  * Renders default subscriptions report
  * 
  * @return string
  */
 public function renderSubscribtionsReportMonthly()
 {
     $result = '';
     $selectedMonth = wf_CheckPost(array('monthsel')) ? $_POST['monthsel'] : date("m");
     $inputs = wf_YearSelector('yearsel', __('Year'), false) . ' ';
     $inputs .= wf_MonthSelector('monthsel', __('Month'), $selectedMonth, false) . ' ';
     $inputs .= wf_Submit(__('Show'));
     $result .= wf_Form('', 'POST', $inputs, 'glamour');
     $curYear = wf_CheckPost(array('yearsel')) ? vf($_POST['yearsel'], 3) : curyear();
     $curMonth = wf_CheckPost(array('monthsel')) ? vf($_POST['monthsel'], 3) : date("m");
     $query = "SELECT * from `payments` WHERE `date` LIKE '" . $curYear . "-" . $curMonth . "%' AND `note` LIKE 'MEGOGO:%';";
     $raw = simple_queryall($query);
     $tmpArr = array();
     if (!empty($raw)) {
         foreach ($raw as $io => $each) {
             $tariffId = explode(':', $each['note']);
             $tariffId = $tariffId[1];
             if (isset($tmpArr[$tariffId])) {
                 $tmpArr[$tariffId]['summ'] = $tmpArr[$tariffId]['summ'] + abs($each['summ']);
                 $tmpArr[$tariffId]['count']++;
                 //try&buy user
                 if ($each['summ'] == 0) {
                     $tmpArr[$tariffId]['freeperiod']++;
                 }
             } else {
                 $tmpArr[$tariffId]['summ'] = abs($each['summ']);
                 $tmpArr[$tariffId]['count'] = 1;
                 //try&buy user
                 if ($each['summ'] == 0) {
                     $tmpArr[$tariffId]['freeperiod'] = 1;
                 } else {
                     $tmpArr[$tariffId]['freeperiod'] = 0;
                 }
             }
         }
     }
     if (!empty($tmpArr)) {
         $cells = wf_TableCell(__('Tariff'));
         $cells .= wf_TableCell(__('Fee'));
         $cells .= wf_TableCell(__('Users'));
         $cells .= wf_TableCell(__('Free period'));
         $cells .= wf_TableCell(__('Total payments'));
         $cells .= wf_TableCell(__('Profit'));
         $rows = wf_TableRow($cells, 'row1');
         $totalUsers = 0;
         $totalFree = 0;
         $totalSumm = 0;
         foreach ($tmpArr as $io => $each) {
             $totalUsers = $totalUsers + $each['count'];
             $totalFree = $totalFree + $each['freeperiod'];
             $totalSumm = $totalSumm + $each['summ'];
             $cells = wf_TableCell(@$this->allTariffs[$io]['name']);
             $cells .= wf_TableCell(@$this->allTariffs[$io]['fee']);
             $cells .= wf_TableCell($each['count']);
             $cells .= wf_TableCell($each['freeperiod']);
             $cells .= wf_TableCell($each['summ']);
             $cells .= wf_TableCell(zb_Percent($each['summ'], $this->altCfg['MG_PERCENT']));
             $rows .= wf_TableRow($cells, 'row3');
         }
         $cells = wf_TableCell(wf_tag('b') . __('Total') . wf_tag('b', true));
         $cells .= wf_TableCell('');
         $cells .= wf_TableCell($totalUsers);
         $cells .= wf_TableCell($totalFree);
         $cells .= wf_TableCell($totalSumm);
         $cells .= wf_TableCell(zb_Percent($totalSumm, $this->altCfg['MG_PERCENT']));
         $rows .= wf_TableRow($cells, 'row2');
         $result .= wf_TableBody($rows, '100%', 0, '');
     } else {
         $result .= $this->messages->getStyledMessage(__('Nothing found'), 'info');
     }
     return $result;
 }
Esempio n. 15
0
 public function yearSelector()
 {
     $inputs = wf_YearSelector('setyear', '', false);
     $inputs .= wf_Submit(__('Show'));
     $result = wf_Form("", 'POST', $inputs, 'glamour');
     return $result;
 }
Esempio n. 16
0
         }
     }
     // tariff change subroutine
     if (wf_CheckPost(array('newtarchange'))) {
         catv_TariffChangeAllPlanned();
         rcms_redirect("?module=catv&action=fees");
     }
     //construct tariff change form
     $tarchangeinputs = wf_HiddenInput('newtarchange', 'true');
     $tarchangeinputs .= wf_Submit('Change tariff for all users');
     $tarform = wf_Form('', 'POST', $tarchangeinputs, 'glamour', '');
     show_window(__('Check out the planned tariff changes'), $tarform);
     //construct charge form
     $feeinputs = wf_HiddenInput('newcharge', 'true');
     $feeinputs .= wf_MonthSelector('chargemonthfee', 'Month', date("m"), false);
     $feeinputs .= wf_YearSelector('chargeyear', 'Year', false) . '&nbsp;&nbsp;';
     $feeinputs .= wf_Submit(__('Manual fee charge'));
     $feeform = wf_Form('', 'POST', $feeinputs, 'glamour', '');
     show_window(__('Сharge monthly fee'), $feeform);
 }
 //reports list
 if ($_GET['action'] == 'reports') {
     if (!isset($_GET['showreport'])) {
         // show available reports list
         catv_ReportsShowList();
     } else {
         // current debtors
         if ($_GET['showreport'] == 'current_debtors') {
             catv_ReportDebtors();
         }
         // current debtors by addr