/** * Returns available list with some controls * * @return string */ function web_CardsShow() { $result = ''; $totalcount = zb_CardsGetCount(); $perpage = 100; //pagination if (!isset($_GET['page'])) { $current_page = 1; } else { $current_page = vf($_GET['page'], 3); } if ($totalcount > $perpage) { $paginator = wf_pagination($totalcount, $perpage, $current_page, "?module=cards", 'ubButton'); $from = $perpage * ($current_page - 1); $to = $perpage; $query = "SELECT * from `cardbank` ORDER by `id` DESC LIMIT " . $from . "," . $to . ";"; $alluhw = simple_queryall($query); } else { $paginator = ''; $query = "SELECT * from `cardbank` ORDER by `id` DESC;"; $alluhw = simple_queryall($query); } $allcards = simple_queryall($query); $cells = wf_TableCell(__('ID')); $cells .= wf_TableCell(__('Serial number')); $cells .= wf_TableCell(__('Price')); $cells .= wf_TableCell(__('Admin')); $cells .= wf_TableCell(__('Date')); $cells .= wf_TableCell(__('Active')); $cells .= wf_TableCell(__('Used')); $cells .= wf_TableCell(__('Usage date')); $cells .= wf_TableCell(__('Used login')); $cells .= wf_TableCell(__('Used IP')); $cells .= wf_TableCell(''); $rows = wf_TableRow($cells, 'row1'); if (!empty($allcards)) { foreach ($allcards as $io => $eachcard) { $cells = wf_TableCell($eachcard['id']); $cells .= wf_TableCell($eachcard['serial']); $cells .= wf_TableCell($eachcard['cash']); $cells .= wf_TableCell($eachcard['admin']); $cells .= wf_TableCell($eachcard['date']); $cells .= wf_TableCell(web_bool_led($eachcard['active'])); $cells .= wf_TableCell(web_bool_led($eachcard['used'])); $cells .= wf_TableCell($eachcard['usedate']); $cells .= wf_TableCell($eachcard['usedlogin']); $cells .= wf_TableCell($eachcard['usedip']); $cells .= wf_TableCell(wf_CheckInput('_cards[' . $eachcard['id'] . ']', '', false, false)); $rows .= wf_TableRow($cells, 'row3'); } } $result = wf_TableBody($rows, '100%', 0, ''); $result .= $paginator . wf_delimiter(); $cardActions = array('caexport' => __('Export serials'), 'caactive' => __('Mark as active'), 'cainactive' => __('Mark as inactive'), 'cadelete' => __('Delete')); $actionSelect = wf_Selector('cardactions', $cardActions, '', '', false); $actionSelect .= wf_Submit(__('With selected')); $result .= $actionSelect; $result = wf_Form('', 'POST', $result, ''); return $result; }
/** * Renders available tickets list with controls * * @global object $ubillingConfig * @return string */ function web_TicketsShow() { global $ubillingConfig; $alterconf = $ubillingConfig->getAlter(); //pagination section $totalcount = zb_TicketsGetCount(); $perpage = $alterconf['TICKETS_PERPAGE']; if (!isset($_GET['page'])) { $current_page = 1; } else { $current_page = vf($_GET['page'], 3); } if ($totalcount > $perpage) { $paginator = wf_pagination($totalcount, $perpage, $current_page, "?module=ticketing", 'ubButton'); $alltickets = zb_TicketsGetLimited($perpage * ($current_page - 1), $perpage); } else { $paginator = ''; $alltickets = zb_TicketsGetAll(); } $tablecells = wf_TableCell(__('ID')); $tablecells .= wf_TableCell(__('Date')); $tablecells .= wf_TableCell(__('From')); $tablecells .= wf_TableCell(__('Real Name')); $tablecells .= wf_TableCell(__('Full address')); $tablecells .= wf_TableCell(__('IP')); $tablecells .= wf_TableCell(__('Tariff')); $tablecells .= wf_TableCell(__('Balance')); $tablecells .= wf_TableCell(__('Credit')); $tablecells .= wf_TableCell(__('Processed')); $tablecells .= wf_TableCell(__('Actions')); $tablerows = wf_TableRow($tablecells, 'row1'); if (!empty($alltickets)) { $allrealnames = zb_UserGetAllRealnames(); $alladdress = zb_AddressGetFulladdresslist(); $alltariffs = zb_TariffsGetAllUsers(); $allcash = zb_CashGetAllUsers(); $allcredits = zb_CreditGetAllUsers(); $alluserips = zb_UserGetAllIPs(); foreach ($alltickets as $io => $eachticket) { $tablecells = wf_TableCell($eachticket['id']); $tablecells .= wf_TableCell($eachticket['date']); $fromlink = wf_Link('?module=userprofile&username='******'from'], web_profile_icon() . ' ' . $eachticket['from']); $tablecells .= wf_TableCell($fromlink); $tablecells .= wf_TableCell(@$allrealnames[$eachticket['from']]); $tablecells .= wf_TableCell(@$alladdress[$eachticket['from']]); $tablecells .= wf_TableCell(@$alluserips[$eachticket['from']]); $tablecells .= wf_TableCell(@$alltariffs[$eachticket['from']]); $tablecells .= wf_TableCell(@$allcash[$eachticket['from']]); $tablecells .= wf_TableCell(@$allcredits[$eachticket['from']]); $tablecells .= wf_TableCell(web_bool_led($eachticket['status']), '', '', 'sorttable_customkey="' . $eachticket['status'] . '"'); $actionlink = wf_Link('?module=ticketing&showticket=' . $eachticket['id'], 'Show', false, 'ubButton'); $tablecells .= wf_TableCell($actionlink); $tablerows .= wf_TableRow($tablecells, 'row3'); } } $result = wf_TableBody($tablerows, '100%', '0', 'sortable'); $result .= $paginator; return $result; }
/** * renders available signups data * * @return void */ public function renderList() { $totalcount = $this->getCount(); if (!wf_CheckGet(array('page'))) { $current_page = 1; } else { $current_page = vf($_GET['page'], 3); } if ($totalcount > $this->perpage) { $paginator = wf_pagination($totalcount, $this->perpage, $current_page, "?module=sigreq", 'ubButton'); $this->loadRequests($this->perpage * ($current_page - 1), $this->perpage); } else { $paginator = ''; $this->loadRequests(0, $this->perpage); } $result = ''; //additional comments indicator if ($this->altcfg['ADCOMMENTS_ENABLED']) { $adcomments = new ADcomments('SIGREQ'); } $tablecells = wf_TableCell(__('ID')); $tablecells .= wf_TableCell(__('Date')); $tablecells .= wf_TableCell(__('IP')); $tablecells .= wf_TableCell(__('Full address')); $tablecells .= wf_TableCell(__('Real Name')); $tablecells .= wf_TableCell(__('Processed')); $tablecells .= wf_TableCell(__('Actions')); $tablerows = wf_TableRow($tablecells, 'row1'); if (!empty($this->requests)) { foreach ($this->requests as $io => $eachreq) { $tablecells = wf_TableCell($eachreq['id']); $tablecells .= wf_TableCell($eachreq['date']); $tablecells .= wf_TableCell(wf_Link(self::URL_WHOIS . $eachreq['ip'], $eachreq['ip'])); if (empty($eachreq['apt'])) { $apt = 0; } else { $apt = $eachreq['apt']; } $reqaddr = $eachreq['street'] . ' ' . $eachreq['build'] . '/' . $apt; $tablecells .= wf_TableCell($reqaddr); $tablecells .= wf_TableCell($eachreq['realname']); if ($this->altcfg['ADCOMMENTS_ENABLED']) { $commIndicator = ' ' . $adcomments->getCommentsIndicator($eachreq['id']); } else { $commIndicator = ''; } $tablecells .= wf_TableCell(web_bool_led($eachreq['state']) . $commIndicator); $actlinks = wf_Link('?module=sigreq&showreq=' . $eachreq['id'], wf_img('skins/icon_search_small.gif') . ' ' . __('Show'), true, 'ubButton'); $tablecells .= wf_TableCell($actlinks); $tablerows .= wf_TableRow($tablecells, 'row3'); } } $result = wf_TableBody($tablerows, '100%', '0', 'sortable'); $result .= $paginator; //check database configuration table if (zb_CheckTableExists('sigreqconf')) { $confControl = wf_Link('?module=sigreq&settings=true', wf_img('skins/settings.png', __('Settings')), false) . ' '; } else { $confControl = ''; } $viewControl = wf_Link('?module=sigreq&calendarview=true', wf_img('skins/icon_calendar.gif', __('As calendar')), false, ''); show_window($confControl . __('Available signup requests') . ' ' . $viewControl, $result); }
/** * Renders base capabilities grid * * @rerturn string */ public function render() { //pagination processing $totalcount = sizeof($this->availids); if (!wf_CheckGet(array('page'))) { $currPage = 1; } else { $currPage = vf($_GET['page'], 3); } $cells = wf_TableCell(__('ID')); $cells .= wf_TableCell(__('Date')); $cells .= wf_TableCell(__('Address')); $cells .= wf_TableCell(__('Phone')); $cells .= wf_TableCell(__('Status')); $cells .= wf_TableCell(__('Notes')); $cells .= wf_TableCell(__('Price')); $cells .= wf_TableCell(__('Employee')); $cells .= wf_TableCell(__('Changed')); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); $panel = $this->panel(); $styles = wf_tag('style'); //making some custom styles if (!empty($this->capabstates)) { foreach ($this->capabstates as $ia => $eachstate) { $styles .= '.capab_' . $eachstate['id'] . ' { background-color:#' . $eachstate['color'] . '; color: #FFFFFF; } '; } } $styles .= wf_tag('style', true); if (!empty($this->allcapab)) { foreach ($this->allcapab as $io => $each) { $stateName = @$this->capabstates[$each['stateid']]['state']; $employeeName = @$this->employees[$each['employeeid']]['name']; $actions = ''; if (cfr('ROOT')) { $actions .= wf_JSAlert("?module=capabilities&delete=" . $each['id'], web_delete_icon(), __('Removing this may lead to irreparable results')) . ' '; } $actions .= wf_JSAlert("?module=capabilities&edit=" . $each['id'] . '&page=' . $currPage, web_edit_icon(), __('Are you serious')); $cells = wf_TableCell($each['id']); $cells .= wf_TableCell($each['date']); $cells .= wf_TableCell($each['address']); $cells .= wf_TableCell($each['phone']); $cells .= wf_TableCell($stateName, '', 'capab_' . $each['stateid']); $cells .= wf_TableCell($each['notes']); $cells .= wf_TableCell($each['price']); $cells .= wf_TableCell($employeeName); $cells .= wf_TableCell($each['donedate']); $cells .= wf_TableCell($actions); $rows .= wf_TableRow($cells, 'row3'); } } if ($totalcount > self::PER_PAGE) { $paginator = wf_pagination($totalcount, self::PER_PAGE, $currPage, "?module=capabilities", 'ubButton'); } else { $paginator = ''; } $result = $panel; $result .= $styles; $result .= wf_TableBody($rows, '100%', '0', 'sortable'); $result .= $paginator; return $result; }