Example #1
0
/**
 *  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;
}
Example #2
0
/**
 * 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;
}
Example #3
0
 /**
  * Renders user profile with all loaded data
  * 
  * @return string
  */
 public function render()
 {
     //all configurable features must be received via getters
     $profile = '';
     //activity and other flags
     $passiveicon = $this->userdata['Passive'] ? wf_img_sized('skins/icon_passive.gif', '', '', '12') . ' ' : '';
     $downicon = $this->userdata['Down'] ? wf_img_sized('skins/icon_down.gif', '', '', '12') . ' ' : '';
     $activity = $this->userdata['Cash'] < '-' . $this->userdata['Credit'] ? wf_img_sized('skins/icon_inactive.gif', '', '', '12') . ' ' . __('No') : wf_img_sized('skins/icon_active.gif', '', '', '12') . ' ' . __('Yes');
     // user linking controller
     $profile .= $this->getUserLinking();
     $profile .= wf_tag('table', false, '', self::MAIN_TABLE_STYLE);
     //external profile container
     $profile .= wf_tag('tbody', false);
     $profile .= wf_tag('tr', false);
     $profile .= wf_tag('td', false, '', 'valign="top"');
     $profile .= wf_tag('table', false, '', self::MAIN_TABLE_STYLE);
     //main profile data
     $profile .= wf_tag('tbody', false);
     //address row and controls
     $profile .= $this->addRow(__('Full address') . $this->getTaskCreateControl(), $this->useraddress . $this->getBuildControls());
     //apt data like floor and entrance row
     $profile .= $this->addRow(__('Entrance') . ', ' . __('Floor'), @$this->aptdata['entrance'] . ' ' . @$this->aptdata['floor']);
     //realname row
     $profile .= $this->addRow(__('Real name') . $this->getPhotostorageControls() . $this->getPassportDataControl(), $this->realname, true);
     //contract row
     $profile .= $this->addRow(__('Contract'), $this->contract, false);
     //contract date row
     $profile .= $this->getContractDate();
     //assigned agents row
     $profile .= $this->getAgentsControls();
     //old corporate users aka userlinking
     $profile .= $this->getCorporateControls();
     //phone
     $profile .= $this->addRow(__('Phone'), $this->phone);
     //and mobile data rows
     $profile .= $this->addRow(__('Mobile'), $this->mobile);
     //Email data row
     $profile .= $this->addRow(__('Email'), $this->mail);
     //payment ID data
     $profile .= $this->addRow(__('Payment ID'), $this->paymentid, true);
     //LAT data row
     $profile .= $this->getUserLat();
     //login row
     $profile .= $this->addRow(__('Login'), $this->userdata['login'], true);
     //password row
     $profile .= $this->addRow(__('Password'), $this->getUserPassword(), true);
     //User IP data and extended networks controls if available
     $profile .= $this->addRow(__('IP'), $this->userdata['IP'] . $this->getExtNetsControls(), true);
     //MAC address row
     $profile .= $this->addRow(__('MAC') . ' ' . $this->getSearchmacControl() . ' ' . $this->getProfileFdbSearchControl(), $this->mac);
     //User tariff row
     $profile .= $this->addRow(__('Tariff') . $this->getTariffInfoControls($this->userdata['Tariff']), $this->userdata['Tariff'] . $this->getTariffInfoContrainer(), true);
     //Tariff change row
     $profile .= $this->addRow(__('Planned tariff change') . $this->getTariffInfoControls($this->userdata['TariffChange']), $this->userdata['TariffChange']);
     //old CaTv backlink if needed
     $profile .= $this->getCatvBacklinks();
     //Speed override row
     $profile .= $this->addRow(__('Speed override'), $this->speedoverride);
     // signup pricing row
     $profile .= $this->getSignupPricing();
     //User current cash row
     $profile .= $this->addRow(__('Balance'), $this->getUserCash(), true);
     //User credit row & easycredit control if needed
     $profile .= $this->addRow(__('Credit') . ' ' . $this->getEasyCreditController(), $this->userdata['Credit'], true);
     //credit expire row
     $profile .= $this->addRow(__('Credit expire'), $this->getUserCreditExpire());
     //Prepayed traffic
     $profile .= $this->addRow(__('Prepayed traffic'), $this->userdata['FreeMb']);
     //finance activity row
     $profile .= $this->addRow(__('Active') . $this->getCemeteryControls(), $activity);
     //DN online detection row
     $profile .= $this->getUserOnlineDN();
     //Always online flag row
     $profile .= $this->addRow(__('Always Online'), web_trigger($this->userdata['AlwaysOnline']));
     //Detail stats flag row
     $profile .= $this->addRow(__('Disable detailed stats'), web_trigger($this->userdata['DisabledDetailStat']));
     //Frozen aka passive flag row
     $profile .= $this->addRow(__('Freezed'), $passiveicon . web_trigger($this->userdata['Passive']), true);
     //Disable aka Down flag row
     $profile .= $this->addRow(__('Disabled'), $downicon . web_trigger($this->userdata['Down']), true);
     //Connection details  row
     $profile .= $this->getUserConnectionDetails();
     //User notes row
     $profile .= $this->addRow(__('Notes'), zb_UserGetNotes($this->login) . $this->getAdcommentsIndicator());
     $profile .= wf_tag('tbody', true);
     $profile .= wf_tag('table', true);
     $profile .= wf_tag('td', true);
     //end of main profile container
     $profile .= wf_tag('td', false, '', 'valign="top" width="10%"');
     //profile plugins container
     $profile .= $this->plugins;
     $profile .= wf_tag('td', true);
     // end of plugins container
     $profile .= wf_tag('tr', true);
     // close profile+plugins row
     $profile .= wf_tag('tbody', true);
     $profile .= wf_tag('table', true);
     //end of all profile container
     //profile switch port controls
     $profile .= $this->getSwitchAssignControls();
     //profile onu signal controls
     $profile .= $this->getPonSignalControl();
     //profile vlan controls
     $profile .= $this->getVlanAssignControls();
     //profile vlan online
     $profile .= $this->getVlanOnline();
     //Custom filelds display
     $profile .= cf_FieldShower($this->login);
     //Tags add control and exiting tags listing
     if (cfr('TAGS')) {
         $profile .= wf_Link('?module=usertags&username='******'Tags')), false);
     }
     $profile .= stg_show_user_tags($this->login);
     //main profile controls here
     $profile .= $this->getMainControls();
     //Profile ending anchor for addcash links scroll
     $profile .= wf_tag('a', false, '', 'id="profileending"') . wf_tag('a', true);
     return $profile;
 }
Example #4
0
/**
 * 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 .= '&nbsp;';
                $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);
        }
    }
}
Example #5
0
 /**
  * Checks have item some additional comments and return native indicator
  * 
  * @param string $item
  * @return string
  */
 public function getCommentsIndicator($item, $size = '')
 {
     if ($this->haveComments($item)) {
         $size = !$size ? 16 : $size;
         $counter = $this->getCommentsCount($item);
         $result = wf_img_sized('skins/adcomments.png', __('Additional comments') . ' (' . $counter . ')', $size, $size);
     } else {
         $result = '';
     }
     return $result;
 }
Example #6
0
 /**
  * Returns clickable if possible host link by its IP
  * 
  * @param array $allUserIps
  * @param array $allUserAddress
  * @param array $allSwitchesIps
  * @param string $ip
  * 
  * @return string
  */
 protected function getHostLink($allUserIps, $allUserAddress, $allSwitchesIps, $ip)
 {
     $result = '';
     $userUrl = '?module=userprofile&username='******'?module=switches&edit=';
     if (isset($allUserIps[$ip])) {
         $result = wf_Link($userUrl . $allUserIps[$ip], web_profile_icon(__('User')) . ' ' . @$allUserAddress[$allUserIps[$ip]], false);
     } else {
         if (isset($allSwitchesIps[$ip])) {
             $result = wf_Link($switchUrl . $allSwitchesIps[$ip]['id'], wf_img_sized('skins/menuicons/switches.png', __('Switch'), '11', '13') . ' ' . $allSwitchesIps[$ip]['location'], false);
         }
     }
     return $result;
 }
Example #7
0
 /**
  * Returns set of inputs, required for SMS-Fly service configuration
  * 
  * @return string
  */
 protected function renderTelegramConfigInputs()
 {
     $inputs = wf_tag('h2') . __('Telegram') . ' ' . wf_Link(self::URL_ME . '&showmisc=telegramcontacts', wf_img_sized('skins/icon_search_small.gif', __('Telegram bot contacts'), '10', '10'), true) . wf_tag('h2', true);
     $inputs .= wf_TextInput('edittelegrambottoken', __('Telegram bot token'), $this->settings['TELEGRAM_BOTTOKEN'], true, 40);
     return $inputs;
 }
Example #8
0
 /**
  * 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));
     }
 }
Example #9
0
 /**
  * Returns additionally spent materials list for some task
  * 
  * @param int $taskid
  * 
  * @return string
  */
 public function taskMaterialsReport($taskid)
 {
     $taskid = vf($taskid, 3);
     $result = '';
     $tmpArr = array();
     $sum = 0;
     if (!empty($this->allOutcoming)) {
         foreach ($this->allOutcoming as $io => $each) {
             if ($each['desttype'] == 'task' and $each['destparam'] == $taskid) {
                 $tmpArr[$each['id']] = $each;
             }
         }
         if (!empty($tmpArr)) {
             $cells = wf_TableCell(__('Date'));
             $cells .= wf_TableCell(__('Warehouse storage'));
             $cells .= wf_TableCell(__('Category'));
             $cells .= wf_TableCell(__('Warehouse item type'));
             $cells .= wf_TableCell(__('Count'));
             $cells .= wf_TableCell(__('Price'));
             $cells .= wf_TableCell(__('Sum'));
             $cells .= wf_TableCell(__('Actions'));
             $rows = wf_TableRow($cells, 'row1');
             foreach ($tmpArr as $io => $each) {
                 @($itemUnit = $this->unitTypes[$this->allItemTypes[$each['itemtypeid']]['unit']]);
                 $cells = wf_TableCell($each['date']);
                 $cells .= wf_TableCell(@$this->allStorages[$each['storageid']]);
                 $cells .= wf_TableCell(@$this->allCategories[$this->allItemTypes[$each['itemtypeid']]['categoryid']]);
                 $cells .= wf_TableCell(@$this->allItemTypeNames[$each['itemtypeid']]);
                 $cells .= wf_TableCell($each['count'] . ' ' . $itemUnit);
                 $cells .= wf_TableCell($each['price']);
                 $cells .= wf_TableCell($each['price'] * $each['count']);
                 if (cfr('WAREHOUSEOUT')) {
                     $actLinks = wf_Link(self::URL_ME . '&' . self::URL_VIEWERS . '&showoutid=' . $each['id'], wf_img_sized('skins/whoutcoming_icon.png', '', '12') . ' ' . __('Show'));
                 } else {
                     $actLinks = '';
                 }
                 $cells .= wf_TableCell($actLinks);
                 $rows .= wf_TableRow($cells, 'row3');
                 $sum = $sum + $each['price'] * $each['count'];
             }
             $cells = wf_TableCell(__('Total'));
             $cells .= wf_TableCell('');
             $cells .= wf_TableCell('');
             $cells .= wf_TableCell('');
             $cells .= wf_TableCell('');
             $cells .= wf_TableCell('');
             $cells .= wf_TableCell($sum);
             $cells .= wf_TableCell('');
             $rows .= wf_TableRow($cells, 'row2');
             $result = wf_TableBody($rows, '100%', 0, '');
         } else {
             $result = $this->messages->getStyledMessage(__('Nothing found'), 'info');
         }
     }
     return $result;
 }
Example #10
0
 /**
  * Renders module control panel
  * 
  * @return string
  */
 public function renderPanel()
 {
     $result = '';
     $result .= wf_Link(self::URL_ME, wf_img('skins/icon_sms_micro.gif') . ' ' . __('SMS in queue'), false, 'ubButton');
     $result .= wf_Link(self::URL_ME . '&showqueue=email', wf_img('skins/icon_mail.gif') . ' ' . __('Emails in queue'), false, 'ubButton');
     $result .= wf_Link(self::URL_ME . '&showqueue=telegram', wf_img_sized('skins/icon_telegram_small.png', '', '10', '10') . ' ' . __('Telegram messages queue'), false, 'ubButton');
     return $result;
 }
Example #11
0
/**
 * Returns visual bar for display tariffs dead/alive user proportions
 * 
 * @param int $alive
 * @param int $dead
 * @return string
 */
function web_barTariffs($alive, $dead)
{
    $barurl = 'skins/bargreen.png';
    $barblackurl = 'skins/barblack.png';
    $total = $alive + $dead;
    if ($total != 0) {
        $widthAlive = $alive / $total * 100;
        $widthDead = $dead / $total * 100;
    } else {
        $widthAlive = 0;
        $widthDead = 0;
    }
    $code = wf_img_sized($barurl, __('Active users') . ': ' . $alive, $widthAlive . '%', '14');
    $code .= wf_img_sized($barblackurl, __('Inactive users') . ': ' . $dead, $widthDead . '%', '14');
    return $code;
}
Example #12
0
 /**
  * Returns file upload form
  * 
  * @return string
  */
 public function renderUploadForm()
 {
     $postUrl = self::UPLOAD_URL_FILE . '&scope=' . $this->scope . '&itemid=' . $this->itemId;
     $inputs = wf_tag('form', false, 'glamour', 'action="' . $postUrl . '" enctype="multipart/form-data" method="POST"');
     $inputs .= wf_tag('input', false, '', 'type="file" name="photostorageFileUpload"');
     $inputs .= wf_Submit(__('Upload'));
     $inputs .= wf_tag('form', true);
     $result = $inputs;
     $result .= wf_delimiter(2);
     if (wf_CheckGet(array('preview'))) {
         $result .= wf_img_sized(self::STORAGE_PATH . $_GET['preview'], __('Preview'), $this->photoCfg['IMGLIST_PREV_W'], $this->photoCfg['IMGLIST_PREV_H']);
         $result .= wf_delimiter();
         $result .= wf_tag('span', false, 'alert_success') . __('Photo upload complete') . wf_tag('span', true);
         $result .= wf_delimiter();
     }
     $result .= wf_Link(self::MODULE_URL . '&scope=' . $this->scope . '&itemid=' . $this->itemId . '&mode=list', __('Back'), true, 'ubButton');
     return $result;
 }
Example #13
0
 /**
  * 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);
     }
 }
Example #14
0
 /**
  * Check weather user online
  * 
  * @param string $login
  * @param int $vlan
  * @return string
  */
 public function GetUserVlanOnline($login, $vlan)
 {
     snmp_set_oid_output_format(SNMP_OID_OUTPUT_NUMERIC);
     if ($this->GetOnlineDetectOid($login, $vlan)) {
         @($data = snmp2_real_walk($this->allTerminators[$this->allVlanHosts[$login]['vlanpoolid']]['ip'], $this->AllSwitches[$this->allTerminators[$this->allVlanHosts[$login]['vlanpoolid']]['ip']]['snmp'], $this->GetOnlineDetectOid($login, $vlan)));
         if (empty($data)) {
             return "Offline" . " " . wf_img_sized('skins/icon_inactive.gif', '', '', '12');
         } else {
             return "Online" . " " . wf_img_sized('skins/icon_active.gif', '', '', '12');
         }
     } else {
         return 'empty';
     }
 }