function show_help($module = '') { global $system; $result = ''; if (empty($module)) { $module = get('module', 'index'); } $lang = curlang(); $help_dir = DATA_PATH . 'help/' . $lang . '/'; if (LOGGED_IN) { if ($system->checkForRight('HELP')) { $admin_link = ' <a href="' . RCMS_ROOT_PATH . '?module=help&edit=' . $module . '"><img title="' . __('Edit') . '" src="' . IMAGES_PATH . 'skins/edit_small.gif"></a> <a href="#" onClick="if(confirm(\'' . __('Delete') . ': \\n' . str_replace('"', '″', $module) . '?\\n\')) document.location.href = \'' . RCMS_ROOT_PATH . '?module=help&delete=' . $module . '\'"> <img title="' . __('Delete') . '" src="' . IMAGES_PATH . 'skins/trash_small.gif"> </a><br/> '; $add_link = '<a href="' . RCMS_ROOT_PATH . '?module=help&edit=' . $module . '"><img src="' . IMAGES_PATH . 'skins/add_help.png" title="' . __('Add') . ' ' . __('Help') . '" alt="' . __('Add') . ' ' . __('Help') . '" /></a> '; } else { $admin_link = ''; $add_link = ''; } $modulename = $help_dir . make_safe_filename($module); if (file_exists($modulename)) { $help_chapter = file_get_contents($modulename); $result = wf_modal(wf_img(IMAGES_PATH . 'skins/help.png', __('Context help')), __('Context help'), $admin_link . $help_chapter, '', '600', '300', 'accesskey="h"'); } else { $result = $add_link; } } return $result; }
function dhcp_show_templates() { $allTemplates = rcms_scandir(CONFIG_PATH . 'dhcp/'); $result = ''; if (!empty($allTemplates)) { foreach ($allTemplates as $each) { $templateData = file_get_contents(CONFIG_PATH . 'dhcp/' . $each); $templateData = nl2br($templateData); $result .= wf_modal($each, $each, $templateData, 'ubButton', 800, 600); } } else { $result = __('Nothing found'); } show_window(__('Global templates'), $result); }
/** * Shows help icon if context chapter available for current language * * @return string */ function web_HelpIconShow() { $lang = curlang(); $result = ''; if (cfr('HELP')) { if (isset($_GET['module'])) { $modulename = vf($_GET['module']); if (file_exists(DATA_PATH . "help/" . $lang . "/" . $modulename)) { $help_chapter = web_HelpChapterGet($modulename); $result = wf_modal(wf_img_sized("skins/help.gif", __('Context help'), 20), __('Context help'), $help_chapter, '', '600', '300'); } } } return $result; }
/** * returns some existing user profile * * @param int $userid existing user`s ID * * @return string */ public function userProfile($userid) { $userid = vf($userid, 3); if (isset($this->users[$userid])) { $userData = $this->users[$userid]; $rows = ''; //zero apt numbers as private builds if ($this->altCfg['ZERO_TOLERANCE']) { $apt = $userData['apt'] == '0' ? '' : '/' . $userData['apt']; } else { $apt = '/' . $userData['apt']; } //photostorage integration if ($this->altCfg['PHOTOSTORAGE_ENABLED']) { $photoControl = wf_Link(self::URL_PHOTOSTORAGE . $userid, wf_img_sized('skins/photostorage.png', __('Upload images'), '10'), false); } else { $photoControl = ''; } //additional user comments if ($this->altCfg['ADCOMMENTS_ENABLED']) { $adcomments = new ADcomments('UKVUSERPROFILE'); } //task creation control if ($this->altCfg['CREATETASK_IN_PROFILE']) { $shortAddress = $userData['street'] . ' ' . $userData['build'] . $apt; $taskForm = ts_TaskCreateFormUnified($shortAddress, $userData['mobile'], $userData['phone'], ''); $taskControl = wf_modal(wf_img('skins/createtask.gif', __('Create task')), __('Create task'), $taskForm, '', '420', '500'); } else { $taskControl = ''; } $cells = wf_TableCell(__('Full address') . ' ' . $taskControl, '20%', 'row2'); $cells .= wf_TableCell($userData['city'] . ' ' . $userData['street'] . ' ' . $userData['build'] . $apt); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Real Name') . ' ' . $photoControl, '20%', 'row2'); $cells .= wf_TableCell($userData['realname']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Phone'), '20%', 'row2'); $cells .= wf_TableCell($userData['phone']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Mobile'), '20%', 'row2'); $cells .= wf_TableCell($userData['mobile']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(wf_tag('b') . __('Contract') . wf_tag('b', true), '20%', 'row2'); $cells .= wf_TableCell(wf_tag('b') . $userData['contract'] . wf_tag('b', true)); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Tariff'), '20%', 'row2'); $cells .= wf_TableCell(@$this->tariffs[$userData['tariffid']]['tariffname']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(wf_tag('b') . __('Cash') . wf_tag('b', true), '20%', 'row2'); $cells .= wf_TableCell(wf_tag('b') . $userData['cash'] . wf_tag('b', true)); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Connected'), '20%', 'row2'); $cells .= wf_TableCell(web_bool_led($userData['active'])); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('User contract date'), '20%', 'row2'); $cells .= wf_TableCell($userData['regdate']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Internet account'), '20%', 'row2'); $inetLink = !empty($userData['inetlogin']) ? wf_Link(self::URL_INET_USER_PROFILE . $userData['inetlogin'], web_profile_icon() . ' ' . $userData['inetlogin'], false, '') : ''; $cells .= wf_TableCell($inetLink); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Cable seal'), '20%', 'row2'); $cells .= wf_TableCell($userData['cableseal']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Notes'), '20%', 'row2'); $cells .= wf_TableCell($userData['notes']); $rows .= wf_TableRow($cells, 'row3'); $profileData = wf_TableBody($rows, '100%', 0, ''); $profilePlugins = ''; if (cfr('UKV')) { $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modal(wf_img('skins/icon_orb_big.gif', __('User lifestory')), __('User lifestory'), $this->userLifeStoryForm($userid), '', '800', '600') . __('Details') . wf_tag('div', true); } if (cfr('UKVCASH')) { $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modal(wf_img('skins/ukv/money.png', __('Cash')), __('Finance operations'), $this->userManualPaymentsForm($userid), '', '600', '250') . __('Cash') . wf_tag('div', true); } if (cfr('UKVREG')) { $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modalAuto(wf_img('skins/ukv/useredit.png', __('Edit user')), __('Edit user'), $this->userEditForm($userid), '') . __('Edit') . wf_tag('div', true); } if (cfr('UKVSEAL')) { $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modalAuto(wf_img('skins/ukv/cableseal.png', __('Cable seal')), __('Cable seal'), $this->userCableSealForm($userid), '') . __('Cable seal') . wf_tag('div', true); } if (cfr('UKVDEL')) { $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modal(wf_img('skins/annihilation.gif', __('Deleting user')), __('Deleting user'), $this->userDeletionForm($userid), '', '800', '300') . __('Delete') . wf_tag('div', true); } //main view construction $profilecells = wf_tag('td', false, '', 'valign="top"') . $profileData . wf_tag('td', true); $profilerows = wf_TableRow($profilecells); $profilecells = wf_tag('td', false, '', 'width="128" valign="top"') . $profilePlugins . wf_tag('td', true); $profilerows .= wf_TableRow($profilecells); $result = wf_TableBody($profilerows, '100%', '0'); $result .= $this->userPaymentsRender($userid); //additional user comments if ($this->altCfg['ADCOMMENTS_ENABLED']) { $result .= wf_tag('h3') . __('Additional comments') . wf_tag('h3', true); $result .= $adcomments->renderComments($userid); } return $result; } else { throw new Exception(self::EX_USER_NOT_EXISTS); } }
if (!empty($newnasip) and !empty($newnasname)) { zb_NasAdd($newnetid, $newnasip, $newnasname, $newnastype, $newbandw); zb_NasConfigSave(); rcms_redirect("?module=nas"); } } // Show available NASes $allnas = zb_NasGetAllData(); // construct needed editor $titles = array('ID', 'Network', 'IP', 'NAS name', 'NAS type', 'Bandwidthd URL'); $keys = array('id', 'netid', 'nasip', 'nasname', 'nastype', 'bandw'); if (!wf_CheckGet(array('edit'))) { $altCfg = $ubillingConfig->getAlter(); if ($altCfg['FREERADIUS_ENABLED']) { $freeRadiusClientsData = web_FreeRadiusListClients(); $radiusControls = wf_modal(web_icon_extended(__('FreeRADIUS NAS parameters')), __('FreeRADIUS NAS parameters'), $freeRadiusClientsData, '', '600', '300'); } else { $radiusControls = ''; } show_window(__('Network Access Servers') . ' ' . $radiusControls, web_GridEditorNas($titles, $keys, $allnas, 'nas')); show_window(__('Add new'), web_NasAddForm()); //vlangen patch start if ($altCfg['VLANGEN_SUPPORT']) { $terminator = new VlanTerminator(); if (isset($_GET['DeleteTerminator'])) { $TermID = $_GET['DeleteTerminator']; $terminator->delete($TermID); rcms_redirect(VlanTerminator::MODULE_URL); } if (!isset($_GET['EditTerminator'])) { if (isset($_POST['AddTerminator'])) {
/** * Returns build lister with controls for some streetID * * @global array $ubillingConfig * @param int $streetid * @return string */ function web_BuildLister($streetid) { global $ubillingConfig; $altcfg = $ubillingConfig->getAlter(); $allbuilds = zb_AddressGetBuildAllDataByStreet($streetid); $cells = wf_TableCell(__('ID')); $cells .= wf_TableCell(__('Building number')); $cells .= wf_TableCell(__('Geo location')); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); if (!empty($allbuilds)) { //build passport data processing if ($altcfg['BUILD_EXTENDED']) { $buildPassport = new BuildPassport(); } foreach ($allbuilds as $io => $eachbuild) { $cells = wf_TableCell($eachbuild['id']); $cells .= wf_TableCell($eachbuild['buildnum']); $cells .= wf_TableCell($eachbuild['geo']); $acts = wf_JSAlert('?module=builds&action=delete&streetid=' . $streetid . '&buildid=' . $eachbuild['id'], web_delete_icon(), 'Removing this may lead to irreparable results'); $acts .= '' . wf_JSAlert('?module=builds&action=editbuild&streetid=' . $streetid . '&buildid=' . $eachbuild['id'], web_edit_icon(), 'Are you serious'); if (!empty($eachbuild['geo'])) { $acts .= ' ' . wf_Link("?module=usersmap&findbuild=" . $eachbuild['geo'], wf_img('skins/icon_search_small.gif', __('Find on map')), false); } if ($altcfg['BUILD_EXTENDED']) { $acts .= ' ' . wf_modal(wf_img('skins/icon_passport.gif', __('Build passport')), __('Build passport'), $buildPassport->renderEditForm($eachbuild['id']), '', '600', '450'); } $cells .= wf_TableCell($acts); $rows .= wf_TableRow($cells, 'row3'); } } $result = wf_TableBody($rows, '100%', 0, 'sortable'); return $result; }
/** * extended network pools controller * * @return string */ protected function getExtNetsControls() { $result = ''; if ($this->alterCfg['NETWORKS_EXT']) { $extNets = new ExtNets(); //pool linking controller if (wf_CheckPost(array('extnetspoollinkid', 'extnetspoollinklogin'))) { $extNets->poolLinkLogin($_POST['extnetspoollinkid'], $_POST['extnetspoollinklogin']); rcms_redirect('?module=userprofile&username='******'extnetspoollinklogin']); } $result = $extNets->poolsExtractByLogin($this->login); $result .= ' ' . wf_modal(wf_img('skins/icon_ip.gif'), __('IP associated with pool'), $extNets->poolLinkingForm($this->login), '', '500', '120'); } return $result; }
//creating of new timesheet if (wf_CheckPost(array('newtimesheet', 'newtimesheetdate', '_employeehours'))) { $tsSheetCreateResult = $salary->timesheetCreate(); if ($tsSheetCreateResult == 0) { //succeful creation rcms_redirect('?module=salary_timesheets'); } else { if ($tsSheetCreateResult == 1) { //date duplicate show_error(__('Timesheets with that date already exist')); } } } $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 {
function zb_AskoziaParseCallHistory($data) { global $altcfg; $normalData = array(); $callersData = array(); $data = explodeRows($data); if (!empty($data)) { foreach ($data as $eachline) { $explode = explode(';', $eachline); //in 2.2.8 delimiter changed from ," to ; if (!empty($eachline)) { $normalData[] = str_replace('"', '', $explode); } } } //custom caller options if (isset($altcfg['ASKOZIA_CUSTOM'])) { if (!empty($altcfg['ASKOZIA_CUSTOM'])) { // 0 - internal peers // 1 - external gateways // 2 - group prefix // 3 - parking $customCfg = explode(',', $altcfg['ASKOZIA_CUSTOM']); } else { $customCfg = array(); } } else { $customCfg = array(); } if (!empty($normalData)) { $totalTime = 0; $callsCounter = 0; $answerCounter = 0; $noAnswerCounter = 0; $chartData = array(); $cells = wf_TableCell('#'); $cells .= wf_TableCell(__('Time')); $cells .= wf_TableCell(__('From')); $cells .= wf_TableCell(__('To')); $cells .= wf_TableCell(__('Picked up')); $cells .= wf_TableCell(__('Type')); $cells .= wf_TableCell(__('Status')); $cells .= wf_TableCell(__('Talk time')); $rows = wf_TableRow($cells, 'row1'); foreach ($normalData as $io => $each) { //fix parsing for askozia 2.2.8 if ($each[0] != 'accountcode') { $callsCounter++; $debugData = wf_tag('pre') . print_r($each, true) . wf_tag('pre', true); $startTime = explode(' ', $each[9]); @($startDate = $startTime[0]); @($startTime = $startTime[1]); @($startHour = date("H:00:00", strtotime($startTime))); $endTime = explode(' ', $each[11]); @($endTime = $endTime[1]); $answerTime = explode(' ', $each[10]); @($answerTime = $answerTime[1]); $tmpStats = __('Taken up the phone') . ': ' . $answerTime . "\n"; $tmpStats .= __('End of call') . ': ' . $endTime; $sessionTimeStats = wf_tag('abbr', false, '', 'title="' . $tmpStats . '"'); $sessionTimeStats .= $startTime; $sessionTimeStats .= wf_tag('abbr', true); $callDirection = ''; //detectiong direction icon if (!empty($customCfg)) { if (isset($customCfg[0]) and $customCfg[1]) { if (zb_AskoziaCheckPrefix($customCfg[0], $each[1])) { $callDirection = wf_img('skins/calls/outgoing.png') . ' '; } if (zb_AskoziaCheckPrefix($customCfg[1], $each[1])) { $callDirection = wf_img('skins/calls/incoming.png') . ' '; } } } $cells = wf_TableCell(wf_modal($callsCounter, $callsCounter, $debugData, '', '500', '600'), '', '', 'sorttable_customkey="' . $callsCounter . '"'); $cells .= wf_TableCell($callDirection . $sessionTimeStats, '', '', 'sorttable_customkey="' . strtotime($each[9]) . '"'); $cells .= wf_TableCell(zb_AskoziaGetNumAlias($each[1])); $cells .= wf_TableCell(zb_AskoziaGetNumAlias($each[2])); $receiveCid = ''; if (!empty($each[6])) { $tmpRcid = explode('-', $each[6]); @($receiveCid = vf($tmpRcid[0], 3)); } $cells .= wf_TableCell(zb_AskoziaGetNumAlias($receiveCid)); $CallType = __('Dial'); if (ispos($each[3], 'internal-caller-transfer')) { $CallType = __('Call transfer'); } if (ispos($each[7], 'VoiceMail')) { $CallType = __('Voice mail'); } $cells .= wf_TableCell($CallType); $callStatus = $each[14]; $statusIcon = ''; if (ispos($each[14], 'ANSWERED')) { $callStatus = __('Answered'); $statusIcon = wf_img('skins/calls/phone_green.png'); $answerCounter++; if (isset($chartData[$startDate . ' ' . $startHour]['answered'])) { $chartData[$startDate . ' ' . $startHour]['answered']++; } else { $chartData[$startDate . ' ' . $startHour]['answered'] = 1; } } if (ispos($each[14], 'NO ANSWER')) { $callStatus = __('No answer'); $statusIcon = wf_img('skins/calls/phone_red.png'); $noAnswerCounter++; if (isset($chartData[$startDate . ' ' . $startHour]['noanswer'])) { $chartData[$startDate . ' ' . $startHour]['noanswer']++; } else { $chartData[$startDate . ' ' . $startHour]['noanswer'] = 1; } } if (ispos($each[14], 'BUSY')) { $callStatus = __('Busy'); $statusIcon = wf_img('skins/calls/phone_yellow.png'); } if (ispos($each[14], 'FAILED')) { $callStatus = __('Failed'); $statusIcon = wf_img('skins/calls/phone_fail.png'); } $cells .= wf_TableCell($statusIcon . ' ' . $callStatus); $speekTimeRaw = $each[13]; $totalTime = $totalTime + $each[13]; $speekTime = zb_AskoziaFormatTime($speekTimeRaw); //current caller stats if (isset($callersData[$each[1]])) { $callersData[$each[1]]['calls'] = $callersData[$each[1]]['calls'] + 1; $callersData[$each[1]]['time'] = $callersData[$each[1]]['time'] + $speekTimeRaw; } else { $callersData[$each[1]]['calls'] = 1; $callersData[$each[1]]['time'] = $speekTimeRaw; } if (isset($callersData[$each[2]])) { $callersData[$each[2]]['calls'] = $callersData[$each[2]]['calls'] + 1; $callersData[$each[2]]['time'] = $callersData[$each[2]]['time'] + $speekTimeRaw; } else { $callersData[$each[2]]['calls'] = 1; $callersData[$each[2]]['time'] = $speekTimeRaw; } if (!empty($receiveCid)) { if (isset($callersData[$receiveCid])) { $callersData[$receiveCid]['calls'] = $callersData[$receiveCid]['calls'] + 1; $callersData[$receiveCid]['time'] = $callersData[$receiveCid]['time'] + $speekTimeRaw; } else { $callersData[$receiveCid]['calls'] = 1; $callersData[$receiveCid]['time'] = $speekTimeRaw; } } $cells .= wf_TableCell($speekTime, '', '', 'sorttable_customkey="' . $each[13] . '"'); $rows .= wf_TableRow($cells, 'row3'); } } if (!empty($callersData)) { if (!empty($customCfg)) { $gcells = wf_TableCell(__('Phone')); $gcells .= wf_TableCell(__('Total calls')); $gcells .= wf_TableCell(__('Time')); $grows = wf_TableRow($gcells, 'row1'); } foreach ($callersData as $cix => $eachcdat) { if (!empty($customCfg)) { if (zb_AskoziaCheckPrefix($customCfg[0], $cix) and strlen($cix) < 4) { $gcells = wf_TableCell(zb_AskoziaGetNumAlias($cix)); $gcells .= wf_TableCell($eachcdat['calls']); $gcells .= wf_TableCell(zb_AskoziaFormatTime($eachcdat['time']), '', '', 'sorttable_customkey="' . $eachcdat['time'] . '"'); $grows .= wf_TableRow($gcells, 'row3'); } } } } //total time stats $result = ''; if (!empty($chartData)) { if (sizeof($chartData) >= 2) { $gdata = __('Date') . ',' . __('Total') . ',' . __('Answered') . ',' . __('No answer') . "\n"; foreach ($chartData as $io => $each) { @($gdata .= $io . ',' . ($each['answered'] + $each['noanswer']) . ',' . $each['answered'] . ',' . $each['noanswer'] . "\n"); } $result .= wf_tag('div', false, '', ''); $result .= wf_tag('h2') . __('Stats') . wf_tag('h2', true) . wf_tag('br'); $result .= wf_Graph($gdata, '800', '200', false); $result .= wf_tag('div', true); $result .= wf_delimiter(); } } $result .= __('Time spent on calls') . ': ' . zb_AskoziaFormatTime($totalTime) . wf_tag('br'); $result .= __('Answered') . ' / ' . __('No answer') . ': ' . $answerCounter . ' / ' . $noAnswerCounter . wf_tag('br'); $result .= __('Total calls') . ': ' . $callsCounter; if (!empty($customCfg)) { @($result .= wf_delimiter() . wf_TableBody($grows, '100%', '0', 'sortable') . wf_delimiter()); } $result .= wf_TableBody($rows, '100%', '0', 'sortable'); show_window('', $result); } }
/** * returns module control panel * * @return string */ protected function panel() { $result = wf_Link('?module=report_finance', __('Back'), false, 'ubButton'); $result .= wf_modal(__('Settings'), __('Settings'), $this->configForm(), 'ubButton', '700', '200'); return $result; }
/** * shows selected signup request by its ID * * @param int $requid Existing signup request ID * * @return void */ public function showRequest($reqid) { $requid = vf($reqid, 3); $reqdata = $this->getData($reqid); if (empty($reqdata['apt'])) { $apt = 0; } else { $apt = $reqdata['apt']; } $shortaddress = $reqdata['street'] . ' ' . $reqdata['build'] . '/' . $apt; $taskCreateControls = wf_modal(wf_img('skins/createtask.gif', __('Create task')), __('Create task'), ts_TaskCreateFormSigreq($shortaddress, $reqdata['phone']), '', '420', '500'); $cells = wf_TableCell(__('Date')); $cells .= wf_TableCell($reqdata['date'] . ' ' . $taskCreateControls); $rows = wf_TableRow($cells, 'row3'); $whoislink = self::URL_WHOIS . $reqdata['ip']; $iplookup = wf_Link($whoislink, $reqdata['ip'], false, ''); $cells = wf_TableCell(__('IP')); $cells .= wf_TableCell($iplookup); $rows .= wf_TableRow($cells, 'row3'); $reqAddress = $reqdata['street'] . ' ' . $reqdata['build'] . '/' . $apt; //Construct capability create form if enabled if ($this->altcfg['CAPABDIR_ENABLED']) { $capabDir = new CapabilitiesDirectory(true); $capabCreateForm = $capabDir->createForm($reqAddress, $reqdata['phone'], $reqdata['service'] . ' ' . $reqdata['notes']); $capabControl = wf_modal(wf_img_sized('skins/icon_cake.png', __('Available connection capabilities'), 10), __('Create connection capability'), $capabCreateForm, '', '400', '300'); } else { $capabControl = ''; } $cells = wf_TableCell(__('Full address')); $cells .= wf_TableCell($reqAddress . ' ' . $capabControl); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Real Name')); $cells .= wf_TableCell($reqdata['realname']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Phone')); $cells .= wf_TableCell($reqdata['phone']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Service')); $cells .= wf_TableCell($reqdata['service']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Processed')); $cells .= wf_TableCell(web_bool_led($reqdata['state'])); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Notes')); $notes = nl2br($reqdata['notes']); $notes = str_replace('Tariff:', __('Tariff') . ':', $notes); $notes = str_replace('Email:', __('Email') . ':', $notes); $cells .= wf_TableCell($notes); $rows .= wf_TableRow($cells, 'row3'); $result = wf_TableBody($rows, '100%', '0', 'glamour'); $actlinks = wf_Link('?module=sigreq', __('Back'), false, 'ubButton'); if ($reqdata['state'] == 0) { $actlinks .= wf_Link('?module=sigreq&reqdone=' . $reqid, wf_img_sized('skins/icon_active.gif', '', '10') . ' ' . __('Close'), false, 'ubButton'); } else { $actlinks .= wf_Link('?module=sigreq&requndone=' . $reqid, wf_img_sized('skins/icon_inactive.gif', '', '10') . ' ' . __('Open'), false, 'ubButton'); } $deletelink = ' ' . wf_JSAlert("?module=sigreq&deletereq=" . $reqid, web_delete_icon(), 'Are you serious'); show_window(__('Signup request') . ': ' . $reqid . $deletelink, $result); show_window('', $actlinks); //additional comments if ($this->altcfg['ADCOMMENTS_ENABLED']) { $adcomments = new ADcomments('SIGREQ'); show_window(__('Additional comments'), $adcomments->renderComments($requid)); } }
function zb_AsteriskParseCDR($data) { global $altcfg; $normalData = $data; if (!empty($normalData)) { $totalTime = 0; $callsCounter = 0; $cells = wf_TableCell('#'); $cells .= wf_TableCell(__('Time')); $cells .= wf_TableCell(__('From')); $cells .= wf_TableCell(__('To')); $cells .= wf_TableCell(__('Type')); $cells .= wf_TableCell(__('Status')); $cells .= wf_TableCell(__('Talk time')); $rows = wf_TableRow($cells, 'row1'); foreach ($normalData as $io => $each) { $callsCounter++; $debugData = wf_tag('pre') . print_r($each, true) . wf_tag('pre', true); $startTime = explode(' ', $each['calldate']); @($startTime = $startTime[1]); $tmpTime = strtotime($each['calldate']); $endTime = $tmpTime + $each['duration']; $endTime = date("H:i:s", $endTime); $answerTime = $tmpTime + ($each['duration'] - $each['billsec']); $answerTime = date("H:i:s", $answerTime); $tmpStats = __('Taken up the phone') . ': ' . $answerTime . "\n"; $tmpStats .= __('End of call') . ': ' . $endTime; $sessionTimeStats = wf_tag('abbr', false, '', 'title="' . $tmpStats . '"'); $sessionTimeStats .= $startTime; $sessionTimeStats .= wf_tag('abbr', true); $callDirection = ''; $cells = wf_TableCell(wf_modal($callsCounter, $callsCounter, $debugData, '', '500', '600'), '', '', 'sorttable_customkey="' . $callsCounter . '"'); $cells .= wf_TableCell($sessionTimeStats, '', '', 'sorttable_customkey="' . $tmpTime . '"'); $cells .= wf_TableCell(zb_AsteriskGetNumAlias($each['src'])); $cells .= wf_TableCell(zb_AsteriskGetNumAlias($each['dst'])); $CallType = __('Dial'); if (ispos($each['lastapp'], 'internal-caller-transfer')) { $CallType = __('Call transfer'); } $cells .= wf_TableCell($CallType); $callStatus = $each['disposition']; $statusIcon = ''; if (ispos($each['disposition'], 'ANSWERED')) { $callStatus = __('Answered'); $statusIcon = wf_img('skins/calls/phone_green.png'); } if (ispos($each['disposition'], 'NO ANSWER')) { $callStatus = __('No answer'); $statusIcon = wf_img('skins/calls/phone_red.png'); } if (ispos($each['disposition'], 'BUSY')) { $callStatus = __('Busy'); $statusIcon = wf_img('skins/calls/phone_yellow.png'); } if (ispos($each['disposition'], 'FAILED')) { $callStatus = __('Failed'); $statusIcon = wf_img('skins/calls/phone_fail.png'); } $cells .= wf_TableCell($statusIcon . ' ' . $callStatus); $speekTime = $each['billsec']; $totalTime = $totalTime + $each['billsec']; $speekTime = zb_AsteriskFormatTime($speekTime); $cells .= wf_TableCell($speekTime, '', '', 'sorttable_customkey="' . $each['billsec'] . '"'); $rows .= wf_TableRow($cells, 'row3'); } $result = wf_TableBody($rows, '100%', '0', 'sortable'); $result .= __('Time spent on calls') . ': ' . zb_AsteriskFormatTime($totalTime) . wf_tag('br'); $result .= __('Total calls') . ': ' . $callsCounter; show_window('', $result); } }
if (!empty($menu_points)) { foreach ($menu_points as $point => $menus) { $system->setCurrentPoint($point); if (!empty($menus) && isset($skin['menu_point'][$point])) { foreach ($menus as $menu) { if (substr($menu, 0, 4) == 'ucm:' && is_readable(DF_PATH . substr($menu, 4) . '.ucm')) { $file = file(DF_PATH . substr($menu, 4) . '.ucm'); $title = preg_replace("/[\n\r]+/", '', $file[0]); $align = preg_replace("/[\n\r]+/", '', $file[1]); unset($file[0]); unset($file[1]); show_window($title, implode('', $file), $align); } elseif (!empty($system->modules['menu'][$menu])) { $module = $menu; $module_dir = MODULES_PATH . $menu; require MODULES_PATH . $menu . '/index.php'; } else { show_window('', __('Module not found'), 'center'); } } } } } if (XHPROF) { $xhprof_data = xhprof_disable(); $xhprof_runs = new XHProfRuns_Default(); $xhprof_run_id = $xhprof_runs->save_run($xhprof_data, "xhprof_ubilling"); $xhprof_link = wf_modal('XHPROF', 'XHPROF DEBUG DATA', '<iframe src="xhprof/xhprof_html/index.php?run=' . $xhprof_run_id . '&source=xhprof_ubilling" width="100%" height="750"></iframe>', '', '1024', '768'); } // Start output require_once CUR_SKIN_PATH . 'skin.general.php';
/** * Shows watchdog control panel * * @return string */ public function panel() { $createWindow = $this->newTaskForm(); $settingsWindow = $this->settingsForm(); $result = wf_modal(wf_img('skins/add_icon.png') . ' ' . __('Create new task'), __('Create new task'), $createWindow, 'ubButton', '400', '300'); $result .= wf_Link("?module=watchdog", wf_img('skins/icon_search_small.gif') . ' ' . __('Show all tasks'), false, 'ubButton'); $result .= wf_Link("?module=watchdog&manual=true", wf_img('skins/refresh.gif') . ' ' . __('Manual run'), false, 'ubButton'); $result .= wf_Link("?module=watchdog&previousalerts=true", wf_img('skins/time_machine.png') . ' ' . __('Previous alerts'), false, 'ubButton'); $result .= wf_modalAuto(wf_img('skins/settings.png') . ' ' . __('Settings'), __('Settings'), $settingsWindow, 'ubButton'); return $result; }
if (cfr('SWITCHM')) { //creatin new model if (wf_CheckPost(array('newsm'))) { ub_SwitchModelAdd($_POST['newsm'], $_POST['newsmp'], $_POST['newsst']); rcms_redirect("?module=switchmodels"); } //deleting existing model if (isset($_GET['deletesm'])) { if (!empty($_GET['deletesm'])) { ub_SwitchModelDelete($_GET['deletesm']); rcms_redirect("?module=switchmodels"); } } //listing available models if (!isset($_GET['edit'])) { $navlinks = wf_modal(wf_img('skins/add_icon.png') . ' ' . __('Create'), __('Create'), web_SwitchModelAddForm(), 'ubButton', '420', '250'); $navlinks .= wf_Link('?module=switches', wf_img('skins/ymaps/switchdir.png') . ' ' . __('Available switches'), true, 'ubButton'); show_window('', $navlinks); show_window(__('Available switch models'), web_SwitchModelsShow()); } else { //show editing form $editid = vf($_GET['edit'], 3); //if someone post changes if (wf_CheckPost(array('editmodelname'))) { simple_update_field('switchmodels', 'modelname', $_POST['editmodelname'], "WHERE `id`='" . $editid . "' "); if (wf_CheckPost(array('editports'))) { simple_update_field('switchmodels', 'ports', $_POST['editports'], "WHERE `id`='" . $editid . "' "); } simple_update_field('switchmodels', 'snmptemplate', $_POST['editsnmptemplate'], "WHERE `id`='" . $editid . "' "); log_register("SWITCHMODEL CHANGE " . $editid); rcms_redirect("?module=switchmodels");
function web_EasyCreditForm($login, $cash, $credit, $userTariff, $easycreditoption) { /////////////////internal controller if (wf_CheckPost(array('easycreditlogin', 'easycreditlimit', 'easycreditexpire'))) { global $billing; $setCredit = vf($_POST['easycreditlimit']); $setLogin = mysql_real_escape_string($_POST['easycreditlogin']); $setExpire = mysql_real_escape_string($_POST['easycreditexpire']); //set credit $billing->setcredit($setLogin, $setCredit); log_register('CHANGE Credit (' . $setLogin . ') ON ' . $setCredit); //set credit expire date $billing->setcreditexpire($setLogin, $setExpire); log_register('CHANGE CreditExpire (' . $setLogin . ') ON ' . $setExpire); rcms_redirect('?module=userprofile&username='******'-' . $credit) { $creditProposal = $tariffPrice; $creditNote = __('The amount of money in the account at the moment is sufficient to provide the service. It is therefore proposed to set a credit limit on the fee of the tariff.'); } else { $creditProposal = abs($cash); $creditNote = __('At the moment the account have debt. It is proposed to establish credit in its size.'); } //calculate credit expire date $nowTimestamp = time(); $creditSeconds = $easycreditoption * 86400; //days*secs $creditOffset = $nowTimestamp + $creditSeconds; $creditExpireDate = date("Y-m-d", $creditOffset); //construct form $controlIcon = wf_tag('img', false, '', 'src="skins/icon_calendar.gif" height="10"'); $inputs = ''; $inputs .= wf_HiddenInput('easycreditlogin', $login); $inputs .= wf_TextInput('easycreditlimit', '', $creditProposal, false, '5') . __('credit limit') . ' '; $inputs .= __('until'); $inputs .= wf_DatePickerPreset('easycreditexpire', $creditExpireDate); $inputs .= wf_Submit(__('Save')); $form = wf_Form("", 'POST', $inputs, 'glamour'); $form .= $creditNote; $result = wf_modal($controlIcon, __('Change') . ' ' . __('credit limit'), $form, '', '500', '180'); return $result; }
function docsis_ModemProfileShow($modemid) { $modemid = vf($modemid, 3); $data = docsis_ModemGetData($modemid); $netdata = array(); $netdata_q = "SELECT * from `nethosts` where `ip`='" . $data['ip'] . "'"; $netdata = simple_queryall($netdata_q); $netdata = print_r($netdata, true); $netdata = nl2br($netdata); $alluserips = zb_UserGetAllIPs(); $alluserips = array_flip($alluserips); $result = wf_Link("?module=docsis", __('Back'), false, 'ubButton'); $ajaxcontainer = wf_AjaxLoader() . wf_AjaxLink("?module=docsis&ajaxsnmp=" . $modemid, __('Renew modem data'), 'ajaxdata', true, 'ubButton') . wf_tag('div', false, '', 'id="ajaxdata"') . wf_tag('div', true); $result .= wf_modal(__('Modem diagnostics'), __('Modem diagnostics'), $ajaxcontainer, 'ubButton', '500', '400'); $result .= wf_modal(__('Networking data'), __('Networking data'), $netdata, 'ubButton', '500', '400'); $result .= wf_delimiter(); if (!empty($data)) { $cells = wf_TableCell(__('ID')); $cells .= wf_TableCell($data['id'] . ' ' . wf_JSAlert("?module=docsis&deletemodem=" . $modemid, web_delete_icon(), __('Removing this may lead to irreparable results'))); $rows = wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('IP')); $cells .= wf_TableCell($data['ip']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('MAC Lan')); $cells .= wf_TableCell($data['maclan']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Date')); $cells .= wf_TableCell($data['date']); $rows .= wf_TableRow($cells, 'row3'); if (isset($alluserips[$data['userbind']])) { $bindedLogin = $alluserips[$data['userbind']]; $profileLink = ' ' . wf_Link('?module=userprofile&username='******' ' . $bindedLogin, false, ''); } else { $profileLink = ''; } $cells = wf_TableCell(__('Linked user')); $cells .= wf_TableCell($data['userbind'] . $profileLink); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Notes')); $cells .= wf_TableCell($data['note']); $rows .= wf_TableRow($cells, 'row3'); $result .= wf_TableBody($rows, '100%', '0', ''); $inputs = wf_TextInput('edituserbind', __('Linked user'), $data['userbind'], true, '40'); $inputs .= wf_TextInput('editnote', __('Notes'), $data['note'], true, '40'); $inputs .= wf_Submit(__('Save')); $form = wf_Form("", 'POST', $inputs, 'glamour'); $result .= $form; show_window(__('Modem profile'), $result); } else { show_window(__('Error'), __('Strange exeption')); } }
/** * returns module control panel * * @return string */ protected function panel() { $result = wf_Link('?module=report_finance', __('Back'), false, 'ubButton'); $result .= wf_modal(web_icon_settings() . ' ' . __('Settings'), __('Settings'), $this->configForm(), 'ubButton', '700', '200'); $result .= wf_delimiter(); $monthArr = months_array_localized(); $inputs = wf_YearSelectorPreset('yearsel', __('Year'), false, $this->year); $inputs .= wf_Selector('monthsel', $monthArr, __('Month'), $this->month, false); $inputs .= wf_Submit(__('Show')); $result .= wf_Form('', 'POST', $inputs, 'glamour'); $result .= wf_CleanDiv(); return $result; }
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; }
/** * Renders ips associated with some poolid * * @param int $poolid Existing pool ID * * @return string */ public function renderIps($poolid) { $poolid = vf($poolid, 3); $result = ''; if (empty($this->switches)) { $this->loadSwitches(); } if (isset($this->pools[$poolid])) { if (!empty($this->ips)) { $cells = wf_TableCell(__('ID')); $cells .= wf_TableCell(__('IP')); $cells .= wf_TableCell(__('Gateway')); $cells .= wf_TableCell(__('Netmask')); $cells .= wf_TableCell(__('NAS')); $cells .= wf_TableCell(__('Interface')); $cells .= wf_TableCell(__('MAC')); $cells .= wf_TableCell(__('Switch')); $cells .= wf_TableCell(__('Port')); $cells .= wf_TableCell(__('VLAN')); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); foreach ($this->ips as $io => $eachip) { if ($eachip['poolid'] == $poolid) { $cells = wf_TableCell($eachip['id']); $cells .= wf_TableCell($eachip['ip']); $cells .= wf_TableCell($this->pools[$poolid]['gw']); $cells .= wf_TableCell($this->cidrToMask[$this->pools[$poolid]['netmask']]); $cells .= wf_TableCell($eachip['nas']); $cells .= wf_TableCell($eachip['iface']); $cells .= wf_TableCell($eachip['mac']); $cells .= wf_TableCell(@$this->switches[$eachip['switchid']]); $cells .= wf_TableCell($eachip['port']); $cells .= wf_TableCell($this->pools[$poolid]['vlan']); $actionsLink = wf_modal(web_edit_icon(), __('Edit') . ' ' . $eachip['ip'], $this->ipsEditForm($eachip['id']), '', '400', '300'); $cells .= wf_TableCell($actionsLink); $rows .= wf_TableRow($cells, 'row3'); } } $result = wf_TableBody($rows, '100%', '0', 'sortable'); //back links controls if (!empty($this->pools[$poolid]['login'])) { $result .= wf_Link("?module=userprofile&username=" . $this->pools[$poolid]['login'], __('Back to user profile'), false, 'ubButton'); } $result .= wf_Link('?module=extnets&showpoolbynetid=' . $this->pools[$poolid]['netid'], __('Back') . ' ' . $this->pools[$poolid]['pool'] . '/' . $this->pools[$poolid]['netmask'], true, 'ubButton'); } } else { throw new Exception(self::EX_NOEXPOOL); } return $result; }
$jobdata[$eachjob['workerid']][$eachjob['jobid']] = 1; } } } //build graphs for each employee if (!empty($jobdata)) { foreach ($jobdata as $employee => $each) { $employeeName = isset($employees[$employee]) ? $employees[$employee] : __('Deleted'); $result .= wf_tag('h3', false) . $employeeName . wf_tag('h3', true); $rows = ''; if (!empty($each)) { foreach ($each as $jobid => $count) { $cells = wf_TableCell(@$jobtypes[$jobid], '40%'); $cells .= wf_TableCell($count, '20%'); $cells .= wf_TableCell(web_bar($count, sizeof($alljobs)), '40%'); $rows .= wf_TableRow($cells, 'row3'); } } $result .= wf_TableBody($rows, '100%', 0); $result .= wf_delimiter(); } } } return $result; } $jobgraphs = wf_modal(wf_img('skins/icon_stats.gif', __('Graphs')), __('Graphs'), ts_EmployeeMonthGraphs(), '', '800', '600'); $donejobs = ts_JGetJobsReport(); show_window(__('Job report') . ' ' . $jobgraphs, wf_FullCalendar($donejobs)); } else { show_error(__('Access denied')); }
/** * Render TurboSMS server-side queue * * @return string */ public function renderTurboSMSQueue() { $result = ''; $tsms_host = $this->settings['TSMS_GATEWAY']; $tsms_db = 'users'; $tsms_login = $this->settings['TSMS_LOGIN']; $tsms_password = $this->settings['TSMS_PASSWORD']; $tsms_table = $this->settings['TSMS_LOGIN']; $smsArray = array(); $total = 0; $TsmsDB = new DbConnect($tsms_host, $tsms_login, $tsms_password, $tsms_db, $error_reporting = true, $persistent = false); $TsmsDB->open() or die($TsmsDB->error()); $TsmsDB->query('SET NAMES utf8;'); if (wf_CheckPost(array('showdate'))) { $date = mysql_real_escape_string($_POST['showdate']); } else { $date = ''; } if (!empty($date)) { $where = " WHERE `send_time` LIKE '" . $date . "%' ORDER BY `id` DESC;"; } else { $where = ' ORDER BY `id` DESC LIMIT 50;'; } $query = "SELECT * from `" . $tsms_table . "`" . $where; $TsmsDB->query($query); while ($row = $TsmsDB->fetchassoc()) { $smsArray[] = $row; } //close old datalink $TsmsDB->close(); //rendering result $inputs = wf_DatePickerPreset('showdate', curdate()); $inputs .= wf_Submit(__('Show')); $dateform = wf_Form("", 'POST', $inputs, 'glamour'); $cells = wf_TableCell(__('ID')); $cells .= wf_TableCell(__('Msg ID')); $cells .= wf_TableCell(__('Mobile')); $cells .= wf_TableCell(__('Sign')); $cells .= wf_TableCell(__('Message')); $cells .= wf_TableCell(__('Balance')); $cells .= wf_TableCell(__('Cost')); $cells .= wf_TableCell(__('Send time')); $cells .= wf_TableCell(__('Sended')); $cells .= wf_TableCell(__('Status')); $rows = wf_TableRow($cells, 'row1'); if (!empty($smsArray)) { foreach ($smsArray as $io => $each) { $cells = wf_TableCell($each['id']); $cells .= wf_TableCell($each['msg_id']); $cells .= wf_TableCell($each['number']); $cells .= wf_TableCell($each['sign']); $msg = wf_modal(__('Show'), __('SMS'), $each['message'], '', '300', '200'); $cells .= wf_TableCell($msg); $cells .= wf_TableCell($each['balance']); $cells .= wf_TableCell($each['cost']); $cells .= wf_TableCell($each['send_time']); $cells .= wf_TableCell($each['sended']); $cells .= wf_TableCell($each['status']); $rows .= wf_TableRow($cells, 'row5'); $total++; } } $result .= wf_Link(self::URL_ME, __('Back'), true, 'ubButton'); $result .= $dateform; $result .= wf_TableBody($rows, '100%', '0', 'sortable'); $result .= __('Total') . ': ' . $total; return $result; }
/** * Shows task editing/management form * * @global object $ubillingConfig * @param int $taskid * * @return void */ function ts_TaskChangeForm($taskid) { global $ubillingConfig; $altercfg = $ubillingConfig->getAlter(); $taskid = vf($taskid, 3); $taskdata = ts_GetTaskData($taskid); $result = ''; $allemployee = ts_GetAllEmployee(); $activeemployee = ts_GetActiveEmployee(); $alljobtypes = ts_GetAllJobtypes(); $messages = new UbillingMessageHelper(); $smsData = ''; if (!empty($taskdata)) { //not done task if (empty($taskdata['login'])) { $login_detected = ts_DetectUserByAddress($taskdata['address']); if ($login_detected) { $addresslink = wf_Link("?module=userprofile&username="******"?module=userprofile&username="******"H:i", strtotime($taskdata['starttime'])) : ''; $smsJobNote = mysql_real_escape_string($taskdata['jobnote']); $smsEmployee = vf($taskdata['employee']); $newSmsText = $smsAddress . ' ' . $smsPhone . ' ' . $smsJobNote . $smsJobTime; $smsDataCells = wf_TableCell(__('Employee'), '', 'row2'); $smsDataCells .= wf_TableCell(@$allemployee[$taskdata['employee']]); $smsDataRows = wf_TableRow($smsDataCells, 'row3'); $smsDataCells = wf_TableCell(__('Message'), '', 'row2'); $smsDataCells .= wf_TableCell(zb_TranslitString($newSmsText)); $smsDataRows .= wf_TableRow($smsDataCells, 'row3'); $smsDataTable = wf_TableBody($smsDataRows, '100%', '0', 'glamour'); $smsInputs = $smsDataTable; $smsInputs .= wf_HiddenInput('postsendemployee', $smsEmployee); $smsInputs .= wf_HiddenInput('postsendsmstext', $newSmsText); $smsInputs .= wf_Submit(__('Send SMS')); $smsForm = wf_Form('', 'POST', $smsInputs, ''); $smsData = wf_modal(wf_img_sized('skins/icon_mobile.gif', __('Send SMS'), '10'), __('Send SMS'), $smsForm, '', '400', '200'); } } $tablecells = wf_TableCell(__('ID'), '30%'); $tablecells .= wf_TableCell($taskdata['id']); $tablerows = wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Task creation date') . ' / ' . __('Administrator')); $tablecells .= wf_TableCell($taskdata['date'] . ' / ' . $taskdata['admin']); $tablerows .= wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Target date')); $tablecells .= wf_TableCell(wf_tag('strong') . $taskdata['startdate'] . ' ' . $taskdata['starttime'] . wf_tag('strong', true)); $tablerows .= wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Task address')); $tablecells .= wf_TableCell($addresslink); $tablerows .= wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Login')); $tablecells .= wf_TableCell($taskLogin . $loginType); $tablerows .= wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Phone')); $tablecells .= wf_TableCell($taskdata['phone']); $tablerows .= wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Job type')); $tablecells .= wf_TableCell(@$alljobtypes[$taskdata['jobtype']]); $tablerows .= wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Who should do')); $tablecells .= wf_TableCell(@$allemployee[$taskdata['employee']] . ' ' . $smsData); $tablerows .= wf_TableRow($tablecells, 'row3'); $tablecells = wf_TableCell(__('Job note')); $tablecells .= wf_TableCell(nl2br($taskdata['jobnote'])); $tablerows .= wf_TableRow($tablecells, 'row3'); $result .= wf_TableBody($tablerows, '100%', '0', 'glamour'); $result .= wf_tag('div', false, '', 'style="clear:both;"') . wf_tag('div', true); // show task preview show_window(__('View task') . ' ' . $modform, $result); //Salary accounting if ($altercfg['SALARY_ENABLED']) { if (cfr('SALARYTASKSVIEW')) { $salary = new Salary(); show_window(__('Additional jobs done'), $salary->taskJobCreateForm($_GET['edittask'])); } } //warehouse integration if ($altercfg['WAREHOUSE_ENABLED']) { if (cfr('WAREHOUSE')) { $warehouse = new Warehouse(); show_window(__('Additionally spent materials'), $warehouse->taskMaterialsReport($_GET['edittask'])); } } //if task undone if ($taskdata['status'] == 0) { $sup = wf_tag('sup') . '*' . wf_tag('sup', false); $inputs = wf_HiddenInput('changetask', $taskid); $inputs .= wf_DatePicker('editenddate') . wf_tag('label', false) . __('Finish date') . $sup . wf_tag('label', true) . wf_tag('br'); $inputs .= wf_tag('br'); $inputs .= wf_Selector('editemployeedone', $activeemployee, __('Worker done'), $taskdata['employee'], true); $inputs .= wf_tag('br'); $inputs .= wf_tag('label', false) . __('Finish note') . wf_tag('label', true) . wf_tag('br'); $inputs .= wf_TextArea('editdonenote', '', '', true, '35x3'); $inputs .= wf_tag('br'); $inputs .= $jobgencheckbox; $inputs .= wf_Submit(__('This task is done')); $form = wf_Form("", 'POST', $inputs, 'glamour'); if (cfr('TASKMANDELETE')) { show_window('', wf_JSAlertStyled('?module=taskman&deletetask=' . $taskid, web_delete_icon() . ' ' . __('Remove this task - it is an mistake'), $messages->getDeleteAlert(), 'ubButton')); } //show editing form if (cfr('TASKMANDONE')) { show_window(__('If task is done'), $form); } } else { $donecells = wf_TableCell(__('Finish date'), '30%'); $donecells .= wf_TableCell($taskdata['enddate']); $donerows = wf_TableRow($donecells, 'row3'); $donecells = wf_TableCell(__('Worker done')); $donecells .= wf_TableCell($allemployee[$taskdata['employeedone']]); $donerows .= wf_TableRow($donecells, 'row3'); $donecells = wf_TableCell(__('Finish note')); $donecells .= wf_TableCell($taskdata['donenote']); $donerows .= wf_TableRow($donecells, 'row3'); $doneresult = wf_TableBody($donerows, '100%', '0', 'glamour'); if (cfr('TASKMANDELETE')) { $doneresult .= wf_JSAlertStyled('?module=taskman&deletetask=' . $taskid, web_delete_icon() . ' ' . __('Remove this task - it is an mistake'), $messages->getDeleteAlert(), 'ubButton'); } if (cfr('TASKMANDONE')) { $doneresult .= ' '; $doneresult .= wf_JSAlertStyled('?module=taskman&setundone=' . $taskid, wf_img('skins/icon_key.gif') . ' ' . __('No work was done'), $messages->getEditAlert(), 'ubButton'); } show_window(__('Task is done'), $doneresult); } } }
public function showSMSqueue() { $smsPath = 'content/tsms/'; $tsms_host = $this->settings['WATCHDOG_TSMS_GATEWAY']; $tsms_db = 'users'; $tsms_login = $this->settings['WATCHDOG_TSMS_LOGIN']; $tsms_password = $this->settings['WATCHDOG_TSMS_PASSWORD']; $tsms_table = $this->settings['WATCHDOG_TSMS_LOGIN']; $smsArray = array(); $TsmsDB = new DbConnect($tsms_host, $tsms_login, $tsms_password, $tsms_db, $error_reporting = true, $persistent = false); $TsmsDB->open() or die($TsmsDB->error()); $TsmsDB->query('SET NAMES utf8;'); if (wf_CheckPost(array('showdate'))) { $date = mysql_real_escape_string($_POST['showdate']); } else { $date = ''; } if (!empty($date)) { $where = " WHERE `send_time` LIKE '" . $date . "%' ORDER BY `id` DESC;"; } else { $where = ' ORDER BY `id` DESC LIMIT 50;'; } $query = "SELECT * from `" . $tsms_table . "`" . $where; $TsmsDB->query($query); while ($row = $TsmsDB->fetchassoc()) { $smsArray[] = $row; } //close old datalink $TsmsDB->close(); //rendering result $inputs = wf_DatePickerPreset('showdate', curdate()); $inputs .= wf_Submit(__('Show')); $dateform = wf_Form("", 'POST', $inputs, 'glamour'); $lighter = 'onmouseover="this.className = \'row2\';" onmouseout="this.className = \'row3\';" '; $cells = wf_TableCell(__('ID')); $cells .= wf_TableCell(__('Msg ID')); $cells .= wf_TableCell(__('Mobile')); $cells .= wf_TableCell(__('Sign')); $cells .= wf_TableCell(__('Message')); $cells .= wf_TableCell(__('WAP')); $cells .= wf_TableCell(__('Cost')); $cells .= wf_TableCell(__('Send time')); $cells .= wf_TableCell(__('Sended')); $cells .= wf_TableCell(__('Status')); $rows = wf_TableRow($cells, 'row1'); if (!empty($smsArray)) { foreach ($smsArray as $io => $each) { $cells = wf_TableCell($each['id']); $cells .= wf_TableCell($each['msg_id']); $cells .= wf_TableCell($each['number']); $cells .= wf_TableCell($each['sign']); $msg = wf_modal(__('Show'), __('SMS'), $each['message'], '', '300', '200'); $cells .= wf_TableCell($msg); $cells .= wf_TableCell($each['wappush']); $cells .= wf_TableCell($each['cost']); $cells .= wf_TableCell($each['send_time']); $cells .= wf_TableCell($each['sended']); $cells .= wf_TableCell($each['status']); $rows .= wf_tag('tr', false, 'row3', $lighter); $rows .= $cells; $rows .= wf_tag('tr', true); } } $result = $dateform; $result .= wf_TableBody($rows, '100%', '0', 'sortable'); return $result; }
$content = $form->text_box('add[Attribute]', ''); $form->addrow(__('Attribute'), $content); // - Оператор $content = $form->select_tag('add[op]', $operators, ''); $form->addrow(__('op'), $content); // - Значение $content = $form->text_box('add[Value]', ''); $form->addrow(__('Value'), $content); /* Кнопка модального окна с формой добавления нового атрибута */ $html .= wf_modal(__('Append'), __('Adding of RADIUS-attribute'), $form->show(1), 'ubButton', 450, 275); // Форма переопределения атрибута 'User-Name' $query = "SELECT `value` FROM `radius_reassigns` WHERE `netid` = '{$netid}'"; $result = simple_query($query); $result['value'] = !empty($result['value']) ? $result['value'] : ''; $form = new InputForm('', 'POST', __('Save'), '', '', '', 'reassignment'); // - Значение $content = $form->radio_button('reassignment[value]', array('' => __('Login'), 'ip' => __('IP'), 'mac' => __('MAC')), $result['value']); $form->addrow(__('Value'), $content); /* Кнопка модального окна с формой переназначения атрибута 'User-Name' */ $html .= wf_modal(__('Reassign User-Name'), __('Reassignment of User-Name'), $form->show(1), 'ubButton', 450, 155); /* Атрибуты сети */ $html .= wf_TableBody($rows, '100%', '0', 'sortable'); } /* Показываем содержимое модуля */ show_window($title, $html); } else { show_window(__('Error'), __('This module is disabled')); } } else { show_error(__('You cant control this module')); }
zb_DownloadFile($saveFullPath, 'docx'); } } else { //template downloading if (wf_CheckGet(array('download'))) { zb_DownloadFile($documents::TEMPLATES_PATH . $_GET['download'], 'docx'); } //template deletion if (wf_CheckGet(array('deletetemplate'))) { $documents->deleteTemplate($_GET['deletetemplate']); rcms_redirect('?module=pl_documents&username='******'Available document templates'), $documents->renderTemplatesList()); //uploading new templates $uploadControl = wf_modal(__('Upload template'), __('Upload template'), $documents->uploadForm(), 'ubButton', '600', '300'); show_window(__('Settings'), $uploadControl); //template upload subroutine if (wf_CheckPost(array('uploadtemplate'))) { $documents->doUpload(); rcms_redirect('?module=pl_documents&username='******'Previously generated documents for this user'), $documents->renderUserDocuments()); } //existing document downloading if (wf_CheckGet(array('documentdownload'))) { zb_DownloadFile($documents::DOCUMENTS_PATH . $_GET['documentdownload'], 'docx'); } //document deletion from database
/** * Extracts array data for some mac from sn_SnmpParseFdbCacheArray results * * @param array $data * * @return string */ function sn_SnmpParseFdbExtract($data) { $result = ''; $modalContent = ''; if (!empty($data)) { if (sizeof($data) == 1) { foreach ($data as $io => $each) { $result .= $each; } } else { foreach ($data as $io => $each) { $modalContent .= $each . wf_tag('br'); } $result .= $each . ' ' . wf_modal(wf_img_sized('skins/menuicons/switches.png', __('Switches'), '12', '12'), __('Switches'), $modalContent, '', '600', '400'); } } return $result; }
function zb_LicenseLister() { $avarice = new Avarice(); $all = $avarice->getLicenseKeys(); $cells = wf_TableCell(__('Module')); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); if (!empty($all)) { foreach ($all as $io => $each) { //construct edit form $editinputs = wf_HiddenInput('editdbkey', $each['KEY']); $editinputs .= wf_TextArea('editlicense', '', $each['LICENSE'], true, '50x10'); $editinputs .= wf_Submit(__('Save')); $editform = wf_Form("", 'POST', $editinputs, 'glamour'); $editcontrol = wf_modal(web_edit_icon(), __('Edit'), $editform, '', '500', '300'); //construct deletion controls $deletecontrol = wf_JSAlert('?module=licensekeys&licensedelete=' . $each['KEY'], web_delete_icon(), __('Removing this may lead to irreparable results')); $cells = wf_TableCell($each['MODULE']); $cells .= wf_TableCell($deletecontrol . ' ' . $editcontrol); $rows .= wf_TableRow($cells, 'row3'); } } //constructing license creation form $addinputs = wf_TextArea('createlicense', '', '', true, '50x10'); $addinputs .= wf_Submit(__('Add')); $addform = wf_Form("", 'POST', $addinputs, 'glamour'); $addcontrol = wf_modal(wf_img('skins/icon_add.gif', __('Add')) . ' ' . __('Add'), __('Add'), $addform, 'ubButton', '500', '300'); $result = wf_TableBody($rows, '100%', 0, ''); $result .= $addcontrol; show_window(__('Installed license keys'), $result); }
/** * returns some existing user profile * * @param int $userid existing user`s ID * * @return string */ public function userProfile($userid) { global $ubillingConfig; $altcfg = $ubillingConfig->getAlter(); $userid = vf($userid, 3); if (isset($this->users[$userid])) { $userData = $this->users[$userid]; $rows = ''; //zero apt numbers as private builds if ($altcfg['ZERO_TOLERANCE']) { $apt = $userData['apt'] == '0' ? '' : '/' . $userData['apt']; } else { $apt = '/' . $userData['apt']; } $cells = wf_TableCell(__('Full address'), '20%', 'row2'); $cells .= wf_TableCell($userData['city'] . ' ' . $userData['street'] . ' ' . $userData['build'] . $apt); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Real Name'), '20%', 'row2'); $cells .= wf_TableCell($userData['realname']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Phone'), '20%', 'row2'); $cells .= wf_TableCell($userData['phone']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Mobile'), '20%', 'row2'); $cells .= wf_TableCell($userData['mobile']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(wf_tag('b') . __('Contract') . wf_tag('b', true), '20%', 'row2'); $cells .= wf_TableCell(wf_tag('b') . $userData['contract'] . wf_tag('b', true)); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Tariff'), '20%', 'row2'); $cells .= wf_TableCell(@$this->tariffs[$userData['tariffid']]['tariffname']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(wf_tag('b') . __('Cash') . wf_tag('b', true), '20%', 'row2'); $cells .= wf_TableCell(wf_tag('b') . $userData['cash'] . wf_tag('b', true)); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Connected'), '20%', 'row2'); $cells .= wf_TableCell(web_bool_led($userData['active'])); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('User contract date'), '20%', 'row2'); $cells .= wf_TableCell($userData['regdate']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Internet account'), '20%', 'row2'); $inetLink = !empty($userData['inetlogin']) ? wf_Link(self::URL_INET_USER_PROFILE . $userData['inetlogin'], web_profile_icon() . ' ' . $userData['inetlogin'], false, '') : ''; $cells .= wf_TableCell($inetLink); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Cable seal'), '20%', 'row2'); $cells .= wf_TableCell($userData['cableseal']); $rows .= wf_TableRow($cells, 'row3'); $cells = wf_TableCell(__('Notes'), '20%', 'row2'); $cells .= wf_TableCell($userData['notes']); $rows .= wf_TableRow($cells, 'row3'); $profileData = wf_TableBody($rows, '100%', 0, ''); $profilePlugins = ''; if (cfr('UKV')) { $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modal(wf_img('skins/icon_orb_big.gif', __('User lifestory')), __('User lifestory'), $this->userLifeStoryForm($userid), '', '800', '600') . __('Details') . wf_tag('div', true); } if (cfr('UKVCASH')) { $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modal(wf_img('skins/ukv/money.png', __('Cash')), __('Finance operations'), $this->userManualPaymentsForm($userid), '', '600', '250') . __('Cash') . wf_tag('div', true); } if (cfr('UKVREG')) { $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modalAuto(wf_img('skins/ukv/useredit.png', __('Edit user')), __('Edit user'), $this->userEditForm($userid), '') . __('Edit') . wf_tag('div', true); } if (cfr('UKVSEAL')) { $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modalAuto(wf_img('skins/ukv/cableseal.png', __('Cable seal')), __('Cable seal'), $this->userCableSealForm($userid), '') . __('Cable seal') . wf_tag('div', true); } if (cfr('UKVDEL')) { $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modal(wf_img('skins/annihilation.gif', __('Deleting user')), __('Deleting user'), $this->userDeletionForm($userid), '', '800', '300') . __('Delete') . wf_tag('div', true); } //main view construction $profilecells = wf_tag('td', false, '', 'valign="top"') . $profileData . wf_tag('td', true); $profilerows = wf_TableRow($profilecells); $profilecells = wf_tag('td', false, '', 'width="128" valign="top"') . $profilePlugins . wf_tag('td', true); $profilerows .= wf_TableRow($profilecells); $result = wf_TableBody($profilerows, '100%', '0'); $result .= $this->userPaymentsRender($userid); return $result; } else { throw new Exception(self::EX_USER_NOT_EXISTS); } }
/** * Renders available and enabled alerts into DarkVoid notification area * * @return void */ protected function updateAlerts() { //new tickets alert if ($this->altCfg['TB_NEWTICKETNOTIFY']) { $newticketcount = zb_TicketsGetAllNewCount(); if ($newticketcount != 0) { $this->alerts .= wf_Link('?module=ticketing', wf_img('skins/ticketnotify.gif', $newticketcount . ' ' . __('support tickets expected processing')), false); } } //new signups notification if ($this->altCfg['SIGREQ_ENABLED']) { $signups = new SignupRequests(); $newreqcount = $signups->getAllNewCount(); if ($newreqcount != 0) { $this->alerts .= wf_Link('?module=sigreq', wf_img('skins/sigreqnotify.gif', $newreqcount . ' ' . __('signup requests expected processing')), false); } } //check for unread messages in instant messanger if ($this->altCfg['TB_UBIM']) { if (cfr('UBIM')) { $unreadMessageCount = im_CheckForUnreadMessages(); if ($unreadMessageCount) { //we have new messages $unreadIMNotify = __('You received') . ' ' . $unreadMessageCount . ' ' . __('new messages'); $urlIM = $unreadIMNotify . wf_delimiter() . wf_Link("?module=ubim&checknew=true", __('Click here to go to the instant messaging service.'), false, 'ubButton'); $this->alerts .= wf_Link("?module=ubim&checknew=true", wf_img("skins/ubim_blink.gif", $unreadMessageCount . ' ' . __('new message received')), false, ''); //$this->alerts.=wf_modalOpened(__('New messages received'), $urlIM, '450', '200'); } } } //check sms sending queue if ($this->altCfg['WATCHDOG_ENABLED']) { $smsQueueCount = rcms_scandir(DATA_PATH . 'tsms/'); $smsQueueCount = sizeof($smsQueueCount); if ($smsQueueCount > 0) { $this->alerts .= wf_Link("?module=tsmsqueue", wf_img("skins/sms.png", $smsQueueCount . ' ' . __('SMS in queue')), false, ''); } } if ($this->altCfg['TB_TASKMANNOTIFY']) { //only "for me" tasks notification if ($this->altCfg['TB_TASKMANNOTIFY'] == 1) { $undoneTasksCount = ts_GetUndoneCountersMy(); if ($undoneTasksCount > 0) { $undoneAlert = $undoneTasksCount . ' ' . __('Undone tasks') . ' ' . __('for me'); $this->alerts .= wf_Link("?module=taskman&show=undone", wf_img("skins/jobnotify.png", $undoneAlert), false, ''); } } //total undone tasks count notification if ($this->altCfg['TB_TASKMANNOTIFY'] == 2) { $undoneTasksCount = ts_GetUndoneCountersAll(); if ($undoneTasksCount > 0) { $undoneAlert = $undoneTasksCount . ' ' . __('Undone tasks') . ' ' . __('for all'); $this->alerts .= wf_Link("?module=taskman&show=undone", wf_img("skins/jobnotify.png", $undoneAlert), false, ''); } } //total+my undone tasks count notification if ($this->altCfg['TB_TASKMANNOTIFY'] == 3) { $undoneTasksCount = ts_GetUndoneCountersAll(); if ($undoneTasksCount > 0) { $undoneTasksCountMy = ts_GetUndoneCountersMy(); $undoneAlert = $undoneTasksCount . ' ' . __('Undone tasks') . ': ' . __('for all') . ' ' . ($undoneTasksCount - $undoneTasksCountMy) . ' / ' . __('for me') . ' ' . $undoneTasksCountMy; $this->alerts .= wf_Link("?module=taskman&show=undone", wf_img("skins/jobnotify.png", $undoneAlert), false, ''); } } } //switchmon at notify area if ($this->altCfg['TB_SWITCHMON']) { $dead_raw = zb_StorageGet('SWDEAD'); $last_pingtime = zb_StorageGet('SWPINGTIME'); $deathTime = zb_SwitchesGetAllDeathTime(); $deadarr = array(); $content = ''; if ($this->altCfg['SWYMAP_ENABLED']) { $content = wf_Link('?module=switchmap', wf_img('skins/swmapsmall.png', __('Switches map')), false); } $content .= wf_AjaxLoader() . wf_AjaxLink("?module=switches&forcereping=true&ajaxping=true", wf_img('skins/refresh.gif', __('Force ping')), 'switchping', true, ''); if ($dead_raw) { $deadarr = unserialize($dead_raw); if (!empty($deadarr)) { //there is some dead switches $deadcount = sizeof($deadarr); if ($this->altCfg['SWYMAP_ENABLED']) { //getting geodata $switchesGeo = zb_SwitchesGetAllGeo(); } //ajax container $content .= wf_tag('div', false, '', 'id="switchping"'); foreach ($deadarr as $ip => $switch) { if ($this->altCfg['SWYMAP_ENABLED']) { if (isset($switchesGeo[$ip])) { if (!empty($switchesGeo[$ip])) { $devicefind = wf_Link('?module=switchmap&finddevice=' . $switchesGeo[$ip], wf_img('skins/icon_search_small.gif', __('Find on map'))) . ' '; } else { $devicefind = ''; } } else { $devicefind = ''; } } else { $devicefind = ''; } //check morgue records for death time if (isset($deathTime[$ip])) { $deathClock = wf_img('skins/clock.png', __('Switch dead since') . ' ' . $deathTime[$ip]) . ' '; } else { $deathClock = ''; } //switch location link $switchLocator = wf_Link('?module=switches&gotoswitchbyip=' . $ip, web_edit_icon(__('Go to switch'))); //add switch as dead $content .= $devicefind . ' ' . $switchLocator . ' ' . $deathClock . $ip . ' - ' . $switch . '<br>'; } //ajax container end $content .= wf_delimiter() . __('Cache state at time') . ': ' . date("H:i:s", $last_pingtime) . wf_tag('div', true); $this->alerts .= wf_tag('div', false, 'ubButton') . wf_modal(__('Dead switches') . ': ' . $deadcount, __('Dead switches'), $content, '', '500', '400') . wf_tag('div', true); } else { $content .= wf_tag('div', false, '', 'id="switchping"') . __('Switches are okay, everything is fine - I guarantee') . wf_delimiter() . __('Cache state at time') . ': ' . date("H:i:s", $last_pingtime) . wf_tag('div', true); $this->alerts .= wf_tag('div', false, 'ubButton') . wf_modal(__('All switches alive'), __('All switches alive'), $content, '', '500', '400') . wf_tag('div', true); } } else { $content .= wf_tag('div', false, '', 'id="switchping"') . __('Switches are okay, everything is fine - I guarantee') . wf_delimiter() . __('Cache state at time') . ': ' . @date("H:i:s", $last_pingtime) . wf_tag('div', true); $this->alerts .= wf_tag('div', false, 'ubButton') . wf_modal(__('All switches alive'), __('All switches alive'), $content, '', '500', '400') . wf_tag('div', true); } } file_put_contents(self::CACHE_PATH . self::CACHE_PREFIX . $this->myLogin, $this->alerts); }