public function render() { $cells = wf_TableCell(__('ID')); $cells .= wf_TableCell(__('Date')); $cells .= wf_TableCell(__('Text')); $cells .= wf_TableCell(__('Processed')); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); if (!empty($this->alltickets)) { foreach ($this->alltickets as $io => $each) { $cells = wf_TableCell($each['id']); $cells .= wf_TableCell($each['date']); if (strlen($each['text']) > 140) { $textPreview = mb_substr(strip_tags($each['text']), 0, 140, 'utf-8') . '...'; } else { $textPreview = strip_tags($each['text']); } $cells .= wf_TableCell($textPreview); $cells .= wf_TableCell(web_bool_led($each['status'])); $cells .= wf_TableCell(wf_Link('?module=ticketing&showticket=' . $each['id'], __('Show'), false, 'ubButton')); $rows .= wf_TableRow($cells, 'row3'); } } $result = wf_TableBody($rows, '100%', 0, 'sortable'); return $result; }
public function render() { $cells = wf_TableCell(__('Login')); $cells .= wf_TableCell(__('Address')); $cells .= wf_TableCell(__('Real Name')); $cells .= wf_TableCell(__('IP')); $cells .= wf_TableCell(__('Tariff')); $cells .= wf_TableCell(__('Traffic')); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); if (!empty($this->data)) { $allrealnames = zb_UserGetAllRealnames(); $alladdress = zb_AddressGetFulladdresslist(); foreach ($this->data as $io => $each) { $loginLink = wf_Link("?module=userprofile&username="******"' . $each['traffic'] . '"'); $actionLinks = wf_Link('?module=pl_traffdetails&username='******'login'], wf_img('skins/icon_stats.gif', __('Detailed stats')), false, ''); $actionLinks .= wf_link('?module=dstatedit&username='******'login'], web_edit_icon(), false, ''); $cells .= wf_TableCell($actionLinks); $rows .= wf_TableRow($cells, 'row3'); } } $result = wf_TableBody($rows, '100%', '0', 'sortable'); return $result; }
/** * Renders search results for used cards * * @param int $year * @param string $month * * @return void */ function web_CardShowUsageByMonth($year, $month) { $month = mysql_real_escape_string($month); $year = mysql_real_escape_string($year); $query = "SELECT * from `cardbank` WHERE `usedate` LIKE '%" . $year . "-" . $month . "-%'"; $allusedcards = simple_queryall($query); $allrealnames = zb_UserGetAllRealnames(); $alladdress = zb_AddressGetFulladdresslist(); $totalsumm = 0; $totalcount = 0; $csvdata = ''; $tablecells = wf_TableCell(__('ID')); $tablecells .= wf_TableCell(__('Serial number')); $tablecells .= wf_TableCell(__('Cash')); $tablecells .= wf_TableCell(__('Usage date')); $tablecells .= wf_TableCell(__('Used login')); $tablecells .= wf_TableCell(__('Full address')); $tablecells .= wf_TableCell(__('Real name')); $tablerows = wf_TableRow($tablecells, 'row1'); if (!empty($allusedcards)) { $csvdata = __('ID') . ';' . __('Serial number') . ';' . __('Cash') . ';' . __('Usage date') . ';' . __('Used login') . ';' . __('Full address') . ';' . __('Real name') . "\n"; foreach ($allusedcards as $io => $eachcard) { $tablecells = wf_TableCell($eachcard['id']); $tablecells .= wf_TableCell($eachcard['serial']); $tablecells .= wf_TableCell($eachcard['cash']); $tablecells .= wf_TableCell($eachcard['usedate']); $profilelink = wf_Link("?module=userprofile&username="******"\n"; } } if (!empty($csvdata)) { $exportFilename = 'exports/cardreport_' . $year . '-' . $month . '.csv'; $csvdata = iconv('utf-8', 'windows-1251', $csvdata); file_put_contents($exportFilename, $csvdata); $exportLink = wf_Link('?module=cardreport&dloadcsv=' . base64_encode($exportFilename), wf_img('skins/excel.gif', __('Export')), false, ''); } else { $exportLink = ''; } $result = wf_TableBody($tablerows, '100%', '0', 'sortable'); $result .= __('Total') . ': ' . $totalcount . ' ' . __('payments') . ', ' . __('with total amount') . ': ' . $totalsumm; show_window(__('Payment cards usage report') . ' ' . $exportLink, $result); }
function multinet_show_serviceeditform($serviceid) { $serviceid = vf($serviceid); $servicedata = multinet_get_service_params($serviceid); $form = ' <form action="" method="POST" class="glamour"> <input type="hidden" name="serviceedit" value="true"> ' . multinet_network_selector($servicedata['netid']) . ' ' . __('Service network') . ' <br> <input type="text" name="editservicename" size="15" value="' . $servicedata['desc'] . '"> ' . __('Service description') . '<sup>*</sup> <br> <input type="submit" value="' . __('Save') . '"> </form> <div style="clear:both;"></div> '; $form .= wf_Link('?module=multinet', 'Back', true, 'ubButton'); show_window(__('Edit'), $form); }
/** * Returns JSON reply for jquery datatables with full list of available UHW usages * * @return string */ public function ajaxGetData() { $query = "SELECT * from `uhw_log` ORDER by `id` DESC;"; $alluhw = simple_queryall($query); $alladdress = zb_AddressGetFulladdresslist(); $allrealnames = zb_UserGetAllRealnames(); $result = '{ "aaData": [ '; if (!empty($alluhw)) { foreach ($alluhw as $io => $each) { $profileLink = wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $each['login'], false); $profileLink = str_replace('"', '', $profileLink); $profileLink = str_replace("'", '', $profileLink); $profileLink = trim($profileLink); $userAddress = @$alladdress[$each['login']]; $userAddress = str_replace("'", '`', $userAddress); $userAddress = str_replace('"', '``', $userAddress); $userAddress = trim($userAddress); $userRealname = @$allrealnames[$each['login']]; $userRealname = str_replace("'", '`', $userRealname); $userRealname = str_replace('"', '``', $userRealname); $userRealname = trim($userRealname); $result .= ' [ "' . $each['id'] . '", "' . $each['date'] . '", "' . $each['password'] . '", "' . $profileLink . '", "' . $userAddress . '", "' . $userRealname . '", "' . $each['ip'] . '", "' . $each['nhid'] . '", "' . $each['oldmac'] . '", "' . $each['newmac'] . '" ],'; } } $result = substr($result, 0, -1); $result .= '] }'; return $result; }
function web_UsersLister($users) { $tablecells = wf_TableCell(__('Login')); $tablecells .= wf_TableCell(__('Real Name')); $tablecells .= wf_TableCell(__('Full address')); $tablecells .= wf_TableCell(__('Tariff')); $tablecells .= wf_TableCell(__('Tariff speeds')); $tablecells .= wf_TableCell(__('Speed override')); $tablecells .= wf_TableCell(__('Actions')); $tablerows = wf_TableRow($tablecells, 'row1'); if (!empty($users)) { $udata = array(); $alluserdata = zb_UserGetAllStargazerData(); $alladdress = zb_AddressGetFulladdresslist(); $allrealnames = zb_UserGetAllRealnames(); $allspeeds = zb_TariffGetAllSpeeds(); if (!empty($alluserdata)) { foreach ($alluserdata as $ia => $eachdata) { $udata[$eachdata['login']]['Tariff'] = $eachdata['Tariff']; @($udata[$eachdata['login']]['Address'] = $alladdress[$eachdata['login']]); @($udata[$eachdata['login']]['RealName'] = $allrealnames[$eachdata['login']]); @($udata[$eachdata['login']]['NormalSpeedDown'] = $allspeeds[$eachdata['Tariff']]['speeddown']); @($udata[$eachdata['login']]['NormalSpeedUp'] = $allspeeds[$eachdata['Tariff']]['speedup']); } } foreach ($users as $io => $eachuser) { $tablecells = wf_TableCell(wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $eachuser['login'])); $tablecells .= wf_TableCell($udata[$eachuser['login']]['RealName']); $tablecells .= wf_TableCell($udata[$eachuser['login']]['Address']); $tablecells .= wf_TableCell($udata[$eachuser['login']]['Tariff']); $tablecells .= wf_TableCell($udata[$eachuser['login']]['NormalSpeedDown'] . '/' . $udata[$eachuser['login']]['NormalSpeedUp']); $tablecells .= wf_TableCell(zb_UserGetSpeedOverride($eachuser['login'])); $fixlink = wf_JSAlert('?module=speedcontrol&fix=' . $eachuser['login'], '<img src="skins/icon_repair.gif" title=' . __('Fix') . '>', 'Are you serious'); $tablecells .= wf_TableCell($fixlink); $tablerows .= wf_TableRow($tablecells, 'row3'); } } $result = wf_TableBody($tablerows, '100%', '0', 'sortable'); return $result; }
function web_PhpConsoleShowTemplates() { $alltemplatekeys = zb_StorageFindKeys('PHPCONSOLETEMPLATE:'); $tablecells = wf_TableCell(__('Template'), '80%'); $tablecells .= wf_TableCell(__('Actions')); $tablerows = wf_TableRow($tablecells, 'row1'); if (!empty($alltemplatekeys)) { foreach ($alltemplatekeys as $eachtemplatekey) { $templatearray = zb_PhpConsoleGetTemplate($eachtemplatekey['key']); $templatename = $templatearray['name']; $templatebody = $templatearray['body']; //show code template $runlink = wf_JSAlert('?module=sqlconsole&devconsole=true&runtpl=' . $eachtemplatekey['key'], $templatename, 'Insert this template into PHP console'); $tablecells = wf_TableCell($runlink); $actionlinks = wf_JSAlert('?module=sqlconsole&devconsole=true&deltemplate=' . $eachtemplatekey['key'], web_delete_icon(), 'Are you serious'); $actionlinks .= wf_Link('?module=sqlconsole&devconsole=true&edittemplate=' . $eachtemplatekey['key'], web_edit_icon()); $tablecells .= wf_TableCell($actionlinks); $tablerows .= wf_TableRow($tablecells, 'row3'); } } $createlink = __('Available code templates') . ' ' . wf_Link("?module=sqlconsole&devconsole=true&templateadd=true", wf_img("skins/icon_add.gif", __('Create')), false); $result = $createlink . ' ' . wf_TableBody($tablerows, '100%', '0', 'sortable'); return $result; }
function web_NasTemplatesShow() { $query = "SELECT * from `nastemplates`"; $alltemplates = simple_queryall($query); $tablecells = wf_TableCell(__('ID')); $tablecells .= wf_TableCell(__('NAS')); $tablecells .= wf_TableCell(__('Template')); $tablecells .= wf_TableCell(__('Actions')); $tablerows = wf_TableRow($tablecells, 'row1'); if (!empty($alltemplates)) { foreach ($alltemplates as $io => $eachtemplate) { $nasdata = zb_NasGetData($eachtemplate['nasid']); $tablecells = wf_TableCell($eachtemplate['id']); $tablecells .= wf_TableCell($eachtemplate['nasid'] . ':' . $nasdata['nasname']); $tablecells .= wf_TableCell('<pre>' . $eachtemplate['template'] . '</pre>'); $actions = wf_JSAlert("?module=radiust&delete=" . $eachtemplate['id'], web_delete_icon(), 'Are you serious'); $actions .= wf_Link("?module=radiust&edit=" . $eachtemplate['id'], web_edit_icon(), false, ''); $tablecells .= wf_TableCell($actions); $tablerows .= wf_TableRow($tablecells, 'row3'); } } $result = wf_TableBody($tablerows, '100%', '0', 'sortable'); show_window(__('Available NAS Radius attribute templates'), $result); }
foreach ($results as $result) { $cells = wf_TableCell($result['id']); $cells .= wf_TableCell($result['scenario']); $cells .= wf_TableCell($result['Attribute']); $cells .= wf_TableCell($result['op']); $cells .= wf_TableCell($result['Value']); $content = web_bool_led($result['login'] == '*'); $cells .= wf_TableCell($content); $content = wf_Link("?module=freeradius&netid={$netid}&edit=" . $result['id'], web_edit_icon()); $content .= wf_JSAlert("?module=freeradius&netid={$netid}&delete=" . $result['id'], web_delete_icon(), 'Are you serious'); $cells .= wf_TableCell($content); $rows .= wf_TableRow($cells, 'row3'); } } /* Кнопка "Назад" */ $html .= wf_Link("?module=multinet", __('Back'), false, 'ubButton'); // Форма добавления нового атрибута $form = new InputForm('', 'POST', __('Save'), '', '', '', 'add'); // - Сценарий $content = $form->radio_button('add[scenario]', $scenarios, 'check'); $form->addrow(__('Scenario'), $content); // - Сервис (disabled) $content = $form->select_tag('add[netid]', getServiceIdDesc(), $netid, 'disabled'); $content .= $form->checkbox('add[login]', '*', __('Foreach'), ''); $form->addrow(__('Service'), $content); // - Атрибут $content = $form->text_box('add[Attribute]', ''); $form->addrow(__('Attribute'), $content); // - Оператор $content = $form->select_tag('add[op]', $operators, ''); $form->addrow(__('op'), $content);
if (method_exists($corps, $beggar['BU']['F'])) { $corpAttachControls = $corps->{$beggar}['BU']['F']($login); show_window(__('Private user'), $corpAttachControls); } if (method_exists($corps, $beggar['BU']['AB'])) { $corpAddAttachControls = $corps->{$beggar}['BU']['AB']($login); show_window(__('Create') . ' ' . __('Corporate user'), $corpAddAttachControls); } } } } if ($route == Corps::URL_SEARCH) { $searchResults = $corps->searchUsersByCorpName($_POST['searchcorpname']); if (!empty($searchResults)) { show_window(__('Search results'), $searchResults); } show_window('', wf_Link('?module=usersearch', __('Back'), false, 'ubButton')); } } else { //default list route rcms_redirect(Corps::URL_CORPS_LIST); } } else { show_error(__('No license key available')); } } else { show_error(__('This module is disabled')); } } else { show_error(__('Access denied')); }
/** * Renders user profile with all loaded data * * @return string */ public function render() { //all configurable features must be received via getters $profile = ''; //activity and other flags $passiveicon = $this->userdata['Passive'] ? wf_img_sized('skins/icon_passive.gif', '', '', '12') . ' ' : ''; $downicon = $this->userdata['Down'] ? wf_img_sized('skins/icon_down.gif', '', '', '12') . ' ' : ''; $activity = $this->userdata['Cash'] < '-' . $this->userdata['Credit'] ? wf_img_sized('skins/icon_inactive.gif', '', '', '12') . ' ' . __('No') : wf_img_sized('skins/icon_active.gif', '', '', '12') . ' ' . __('Yes'); // user linking controller $profile .= $this->getUserLinking(); $profile .= wf_tag('table', false, '', self::MAIN_TABLE_STYLE); //external profile container $profile .= wf_tag('tbody', false); $profile .= wf_tag('tr', false); $profile .= wf_tag('td', false, '', 'valign="top"'); $profile .= wf_tag('table', false, '', self::MAIN_TABLE_STYLE); //main profile data $profile .= wf_tag('tbody', false); //address row and controls $profile .= $this->addRow(__('Full address') . $this->getTaskCreateControl(), $this->useraddress . $this->getBuildControls()); //apt data like floor and entrance row $profile .= $this->addRow(__('Entrance') . ', ' . __('Floor'), @$this->aptdata['entrance'] . ' ' . @$this->aptdata['floor']); //realname row $profile .= $this->addRow(__('Real name') . $this->getPhotostorageControls() . $this->getPassportDataControl(), $this->realname, true); //contract row $profile .= $this->addRow(__('Contract'), $this->contract, false); //contract date row $profile .= $this->getContractDate(); //assigned agents row $profile .= $this->getAgentsControls(); //old corporate users aka userlinking $profile .= $this->getCorporateControls(); //phone $profile .= $this->addRow(__('Phone'), $this->phone); //and mobile data rows $profile .= $this->addRow(__('Mobile'), $this->mobile); //Email data row $profile .= $this->addRow(__('Email'), $this->mail); //payment ID data $profile .= $this->addRow(__('Payment ID'), $this->paymentid, true); //LAT data row $profile .= $this->getUserLat(); //login row $profile .= $this->addRow(__('Login'), $this->userdata['login'], true); //password row $profile .= $this->addRow(__('Password'), $this->getUserPassword(), true); //User IP data and extended networks controls if available $profile .= $this->addRow(__('IP'), $this->userdata['IP'] . $this->getExtNetsControls(), true); //MAC address row $profile .= $this->addRow(__('MAC') . ' ' . $this->getSearchmacControl() . ' ' . $this->getProfileFdbSearchControl(), $this->mac); //User tariff row $profile .= $this->addRow(__('Tariff') . $this->getTariffInfoControls($this->userdata['Tariff']), $this->userdata['Tariff'] . $this->getTariffInfoContrainer(), true); //Tariff change row $profile .= $this->addRow(__('Planned tariff change') . $this->getTariffInfoControls($this->userdata['TariffChange']), $this->userdata['TariffChange']); //old CaTv backlink if needed $profile .= $this->getCatvBacklinks(); //Speed override row $profile .= $this->addRow(__('Speed override'), $this->speedoverride); // signup pricing row $profile .= $this->getSignupPricing(); //User current cash row $profile .= $this->addRow(__('Balance'), $this->getUserCash(), true); //User credit row & easycredit control if needed $profile .= $this->addRow(__('Credit') . ' ' . $this->getEasyCreditController(), $this->userdata['Credit'], true); //credit expire row $profile .= $this->addRow(__('Credit expire'), $this->getUserCreditExpire()); //Prepayed traffic $profile .= $this->addRow(__('Prepayed traffic'), $this->userdata['FreeMb']); //finance activity row $profile .= $this->addRow(__('Active') . $this->getCemeteryControls(), $activity); //DN online detection row $profile .= $this->getUserOnlineDN(); //Always online flag row $profile .= $this->addRow(__('Always Online'), web_trigger($this->userdata['AlwaysOnline'])); //Detail stats flag row $profile .= $this->addRow(__('Disable detailed stats'), web_trigger($this->userdata['DisabledDetailStat'])); //Frozen aka passive flag row $profile .= $this->addRow(__('Freezed'), $passiveicon . web_trigger($this->userdata['Passive']), true); //Disable aka Down flag row $profile .= $this->addRow(__('Disabled'), $downicon . web_trigger($this->userdata['Down']), true); //Connection details row $profile .= $this->getUserConnectionDetails(); //User notes row $profile .= $this->addRow(__('Notes'), zb_UserGetNotes($this->login) . $this->getAdcommentsIndicator()); $profile .= wf_tag('tbody', true); $profile .= wf_tag('table', true); $profile .= wf_tag('td', true); //end of main profile container $profile .= wf_tag('td', false, '', 'valign="top" width="10%"'); //profile plugins container $profile .= $this->plugins; $profile .= wf_tag('td', true); // end of plugins container $profile .= wf_tag('tr', true); // close profile+plugins row $profile .= wf_tag('tbody', true); $profile .= wf_tag('table', true); //end of all profile container //profile switch port controls $profile .= $this->getSwitchAssignControls(); //profile onu signal controls $profile .= $this->getPonSignalControl(); //profile vlan controls $profile .= $this->getVlanAssignControls(); //profile vlan online $profile .= $this->getVlanOnline(); //Custom filelds display $profile .= cf_FieldShower($this->login); //Tags add control and exiting tags listing if (cfr('TAGS')) { $profile .= wf_Link('?module=usertags&username='******'Tags')), false); } $profile .= stg_show_user_tags($this->login); //main profile controls here $profile .= $this->getMainControls(); //Profile ending anchor for addcash links scroll $profile .= wf_tag('a', false, '', 'id="profileending"') . wf_tag('a', true); return $profile; }
/** * Renders transaction list container * * @return void */ public function renderTransactionList() { $columns = array('ID', 'Date', 'Cash', 'Payment ID', 'Real Name', 'Full address', 'Payment system', 'Processed'); $graphsUrl = wf_Link(self::URL_CHARTS, wf_img('skins/icon_stats.gif', __('Graphs')), false, ''); show_window(__('OpenPayz transactions') . ' ' . $graphsUrl, wf_JqDtLoader($columns, self::URL_AJAX_SOURCE, true, 'payments', 100)); }
simple_update_field('switches', 'snmp', $_POST['editsnmp'], "WHERE `id`='" . $switchid . "'"); simple_update_field('switches', 'geo', $_POST['editgeo'], "WHERE `id`='" . $switchid . "'"); if ($_POST['editparentid'] != $switchid) { simple_update_field('switches', 'parentid', $_POST['editparentid'], "WHERE `id`='" . $switchid . "'"); } log_register('SWITCH CHANGE [' . $switchid . ']' . ' IP ' . $_POST['editip'] . " LOC `" . $_POST['editlocation'] . "`"); rcms_redirect("?module=switches&edit=" . $switchid); } else { show_error(__('Access denied')); } } //render switch edit form show_window(__('Edit switch'), web_SwitchEditForm($switchid)); //minimap container if ($altCfg['SWYMAP_ENABLED']) { if (!empty($switchdata['geo'])) { show_window(__('Mini-map'), wf_delimiter() . web_SwitchMiniMap($switchdata)); } } //downlinks list web_SwitchDownlinksList($switchid); //additional comments engine if ($altCfg['ADCOMMENTS_ENABLED']) { $adcomments = new ADcomments('SWITCHES'); show_window(__('Additional comments'), $adcomments->renderComments($switchid)); } show_window('', wf_Link('?module=switches', 'Back', true, 'ubButton')); } } else { show_error(__('Access denied')); }
$nasbwdurl = mysql_real_escape_string($_POST['editnasbwdurl']); $netid = vf($_POST['networkselect']); simple_update_field('nas', 'nastype', $nastype, $targetnas); simple_update_field('nas', 'nasip', $nasip, $targetnas); simple_update_field('nas', 'nasname', $nasname, $targetnas); simple_update_field('nas', 'bandw', $nasbwdurl, $targetnas); simple_update_field('nas', 'netid', $netid, $targetnas); zb_NasConfigSave(); log_register("NAS EDIT " . $nasip); rcms_redirect("?module=nas&edit=" . $nasid); } $nasdata = zb_NasGetData($nasid); $currentnetid = $nasdata['netid']; $currentnasip = $nasdata['nasip']; $currentnasname = $nasdata['nasname']; $currentnastype = $nasdata['nastype']; $currentbwdurl = $nasdata['bandw']; $nastypes = array('local' => 'Local NAS', 'rscriptd' => 'rscriptd', 'mikrotik' => 'MikroTik', 'radius' => 'Radius'); $editinputs = multinet_network_selector($currentnetid) . "<br>"; $editinputs .= wf_Selector('editnastype', $nastypes, 'NAS type', $currentnastype, true); $editinputs .= wf_TextInput('editnasip', 'IP', $currentnasip, true, '15'); $editinputs .= wf_TextInput('editnasname', 'NAS name', $currentnasname, true, '15'); $editinputs .= wf_TextInput('editnasbwdurl', 'Bandwidthd URL', $currentbwdurl, true, '25'); $editinputs .= wf_Submit('Save'); $editform = wf_Form('', 'POST', $editinputs, 'glamour'); show_window(__('Edit') . ' NAS', $editform); show_window('', wf_Link("?module=nas", 'Back', true, 'ubButton')); } } else { show_error(__('You cant control this module')); }
/** * Returns existing city editing form * * @param int $cityid * @return string */ function web_CityEditForm($cityid) { $citydata = zb_AddressGetCityData($cityid); $cityname = $citydata['cityname']; $cityalias = $citydata['cityalias']; $sup = wf_tag('sup') . '*' . wf_tag('sup', true); $inputs = wf_TextInput('editcityname', __('City name') . $sup, $cityname, true); $inputs .= wf_TextInput('editcityalias', __('City alias'), $cityalias, true); $inputs .= wf_Submit(__('Save')); $form = wf_Form('', 'POST', $inputs, 'glamour'); $form .= wf_Link('?module=city', 'Back', true, 'ubButton'); return $form; }
/** * renders streets report * * @return void */ public function reportStreets() { $ukvCities = array(); $ukvStreets = array(); //loads cities and streets occupied by UKV users $ukvCities_q = "SELECT DISTINCT `city` from `ukv_users` ORDER BY `city` ASC"; $ukvCitiesRaw = simple_queryall($ukvCities_q); if (!empty($ukvCitiesRaw)) { foreach ($ukvCitiesRaw as $ieuc => $euc) { $ukvCities[$euc['city']] = $euc['city']; } } $ukvStreets_q = "SELECT DISTINCT `street` from `ukv_users` ORDER BY `street` ASC"; $ukvStreetsRaw = simple_queryall($ukvStreets_q); if (!empty($ukvStreetsRaw)) { foreach ($ukvStreetsRaw as $ieus => $eus) { $ukvStreets[$eus['street']] = $eus['street']; } } //main codepart $citySelected = wf_CheckPost(array('streetreportcity')) ? $_POST['streetreportcity'] : ''; $streetSelected = wf_CheckPost(array('streetreportstreet')) ? $_POST['streetreportstreet'] : ''; $inputs = wf_Selector('streetreportcity', $ukvCities, __('City'), $citySelected, false); $inputs .= wf_Selector('streetreportstreet', $ukvStreets, __('Street'), $streetSelected, false); $inputs .= wf_Submit(__('Show')); $form = wf_Form('', 'POST', $inputs, 'glamour'); show_window(__('Streets report'), $form); if (wf_CheckPost(array('streetreportcity', 'streetreportstreet')) or wf_CheckGet(array('rc', 'rs'))) { //set form data if (wf_CheckPost(array('streetreportcity', 'streetreportstreet'))) { $citySearch = $_POST['streetreportcity']; $streetSearch = $_POST['streetreportstreet']; } //or printable report if (wf_CheckGet(array('rc', 'rs'))) { $citySearch = $_GET['rc']; $streetSearch = $_GET['rs']; } if (!empty($this->users)) { $counter = 0; $cells = wf_TableCell(__('Contract'), '10%'); $cells .= wf_TableCell(__('Full address'), '31%'); $cells .= wf_TableCell(__('Real Name'), '30%'); $cells .= wf_TableCell(__('Tariff'), '15%'); $cells .= wf_TableCell(__('Cash'), '7%'); $cells .= wf_TableCell(__('Status'), '7%'); $rows = wf_TableRow($cells, 'row1'); foreach ($this->users as $io => $eachUser) { if ($eachUser['city'] == $citySearch and $eachUser['street'] == $streetSearch) { $cells = wf_TableCell($eachUser['contract']); $fullAddress = $this->userGetFullAddress($eachUser['id']); $profileLink = wf_Link(self::URL_USERS_PROFILE . $eachUser['id'], web_profile_icon() . ' ', false, ''); $cells .= wf_TableCell($profileLink . $fullAddress); $cells .= wf_TableCell($eachUser['realname']); $cells .= wf_TableCell($this->tariffs[$eachUser['tariffid']]['tariffname']); $cells .= wf_TableCell($eachUser['cash']); $cells .= wf_TableCell(web_bool_led($eachUser['active'], true)); $rows .= wf_TableRow($cells, 'row3'); $counter++; } } $result = wf_TableBody($rows, '100%', '0', 'sortable'); $result .= __('Total') . ': ' . $counter; if (wf_CheckGet(array('printable'))) { $this->reportPrintable($citySearch . ' / ' . $streetSearch, $result); } else { $printlink = wf_Link(self::URL_REPORTS_MGMT . 'reportStreets&rc=' . $citySearch . '&rs=' . $streetSearch . '&printable=true', wf_img('skins/icon_print.png', __('Print')), false, ''); show_window($citySearch . ' / ' . $streetSearch . ' ' . $printlink, $result); } } else { show_window(__('Result'), __('Any users found')); } } }
/** * Renders previously generated all users documents * * @return string */ public function renderAllUserDocuments() { $allAddress = zb_AddressGetFulladdresslistCached(); $allRealnames = zb_UserGetAllRealnames(); $cells = wf_TableCell(__('ID')); $cells .= wf_TableCell(__('Date')); $cells .= wf_TableCell(__('Public')); $cells .= wf_TableCell(__('Template')); $cells .= wf_TableCell(__('Path')); $cells .= wf_TableCell(__('Login')); $cells .= wf_TableCell(__('Address')); $cells .= wf_TableCell(__('Real Name')); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); if (!empty($this->allUserDocuments)) { foreach ($this->allUserDocuments as $io => $each) { $cells = wf_TableCell($each['id']); $cells .= wf_TableCell($each['date']); $cells .= wf_TableCell(web_bool_led($each['public'])); @($templateName = $this->templates[$each['templateid']]['name']); $cells .= wf_TableCell(wf_tag('abbr', false, '', 'title="' . $each['templateid'] . '"') . $templateName . wf_tag('abbr', true)); $downloadLink = wf_Link('?module=report_documents&documentdownload=' . $each['path'], $each['path'], false, ''); $cells .= wf_TableCell($downloadLink); $profileLink = wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $each['login']); $cells .= wf_TableCell($profileLink); $cells .= wf_TableCell(@$allAddress[$each['login']]); $cells .= wf_TableCell(@$allRealnames[$each['login']]); $actionLinks = wf_JSAlert('?module=report_documents&deletedocument=' . $each['id'], web_delete_icon(), __('Are you serious')); $cells .= wf_TableCell($actionLinks); $rows .= wf_TableRow($cells, 'row3'); } } $result = wf_TableBody($rows, '100%', '0', ''); return $result; }
} } $tsCf = $salary->timesheetCreateForm(); if ($tsCf) { $timesheetsControls = wf_modal(web_add_icon() . ' ' . __('Create'), __('Create') . ' ' . __('Timesheet'), $tsCf, 'ubButton', '800', '600'); show_window('', $timesheetsControls); if (!wf_CheckGet(array('showdate'))) { //render available timesheets list by date show_window(__('Timesheets'), $salary->timesheetsListRender('?module=salary_timesheets')); } else { //saving changes for single timesheet row if (wf_CheckPost(array('edittimesheetid'))) { $salary->timesheetSaveChanges(); rcms_redirect('?module=salary_timesheets&showdate=' . $_GET['showdate']); } //render timesheet by date (edit form) show_window(__('Timesheet') . ' ' . $_GET['showdate'], $salary->timesheetEditForm($_GET['showdate'])); show_window('', wf_Link('?module=salary_timesheets', __('Back'), false, 'ubButton')); } } else { show_warning(__('No available workers for timesheets')); } } else { show_error(__('No license key available')); } } else { show_error(__('This module is disabled')); } } else { show_error(__('Permission denied')); }
if ($altcfg['DOCX_SUPPORT']) { $documents = new ProfileDocuments(); $date = wf_CheckPost(array('showdate')) ? $_POST['showdate'] : ''; $documents->loadAllUsersDocuments($date); //existing document downloading if (wf_CheckGet(array('documentdownload'))) { zb_DownloadFile($documents::DOCUMENTS_PATH . $_GET['documentdownload'], 'docx'); } //document deletion from database if (wf_CheckGet(array('deletedocument'))) { $documents->unregisterDocument($_GET['deletedocument']); rcms_redirect('?module=report_documents'); } //controls $actionLinks = wf_Link('?module=report_documents', __('Grid view') . ' ' . wf_img('skins/icon_table.png'), false, 'ubButton'); $actionLinks .= wf_Link('?module=report_documents&calendarview=true', __('As calendar') . ' ' . wf_img('skins/icon_calendar.gif'), false, 'ubButton'); show_window('', $actionLinks); if (!wf_CheckGet(array('calendarview'))) { //show calendar control show_window(__('By date'), $documents->dateControl()); //list available documents show_window(__('Previously generated documents'), $documents->renderAllUserDocuments()); } else { //or calendar view show_window(__('Previously generated documents'), $documents->renderAllUserDocumentsCalendar()); } } else { show_error(__('This module is disabled')); } } else { show_error(__('You cant control this module'));
/** * Returns JSON reply for jquery datatables with full list of available connection details * * @return void */ public function ajaxGetDataUkv() { $ukv = new UkvSystem(); $query = "SELECT * from `ukv_users` WHERE `cableseal` != '' ;"; $all = simple_queryall($query); $result = '{ "aaData": [ '; if (!empty($all)) { foreach ($all as $io => $each) { $profileLink = wf_Link('?module=ukv&users=true&showuser='******'id'], web_profile_icon() . ' ', false); $profileLink = str_replace('"', '', $profileLink); $profileLink = str_replace("'", '', $profileLink); $profileLink = trim($profileLink); $userAddress = @$ukv->userGetFullAddress($each['id']); $userAddress = str_replace("'", '`', $userAddress); $userAddress = str_replace('"', '``', $userAddress); $userAddress = trim($userAddress); $userRealname = $each['realname']; $userRealname = str_replace("'", '`', $userRealname); $userRealname = str_replace('"', '``', $userRealname); $userRealname = trim($userRealname); $act = wf_img('skins/icon_active.gif') . __('Yes'); //finance check if (!$each['active']) { $act = wf_img('skins/icon_inactive.gif') . __('No'); } $act = str_replace('"', '', $act); $act = trim($act); $result .= ' [ "' . $profileLink . $userAddress . '", "' . $userRealname . '", "' . $ukv->tariffGetName($each['tariffid']) . '", "' . $act . '", "' . $each['cash'] . '", "' . $each['cableseal'] . '" ],'; } } $result = substr($result, 0, -1); $result .= '] }'; die($result); }
} if (!isset($_GET['edit'])) { $megaForm = wf_AjaxLoader(); $megaForm .= wf_AjaxLink(SwitchLogin::MODULE_URL . '&ajax=snmp', 'SNMP', 'megaContainer1', false, 'ubButton'); $megaForm .= wf_AjaxLink(SwitchLogin::MODULE_URL . '&ajax=connect', 'Connect', 'megaContainer1', false, 'ubButton'); $megaForm .= wf_tag('div', false, '', 'id="megaContainer1"') . wf_tag('div', true); show_window(__("Switches login data"), $megaForm); $swLogin->ShowSwAllLogin(); } else { $megaEditForm = wf_AjaxLoader(); $megaEditForm .= wf_AjaxLink(SwitchLogin::MODULE_URL . '&edit=' . $_GET['edit'] . '&ajax=snmp_edit', 'SNMP', 'megaContainer1', false, 'ubButton'); $megaEditForm .= wf_AjaxLink(SwitchLogin::MODULE_URL . '&edit=' . $_GET['edit'] . '&ajax=connect_edit', 'Connect', 'megaContainer1', false, 'ubButton'); $megaEditForm .= wf_tag('div', false, '', 'id="megaContainer1"') . wf_tag('div', true); show_warning(__("Are you sure that you want to change switch login data") . "?"); show_window(__("Switches login data"), $megaEditForm); $back = wf_Link(SwitchLogin::MODULE_URL, __('Back'), false, 'ubButton'); show_window('', $back); } if (isset($_POST['add'])) { $params = array('swmodel', 'SwMethod'); if (wf_CheckPost($params)) { $model = $_POST['swmodel']; $snmpTemplate = $_POST['snmptemplate']; $login = $_POST['SwLogin']; $pass = $_POST['SwPass']; $method = $_POST['SwMethod']; $community = $_POST['RwCommunity']; $enable = $_POST['Enable']; $swLogin->SwLoginAdd($model, $login, $pass, $method, $community, $enable, $snmpTemplate); rcms_redirect(SwitchLogin::MODULE_URL); }
zb_AddressCreateCity($newcityname, $newcityalias); rcms_redirect('?module=city'); } else { show_error(__('Empty city name')); } } if (isset($_GET['action'])) { if (isset($_GET['cityid'])) { $cityid = $_GET['cityid']; if ($_GET['action'] == 'delete') { if (!zb_AddressCityProtected($cityid)) { zb_AddressDeleteCity($cityid); rcms_redirect('?module=city'); } else { show_window(__('Error'), __('You can not just remove a city where there are streets and possibly survivors')); show_window('', wf_Link('?module=city', __('Back'), true, 'ubButton')); } } if ($_GET['action'] == 'edit') { if (isset($_POST['editcityname'])) { if (!empty($_POST['editcityname'])) { zb_AddressChangeCityName($cityid, $_POST['editcityname']); } zb_AddressChangeCityAlias($cityid, $_POST['editcityalias']); rcms_redirect('?module=city'); } show_window(__('Edit City'), web_CityEditForm($cityid)); } } } // create form
if (wf_CheckGet(array('printremainsstorage'))) { $warehouse->reportStorageRemainsPrintable($_GET['printremainsstorage']); } } //reports if (wf_CheckGet(array('reports'))) { if (wf_CheckGet(array('ajaxtremains'))) { $warehouse->{$avidity}['A']['SEENOEVIL'](); } if (wf_CheckGet(array('calendarops'))) { show_window(__('Operations in the context of time'), $warehouse->reportCalendarOps()); $warehouse->{$avidity}['M']['FALL']($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&' . 'totalremains=true'); } if (wf_CheckGet(array('totalremains'))) { $calendarLink = wf_Link($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&calendarops=true', wf_img('skins/icon_calendar.gif', __('Operations in the context of time')), false, ''); $dateRemainsLink = wf_Link($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&dateremains=true', wf_img('skins/ukv/report.png', __('Date remains'))); show_window(__('The remains in all storages') . ' ' . $calendarLink . ' ' . $dateRemainsLink, $warehouse->reportAllStoragesRemains()); $warehouse->{$avidity}['M']['FALL'](); } if (wf_CheckGet(array('dateremains'))) { show_window(__('Date remains'), $warehouse->reportDateRemains()); $warehouse->{$avidity}['M']['FALL'](); } } $warehouse->{$avidity}['M']['FRONT'](); } else { show_error(__('No license key available')); } } else { show_error(__('This module is disabled')); }
/** * Returns list of expired undone tasks * * @return string */ function ts_ShowLate() { $allemployee = ts_GetAllEmployee(); $alljobtypes = ts_GetAllJobtypes(); $curyear = curyear(); $curmonth = date("m"); $curdate = curdate(); if ($curmonth != 1 and $curmonth != 12) { $query = "SELECT * from `taskman` WHERE `status`='0' AND `startdate` LIKE '" . $curyear . "-%' AND `startdate`< '" . $curdate . "' ORDER BY `startdate` ASC"; } else { $query = "SELECT * from `taskman` WHERE `status`='0' AND `startdate`< '" . $curdate . "' ORDER BY `startdate` ASC"; } $cells = wf_TableCell(__('Target date')); $cells .= wf_TableCell(__('Task address')); $cells .= wf_TableCell(__('Phone')); $cells .= wf_TableCell(__('Job type')); $cells .= wf_TableCell(__('Who should do')); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); $all = simple_queryall($query); if (!empty($all)) { foreach ($all as $io => $each) { $cells = wf_TableCell($each['startdate']); $cells .= wf_TableCell($each['address']); $cells .= wf_TableCell($each['phone']); $cells .= wf_TableCell(@$alljobtypes[$each['jobtype']]); $cells .= wf_TableCell(@$allemployee[$each['employee']]); $actions = wf_Link('?module=taskman&edittask=' . $each['id'], web_edit_icon(), false, ''); $cells .= wf_TableCell($actions); $rows .= wf_TableRow($cells, 'row3'); } } $result = wf_TableBody($rows, '100%', '0', 'sortable'); return $result; }
/** * Show data for some device * * @param $ip device ip * @param $community snmp community * @param $alltemplates all of snmp templates * @param $quiet no output * * @return void */ function sp_SnmpPollDevice($ip, $community, $alltemplates, $deviceTemplate, $allusermacs, $alladdress, $quiet = false) { global $ubillingConfig; if (isset($alltemplates[$deviceTemplate])) { $currentTemplate = $alltemplates[$deviceTemplate]; if (!empty($currentTemplate)) { $deviceDescription = $currentTemplate['define']['DEVICE']; $deviceFdb = $currentTemplate['define']['FDB']; $sectionResult = ''; $sectionName = ''; $finalResult = ''; $tempArray = array(); $alterCfg = $ubillingConfig->getAlter(); $snmp = new SNMPHelper(); //selecting FDB processing mode if (isset($currentTemplate['define']['FDB_MODE'])) { $deviceFdbMode = $currentTemplate['define']['FDB_MODE']; } else { $deviceFdbMode = 'default'; } //selecting FDB ignored port for skipping MAC-s on it if (isset($currentTemplate['define']['FDB_IGNORE_PORTS'])) { $deviceFdbIgnore = $currentTemplate['define']['FDB_IGNORE_PORTS']; $deviceFdbIgnore = explode(',', $deviceFdbIgnore); $deviceFdbIgnore = array_flip($deviceFdbIgnore); } else { $deviceFdbIgnore = array(); } //parse each section of template foreach ($alltemplates[$deviceTemplate] as $section => $eachpoll) { if ($section != 'define') { if (!$quiet) { $finalResult .= wf_tag('div', false, 'dashboard', ''); } $sectionName = $eachpoll['NAME']; $sectionOids = explode(',', $eachpoll['OIDS']); $sectionParser = $eachpoll['PARSER']; $sectionResult = ''; //now parse each oid foreach ($sectionOids as $eachOid) { $eachOid = trim($eachOid); $rawData = $snmp->walk($ip, $community, $eachOid, true); $rawData = str_replace('"', '`', $rawData); $parseCode = '$sectionResult.=' . $sectionParser . '("' . $rawData . '");'; eval($parseCode); } if (!$quiet) { $finalResult .= wf_tag('div', false, 'dashtask', '') . wf_tag('strong') . __($sectionName) . wf_tag('strong', true) . '<br>'; $finalResult .= $sectionResult . wf_tag('div', true); } } } $finalResult .= wf_tag('div', true); $finalResult .= wf_tag('div', false, '', 'style="clear:both;"'); $finalResult .= wf_tag('div', true); if (!$quiet) { show_window('', $finalResult); } // //parsing data from FDB table // if ($deviceFdb == 'true') { $portData = array(); $snmp->setBackground(false); // need to process data with system + background if ($deviceFdbMode == 'default') { //default zyxel & cisco port table $portTable = $snmp->walk($ip, $community, '.1.3.6.1.2.1.17.4.3.1.2', true); } else { if ($deviceFdbMode == 'dlp') { //custom dlink port table with VLANS $portTable = $snmp->walk($ip, $community, '.1.3.6.1.2.1.17.7.1.2.2.1.2', true); } } if (!empty($portTable)) { if ($deviceFdbMode == 'default') { //default FDB parser $portData = sp_SnmpParseFDB($portTable); } else { if ($deviceFdbMode == 'dlp') { //exotic dlink parser $portData = sp_SnmpParseFdbDl($portTable); } } //skipping some port data if FDB_IGNORE_PORTS option is set if (!empty($deviceFdbIgnore)) { if (!empty($portData)) { foreach ($portData as $some_mac => $some_port) { if (!isset($deviceFdbIgnore[$some_port])) { $tempArray[$some_mac] = $some_port; } } $portData = $tempArray; } } $fdbCache = serialize($portData); file_put_contents('exports/' . $ip . '_fdb', $fdbCache); } //show port data User friendly :) if (!empty($portData)) { //extracting all needed data for switchport control if ($alterCfg['SWITCHPORT_IN_PROFILE']) { $allswitchesArray = zb_SwitchesGetAll(); $allportassigndata = array(); $allportassigndata_q = "SELECT * from `switchportassign`;"; $allportassigndata_raw = simple_queryall($allportassigndata_q); if (!empty($allportassigndata_raw)) { foreach ($allportassigndata_raw as $iopd => $eachpad) { $allportassigndata[$eachpad['login']] = $eachpad; } } } $allusermacs = array_flip($allusermacs); $cells = wf_TableCell(__('User'), '30%'); $cells .= wf_TableCell(__('MAC')); $cells .= wf_TableCell(__('Ports')); $rows = wf_TableRow($cells, 'row1'); foreach ($portData as $eachMac => $eachPort) { //user detection if (isset($allusermacs[$eachMac])) { $userLogin = $allusermacs[$eachMac]; @($useraddress = $alladdress[$userLogin]); $userlink = wf_Link('?module=userprofile&username='******' ' . $useraddress, false); //switch port assing form if ($alterCfg['SWITCHPORT_IN_PROFILE']) { $assignForm = wf_modal(web_edit_icon(__('Switch port assign')), __('Switch port assign'), web_SnmpSwitchControlForm($userLogin, $allswitchesArray, $allportassigndata, @$_GET['switchid'], $eachPort), '', '500', '250'); if (isset($allportassigndata[$userLogin])) { $assignForm .= wf_img('skins/arrow_right_green.png') . @$allportassigndata[$userLogin]['port']; } } else { $assignForm = ''; } } else { $userlink = ''; $assignForm = ''; } $cells = wf_TableCell($userlink . $assignForm, '', '', 'sorttable_customkey="' . $eachPort . '"'); $cells .= wf_TableCell($eachMac); $cells .= wf_TableCell($eachPort); $rows .= wf_TableRow($cells, 'row3'); } if (!$quiet) { show_window(__('FDB'), wf_TableBody($rows, '100%', '0', 'sortable')); } } } } } }
/** * 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); }
/** * Renders available reports list * * @return string */ function web_ReportMasterShowReportsList() { $messages = new UbillingMessageHelper(); $reports_path = DATA_PATH . "reports/"; $allreports = rcms_scandir($reports_path); $cells = wf_TableCell(__('Report name')); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); if (!empty($allreports)) { foreach ($allreports as $eachreport) { $report_template = rcms_parse_ini_file($reports_path . $eachreport); $cells = wf_TableCell(wf_Link('?module=reportmaster&view=' . $eachreport, __($report_template['REPORT_NAME']))); $actControls = wf_JSAlert('?module=reportmaster&delete=' . $eachreport, web_delete_icon(), $messages->getDeleteAlert()); $actControls .= wf_JSAlert('?module=reportmaster&edit=' . $eachreport, web_edit_icon(), $messages->getEditAlert()); $cells .= wf_TableCell($actControls); $rows .= wf_TableRow($cells, 'row3'); } } $result = wf_TableBody($rows, '100%', 0, 'sortable'); return $result; }
function web_AskoziaConfigForm() { global $askoziaUrl, $askoziaLogin, $askoziaPassword, $askoziaCacheTime; $result = wf_Link('?module=askozia', __('Back'), true, 'ubButton') . wf_delimiter(); $inputs = wf_TextInput('newurl', __('AskoziaPBX URL'), $askoziaUrl, true); $inputs .= wf_TextInput('newlogin', __('Administrator login'), $askoziaLogin, true); $inputs .= wf_TextInput('newpassword', __('Password'), $askoziaPassword, true); $inputs .= wf_TextInput('newcachetime', __('Cache time'), $askoziaCacheTime, true); $inputs .= wf_Submit(__('Save')); $result .= wf_Form("", "POST", $inputs, 'glamour'); return $result; }
public function documents_list_show($item, $item_id) { // Get documents list using the elements' id: $query = "SELECT * FROM `" . self::TABLE_DOCS . "` WHERE `" . $item . "_id` = '" . $item_id . "'"; $result = simple_queryall($query); $cells = wf_TableCell(__('ID')); $cells .= wf_TableCell(__('Title')); $cells .= wf_TableCell(__('Date')); $cells .= wf_TableCell(__('Filename')); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row2'); if (!empty($result)) { foreach ($result as $document) { $filename = basename($document['path']); $cells = wf_TableCell($document['id']); $cells .= wf_TableCell($document['title']); $cells .= wf_TableCell($document['date']); $cells .= wf_TableCell($filename); $actions = wf_Link(self::URL_DOC_DOWNLOAD . $document['id'], wf_img('skins/icon_download.png', __('Download'))); $actions .= wf_Link(self::URL_DOC_DELETE . $document['id'], web_delete_icon()); $cells .= wf_TableCell($actions); $rows .= wf_TableRow($cells, 'row3'); } } else { $cells = wf_TableCell(__('There is no documents to show'), null, null, 'colspan="5" align="center"'); $rows .= wf_TableRow($cells, 'row3'); } return wf_TableBody($rows, '100%', '0'); }
/** * Returns CF type edit form * * @param int $typeid Existing CF type ID * * @return void */ function cf_TypeEditForm($typeid) { $typeid = vf($typeid, 3); $typedata = cf_TypeGetData($typeid); $current_type = $typedata['type']; $current_name = $typedata['name']; $availtypes = array('VARCHAR' => 'VARCHAR', 'TRIGGER' => 'TRIGGER', 'TEXT' => 'TEXT'); $editinputs = wf_HiddenInput('editid', $typeid); $editinputs .= wf_Selector('edittype', $availtypes, 'Field type', $current_type, true); $editinputs .= wf_TextInput('editname', 'Field name', $current_name, true); $editinputs .= wf_Submit('Edit'); $editform = wf_Form('', 'POST', $editinputs, 'glamour'); show_window(__('Edit custom field type'), $editform); show_window('', wf_Link('?module=cftypes', 'Back', true, 'ubButton')); }