Ejemplo n.º 1
0
 public function web_MikbillMigrationNetworksForm($counter)
 {
     $period = array('day' => __('day'), 'month' => __('month'));
     $inputs = wf_TextInput('db_user', __('Database user'), '', true, 20);
     $inputs .= wf_TextInput('db_pass', __('Database password'), '', true, 20);
     $inputs .= wf_TextInput('db_host', __('Database host'), '', true, 20);
     $inputs .= wf_TextInput('db_name', __('Database name'), 'mikbill', true, 20);
     $inputs .= wf_Selector('tariff_period', $period, __('Tariff period'), '', true);
     $inputs .= wf_delimiter();
     $radius = array('0' => __('no'), '1' => __('yes'));
     $nettype = array('dhcpstatic' => 'DHCP static hosts', 'dhcpdynamic' => 'DHCP dynamic hosts', 'dhcp82' => 'DHCP option 82', 'dhcp82_vpu' => 'DHCP option 82 + vlan per user', 'pppstatic' => 'PPP static network', 'pppdynamic' => 'PPP dynamic network', 'other' => 'Other type');
     if (isset($counter)) {
         for ($i = $counter; $i > 0; $i--) {
             $inputs .= wf_TextInput("network[{$i}][start_ip]", __('First IP'), '', true, 26);
             $inputs .= wf_TextInput("network[{$i}][last_ip]", __('Last IP'), '', true, 26);
             $inputs .= wf_TextInput("network[{$i}][net]", __('Network/CIDR'), '', true, 26);
             $inputs .= wf_Selector("network[{$i}][type]", $nettype, __('Network type'), '', true);
             $inputs .= wf_Selector("network[{$i}][radius]", $radius, __('Use Radius'), '', true);
             $inputs .= wf_delimiter();
         }
         $inputs .= wf_Submit(__('Send'));
         $form = wf_Form("", 'POST', $inputs, 'glamour');
         return $form;
     } else {
         return "error netnum is empty";
     }
 }
Ejemplo n.º 2
0
 /**
  * Returns new user service select form
  * 
  * @return string
  */
 function web_IPChangeFormService()
 {
     global $current_ip;
     $inputs = multinet_service_selector() . ' ' . __('New IP service');
     $inputs .= wf_delimiter();
     $inputs .= wf_Submit(__('Save'));
     $result = wf_Form("", 'POST', $inputs, 'floatpanels');
     return $result;
 }
Ejemplo n.º 3
0
/**
 * Shows map container for builds
 *
 * @return void
 */
function um_ShowMapContainer()
{
    $container = wf_tag('div', false, '', 'id="swmap" style="width: 1000; height:800px;"');
    $container .= wf_tag('div', true);
    $controls = wf_Link("?module=switchmap", wf_img('skins/ymaps/network.png') . ' ' . __('Switches map'), false, 'ubButton');
    $controls .= wf_Link("?module=usersmap", wf_img('skins/ymaps/build.png') . ' ' . __('Builds map'), false, 'ubButton');
    $controls .= wf_Link("?module=usersmap&locfinder=true", wf_img('skins/ymaps/edit.png') . ' ' . __('Edit map'), false, 'ubButton');
    $controls .= wf_Link("?module=usersmap&clusterer=true", wf_img('skins/ymaps/cluster.png') . ' ' . __('Clusterer'), false, 'ubButton');
    $controls .= wf_delimiter(1);
    show_window(__('Builds and users map'), $controls . $container);
}
Ejemplo n.º 4
0
 /**
  * returns logout dialog localised template
  * 
  * @return string
  */
 protected function createDialog()
 {
     $autoLogoutTimerContainer = wf_tag('div', false, '', 'id="idledialog" title="' . __('Your session is about to expire!') . '"');
     $autoLogoutTimerContainer .= wf_tag('span', false, 'ui-icon ui-icon-alert', 'style="float:left; margin:0 7px 50px 0;"') . wf_tag('span', true);
     $autoLogoutTimerContainer .= __('You will be logged off in') . ' ';
     $autoLogoutTimerContainer .= wf_tag('span', false, '', 'id="dialog-countdown" style="font-weight:bold"') . wf_tag('span', true);
     $autoLogoutTimerContainer .= ' ' . __('seconds') . wf_delimiter();
     $autoLogoutTimerContainer .= wf_tag('center', false) . wf_tag('img', false, '', 'src="skins/idleicon.gif" width="160"') . wf_tag('center', true);
     $autoLogoutTimerContainer .= wf_tag('div', true);
     return $autoLogoutTimerContainer;
 }
Ejemplo n.º 5
0
 function web_AnnihilateFormShow($login)
 {
     $alladdress = zb_AddressGetFulladdresslist();
     $inputs = __('Be careful, this module permanently deletes user and all data associated with it. Opportunities to raise from the dead no longer.');
     $inputs .= wf_tag('br');
     $inputs .= __('To ensure that we have seen the seriousness of your intentions to enter the word сonfirm the field below.');
     $inputs .= wf_tag('br');
     $inputs .= wf_tag('input', false, '', 'type="text" name="confirmation" autocomplete="off"');
     $inputs .= wf_HiddenInput('anihilation', 'true');
     $inputs .= wf_delimiter();
     $inputs .= wf_Submit(__('I really want to stop suffering User'));
     $form = wf_Form('', 'POST', $inputs, 'glamour');
     show_window(__('Deleting user') . ' ' . @$alladdress[$login] . ' (' . $login . ')', $form);
 }
Ejemplo n.º 6
0
 /**
  * Generates HTML-code of Yandex.Maps control buttons
  * 
  * @return  string  HTML-code of Yandex.Maps control buttons
  */
 private function map_controls()
 {
     // Controls:
     $this->html .= wf_Link(self::URL_MARK_TYPES_LIST, __('Types of marks'), false, 'ubButton');
     $this->html .= wf_Link(self::URL_MARKS_LIST, __('VOLS marks'), false, 'ubButton');
     $this->html .= wf_Link(self::URL_LINES_LIST, __('VOLS lines'), false, 'ubButton');
     switch (true) {
         case strpos($_SERVER['REQUEST_URI'], self::URL_MAP_EDIT) !== false:
         case strpos($_SERVER['REQUEST_URI'], self::URL_MARK_PLACE) !== false:
         case strpos($_SERVER['REQUEST_URI'], self::URL_LINE_PLACE) !== false:
             $this->html .= wf_Link(self::URL_MAP_SHOW, __('Save'), false, 'ubButton');
             break;
         default:
             $this->html .= wf_Link(self::URL_MAP_EDIT, __('Edit'), false, 'ubButton');
             break;
     }
     $this->html .= wf_delimiter(1);
     return $this->html;
 }
Ejemplo n.º 7
0
 function ts_EmployeeMonthGraphs()
 {
     $curmonth = curmonth();
     $employees = ts_GetAllEmployee();
     $month_jobs_q = "SELECT `workerid`,`jobid` from `jobs` WHERE `date` LIKE '" . $curmonth . "%'";
     $alljobs = simple_queryall($month_jobs_q);
     $jobtypes = ts_GetAllJobtypes();
     $jobdata = array();
     $result = '';
     if (!empty($employees)) {
         if (!empty($alljobs)) {
             foreach ($alljobs as $io => $eachjob) {
                 if (isset($jobdata[$eachjob['workerid']][$eachjob['jobid']])) {
                     $jobdata[$eachjob['workerid']][$eachjob['jobid']]++;
                 } else {
                     $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;
 }
Ejemplo n.º 8
0
/**
 * Returns typical answer preset insertion form
 * 
 * @return string
 */
function web_TicketsTAPLister()
{
    $result = '';
    $maxLen = 50;
    $allReplies = zb_TicketsTAPgetAll();
    if (!empty($allReplies)) {
        $result .= wf_delimiter() . wf_tag('h3') . __('Typical answers presets') . wf_tag('h3', true);
        $result .= wf_tag('ul', false);
        foreach ($allReplies as $io => $each) {
            $randId = wf_InputId();
            $rawText = trim($each);
            $result .= wf_tag('script', false, '', 'language="javascript" type="text/javascript"');
            $result .= '
                    function jsAddReplyText_' . $randId . '() {
                         var replytext=\'' . json_encode($rawText) . '\';
                         $("#ticketreplyarea").val(replytext);
                    }
                    ';
            $result .= wf_tag('script', true);
            $linkText = htmlspecialchars($rawText);
            if (mb_strlen($linkText, 'UTF-8') > $maxLen) {
                $linkText = mb_substr($rawText, 0, $maxLen, 'UTF-8') . '..';
            } else {
                $linkText = $rawText;
            }
            $result .= wf_tag('li') . wf_tag('a', false, '', 'href="#" onClick="jsAddReplyText_' . $randId . '();"') . $linkText . wf_tag('a', true) . wf_tag('li', true);
        }
        $result .= wf_tag('ul', true);
    }
    return $result;
}
Ejemplo n.º 9
0
                simple_update_field('switches', 'snmp', $_POST['editsnmp'], "WHERE `id`='" . $switchid . "'");
                simple_update_field('switches', 'geo', $_POST['editgeo'], "WHERE `id`='" . $switchid . "'");
                if ($_POST['editparentid'] != $switchid) {
                    simple_update_field('switches', 'parentid', $_POST['editparentid'], "WHERE `id`='" . $switchid . "'");
                }
                log_register('SWITCH CHANGE [' . $switchid . ']' . ' IP ' . $_POST['editip'] . " LOC `" . $_POST['editlocation'] . "`");
                rcms_redirect("?module=switches&edit=" . $switchid);
            } else {
                show_error(__('Access denied'));
            }
        }
        //render switch edit form
        show_window(__('Edit switch'), web_SwitchEditForm($switchid));
        //minimap container
        if ($altCfg['SWYMAP_ENABLED']) {
            if (!empty($switchdata['geo'])) {
                show_window(__('Mini-map'), wf_delimiter() . web_SwitchMiniMap($switchdata));
            }
        }
        //downlinks list
        web_SwitchDownlinksList($switchid);
        //additional comments engine
        if ($altCfg['ADCOMMENTS_ENABLED']) {
            $adcomments = new ADcomments('SWITCHES');
            show_window(__('Additional comments'), $adcomments->renderComments($switchid));
        }
        show_window('', wf_Link('?module=switches', 'Back', true, 'ubButton'));
    }
} else {
    show_error(__('Access denied'));
}
Ejemplo n.º 10
0
 /**
  * renders tariffs popularity report
  * 
  * @return void
  */
 public function reportTariffs()
 {
     $tariffArr = array();
     $tariffUsers = array();
     $tariffCounter = array();
     $userTotalCount = sizeof($this->users);
     $result = '';
     if (!empty($this->tariffs)) {
         foreach ($this->tariffs as $io => $each) {
             $tariffArr[$each['id']] = $each['tariffname'];
             $tariffCounter[$each['id']]['all'] = 0;
             $tariffCounter[$each['id']]['alive'] = 0;
         }
     }
     if (!empty($tariffArr) and !empty($this->users)) {
         foreach ($this->users as $io => $eachUser) {
             if (!empty($eachUser['tariffid'])) {
                 $tariffUsers[$eachUser['tariffid']][] = $eachUser;
                 $tariffCounter[$eachUser['tariffid']]['all'] = $tariffCounter[$eachUser['tariffid']]['all'] + 1;
                 if ($eachUser['active']) {
                     $tariffCounter[$eachUser['tariffid']]['alive'] = $tariffCounter[$eachUser['tariffid']]['alive'] + 1;
                 }
             }
         }
     }
     //tariff summary grid
     $cells = wf_TableCell(__('Tariff'));
     $cells .= wf_TableCell(__('Total'));
     $cells .= wf_TableCell(__('Visual'));
     $cells .= wf_TableCell(__('Active'));
     $rows = wf_TableRow($cells, 'row1');
     foreach ($tariffArr as $tariffId => $tariffName) {
         $tariffLink = wf_Link(self::URL_REPORTS_MGMT . 'reportTariffs&showtariffusers=' . $tariffId, $tariffName);
         $cells = wf_TableCell($tariffLink);
         $cells .= wf_TableCell($tariffCounter[$tariffId]['all']);
         $cells .= wf_TableCell(web_bar($tariffCounter[$tariffId]['all'], $userTotalCount));
         $cells .= wf_TableCell(web_barTariffs($tariffCounter[$tariffId]['alive'], $tariffCounter[$tariffId]['all'] - $tariffCounter[$tariffId]['alive']));
         $rows .= wf_TableRow($cells, 'row3');
     }
     $result .= wf_TableBody($rows, '100%', '0', 'sortable');
     //show per tariff users
     if (wf_CheckGet(array('showtariffusers'))) {
         $tariffSearch = vf($_GET['showtariffusers'], 3);
         if (isset($tariffUsers[$tariffSearch])) {
             if (!empty($tariffUsers[$tariffSearch])) {
                 $result .= wf_delimiter();
                 $result .= wf_tag('h2') . __('Tariff') . ': ' . $tariffArr[$tariffSearch] . wf_tag('h2', true);
                 $cells = wf_TableCell(__('Contract'), '10%');
                 $cells .= wf_TableCell(__('Full address'), '31%');
                 $cells .= wf_TableCell(__('Real Name'), '30%');
                 $cells .= wf_TableCell(__('Tariff'), '15%');
                 $cells .= wf_TableCell(__('Cash'), '7%');
                 $cells .= wf_TableCell(__('Status'), '7%');
                 $rows = wf_TableRow($cells, 'row1');
                 foreach ($tariffUsers[$_GET['showtariffusers']] as $io => $eachUser) {
                     $cells = wf_TableCell($eachUser['contract']);
                     $fullAddress = $this->userGetFullAddress($eachUser['id']);
                     $profileLink = wf_Link(self::URL_USERS_PROFILE . $eachUser['id'], web_profile_icon() . ' ', false, '');
                     $cells .= wf_TableCell($profileLink . $fullAddress);
                     $cells .= wf_TableCell($eachUser['realname']);
                     $cells .= wf_TableCell($this->tariffs[$eachUser['tariffid']]['tariffname']);
                     $cells .= wf_TableCell($eachUser['cash']);
                     $cells .= wf_TableCell(web_bool_led($eachUser['active'], true));
                     $rows .= wf_TableRow($cells, 'row3');
                 }
                 $result .= wf_TableBody($rows, '100%', '0', 'sortable');
             }
         }
         $printableControl = wf_Link(self::URL_REPORTS_MGMT . 'reportTariffs&showtariffusers=' . $tariffSearch . '&printable=true', wf_img('skins/icon_print.png', __('Print')));
     } else {
         $printableControl = wf_Link(self::URL_REPORTS_MGMT . 'reportTariffs&printable=true', wf_img('skins/icon_print.png', __('Print')));
     }
     if (!wf_CheckGet(array('printable'))) {
         show_window(__('Tariffs report') . ' ' . $printableControl, $result);
     } else {
         $this->reportPrintable(__('Tariffs report'), $result);
     }
 }
Ejemplo n.º 11
0
function dhcp_show_edit_form($dhcpid)
{
    $dhcpid = vf($dhcpid);
    $dhcpnetdata = dhcp_get_data($dhcpid);
    $form = '
            <form action="" method="POST">
            <input type="text" name="editdhcpconfname" value="' . $dhcpnetdata['confname'] . '"> ' . __('DHCP config name') . ' <br>
            ' . __('DHCP custom subnet template') . ' <br>    
            <textarea name="editdhcpconfig" cols="50" rows="10">' . $dhcpnetdata['dhcpconfig'] . '</textarea>   
            <br>    
            <input type="button" value="' . __('Cleanup') . '" onclick="this.form.elements[\'editdhcpconfig\'].value=\'\'">
            <input type="submit" value="' . __('Save') . '">    
            </form>
            ';
    $form .= wf_delimiter();
    $form .= wf_Link("?module=dhcp", __('Back'), false, 'ubButton');
    show_window(__('Edit custom subnet template'), $form);
}
Ejemplo n.º 12
0
 /**
  * loads pofile plugins if enabled into private plugins property
  * 
  * @return void
  */
 protected function loadPlugins()
 {
     if (!empty($this->login)) {
         $rawPlugins = $this->loadPluginsRaw('plugins.ini');
         if (!empty($rawPlugins)) {
             foreach ($rawPlugins as $modulename => $eachplugin) {
                 if (isset($eachplugin['overlay'])) {
                     $overlaydata = $this->loadPluginsOverlay($eachplugin['overlaydata']) . wf_delimiter();
                     $this->plugins .= wf_modal(wf_img_sized('skins/' . $eachplugin['icon'], __($eachplugin['name']), '', self::MAIN_PLUGINS_SIZE), __($eachplugin['name']), $overlaydata, '', 850, 650);
                 } else {
                     $this->plugins .= wf_Link('?module=' . $modulename . '&username='******'skins/' . $eachplugin['icon'], __($eachplugin['name']), '', self::MAIN_PLUGINS_SIZE), false, '') . wf_delimiter();
                 }
             }
         }
     }
 }
Ejemplo n.º 13
0
if (cfr('REPORTTARIFFS')) {
    $altCfg = $ubillingConfig->getAlter();
    $chartsCache = new UbillingCache();
    show_window(__('Popularity of tariffs among users'), web_TariffShowReport());
    show_window(__('Planned tariff changes'), web_TariffShowMoveReport());
    if (!isset($altCfg['GCHARTS_ENABLED'])) {
        $chartsEnabled = true;
    } else {
        if ($altCfg['GCHARTS_ENABLED']) {
            $chartsEnabled = true;
        } else {
            $chartsEnabled = false;
        }
    }
    //google charts
    if ($chartsEnabled) {
        $cachingTime = 3600;
        $moveCharts = $chartsCache->getCallback('REPORT_TARIFFS_MOVECHART', function () {
            return web_TariffShowMoveCharts();
        }, $cachingTime);
        $tariffCharts = $chartsCache->getCallback('REPORT_TARIFFS_TARIFFHCHART', function () {
            return web_TariffShowTariffCharts();
        }, $cachingTime);
        //rendering charts
        show_window(__('Graphs'), $tariffCharts . wf_delimiter() . $moveCharts);
        zb_BillingStats(true);
    }
} else {
    show_error(__('You cant control this module'));
}
Ejemplo n.º 14
0
 function web_TsmsExcludeOpts()
 {
     $excludedUsers = tsms_GetExcludeUsers();
     $alladdress = zb_AddressGetFulladdresslist();
     $allrealnames = zb_UserGetAllRealnames();
     $allphones = tsms_GetAllMobileNumbers();
     $cells = wf_TableCell(__('Login'));
     $cells .= wf_TableCell(__('Full address'));
     $cells .= wf_TableCell(__('Real Name'));
     $cells .= wf_TableCell(__('Phone'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($excludedUsers)) {
         foreach ($excludedUsers as $eachlogin => $io) {
             $cells = wf_TableCell(wf_Link("?module=userprofile&username="******"?module=turbosms&excludedelete=" . $eachlogin, web_delete_icon(), __('Are you serious')));
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     //adding form
     $inputs = wf_TextInput('newexcludelogin', __('User login to exclude from sending'), '', true, '15');
     $inputs .= wf_Submit('Save');
     $result = wf_TableBody($rows, '100%', '0', 'sortable');
     $result .= wf_delimiter();
     $result .= wf_Form("", 'POST', $inputs, 'glamour');
     return $result;
 }
Ejemplo n.º 15
0
 } else {
     show_window(__('Developer Console'), $phpgrid);
 }
 // SQL console processing
 if (isset($_POST['sqlq'])) {
     $newquery = trim($_POST['sqlq']);
     if (!empty($newquery)) {
         $stripquery = substr($newquery, 0, 70) . '..';
         log_register('SQLCONSOLE ' . $stripquery);
         ob_start();
         // commented due Den1xxx patch
         // $query_result=simple_queryall($newquery);
         $queried = mysql_query($newquery);
         if ($queried === false) {
             ob_end_clean();
             return show_window('SQL ' . __('Result'), wf_tag('b') . __('Wrong query') . ':' . wf_tag('b', true) . wf_delimiter() . $newquery);
         } else {
             while (@($row = mysql_fetch_assoc($queried))) {
                 $query_result[] = $row;
             }
             $sqlDebugData = ob_get_contents();
             ob_end_clean();
             log_register('SQLCONSOLE QUERYDONE');
             if ($alterconf['DEVCON_VERBOSE_DEBUG']) {
                 show_window(__('Console debug data'), $sqlDebugData);
             }
         }
         //end of wrong query exeption patch
         if (!empty($query_result)) {
             if (!isset($_POST['tableresult'])) {
                 //raw array result
Ejemplo n.º 16
0
 function web_PayFindForm()
 {
     //try to save calendar states
     if (wf_CheckPost(array('datefrom', 'dateto'))) {
         $curdate = $_POST['dateto'];
         $yesterday = $_POST['datefrom'];
     } else {
         $curdate = date("Y-m-d", time() + 60 * 60 * 24);
         $yesterday = curdate();
     }
     $inputs = __('Date');
     $inputs .= wf_DatePickerPreset('datefrom', $yesterday) . ' ' . __('From');
     $inputs .= wf_DatePickerPreset('dateto', $curdate) . ' ' . __('To');
     $inputs .= wf_delimiter();
     $inputs .= wf_CheckInput('type_payid', '', false, false);
     $inputs .= wf_TextInput('payid', __('Search by payment ID'), '', true, '10');
     $inputs .= wf_CheckInput('type_contract', '', false, false);
     $inputs .= wf_TextInput('contract', __('Search by users contract'), '', true, '10');
     $inputs .= wf_CheckInput('type_login', '', false, false);
     $inputs .= wf_TextInput('login', __('Search by users login'), '', true, '10');
     $inputs .= wf_CheckInput('type_summ', '', false, false);
     $inputs .= wf_TextInput('summ', __('Search by payment sum'), '', true, '10');
     $inputs .= wf_CheckInput('type_cashtype', '', false, false);
     $inputs .= web_CashTypeSelector() . wf_tag('label', false, '', 'for="cashtype"') . __('Search by cash type') . wf_tag('label', true) . wf_tag('br');
     $inputs .= wf_CheckInput('type_cashier', '', false, false);
     $inputs .= web_PayFindCashierSelector();
     $inputs .= wf_CheckInput('type_tagid', '', false, false);
     $inputs .= web_PayFindTagidSelector();
     $inputs .= wf_CheckInput('type_paysys', '', false, false);
     $inputs .= web_PaySysPercentSelector();
     $inputs .= wf_Link("?module=payfind&confpaysys=true", __('Settings')) . wf_tag('br');
     $inputs .= wf_CheckInput('only_positive', __('Show only positive payments'), true, false);
     $inputs .= wf_CheckInput('numeric_notes', __('Show payments with numeric notes'), true, false);
     $inputs .= wf_CheckInput('numericonly_notes', __('Show payments with only numeric notes'), true, false);
     //ugly spacing hack
     $inputs .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;' . web_PayFindTableSelect() . wf_delimiter();
     $inputs .= wf_HiddenInput('dosearch', 'true');
     $inputs .= wf_Submit(__('Search'));
     $result = wf_Form('', 'POST', $inputs, 'glamour');
     $result .= wf_Link("?module=report_finance", __('Back'), true, 'ubButton');
     return $result;
 }
Ejemplo n.º 17
0
 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'));
     }
 }
Ejemplo n.º 18
0
 /**
  * Returns nethost option modify form
  * 
  * @param $allLeases - all available leases parsed from log
  * @param $login - user`s  login 
  * 
  * @return string
  */
 function web_opt82_ShowForm($allLeases, $login)
 {
     $result = '';
     $currentData = opt82_GetCurrentOptions($login);
     $cells = wf_TableCell(__('IP'));
     $cells .= wf_TableCell($currentData['hostip']);
     $rows = wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Remote-ID'));
     $cells .= wf_TableCell($currentData['remoteid']);
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Circuit-ID'));
     $cells .= wf_TableCell($currentData['circuitid']);
     $rows .= wf_TableRow($cells, 'row3');
     $currentTable = wf_TableBody($rows, '30%', '0', '');
     $result .= $currentTable;
     $result .= wf_delimiter();
     $inputs = wf_Selector('newopt82', $allLeases, __('New DHCP option 82'), '', true);
     $inputs .= wf_HiddenInput('edithostid', $currentData['hostid']);
     $inputs .= wf_HiddenInput('edithostip', $currentData['hostip']);
     $inputs .= wf_CheckInput('setrandomopt82', __('Set random'), true, false);
     $inputs .= wf_Submit(__('Save'));
     $form = wf_Form('', 'POST', $inputs, 'glamour');
     $result .= $form;
     $result .= wf_delimiter();
     $result .= web_UserControls($login);
     return $result;
 }
Ejemplo n.º 19
0
/**
 * Returns custom contract search form
 * 
 * @global object $ubillingConfig
 * @return string
 */
function web_UserSearchContractForm()
{
    $result = '';
    global $ubillingConfig;
    $altercfg = $ubillingConfig->getAlter();
    if (isset($altercfg['SEARCH_CUSTOM_CONTRACT'])) {
        if ($altercfg['SEARCH_CUSTOM_CONTRACT']) {
            $result .= wf_tag('h3') . __('Contract search') . wf_tag('h3', true);
            $inputs = wf_TextInput('searchquery', '', '', false);
            $inputs .= wf_HiddenInput('searchtype', 'contract');
            $inputs .= wf_Submit(__('Search'));
            $result .= wf_Form("", 'POST', $inputs, '');
            $result .= wf_delimiter();
        }
    }
    return $result;
}
Ejemplo n.º 20
0
/**
 * Returns users passport data 
 * 
 * @param string $login
 * @return string
 */
function web_UserPassportDataShow($login)
{
    $login = mysql_real_escape_string($login);
    $passportdata = zb_UserPassportDataGet($login);
    if (!empty($passportdata)) {
        $cells = wf_TableCell(__('Birth date'));
        $cells .= wf_TableCell($passportdata['birthdate']);
        $rows = wf_TableRow($cells, 'row3');
        $cells = wf_TableCell(__('Passport number'));
        $cells .= wf_TableCell($passportdata['passportnum']);
        $rows .= wf_TableRow($cells, 'row3');
        $cells = wf_TableCell(__('Issuing authority'));
        $cells .= wf_TableCell($passportdata['passportwho']);
        $rows .= wf_TableRow($cells, 'row3');
        $cells = wf_TableCell(__('Date of issue'));
        $cells .= wf_TableCell($passportdata['passportdate']);
        $rows .= wf_TableRow($cells, 'row3');
        $cells = wf_TableCell(__('Registration address'));
        $cells .= wf_TableCell($passportdata['pcity'] . ' ' . $passportdata['pstreet'] . ' ' . $passportdata['pbuild'] . '/' . $passportdata['papt']);
        $rows .= wf_TableRow($cells, 'row3');
        $result = wf_TableBody($rows, '100%', '0');
    } else {
        $result = __('User passport data is empty') . ' ' . __('You can fill them with the appropriate module');
    }
    if (cfr('PDATA')) {
        $result .= wf_delimiter();
        $result .= wf_Link("?module=pdataedit&username=" . $login, __('Edit') . ' ' . __('passport data'), false, 'ubButton');
    }
    return $result;
}
Ejemplo n.º 21
0
/**
 * Returns task typical problems editing form
 * 
 * @return string
 */
function ts_TaskProblemsEditForm()
{
    $rawNotes = zb_StorageGet('PROBLEMS');
    //extract old or create new typical problems array
    if (!empty($rawNotes)) {
        $rawNotes = base64_decode($rawNotes);
        $rawNotes = unserialize($rawNotes);
    } else {
        $emptyArray = array();
        $newNotes = serialize($emptyArray);
        $newNotes = base64_encode($newNotes);
        zb_StorageSet('PROBLEMS', $newNotes);
        $rawNotes = $emptyArray;
    }
    //adding and deletion subroutines
    if (wf_CheckPost(array('createtypicalnote'))) {
        $toPush = strip_tags($_POST['createtypicalnote']);
        array_push($rawNotes, $toPush);
        $newNotes = serialize($rawNotes);
        $newNotes = base64_encode($newNotes);
        zb_StorageSet('PROBLEMS', $newNotes);
        log_register('TASKMAN ADD TYPICALPROBLEM');
        rcms_redirect("?module=taskman&probsettings=true");
    }
    if (wf_CheckPost(array('deletetypicalnote', 'typicalnote'))) {
        $toUnset = $_POST['typicalnote'];
        if (($delkey = array_search($toUnset, $rawNotes)) !== false) {
            unset($rawNotes[$delkey]);
        }
        $newNotes = serialize($rawNotes);
        $newNotes = base64_encode($newNotes);
        zb_StorageSet('PROBLEMS', $newNotes);
        log_register('TASKMAN DELETE TYPICALPROBLEM');
        rcms_redirect("?module=taskman&probsettings=true");
    }
    $rows = '';
    $result = wf_Link("?module=taskman", __('Back'), true, 'ubButton');
    if (!empty($rawNotes)) {
        foreach ($rawNotes as $eachNote) {
            $cells = wf_TableCell($eachNote);
            $rows .= wf_TableRow($cells, 'row3');
        }
    }
    $result .= wf_TableBody($rows, '100%', '0', '');
    $result .= wf_delimiter();
    $addinputs = wf_TextInput('createtypicalnote', __('Create'), '', true, '20');
    $addinputs .= wf_Submit(__('Save'));
    $addform = wf_Form("", "POST", $addinputs, 'glamour');
    $result .= $addform;
    $delinputs = ts_TaskTypicalNotesSelector(false);
    $delinputs .= wf_HiddenInput('deletetypicalnote', 'true');
    $delinputs .= wf_Submit(__('Delete'));
    $delform = wf_Form("", "POST", $delinputs, 'glamour');
    $result .= $delform;
    return $result;
}
Ejemplo n.º 22
0
 /**
  * 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);
 }
Ejemplo n.º 23
0
 /**
  * Renders per-payment system openpayz transaction charts
  * 
  * @return string
  */
 public function renderGraphs()
 {
     $psysdata = array();
     $gcAllData = array();
     $gcMonthData = array();
     $result = wf_Link('?module=openpayz', __('Back'), true, 'ubButton');
     if (!empty($this->allTransactions)) {
         foreach ($this->allTransactions as $io => $each) {
             $timestamp = strtotime($each['date']);
             $curMonth = curmonth();
             $date = date("Y-m-01", $timestamp);
             if (isset($psysdata[$each['paysys']][$date]['count'])) {
                 $psysdata[$each['paysys']][$date]['count']++;
                 $psysdata[$each['paysys']][$date]['summ'] = $psysdata[$each['paysys']][$date]['summ'] + $each['summ'];
             } else {
                 $psysdata[$each['paysys']][$date]['count'] = 1;
                 $psysdata[$each['paysys']][$date]['summ'] = $each['summ'];
             }
             //all time stats
             if (isset($gcAllData[$each['paysys']])) {
                 $gcAllData[$each['paysys']]++;
             } else {
                 $gcAllData[$each['paysys']] = 1;
             }
             //current month stats
             if (ispos($date, $curMonth . '-')) {
                 if (isset($gcMonthData[$each['paysys']])) {
                     $gcMonthData[$each['paysys']]++;
                 } else {
                     $gcMonthData[$each['paysys']] = 1;
                 }
             }
         }
     }
     $chartOpts = "chartArea: {  width: '90%', height: '90%' }, legend : {position: 'right'}, ";
     if (!empty($gcAllData)) {
         $gcAllPie = wf_gcharts3DPie($gcAllData, __('All time'), '400px', '400px', $chartOpts);
     } else {
         $gcAllPie = '';
     }
     if (!empty($gcMonthData)) {
         $gcMonthPie = wf_gcharts3DPie($gcMonthData, __('Current month'), '400px', '400px', $chartOpts);
     } else {
         $gcMonthPie = '';
     }
     $gcells = wf_TableCell($gcAllPie);
     $gcells .= wf_TableCell($gcMonthPie);
     $grows = wf_TableRow($gcells);
     $result .= wf_TableBody($grows, '100%', 0, '');
     if (!empty($psysdata)) {
         foreach ($psysdata as $psys => $opdate) {
             $gdata = __('Date') . ',' . __('Count') . ',' . __('Cash') . "\n";
             foreach ($opdate as $datestamp => $optrans) {
                 $gdata .= $datestamp . ',' . $optrans['count'] . ',' . $optrans['summ'] . "\n";
             }
             $result .= wf_tag('div', false, '', '');
             $result .= wf_tag('h2') . $psys . wf_tag('h2', true) . wf_delimiter();
             $result .= wf_Graph($gdata, '800', '200', false);
             $result .= wf_tag('div', true);
         }
     }
     return $result;
 }
Ejemplo n.º 24
0
 /**
  * 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;
 }
Ejemplo n.º 25
0
             if (method_exists($corps, $beggar['METH']['RENDER'])) {
                 show_window(__('Available corps'), $corps->{$beggar}['METH']['RENDER']());
             }
         }
     }
 }
 //user management
 if ($route == Corps::URL_USER) {
     if (wf_CheckGet(array('username'))) {
         $login = mysql_real_escape_string($_GET['username']);
         $userCorpCheck = $corps->userIsCorporate($login);
         if ($userCorpCheck) {
             //enterprise user
             $corpsControls = $corps->corpPreview($userCorpCheck);
             $corpsControls .= wf_Link(Corps::URL_CORPS_EDIT . $userCorpCheck . '&usercallback=' . $login, web_edit_icon() . ' ' . __('Edit'), true, 'ubButton');
             $corpsControls .= wf_delimiter();
             $corpsControls .= web_UserControls($login);
             show_window(__('Corporate user'), $corpsControls);
         } else {
             //user is private
             if (wf_CheckPost(array('bindsomelogin', 'bindlogintocorpid'))) {
                 $corps->userBind($_POST['bindsomelogin'], $_POST['bindlogintocorpid']);
                 rcms_redirect(Corps::URL_USER_MANAGE . $_POST['bindsomelogin']);
             }
             if (method_exists($corps, $beggar['BU']['F'])) {
                 $corpAttachControls = $corps->{$beggar}['BU']['F']($login);
                 show_window(__('Private user'), $corpAttachControls);
             }
             if (method_exists($corps, $beggar['BU']['AB'])) {
                 $corpAddAttachControls = $corps->{$beggar}['BU']['AB']($login);
                 show_window(__('Create') . ' ' . __('Corporate user'), $corpAddAttachControls);
Ejemplo n.º 26
0
/**
 * Returns NP switches replacement form
 * 
 * @param int $fromSwitchId
 * 
 * @return string
 */
function zb_SwitchReplaceForm($fromSwitchId)
{
    $fromSwitchId = vf($fromSwitchId, 3);
    $result = '';
    $query = "SELECT * from `switches` WHERE `desc` LIKE '%NP%' ORDER BY `id` DESC";
    $raw = simple_queryall($query);
    $paramsNp = array();
    $employee = array();
    $employee = ts_GetActiveEmployee();
    if (!empty($raw)) {
        foreach ($raw as $io => $eachNp) {
            $paramsNp[$eachNp['id']] = $eachNp['location'] . ' - ' . $eachNp['ip'];
        }
    }
    $inputs = wf_HiddenInput('switchreplace', $fromSwitchId);
    $inputs .= wf_Selector('toswtichreplace', $paramsNp, 'NP ' . __('Switch'), '', false);
    $inputs .= wf_Selector('replaceemployeeid', $employee, __('Worker'), '', false);
    $inputs .= wf_Submit('Save');
    $result = wf_Form('', 'POST', $inputs, 'glamour');
    $result .= wf_CleanDiv();
    $result .= wf_delimiter();
    $result .= wf_Link('?module=switches&edit=' . $fromSwitchId, __('Back'), false, 'ubButton');
    return $result;
}
Ejemplo n.º 27
0
/**
 * Returns street creation form
 * 
 * @return string
 */
function web_StreetCreateForm()
{
    $cities = simple_query("SELECT `id` from `city`");
    if (!empty($cities)) {
        $inputs = web_CitySelector() . ' ' . __('City') . wf_delimiter();
        $inputs .= wf_TextInput('newstreetname', __('New Street name') . wf_tag('sup') . '*' . wf_tag('sup', true), '', true, '20');
        $inputs .= wf_TextInput('newstreetalias', __('New Street alias'), '', true, '20');
        $inputs .= wf_Submit(__('Create'));
        $form = wf_Form('', 'POST', $inputs, 'glamour');
    } else {
        $form = __('No added cities - they will need to create a street');
    }
    return $form;
}
Ejemplo n.º 28
0
 function web_AskoziaConfigForm()
 {
     global $askoziaUrl, $askoziaLogin, $askoziaPassword, $askoziaCacheTime;
     $result = wf_Link('?module=askozia', __('Back'), true, 'ubButton') . wf_delimiter();
     $inputs = wf_TextInput('newurl', __('AskoziaPBX URL'), $askoziaUrl, true);
     $inputs .= wf_TextInput('newlogin', __('Administrator login'), $askoziaLogin, true);
     $inputs .= wf_TextInput('newpassword', __('Password'), $askoziaPassword, true);
     $inputs .= wf_TextInput('newcachetime', __('Cache time'), $askoziaCacheTime, true);
     $inputs .= wf_Submit(__('Save'));
     $result .= wf_Form("", "POST", $inputs, 'glamour');
     return $result;
 }
Ejemplo n.º 29
0
                        $tablecells = wf_TableCell($profilelink);
                        $tablecells .= wf_TableCell($realname);
                        $tablecells .= wf_TableCell($usertariff);
                        $tablecells .= wf_TableCell($userip);
                        $tablecells .= wf_TableCell($eachmac);
                        $tablecells .= wf_TableCell($displaysig);
                        $tablerows .= wf_TableRow($tablecells, $rowclass);
                    }
                    $result .= wf_TableBody($tablerows, '100%', '0', 'sortable');
                } else {
                    $result .= __('Empty reply received');
                }
                $result .= wf_tag('div', false, '', 'style="clear:both;"') . wf_tag('div', true);
                $result .= wf_tag('div', false, 'glamour') . __('Total') . ': ' . $userCounter . wf_tag('div', true);
                $result .= wf_tag('div', false, '', 'style="clear:both;"') . wf_tag('div', true);
                $result .= wf_delimiter();
            }
        } else {
            $result = __('No devices for signal monitoring found');
        }
        //if called as an user profile plugin
        if (isset($_GET['username'])) {
            $result .= wf_Link('?module=userprofile&username='******'username'], __('Back'), true, 'ubButton');
        }
        //show final result
        show_window(__('Mikrotik signal monitor'), $result);
    } else {
        show_error(__('This module disabled'));
    }
} else {
    show_error(__('You cant control this module'));
Ejemplo n.º 30
0
/**
 * Shows thread for me with some user
 * 
 * @param string $threadUser  user to show thread
 * 
 * @return string
 */
function im_ThreadShow($threadUser)
{
    global $ubillingConfig;
    $altCfg = $ubillingConfig->getAlter();
    $me = whoami();
    @($employeeNames = unserialize(ts_GetAllEmployeeLoginsCached()));
    $threadUser = mysql_real_escape_string($threadUser);
    $adminName = isset($employeeNames[$threadUser]) ? $employeeNames[$threadUser] : $threadUser;
    $result = __('No conversations with') . ' ' . $adminName . ' ' . __('yet') . wf_delimiter();
    $rows = '';
    $query = "SELECT * from `ub_im` WHERE (`to`='" . $me . "' AND `from`='" . $threadUser . "')  OR (`to`='" . $threadUser . "' AND `from`='" . $me . "') ORDER BY `date` DESC";
    $alldata = simple_queryall($query);
    if (!empty($alldata)) {
        foreach ($alldata as $io => $each) {
            //read icon
            $readIcon = $each['read'] == '0' ? wf_img("skins/icon_inactive.gif", __('Unread message')) : '';
            $fromName = isset($employeeNames[$each['from']]) ? $employeeNames[$each['from']] : $each['from'];
            $cells = wf_TableCell(wf_tag('b') . $fromName . wf_tag('b', true), '20%', '', 'align="center"');
            $cells .= wf_TableCell($each['date'] . ' ' . $readIcon, '80%');
            $rows .= wf_TableRow($cells, 'row2');
            $messageText = nl2br($each['text']);
            if (!isset($altCfg['UBIM_NO_LINKIFY'])) {
                $messageText = im_linkify($messageText);
            } else {
                if (!$altCfg['UBIM_NO_LINKIFY']) {
                    $messageText = im_linkify($messageText);
                }
            }
            $cells = wf_TableCell(gravatar_ShowAdminAvatar($each['from'], '64'), '', 'row3', 'align="center"');
            $cells .= wf_TableCell($messageText, '', 'row3');
            $rows .= wf_TableRow($cells);
        }
        $result = wf_TableBody($rows, '100%', '0');
        //mark all unread messages as read now
        im_ThreadMarkAsRead($threadUser);
    }
    return $result;
}