/** * Renders list of available SMS in queue with some controls * * @return string */ public function render() { $result = ''; if (!empty($this->queue)) { $cells = wf_TableCell(__('Date')); $cells .= wf_TableCell(__('Mobile')); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); foreach ($this->queue as $io => $each) { $cells = wf_TableCell($each['date']); $cells .= wf_TableCell($each['number']); $actLinks = wf_modalAuto(wf_img('skins/icon_search_small.gif', __('Preview')), __('Preview'), $this->smsPreview($each), ''); $actLinks .= wf_JSAlert('?module=tsmsqueue&deletesms=' . $each['filename'], web_delete_icon(), __('Are you serious')); $cells .= wf_TableCell($actLinks); $rows .= wf_TableRow($cells, 'row3'); } $result = wf_TableBody($rows, '100%', 0, 'sortable'); } else { $result .= wf_tag('span', false, 'alert_info'); $result .= wf_tag('center', false); $result .= __('Nothing found'); $result .= wf_tag('center', true); $result .= wf_tag('span', true); } return $result; }
/** * Shows current FDB cache list container * * @param string $fdbSwitchFilter */ function web_FDBTableShowDataTable($fdbSwitchFilter = '') { $filter = !empty($fdbSwitchFilter) ? '&swfilter=' . $fdbSwitchFilter : ''; $filtersForm = wf_modalAuto(web_icon_search('MAC filters setup'), __('MAC filters setup'), web_FDBTableFiltersForm(), ''); $columns = array('Switch IP', 'Port', 'Location', 'MAC', 'User'); $result = wf_JqDtLoader($columns, '?module=switchpoller&ajax=true' . $filter, true, 'Objects', 100); show_window(__('Current FDB cache') . ' ' . $filtersForm, $result); }
/** * Returns default list controls * * @return string */ public function controls() { $result = ''; $result .= wf_modalAuto(wf_img('skins/add_icon.png') . ' ' . __('Create'), __('Create') . ' ' . __('ONU'), $this->onuCreateForm(), 'ubButton'); $result .= wf_delimiter(); return $result; }
/** * Returns default contol for QR code view interface * * @param string $type * @param int $id * @return string */ protected function qrControl($type, $id) { $result = ''; $qrUrl = self::URL_ME . '&' . self::URL_VIEWERS . '&qrcode=' . $type . '&renderid=' . $id; $result = wf_modalAuto(wf_img_sized('skins/qrcode.png', __('QR code'), '16', '16'), __('QR code'), wf_img($qrUrl), ''); return $result; }
/** * Renders available employee wages list with some controls * * @return string */ public function employeeWagesRender() { $result = ''; $messages = new UbillingMessageHelper(); $cells = wf_TableCell(__('Employee')); $cells .= wf_TableCell(__('Wage')); $cells .= wf_TableCell(__('Bounty')); $cells .= wf_TableCell(__('Work hours')); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); if (!empty($this->allWages)) { foreach ($this->allWages as $io => $each) { $rowClass = isset($this->allEmployee[$io]) ? 'row3' : 'sigdeleteduser'; $cells = wf_TableCell(@$this->allEmployeeRaw[$io]); $cells .= wf_TableCell($this->allWages[$io]['wage']); $cells .= wf_TableCell($this->allWages[$io]['bounty']); $cells .= wf_TableCell($this->allWages[$io]['worktime']); $actlinks = wf_JSAlertStyled('?module=salary&employeewages=true&deletewage=' . $io, web_delete_icon(), $messages->getDeleteAlert()); $actlinks .= wf_modalAuto(web_edit_icon(), __('Edit'), $this->employeeWageEditForm($io)); $cells .= wf_TableCell($actlinks); $rows .= wf_TableRow($cells, $rowClass); } } $result = wf_TableBody($rows, '100%', 0, 'sortable'); return $result; }
/** * 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; }
/** * Cemetery controls * * @return string */ protected function getCemeteryControls() { $result = ''; if (isset($this->alterCfg['CEMETERY_ENABLED'])) { if ($this->alterCfg['CEMETERY_ENABLED']) { $cemetery = new Cemetery(); //integrated controller if (wf_CheckPost(array('cemeterysetasundead'))) { $cemetery->setUndead($_POST['cemeterysetasundead']); rcms_redirect('?module=userprofile&username='******'cemeterysetasdead'))) { $cemetery->setDead($_POST['cemeterysetasdead']); rcms_redirect('?module=userprofile&username='******'skins/dead_icon.png', '', '12', '12'), __('User lifestory'), $cemetery->renderCemeteryLog($this->login)); $result = ' / ' . __('Subscriber is not connected') . ' ' . $log; } else { $log = wf_modalAuto(wf_img_sized('skins/pigeon_icon.png', '', '12', '12'), __('User lifestory'), $cemetery->renderCemeteryLog($this->login)); $result = ' / ' . __('Subscriber is connected') . ' ' . $log; } } } return $result; }
} else { show_warning(__('This switch is the parent for other switches')); } } else { ub_SwitchDelete($_GET['switchdelete']); rcms_redirect("?module=switches"); } } else { show_window(__('Error'), __('Access denied')); } } } if (!isset($_GET['edit'])) { $swlinks = ''; if (cfr('SWITCHESEDIT')) { $swlinks .= wf_modalAuto(wf_img('skins/add_icon.png') . ' ' . __('Add switch'), __('Add switch'), web_SwitchFormAdd(), 'ubButton'); } if (cfr('SWITCHM')) { $swlinks .= wf_Link('?module=switchmodels', wf_img('skins/switch_models.png') . ' ' . __('Available switch models'), false, 'ubButton'); } $swlinks .= wf_Link('?module=switches&forcereping=true', wf_img('skins/refresh.gif') . ' ' . __('Force ping'), false, 'ubButton'); $swlinks .= wf_Link('?module=switches&timemachine=true', wf_img('skins/time_machine.png') . ' ' . __('Time machine'), false, 'ubButton'); if ($altCfg['SWYMAP_ENABLED']) { $swlinks .= wf_Link('?module=switchmap', wf_img('skins/ymaps/network.png') . ' ' . __('Switches map'), false, 'ubButton'); } if ($altCfg['SWITCH_AUTOCONFIG']) { if (cfr(SwitchLogin::MODULE)) { $swlinks .= wf_Link(SwitchLogin::MODULE_URL, wf_img('skins/sw_login.png') . ' ' . __('Switch login'), false, 'ubButton'); } } //parental switch deletion alternate controls
/** * Returns list of available images for current scope/item * * @return string */ public function renderImagesRaw() { $result = ''; if (empty($this->allimages)) { $this->loadAllImages(); } if (!empty($this->allimages)) { foreach ($this->allimages as $io => $eachimage) { if ($eachimage['scope'] == $this->scope and $eachimage['item'] == $this->itemId) { $imgPreview = wf_img_sized(self::STORAGE_PATH . $eachimage['filename'], __('Show'), $this->photoCfg['IMGLIST_PREV_W'], $this->photoCfg['IMGLIST_PREV_H']); $imgFull = wf_img(self::STORAGE_PATH . $eachimage['filename']); $dimensions = 'width:' . ($this->photoCfg['IMGLIST_PREV_W'] + 10) . 'px;'; $dimensions .= 'height:' . ($this->photoCfg['IMGLIST_PREV_H'] + 10) . 'px;'; $result .= wf_modalAuto($imgPreview, __('Image') . ' ' . $eachimage['id'], $imgFull, ''); } } } $result .= wf_CleanDiv(); 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); } }
/** * Renders available tariffs list * * @return string */ public function renderTariffs() { $result = ''; $cells = wf_TableCell(__('ID')); $cells .= wf_TableCell(__('Tariff name')); $cells .= wf_TableCell(__('Fee')); $cells .= wf_TableCell(__('Service ID')); $cells .= wf_TableCell(__('Primary')); $cells .= wf_TableCell(__('Free period')); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); if (!empty($this->allTariffs)) { foreach ($this->allTariffs as $io => $each) { $cells = wf_TableCell($each['id']); $cells .= wf_TableCell($each['name']); $cells .= wf_TableCell($each['fee']); $cells .= wf_TableCell($each['serviceid']); $cells .= wf_TableCell(web_bool_led($each['primary'])); $cells .= wf_TableCell(web_bool_led($each['freeperiod'])); $actLinks = wf_JSAlert(self::URL_ME . '&' . self::URL_TARIFFS . '&deletetariffid=' . $each['id'], web_delete_icon(), $this->messages->getDeleteAlert()); $actLinks .= wf_modalAuto(web_edit_icon(), __('Edit tariff'), $this->tariffEditForm($each['id'])); $cells .= wf_TableCell($actLinks); $rows .= wf_TableRow($cells, 'row3'); } } $result = wf_TableBody($rows, '100%', 0, 'sortable'); return $result; }
/** * Renders phone data with available controls * * @return string */ public function renderContacts() { $result = ''; $messages = new UbillingMessageHelper(); if (!empty($this->allContacts) or !empty($this->allBuildContacts)) { $cells = wf_TableCell(__('Phone')); $cells .= wf_TableCell(__('Name')); if (cfr('PHONEBOOKEDIT')) { $cells .= wf_TableCell(__('Actions')); } $rows = wf_TableRow($cells, 'row1'); //normal contacts processing if (!empty($this->allContacts)) { foreach ($this->allContacts as $io => $each) { $cells = wf_TableCell($each['phone']); $cells .= wf_TableCell($each['name']); if (cfr('PHONEBOOKEDIT')) { $actLinks = wf_JSAlert(self::URL_ME . '&deletecontactid=' . $io, web_delete_icon(), $messages->getDeleteAlert()); $actLinks .= wf_modalAuto(web_edit_icon(), __('Edit'), $this->editForm($io)); $cells .= wf_TableCell($actLinks); } $rows .= wf_TableRow($cells, 'row3'); } } //build passport contacts processing if (!empty($this->allBuildContacts)) { foreach ($this->allBuildContacts as $io => $each) { $cells = wf_TableCell($each['phone']); $cells .= wf_TableCell($each['name']); if (cfr('PHONEBOOKEDIT')) { $cells .= wf_TableCell(''); } $rows .= wf_TableRow($cells, 'row3'); } } $result .= wf_TableBody($rows, '100%', 0, 'sortable'); } else { $messages = new UbillingMessageHelper(); $result = $messages->getStyledMessage(__('Nothing found'), 'info'); } return $result; }
/** * Renders report for some year * * @return string */ public function renderReport() { $result = ''; $months = months_array_localized(); $yearData = $this->loadStoredData(); $inputs = wf_YearSelectorPreset('yearsel', __('Year'), false, $this->showYear) . ' '; $chartsFlag = wf_CheckPost(array('showcharts')) ? true : false; $inputs .= wf_CheckInput('showcharts', __('Graphs'), false, $chartsFlag) . ' '; $inputs .= wf_Submit(__('Show')); $yearForm = wf_Form('', 'POST', $inputs, 'glamour'); $yearForm .= wf_CleanDiv(); $result .= $yearForm; //charts presets $chartsOptions = "\n 'focusTarget': 'category',\n 'hAxis': {\n 'color': 'none',\n 'baselineColor': 'none',\n },\n 'vAxis': {\n 'color': 'none',\n 'baselineColor': 'none',\n },\n 'curveType': 'function',\n 'pointSize': 5,\n 'crosshair': {\n trigger: 'none'\n },"; $usersChartData = array(0 => array(__('Month'), __('Total'), __('Active'), __('Inactive'), __('Frozen'), __('Signups'))); $complexChartData = array(0 => array(__('Month'), __('Total'), __('Active'), __('Inactive'))); $financeChartsData = array(0 => array(__('Month'), __('Money'), __('Payments count'), __('ARPU'), __('ARPAU'))); $ukvChartData = array(0 => array(__('Month'), __('Total'), __('Active'), __('Inactive'), __('Illegal'), __('Complex'), __('Social'), __('Signups'))); $ukvfChartData = array(0 => array(__('Month'), __('Money'), __('Payments count'), __('ARPU'), __('ARPAU'), __('Debt'))); $askoziaChartData = array(0 => array(__('Month'), __('Total calls'), __('Total answered'), __('No answer'))); $equipChartData = array(0 => array(__('Month'), __('Switches'), __('PON ONU'), __('DOCSIS modems'))); if (!empty($yearData)) { //internet users $cells = wf_TableCell(__('Month')); $cells .= wf_TableCell(__('Total')); $cells .= wf_TableCell(__('Active')); $cells .= wf_TableCell(__('Inactive')); $cells .= wf_TableCell(__('Frozen')); $cells .= wf_TableCell(__('Signups')); $rows = wf_TableRow($cells, 'row1'); foreach ($yearData as $monthNum => $each) { $cells = wf_TableCell($months[$monthNum]); $cells .= wf_TableCell($each['u_totalusers']); $cells .= wf_TableCell($each['u_activeusers'] . ' (' . $this->percentValue($each['u_totalusers'], $each['u_activeusers']) . '%)'); $cells .= wf_TableCell($each['u_inactiveusers'] . ' (' . $this->percentValue($each['u_totalusers'], $each['u_inactiveusers']) . '%)'); $cells .= wf_TableCell($each['u_frozenusers'] . ' (' . $this->percentValue($each['u_totalusers'], $each['u_frozenusers']) . '%)'); if (!empty($each['u_citysignups'])) { $signupData = ''; $sigDataTmp = base64_decode($each['u_citysignups']); $sigDataTmp = unserialize($sigDataTmp); $citySigs = ''; $cityRows = ''; if (!empty($sigDataTmp)) { $cityCells = wf_TableCell(__('City')); $cityCells .= wf_TableCell(__('Signups')); $cityRows .= wf_TableRow($cityCells, 'row1'); foreach ($sigDataTmp as $sigCity => $cityCount) { $cityCells = wf_TableCell($sigCity); $cityCells .= wf_TableCell($cityCount); $cityRows .= wf_TableRow($cityCells, 'row3'); } $citySigs .= wf_TableBody($cityRows, '100%', 0, ''); } $signupData .= wf_modalAuto($each['u_signups'], __('Cities'), $citySigs); } else { $signupData = $each['u_signups']; } $cells .= wf_TableCell($signupData); $rows .= wf_TableRow($cells, 'row3'); //chart data $usersChartData[] = array($months[$monthNum], $each['u_totalusers'], $each['u_activeusers'], $each['u_inactiveusers'], $each['u_frozenusers'], $each['u_signups']); } $result .= wf_tag('h2') . __('Internets users') . wf_tag('h2', true); $result .= wf_TableBody($rows, '100%', 0, ''); if ($chartsFlag) { $result .= wf_gchartsLine($usersChartData, __('Internets users'), '100%', '300px', $chartsOptions); } //complex data if ($this->complexFlag) { $result .= wf_tag('h2') . __('Complex services') . wf_tag('h2', true); $cells = wf_TableCell(__('Month')); $cells .= wf_TableCell(__('Total')); $cells .= wf_TableCell(__('Active')); $cells .= wf_TableCell(__('Inactive')); $rows = wf_TableRow($cells, 'row1'); foreach ($yearData as $monthNum => $each) { $cells = wf_TableCell($months[$monthNum]); $cells .= wf_TableCell($each['u_complextotal']); $cells .= wf_TableCell($each['u_complexactive'] . ' (' . $this->percentValue($each['u_complextotal'], $each['u_complexactive']) . '%)'); $cells .= wf_TableCell($each['u_complexinactive'] . ' (' . $this->percentValue($each['u_complextotal'], $each['u_complexinactive']) . '%)'); $rows .= wf_TableRow($cells, 'row3'); //chart data $complexChartData[] = array($months[$monthNum], $each['u_complextotal'], $each['u_complexactive'], $each['u_complexinactive']); } $result .= wf_TableBody($rows, '100%', 0, ''); if ($chartsFlag) { $result .= wf_gchartsLine($complexChartData, __('Complex services'), '100%', '300px', $chartsOptions); } } //finance data $result .= wf_tag('h2') . __('Financial highlights') . wf_tag('h2', true); $cells = wf_TableCell(__('Month')); $cells .= wf_TableCell(__('Money')); $cells .= wf_TableCell(__('Payments count')); $cells .= wf_TableCell(__('Cash payments')); $cells .= wf_TableCell(__('Cash payments count')); $cells .= wf_TableCell(__('ARPU')); $cells .= wf_TableCell(__('ARPAU')); $rows = wf_TableRow($cells, 'row1'); foreach ($yearData as $monthNum => $each) { $cells = wf_TableCell($months[$monthNum]); $cells .= wf_TableCell($each['f_totalmoney']); $cells .= wf_TableCell($each['f_paymentscount']); $cells .= wf_TableCell($each['f_cashmoney'] . ' (' . $this->percentValue($each['f_totalmoney'], $each['f_cashmoney']) . '%)'); $cells .= wf_TableCell($each['f_cashcount'] . ' (' . $this->percentValue($each['f_paymentscount'], $each['f_cashcount']) . '%)'); $cells .= wf_TableCell($each['f_arpu']); $cells .= wf_TableCell($each['f_arpau']); $rows .= wf_TableRow($cells, 'row3'); //chart data $financeChartsData[] = array($months[$monthNum], $each['f_totalmoney'], $each['f_paymentscount'], $each['f_arpu'], $each['f_arpau']); } $result .= wf_TableBody($rows, '100%', 0, ''); if ($chartsFlag) { $result .= wf_gchartsLine($financeChartsData, __('Financial highlights'), '100%', '300px', $chartsOptions); } // UKV cable users if ($this->ukvFlag) { $result .= wf_tag('h2') . __('UKV users') . wf_tag('h2', true); $cells = wf_TableCell(__('Month')); $cells .= wf_TableCell(__('Total')); $cells .= wf_TableCell(__('Active')); $cells .= wf_TableCell(__('Inactive')); $cells .= wf_TableCell(__('Illegal')); if ($this->complexFlag) { $cells .= wf_TableCell(__('Complex')); } $cells .= wf_TableCell(__('Social')); $cells .= wf_TableCell(__('Signups')); $rows = wf_TableRow($cells, 'row1'); foreach ($yearData as $monthNum => $each) { $cells = wf_TableCell($months[$monthNum]); $cells .= wf_TableCell($each['c_totalusers']); $cells .= wf_TableCell($each['c_activeusers'] . ' (' . $this->percentValue($each['c_totalusers'], $each['c_activeusers']) . '%)'); $cells .= wf_TableCell($each['c_inactiveusers'] . ' (' . $this->percentValue($each['c_totalusers'], $each['c_inactiveusers']) . '%)'); $cells .= wf_TableCell($each['c_illegal'] . ' (' . $this->percentValue($each['c_totalusers'], $each['c_illegal']) . '%)'); if ($this->complexFlag) { $cells .= wf_TableCell($each['c_complex'] . ' (' . $this->percentValue($each['c_totalusers'], $each['c_complex']) . '%)'); } $cells .= wf_TableCell($each['c_social'] . ' (' . $this->percentValue($each['c_totalusers'], $each['c_social']) . '%)'); $cells .= wf_TableCell($each['c_signups']); $rows .= wf_TableRow($cells, 'row3'); //chart data $ukvChartData[] = array($months[$monthNum], $each['c_totalusers'], $each['c_activeusers'], $each['c_inactiveusers'], $each['c_illegal'], $each['c_complex'], $each['c_social'], $each['c_signups']); } $result .= wf_TableBody($rows, '100%', 0, ''); if ($chartsFlag) { $result .= wf_gchartsLine($ukvChartData, __('UKV users'), '100%', '300px', $chartsOptions); } //UKV financial data $result .= wf_tag('h2') . __('UKV finance') . wf_tag('h2', true); $cells = wf_TableCell(__('Month')); $cells .= wf_TableCell(__('Money')); $cells .= wf_TableCell(__('Payments count')); $cells .= wf_TableCell(__('ARPU')); $cells .= wf_TableCell(__('ARPAU')); $cells .= wf_TableCell(__('Debt')); $rows = wf_TableRow($cells, 'row1'); foreach ($yearData as $monthNum => $each) { $cells = wf_TableCell($months[$monthNum]); $cells .= wf_TableCell($each['c_totalmoney']); $cells .= wf_TableCell($each['c_paymentscount']); $cells .= wf_TableCell($each['c_arpu']); $cells .= wf_TableCell($each['c_arpau']); $cells .= wf_TableCell($each['c_totaldebt']); $rows .= wf_TableRow($cells, 'row3'); //chart data $ukvfChartData[] = array($months[$monthNum], $each['c_totalmoney'], $each['c_paymentscount'], $each['c_arpu'], $each['c_arpau'], $each['c_totaldebt']); } $result .= wf_TableBody($rows, '100%', 0, ''); if ($chartsFlag) { $result .= wf_gchartsLine($ukvfChartData, __('UKV users'), '100%', '300px', $chartsOptions); } } //Askozia PBX if ($this->askoziaFlag) { $result .= wf_tag('h2') . __('AskoziaPBX integration') . wf_tag('h2', true); $cells = wf_TableCell(__('Month')); $cells .= wf_TableCell(__('Incoming calls')); $cells .= wf_TableCell(__('Total answered')); $cells .= wf_TableCell(__('No answer')); $cells .= wf_TableCell(__('Total duration')); $cells .= wf_TableCell(__('Average duration')); $cells .= wf_TableCell(__('Answers percent')); $rows = wf_TableRow($cells, 'row1'); foreach ($yearData as $monthNum => $each) { $cells = wf_TableCell($months[$monthNum]); $cells .= wf_TableCell($each['a_totalcalls']); $cells .= wf_TableCell($each['a_totalanswered']); $cells .= wf_TableCell($each['a_totalcalls'] - $each['a_totalanswered']); $cells .= wf_TableCell($this->formatTime($each['a_totalcallsduration'])); $cells .= wf_TableCell($this->formatTime($each['a_averagecallduration'])); $cells .= wf_TableCell($this->percentValue($each['a_totalcalls'], $each['a_totalanswered']) . '%'); $rows .= wf_TableRow($cells, 'row3'); //chart data $askoziaChartData[] = array($months[$monthNum], $each['a_totalcalls'], $each['a_totalanswered'], $each['a_totalcalls'] - $each['a_totalanswered']); } $result .= wf_TableBody($rows, '100%', 0, ''); if ($chartsFlag) { $result .= wf_gchartsLine($askoziaChartData, __('Askozia'), '100%', '300px', $chartsOptions); } } //Equipment $result .= wf_tag('h2') . __('Equipment') . wf_tag('h2', true); $cells = wf_TableCell(__('Month')); $cells .= wf_TableCell(__('Switches')); if ($this->ponFlag) { $cells .= wf_TableCell(__('PON ONU')); } if ($this->docsisFlag) { $cells .= wf_TableCell(__('DOCSIS Modems')); } $rows = wf_TableRow($cells, 'row1'); foreach ($yearData as $monthNum => $each) { $cells = wf_TableCell($months[$monthNum]); $cells .= wf_TableCell($each['e_switches']); if ($this->ponFlag) { $cells .= wf_TableCell($each['e_pononu']); } if ($this->docsisFlag) { $cells .= wf_TableCell($each['e_docsis']); } $rows .= wf_TableRow($cells, 'row3'); //chart data $equipChartData[] = array($months[$monthNum], $each['e_switches'], $each['e_pononu'], $each['e_docsis']); } $result .= wf_TableBody($rows, '100%', 0, ''); if ($chartsFlag) { $result .= wf_gchartsLine($equipChartData, __('Equipment'), '100%', '300px', $chartsOptions); } } else { $result .= $this->messages->getStyledMessage(__('Nothing found'), 'info'); } return $result; }
/** * Renders main module controls * * @return string */ public function renderPanel() { $result = ''; $result .= wf_modalAuto(wf_img('skins/add_icon.png') . ' ' . __('Add DHCP network'), __('Add DHCP network'), $this->addForm(), 'ubButton') . ' '; $result .= wf_Link(self::URL_ME . '&restartserver=true', wf_img('skins/refresh.gif') . ' ' . __('Restart DHCP server'), false, 'ubButton'); return $result; }
/** * Renders available typical answer presets list with controls * * @return string */ function web_TicketsTapShowAvailable() { $all = zb_TicketsTAPgetAll(); $cells = wf_TableCell(__('Text'), '90%'); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); if (!empty($all)) { foreach ($all as $io => $each) { $cells = wf_TableCell($each); $actlinks = wf_JSAlert('?module=ticketing&settings=true&deletetap=' . $io, web_delete_icon(), __('Removing this may lead to irreparable results')); $actlinks .= wf_modalAuto(web_edit_icon(), __('Edit'), web_TicketsTAPEditForm($io, $each), ''); $cells .= wf_TableCell($actlinks); $rows .= wf_TableRow($cells, 'row3'); } } $result = wf_TableBody($rows, '100%', '0', 'sortable'); return $result; }
/** * Returns map list controls panel * * @return string */ protected function mapListControls() { $result = wf_modalAuto(wf_img('skins/add_icon.png') . ' ' . __('Create'), __('Create new map'), $this->mapCreateForm(), 'ubButton'); $result .= wf_delimiter(); return $result; }
$dshaper->delete($_GET['delete']); rcms_redirect("?module=dshaper"); } //if someone adding time rule if (isset($_POST['newdshapetariff'])) { $dshaper->create($_POST['newdshapetariff'], $_POST['newthreshold1'], $_POST['newthreshold2'], $_POST['newspeed']); rcms_redirect("?module=dshaper"); } //timerule editing subroutine if (isset($_GET['edit'])) { if (isset($_POST['editdshapetariff'])) { $dshaper->edit($_GET['edit'], $_POST['editthreshold1'], $_POST['editthreshold2'], $_POST['editspeed']); rcms_redirect("?module=dshaper"); } //show edit form show_window(__('Edit time shaper rule'), $dshaper->renderEditForm($_GET['edit'])); } else { //show rules lister show_window('', wf_modalAuto(wf_img('skins/add_icon.png') . ' ' . __('Add new time shaper rule'), __('Create'), $dshaper->renderAddForm(), 'ubButton')); show_window(__('Available dynamic shaper time rules'), $dshaper->renderList()); } } else { show_error(__('This module is disabled')); } } else { show_error(__('This module is disabled')); } //end of option enabled check } else { show_error(__('You cant control this module')); }
/** * Returns list of previous user payments * * @param string $login * @return string */ function web_PaymentsByUser($login) { global $ubillingConfig; $allpayments = zb_CashGetUserPayments($login); $alter_conf = $ubillingConfig->getAlter(); $alltypes = zb_CashGetAllCashTypes(); $allservicenames = zb_VservicesGetAllNamesLabeled(); $total_payments = "0"; $curdate = curdate(); $deletingAdmins = array(); $editingAdmins = array(); $iCanDeletePayments = false; $iCanEditPayments = false; $currentAdminLogin = whoami(); //extract admin logins with payments delete rights if (!empty($alter_conf['CAN_DELETE_PAYMENTS'])) { $deletingAdmins = explode(',', $alter_conf['CAN_DELETE_PAYMENTS']); $deletingAdmins = array_flip($deletingAdmins); } //extract admin logins with date edit rights if (!empty($alter_conf['CAN_EDIT_PAYMENTS'])) { $editingAdmins = explode(',', $alter_conf['CAN_EDIT_PAYMENTS']); $editingAdmins = array_flip($editingAdmins); } //setting editing/deleting flags $iCanDeletePayments = isset($deletingAdmins[$currentAdminLogin]) ? true : false; $iCanEditPayments = isset($editingAdmins[$currentAdminLogin]) ? true : false; $cells = wf_TableCell(__('ID')); $cells .= wf_TableCell(__('IDENC')); $cells .= wf_TableCell(__('Date')); $cells .= wf_TableCell(__('Payment')); $cells .= wf_TableCell(__('Balance before')); $cells .= wf_TableCell(__('Cash type')); $cells .= wf_TableCell(__('Payment note')); $cells .= wf_TableCell(__('Admin')); $cells .= wf_TableCell(__('Actions')); $rows = wf_TableRow($cells, 'row1'); if (!empty($allpayments)) { foreach ($allpayments as $eachpayment) { if ($alter_conf['TRANSLATE_PAYMENTS_NOTES']) { $eachpayment['note'] = zb_TranslatePaymentNote($eachpayment['note'], $allservicenames); } //hightlight of today payments if ($alter_conf['HIGHLIGHT_TODAY_PAYMENTS']) { if (ispos($eachpayment['date'], $curdate)) { $hlight = 'paytoday'; } else { $hlight = 'row3'; } } else { $hlight = 'row3'; } if (!empty($alter_conf['DOCX_SUPPORT']) && !empty($alter_conf['DOCX_CHECK'])) { $printcheck = wf_Link('?module=printcheck&paymentid=' . $eachpayment['id'], wf_img('skins/printer_small.gif', __('Print')), false); } else { $printcheck = wf_tag('a', false, '', 'href="#" onClick="window.open(\'?module=printcheck&paymentid=' . $eachpayment['id'] . '\',\'checkwindow\',\'width=800,height=600\')"'); $printcheck .= wf_img('skins/printer_small.gif', __('Print')); $printcheck .= wf_tag('a', true); } //payments deleting controls if ($iCanDeletePayments) { $deleteControls = wf_JSAlert('?module=addcash&username='******'&paymentdelete=' . $eachpayment['id'], wf_img('skins/delete_small.png', __('Delete')), __('Removing this may lead to irreparable results')) . ' '; } else { $deleteControls = ''; } //payments editing form if ($iCanEditPayments) { $editControls = wf_modalAuto(wf_img_sized('skins/icon_edit.gif', __('Edit'), '10'), __('Edit'), web_PaymentEditForm($eachpayment), '') . ' '; } else { $editControls = ''; } $cells = wf_TableCell($eachpayment['id']); $cells .= wf_TableCell(zb_NumEncode($eachpayment['id'])); $cells .= wf_TableCell($eachpayment['date']); $cells .= wf_TableCell($eachpayment['summ']); $cells .= wf_TableCell($eachpayment['balance']); $cells .= wf_TableCell(@__($alltypes[$eachpayment['cashtypeid']])); $cells .= wf_TableCell($eachpayment['note']); $cells .= wf_TableCell($eachpayment['admin']); $cells .= wf_TableCell($deleteControls . $editControls . $printcheck); $rows .= wf_TableRow($cells, $hlight); $total_payments = $total_payments + $eachpayment['summ']; } } $result = wf_TableBody($rows, '100%', '0', 'sortable'); $result .= __('Total payments') . ': ' . wf_tag('b') . abs($total_payments) . wf_tag('b') . wf_tag('br'); return $result; }
/** * Returns modal window with telegram message creation form * * @return string */ public function telegramCreateForm() { $result = ''; $inputs = wf_TextInput('newtelegramchatid', __('Chat ID'), '', true, '20'); $inputs .= wf_TextArea('newtelegrammessage', '', '', true, '50x10'); $inputs .= wf_Submit(__('Create')); $form = wf_Form('', 'POST', $inputs, 'glamour'); $result = wf_modalAuto(wf_img('skins/add_icon.png', __('Create new Telegram message')), __('Create new Telegram message'), $form, ''); return $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); } }
$sysInfoData = ''; //phpinfo() $phpInfoCode = wf_modal(__('Check required PHP extensions'), __('Check required PHP extensions'), zb_CheckPHPExtensions(), 'ubButton', '800', '600'); if ($alterconf['UBCACHE_STORAGE'] == 'memcached') { $phpInfoCode .= wf_modal(__('Stats') . ' ' . __('Memcached'), __('Stats') . ' ' . __('Memcached'), web_MemCachedRenderStats(), 'ubButton', '800', '600'); } $phpInfoCode .= wf_tag('br'); $phpInfoCode .= wf_tag('iframe', false, '', 'src="?module=report_sysload&phpinfo=true" width="1000" height="500" frameborder="0"') . wf_tag('iframe', true); $sysInfoData .= wf_modalAuto(__('Information about PHP version'), __('Information about PHP version'), $phpInfoCode, 'ubButton'); //database info $dbInfoCode = zb_DBStatsRenderContainer(); $sysInfoData .= wf_modal(__('MySQL database info'), __('MySQL database info'), $dbInfoCode, 'ubButton', 1020, 570); //phpsysinfo frame if (!empty($monit_url)) { $monitCode = wf_tag('iframe', false, '', 'src="' . $monit_url . '" width="1000" height="500" frameborder="0"') . wf_tag('iframe', true); $sysInfoData .= wf_modalAuto(__('System health with phpSysInfo'), __('phpSysInfo'), $monitCode, 'ubButton'); } show_window('', $sysInfoData); //custom scripts shows data if (isset($alterconf['SYSLOAD_CUSTOM_SCRIPTS'])) { if (!empty($alterconf['SYSLOAD_CUSTOM_SCRIPTS'])) { show_window(__('Additional monitoring'), $customScriptsData); } } $top = $globconf['TOP']; $top_output = wf_tag('pre') . shell_exec($top) . wf_tag('pre', true); $uptime = $globconf['UPTIME']; $uptime_output = wf_tag('pre') . shell_exec($uptime) . wf_tag('pre', true); show_window(__('Process'), $top_output); show_window(__('Uptime'), $uptime_output); } else {