/** * Returns form for usersearch and debtors by city * * @return string */ public function PerCityDataShow() { $this->LoadAllOnu(); $this->LoadAllNotes(); $this->LoadAllPhoneData(); $this->LoadAllCredited(); $this->loadSignalsCache(); $addr_sort = 'address_down'; $realname_sort = 'realname_down'; $credited_sort = 'credited_down'; $cash_sort = 'cash_down'; $tariff_sort = 'tariff_down'; $comment_sort = 'comment_down'; $signal_sort = 'signal_down'; $mac_onu_sort = 'mac_onu_down'; if (isset($_GET['sort'])) { switch ($_GET['sort']) { case 'address_up': $this->sort_additional($this->allAddresses, SORT_ASC); break; case 'address_down': $this->sort_additional($this->allAddresses, SORT_DESC); break; case 'realname_up': $this->sort_additional($this->allRealNames, SORT_ASC); break; case 'realname_down': $this->sort_additional($this->allRealNames, SORT_DESC); break; case 'credited_up': $this->sort_additional($this->allCredited, SORT_ASC); break; case 'credited_down': $this->sort_additional($this->allCredited, SORT_DESC); break; case 'cash_up': $this->sort_standart('Cash', SORT_ASC); break; case 'cash_down': $this->sort_standart('Cash', SORT_DESC); break; case 'tariff_up': $this->sort_standart('Tariff', SORT_ASC); break; case 'tariff_down': $this->sort_standart('Tariff', SORT_DESC); break; case 'comment_up': $this->sort_additional($this->allNotes, SORT_ASC); break; case 'comment_down': $this->sort_additional($this->allNotes, SORT_DESC); break; case 'signal_up': $this->sort_signal($this->allOnu, $this->signalCache, SORT_ASC); break; case 'signal_down': $this->sort_signal($this->allOnu, $this->signalCache, SORT_DESC); break; case 'mac_onu_up': $this->sort_additional($this->allOnu, SORT_ASC); break; case 'mac_onu_down': $this->sort_additional($this->allOnu, SORT_DESC); break; } if ($_GET['sort'] == 'address_down') { $addr_sort = 'address_up'; } if ($_GET['sort'] == 'realname_down') { $realname_sort = 'realname_up'; } if ($_GET['sort'] == 'credited_down') { $credited_sort = 'credited_up'; } if ($_GET['sort'] == 'cash_down') { $cash_sort = 'cash_up'; } if ($_GET['sort'] == 'tariff_down') { $tariff_sort = 'tariff_up'; } if ($_GET['sort'] == 'comment_down') { $comment_sort = 'comment_up'; } if ($_GET['sort'] == 'signal_down') { $signal_sort = 'signal_up'; } if ($_GET['sort'] == 'mac_onu_down') { $mac_onu_sort = 'mac_onu_up'; } } $total = 0; $totalPayCount = 0; $colors = new ColorTagging(); $cells = wf_TableCell(wf_tag('h2', false) . __('ID') . wf_tag('h2', true)); $cells .= wf_TableCell(wf_tag('h2', false) . wf_Link($this->SaveGetParams('sort') . 'sort=' . $addr_sort, __('Full address')) . wf_tag('h2', true)); $cells .= wf_TableCell(wf_tag('h2', false) . wf_Link($this->SaveGetParams('sort') . 'sort=' . $realname_sort, __('Real Name')) . wf_tag('h2', true)); $cells .= wf_TableCell(wf_tag('h2', false) . wf_Link($this->SaveGetParams('sort') . 'sort=' . $credited_sort, __('Was credited')) . wf_tag('h2', true)); $cells .= wf_TableCell(wf_tag('h2', false) . wf_Link($this->SaveGetParams('sort') . 'sort=' . $cash_sort, __('Cash')) . wf_tag('h2', true)); if ($this->altCfg['FINREP_TARIFF']) { $cells .= wf_TableCell(wf_tag('h2', false) . wf_Link($this->SaveGetParams('sort') . 'sort=' . $tariff_sort, __('Tariff')) . wf_tag('h2', true)); $this->LoadAllTariffs(); } $cells .= wf_TableCell(wf_tag('h2', false) . wf_Link($this->SaveGetParams('sort') . 'sort=' . $comment_sort, __('Comment')) . wf_tag('h2', true)); $cells .= wf_TableCell(wf_tag('h2', false) . wf_Link($this->SaveGetParams('sort') . 'sort=' . $signal_sort, __('Signal')) . wf_tag('h2', true)); $cells .= wf_TableCell(wf_tag('h2', false) . wf_Link($this->SaveGetParams('sort') . 'sort=' . $mac_onu_sort, __('MAC ONU/ONT')) . wf_tag('h2', true)); $cells .= wf_TableCell(wf_tag('h2', false) . __('Login') . wf_tag('h2', true)); $rows = wf_TableRow($cells, 'row1'); if (!empty($this->allData)) { foreach ($this->allData as $eachdebtor) { $total = $total + $eachdebtor['Cash']; $totalPayCount++; $signal = @$this->signalCache[$this->allOnu[$eachdebtor['login']]['mac']]; $sigColor = '#000000'; if (!empty($signal)) { if ($signal > 0 or $signal < -25) { $sigColor = '#ab0000'; } else { $sigColor = '#005502'; } } else { $signal = __("No"); } $userColor = $colors->GetUsersColor($eachdebtor['login']); $cell = wf_TableCell($totalPayCount); $cell .= wf_TableCell(@$this->allAddresses[$eachdebtor['login']]); $cell .= wf_TableCell(@$this->allRealNames[$eachdebtor['login']] . "  " . @$this->allPhoneData[$eachdebtor['login']]['mobile']); $cell .= wf_TableCell(@$this->allCredited[$eachdebtor['login']]); $cell .= wf_TableCell($eachdebtor['Cash']); if ($this->altCfg['FINREP_TARIFF']) { $cell .= wf_TableCell($this->allTariffs[$eachdebtor['login']]); } $cell .= wf_TableCell(@$this->allNotes[$eachdebtor['login']]); $cell .= wf_TableCell(wf_tag('strong') . wf_tag('font color=' . $sigColor, false) . $signal . wf_tag('font', true) . wf_tag('strong', true)); $cell .= wf_TableCell(@$this->allOnu[$eachdebtor['login']]['mac']); $cell .= wf_TableCell(wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $eachdebtor['login'], false, '')); if (!empty($userColor)) { $style = "background-color:{$userColor}"; $rows .= wf_TableRowStyled($cell, 'row4', $style); } else { $rows .= wf_TableRow($cell, 'row4'); } } } $result = wf_tag('strong') . __('Count') . ': ' . $totalPayCount . wf_tag('strong', true) . wf_tag('br'); $result .= wf_tag('strong') . __('Cash') . ': ' . $total . wf_tag('strong', true) . wf_tag('br'); $result .= wf_TableBody($rows, '100%', '0', ''); return $result; }
/** * Returns form for usersearch and debtors by city * * @return string */ public function PerCityDataShow() { $total = 0; $totalPayCount = 0; $colors = new ColorTagging(); $this->LoadAllOnu(); $this->LoadAllComments(); $this->LoadAllNotes(); $this->LoadAllPhoneData(); $this->LoadAllCredited(); $cells = wf_TableCell(__('Full address')); $cells .= wf_TableCell(__('Real Name')); $cells .= wf_TableCell(__('Credited')); $cells .= wf_TableCell(__('Cash')); if ($this->altCfg['FINREP_TARIFF']) { $cells .= wf_TableCell(__('Tariff')); $this->LoadAllTariffs(); } $cells .= wf_TableCell(__('Comment')); $cells .= wf_TableCell(__('MAC ONU/ONT')); $cells .= wf_TableCell(__('Login')); $rows = wf_TableRow($cells, 'row1'); if (!empty($this->allData)) { foreach ($this->allData as $eachdebtor) { $userColor = $colors->GetUsersColor($eachdebtor['login']); $cell = wf_TableCell(@$this->allAddresses[$eachdebtor['login']]); $cell .= wf_TableCell(@$this->allRealNames[$eachdebtor['login']] . "  " . @$this->allPhoneData[$eachdebtor['login']]['mobile']); $cell .= wf_TableCell(@$this->allCredited[$eachdebtor['login']]); $cell .= wf_TableCell($eachdebtor['Cash']); if ($this->altCfg['FINREP_TARIFF']) { $cell .= wf_TableCell($this->allTariffs[$eachdebtor['login']]); } $cell .= wf_TableCell(@$this->allNotes[$eachdebtor['login']] . "  " . @$this->allComments[$eachdebtor['login']]); $cell .= wf_TableCell(@$this->allOnu[$eachdebtor['login']]); $cell .= wf_TableCell(wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $eachdebtor['login'], false, '')); if (!empty($userColor)) { $style = "background-color:{$userColor}"; $rows .= wf_TableRowStyled($cell, 'row4', $style); } else { $rows .= wf_TableRow($cell, 'row4'); } $total = $total + $eachdebtor['Cash']; $totalPayCount++; } } $result = wf_TableBody($rows, '100%', '0', 'sortable id'); $result .= wf_tag('strong') . __('Cash') . ': ' . $total . wf_tag('strong', true) . wf_tag('br'); $result .= wf_tag('strong') . __('Count') . ': ' . $totalPayCount . wf_tag('strong', true); return $result; }