<?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')); }
/** * 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; }