Exemplo n.º 1
0
 function web_TsmsMassendConfirm($userarray)
 {
     global $td_users, $td_mobiles, $td_realnames, $td_realnamestrans, $td_tariffprices, $td_alladdress;
     global $ubillingConfig;
     $altCfg = $ubillingConfig->getAlter();
     $template = tsms_GetTemplate();
     $excludeUsers = tsms_GetExcludeUsers();
     $excludeArr = array();
     //ignoring DEAD_TAGID users
     if ($altCfg['CEMETERY_ENABLED']) {
         $cemetery = new Cemetery();
         $excludeCemetery = $cemetery->getAllTagged();
         if (!empty($excludeCemetery)) {
             foreach ($excludeCemetery as $eecl => $eecld) {
                 $excludeUsers[$eecl] = 'NOP';
             }
         }
     }
     $cells = wf_TableCell(__('Login'));
     $cells .= wf_TableCell(__('Address'));
     $cells .= wf_TableCell(__('Real Name'));
     $cells .= wf_TableCell(__('SMS'));
     $cells .= wf_TableCell(__('Mobile'));
     $cells .= wf_TableCell(__('Tariff'));
     $cells .= wf_TableCell(__('Balance'));
     $cells .= wf_TableCell(__('Credit'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($userarray)) {
         //excluded users handling
         if (!empty($excludeUsers)) {
             $excludeResult = wf_tag('h3') . __('Next users will be ignored while SMS sending') . wf_tag('h3', true);
             foreach ($excludeUsers as $excludeLogin => $nop) {
                 unset($userarray[$excludeLogin]);
                 $excludeArr[$excludeLogin] = $excludeLogin;
             }
         } else {
             $excludeResult = '';
         }
         foreach ($userarray as $login => $phone) {
             $message = tsms_ParseTemplate($login, $template);
             $smsContainer = wf_modal(__('Show'), __('SMS'), $message, '', '300', '200');
             $cells = wf_TableCell(wf_Link("?module=userprofile&username="******"", 'POST', $inputs, 'glamour');
     $result = $confirmForm;
     $result .= wf_TableBody($rows, '100%', '0', 'sortable');
     //showing which users will be excluded
     if (!empty($excludeUsers)) {
         $result .= $excludeResult;
         $result .= web_UserArrayShower($excludeArr);
     }
     return $result;
 }
Exemplo n.º 2
0
 /**
  * Shows signups by another year-month
  * 
  * @global object $altercfg
  * @param string $cmonth
  * 
  * @return void
  */
 function web_SignupsShowAnotherYearMonth($cmonth)
 {
     global $altercfg;
     $alltariffs = zb_TariffsGetAllUsers();
     $cmonth = mysql_real_escape_string($cmonth);
     $where = "WHERE `date` LIKE '" . $cmonth . "%' ORDER by `date` DESC;";
     $signups = zb_SignupsGet($where);
     $curdate = curdate();
     //cemetery hide processing
     $ignoreUsers = array();
     if ($altercfg['CEMETERY_ENABLED']) {
         $cemetery = new Cemetery();
         $ignoreUsers = $cemetery->getAllTagged();
     }
     $tablecells = wf_TableCell(__('ID'));
     $tablecells .= wf_TableCell(__('Date'));
     $tablecells .= wf_TableCell(__('Administrator'));
     if ($altercfg['SIGREP_CONTRACT']) {
         $tablecells .= wf_TableCell(__('Contract'));
         $allcontracts = array_flip(zb_UserGetAllContracts());
     }
     $tablecells .= wf_TableCell(__('Login'));
     $tablecells .= wf_TableCell(__('Tariff'));
     $tablecells .= wf_TableCell(__('Full address'));
     $tablerows = wf_TableRow($tablecells, 'row1');
     if (!empty($signups)) {
         foreach ($signups as $io => $eachsignup) {
             $tablecells = wf_TableCell($eachsignup['id']);
             $tablecells .= wf_TableCell($eachsignup['date']);
             $tablecells .= wf_TableCell($eachsignup['admin']);
             if ($altercfg['SIGREP_CONTRACT']) {
                 $tablecells .= wf_TableCell(@$allcontracts[$eachsignup['login']]);
             }
             $tablecells .= wf_TableCell($eachsignup['login']);
             @($sigTariff = $alltariffs[$eachsignup['login']]);
             $tablecells .= wf_TableCell($sigTariff);
             $profilelink = wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $eachsignup['address']);
             $tablecells .= wf_TableCell($profilelink);
             if (ispos($eachsignup['date'], $curdate)) {
                 $rowClass = 'todaysig';
             } else {
                 $rowClass = 'row3';
             }
             //cemetary user
             if (isset($ignoreUsers[$eachsignup['login']])) {
                 $rowClass = 'sigcemeteryuser';
             }
             //ugly check - is user removed?
             if (empty($sigTariff)) {
                 $rowClass = 'sigdeleteduser';
             }
             $tablerows .= wf_TableRow($tablecells, $rowClass);
         }
     }
     $result = wf_TableBody($tablerows, '100%', '0', 'sortable');
     show_window(__('User signups by month') . ' ' . $cmonth, $result);
 }
Exemplo n.º 3
0
 /**
  * Renders table for corps users payments/fees stats
  * 
  * @param array $fundsFlows
  * @param array $corpsData
  * @param array $corpUsers
  * @param array $allUserTariffs
  * @param array $allUserContracts
  * 
  * @return string
  */
 public function renderCorpsFlows($num, $fundsFlows, $corpsData, $corpUsers, $allUserContracts, $allUsersCash, $allUserTariffs, $allTariffPrices)
 {
     $result = '';
     $rawData = array();
     $rawData['balance'] = 0;
     $rawData['payments'] = 0;
     $rawData['paymentscorr'] = 0;
     $rawData['fees'] = 0;
     $rawData['login'] = '';
     $rawData['contract'] = '';
     $rawData['corpid'] = '';
     $rawData['corpname'] = '';
     $rawData['balance'] = 0;
     $rawData['used'] = 0;
     //cemetery dead-hide processing
     $ignoreArr = array();
     if ($this->alterConf['CEMETERY_ENABLED']) {
         $cemetery = new Cemetery();
         $ignoreArr = $cemetery->getAllTagged();
     }
     if (!empty($fundsFlows)) {
         foreach ($fundsFlows as $io => $eachop) {
             if ($eachop['operation'] == 'Fee') {
                 $rawData['fees'] = $rawData['fees'] + abs($eachop['summ']);
             }
             if ($eachop['operation'] == 'Payment') {
                 $rawData['payments'] = $rawData['payments'] + abs($eachop['summ']);
             }
             if ($eachop['operation'] == 'Correcting') {
                 $rawData['paymentscorr'] = $rawData['paymentscorr'] + abs($eachop['summ']);
             }
         }
         $rawData['login'] = $eachop['login'];
         if (!isset($ignoreArr[$rawData['login']])) {
             @($rawData['contract'] = array_search($eachop['login'], $allUserContracts));
             @($rawData['corpid'] = $corpUsers[$eachop['login']]);
             @($rawData['corpname'] = $corpsData[$rawData['corpid']]['corpname']);
             $rawData['balance'] = $allUsersCash[$eachop['login']];
             $rawData['used'] = $rawData['fees'];
             //forming result
             $cells = wf_TableCell($num);
             $corpLink = wf_Link('?module=corps&show=corps&editid=' . $rawData['corpid'], $rawData['corpname'], false, '');
             $cells .= wf_TableCell($corpLink);
             if ($rawData['contract']) {
                 $loginLink = wf_Link('?module=userprofile&username='******'login'], $rawData['contract'], false, '');
             } else {
                 $loginLink = wf_Link('?module=userprofile&username='******'login'], $rawData['login'], false, '');
             }
             $cells .= wf_TableCell($loginLink);
             $cells .= wf_TableCell(@$allTariffPrices[$allUserTariffs[$rawData['login']]]);
             $cells .= wf_TableCell(round($rawData['payments'], 2));
             $cells .= wf_TableCell(round($rawData['paymentscorr'], 2));
             $cells .= wf_TableCell(round($rawData['balance'], 2));
             $cells .= wf_TableCell(round($rawData['used'], 2));
             $result .= wf_TableRow($cells, 'row3');
         }
     }
     return $result;
 }