Exemplo n.º 1
0
<?php

if (cfr('PLFUNDS')) {
    if (isset($_GET['username'])) {
        $login = $_GET['username'];
        $funds = new FundsFlow();
        show_window('', $funds->getOnlineLeftCount($login));
        $allfees = $funds->getFees($login);
        $allpayments = $funds->getPayments($login);
        $allcorrectings = $funds->getPaymentsCorr($login);
        $fundsflow = $allfees + $allpayments + $allcorrectings;
        $fundsflow = $funds->transformArray($fundsflow);
        show_window(__('Funds flow'), $funds->renderArray($fundsflow));
        show_window('', web_UserControls($login));
    }
} else {
    show_error(__('You cant control this module'));
}
Exemplo n.º 2
0
 /**
  * Returns users finance operations history
  * 
  * @param string $customerId
  * 
  * @return array
  */
 protected function getUserFinanceHistory($customerId)
 {
     $result = array();
     if (isset($this->allUserData[$customerId])) {
         $allServices = zb_VservicesGetAllNamesLabeled();
         $fundsFlow = new FundsFlow();
         $allfees = $fundsFlow->getFees($customerId);
         $allpayments = $fundsFlow->getPayments($customerId);
         $allcorrectings = $fundsFlow->getPaymentsCorr($customerId);
         $allOps = $allfees + $allpayments + $allcorrectings;
         $allOps = $fundsFlow->transformArray($allOps);
         $i = 0;
         if (!empty($allOps)) {
             foreach ($allOps as $io => $each) {
                 // print_r($each);
                 $result[] = array('id' => $i, 'date' => $each['date'], 'type' => 'financial', 'name' => __($each['operation']), 'data' => json_encode(array('amount' => $each['summ'], 'from' => $each['from'], 'to' => $each['to'], 'operator_name' => $each['admin'])), 'comment' => zb_TranslatePaymentNote($each['note'], $allServices));
                 $i++;
             }
         }
     } else {
         $result = array('result' => 'error', 'error' => $this->errorNotices['EX_USER_NOT_EXISTS'] . ': ' . $customerId);
     }
     return $result;
 }
Exemplo n.º 3
0
  * friendship processing
  */
 if ($_GET['action'] == 'friendshipdaily') {
     if ($alterconf['FRIENDSHIP_ENABLED']) {
         $friends = new FriendshipIsMagic();
         $friends->friendsDailyProcessing();
         die('OK:FRIENDSHIP');
     } else {
         die('ERROR:FRIENDSHIP DISABLED');
     }
 }
 /*
  * Per month freezing fees
  */
 if ($_GET['action'] == 'freezemonth') {
     $money = new FundsFlow();
     $money->runDataLoders();
     $money->makeFreezeMonthFee();
     die('OK:FREEZEMONTH');
 }
 /**
  * UserSide get API handling
  */
 if ($_GET['action'] == 'userside') {
     if ($alterconf['USERSIDE_API']) {
         $usersideapi = new UserSideApi();
         $usersideapi->catchRequest();
     } else {
         die('ERROR:NO_USERSIDE_API_ENABLED');
     }
 }
Exemplo n.º 4
0
<?php

if (cfr('CORPS')) {
    $altcfg = $ubillingConfig->getAlter();
    if ($altcfg['CORPS_ENABLED']) {
        $greed = new Avarice();
        $beggar = $greed->runtime('CORPS');
        if (!empty($beggar)) {
            $corps = new Corps();
            $funds = new FundsFlow();
            //all that we need
            $corpsData = $corps->getCorps();
            $corpUsers = $corps->getUsers();
            $allUserContracts = zb_UserGetAllContracts();
            $allUsersCash = zb_UserGetAllBalance();
            $allUserTariffs = zb_TariffsGetAllUsers();
            $allTariffPrices = zb_TariffGetPricesAll();
            $rows = '';
            $count = 0;
            //showing date search form
            show_window(__('Corporate users') . ' - ' . __('Funds flow'), $funds->renderCorpsFlowsDateForm());
            if (!wf_CheckPost(array('yearsel', 'monthsel'))) {
                $needYear = curyear();
                $needMonth = date("m");
            } else {
                $needYear = $_POST['yearsel'];
                $needMonth = $_POST['monthsel'];
            }
            //setting date filter
            $date = $needYear . '-' . $needMonth . '-';
            if (!empty($corpUsers)) {
Exemplo n.º 5
0
<?php

if (cfr('PLFEES')) {
    if (isset($_GET['username'])) {
        $login = $_GET['username'];
        $funds = new FundsFlow();
        $allFees = $funds->getFees($login);
        $tablecells = wf_TableCell(__('Date'));
        $tablecells .= wf_TableCell(__('Time'));
        $tablecells .= wf_TableCell(__('Sum'));
        $tablecells .= wf_TableCell(__('From'));
        $tablecells .= wf_TableCell(__('To'));
        $tablerows = wf_TableRow($tablecells, 'row1');
        if (!empty($allFees)) {
            foreach ($allFees as $io => $each) {
                $feeTimestamp = strtotime($each['date']);
                $feeDate = date("Y-m-d", $feeTimestamp);
                $feeTime = date("H:i:s", $feeTimestamp);
                $tablecells = wf_TableCell($feeDate);
                $tablecells .= wf_TableCell($feeTime);
                $tablecells .= wf_TableCell($each['summ']);
                $tablecells .= wf_TableCell($each['from']);
                $tablecells .= wf_TableCell($each['to']);
                $tablerows .= wf_TableRow($tablecells, 'row3');
            }
        }
        $result = wf_TableBody($tablerows, '100%', '0', 'sortable');
        show_window(__('Money fees'), $result);
        show_window('', web_UserControls($login));
    }
} else {