Exemplo n.º 1
0
 /**
  * Generates HTML-table, containing existing lines
  * 
  * @return  string  HTML-table
  */
 public function line_list_show()
 {
     // Query lines:
     $query = "SELECT\n                     `" . self::TABLE_LINES . "`.`id`,\n                     `" . self::TABLE_LINES . "`.`point_start`,\n                     `" . self::TABLE_LINES . "`.`point_end`,\n                     `" . self::TABLE_LINES . "`.`fibers_amount`,\n                     `" . self::TABLE_LINES . "`.`length`,\n                     `" . self::TABLE_LINES . "`.`description`,\n                     `employee`.`name` AS `engineer`,\n                     `" . self::TABLE_LINES . "`.`param_color`,\n                     `" . self::TABLE_LINES . "`.`geo`\n                FROM `" . self::TABLE_LINES . "`\n           LEFT JOIN `employee`\n                  ON `" . self::TABLE_LINES . "`.`employee_id` = `employee`.id\n            ";
     $result = simple_queryall($query);
     // HTML-table header:
     $cells = wf_TableCell(__('ID'));
     $cells .= wf_TableCell(__('Starting point'));
     $cells .= wf_TableCell(__('End point'));
     $cells .= wf_TableCell(__('Fibers amount'), 75);
     $cells .= wf_TableCell(__('Length'), 100);
     $cells .= wf_TableCell(__('Description'), 350);
     $cells .= wf_TableCell(__('Engineer'));
     $cells .= wf_TableCell(__('Color'), 60);
     $cells .= wf_TableCell(__('Actions'), 80);
     $rows = wf_TableRow($cells, 'row2');
     // HTML-table content:
     if (!empty($result)) {
         foreach ($result as $line) {
             // Color decoration:
             $line['param_color'] = '<span style="color: ' . $line['param_color'] . '">' . $line['param_color'] . '</span>';
             $cells = wf_TableCell($line['id']);
             $cells .= wf_TableCell($line['point_start']);
             $cells .= wf_TableCell($line['point_end']);
             $cells .= wf_TableCell($line['fibers_amount']);
             $cells .= wf_TableCell($line['length']);
             $cells .= wf_TableCell($line['description']);
             $cells .= wf_TableCell($line['engineer']);
             $cells .= wf_TableCell($line['param_color']);
             // Actions:
             $actions = wf_Link(self::URL_LINE_DEL . $line['id'], web_delete_icon());
             $actions .= wf_Link(self::URL_LINE_EDIT . $line['id'], web_edit_icon());
             $actions .= wf_Link(self::URL_LINE_DOCS . $line['id'], web_corporate_icon('Documentation'));
             if (empty($line['geo']) || $line['geo'] == '[  ]') {
                 $actions .= wf_Link(self::URL_LINE_PLACE . $line['id'], web_add_icon(__('Place on map')));
             }
             $cells .= wf_TableCell($actions);
             $rows .= wf_TableRow($cells, 'row3');
         }
     } else {
         $cells = wf_TableCell(__('There is no lines to show'), null, null, 'colspan="9" align="center"');
         $rows .= wf_TableRow($cells, 'row3');
     }
     // Generate HTML-table:
     return wf_TableBody($rows, '100%', '0');
 }
Exemplo n.º 2
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;
 }
Exemplo n.º 3
0
 /**
  * Retruns json data for jquery data tables with transactions list
  * 
  * @global object $ubillingConfig
  * @return string
  */
 public function transactionAjaxSource()
 {
     $manual_mode = $this->altCfg['OPENPAYZ_MANUAL'];
     $query = "SELECT * from `op_transactions` ORDER by `id` DESC;";
     $alltransactions = simple_queryall($query);
     $result = '{ 
               "aaData": [ ';
     if (!empty($alltransactions)) {
         foreach ($alltransactions as $io => $eachtransaction) {
             if ($manual_mode) {
                 if ($eachtransaction['processed'] == 0) {
                     $control = wf_Link('?module=openpayz&process=' . $eachtransaction['id'], web_add_icon('Payment'));
                     $control = str_replace('"', '', $control);
                     $control = trim($control);
                 } else {
                     $control = '';
                 }
             } else {
                 $control = '';
             }
             @($user_login = $this->allCustomers[$eachtransaction['customerid']]);
             @($user_realname = $this->allRealnames[$user_login]);
             $user_realname = str_replace('"', '', $user_realname);
             $user_realname = trim($user_realname);
             @($user_address = $this->allAddress[$user_login]);
             $user_address = trim($user_address);
             $user_address = str_replace("'", '`', $user_address);
             $user_address = mysql_real_escape_string($user_address);
             if (!empty($user_login)) {
                 $profileLink = wf_Link('?module=userprofile&username='******'"', '', $profileLink);
                 $profileLink = trim($profileLink);
             } else {
                 $profileLink = '';
             }
             $stateIcon = web_bool_led($eachtransaction['processed']);
             $stateIcon = str_replace('"', '', $stateIcon);
             $stateIcon = trim($stateIcon) . ' ' . $control;
             $result .= '
                 [
                 "' . $eachtransaction['id'] . '",
                 "' . $eachtransaction['date'] . '",
                 "' . $eachtransaction['summ'] . '",
                 "' . $eachtransaction['customerid'] . '",
                 "' . $user_realname . '",
                 "' . $profileLink . ' ' . $user_address . '",
                 "' . $eachtransaction['paysys'] . '",
                 "' . $stateIcon . '"
                 ],';
         }
     }
     $result = substr($result, 0, -1);
     $result .= '] 
     }';
     return $result;
 }
Exemplo n.º 4
0
         }
         log_register('DOWNLOAD FILE `userbase.csv`');
         // push data for csv handler
         header('Content-type: application/ms-excel');
         header('Content-Disposition: attachment; filename=userbase.csv');
         echo $result;
         die;
     }
 }
 // show reports list
 if (cfr('REPORTMASTERADM')) {
     $export_link = wf_Link('?module=reportmaster&exportuserbase=excel', wf_img("skins/excel.gif", __('Export userbase')), false);
 } else {
     $export_link = '';
 }
 $newreport_link = wf_Link('?module=reportmaster&add=true', web_add_icon(), false);
 $action_links = ' ' . $export_link . ' ' . $newreport_link;
 show_window(__('Available reports') . $action_links, web_ReportMasterShowReportsList());
 //userbase exporting
 if (wf_CheckGet(array('exportuserbase'))) {
     zb_RMExportUserbaseCsv();
 }
 //create new report
 if (isset($_POST['newreportname']) and isset($_POST['newsqlquery']) and isset($_POST['newdatakeys']) and isset($_POST['newfieldnames'])) {
     if (cfr('REPORTMASTERADM')) {
         zb_RMCreateReport($_POST['newreportname'], $_POST['newsqlquery'], $_POST['newdatakeys'], $_POST['newfieldnames'], $_POST['newaddr'], $_POST['newrnames'], $_POST['newrowcount']);
         rcms_redirect("?module=reportmaster");
     } else {
         show_error(__('You cant control this module'));
     }
 }
Exemplo n.º 5
0
 //creating of new timesheet
 if (wf_CheckPost(array('newtimesheet', 'newtimesheetdate', '_employeehours'))) {
     $tsSheetCreateResult = $salary->timesheetCreate();
     if ($tsSheetCreateResult == 0) {
         //succeful creation
         rcms_redirect('?module=salary_timesheets');
     } else {
         if ($tsSheetCreateResult == 1) {
             //date duplicate
             show_error(__('Timesheets with that date already exist'));
         }
     }
 }
 $tsCf = $salary->timesheetCreateForm();
 if ($tsCf) {
     $timesheetsControls = wf_modal(web_add_icon() . ' ' . __('Create'), __('Create') . ' ' . __('Timesheet'), $tsCf, 'ubButton', '800', '600');
     show_window('', $timesheetsControls);
     if (!wf_CheckGet(array('showdate'))) {
         //render available timesheets list by date
         show_window(__('Timesheets'), $salary->timesheetsListRender('?module=salary_timesheets'));
     } else {
         //saving changes for single timesheet row
         if (wf_CheckPost(array('edittimesheetid'))) {
             $salary->timesheetSaveChanges();
             rcms_redirect('?module=salary_timesheets&showdate=' . $_GET['showdate']);
         }
         //render timesheet by date (edit form)
         show_window(__('Timesheet') . ' ' . $_GET['showdate'], $salary->timesheetEditForm($_GET['showdate']));
         show_window('', wf_Link('?module=salary_timesheets', __('Back'), false, 'ubButton'));
     }
 } else {
Exemplo n.º 6
0
/**
 * Returns switch model add form
 * 
 * @return string
 */
function web_SwitchModelAddForm()
{
    $allSnmpTemplates = zb_SwitchModelsSnmpTemplatesGetAll();
    $addinputs = wf_TextInput('newsm', 'Model', '', true);
    $addinputs .= wf_TextInput('newsmp', 'Ports', '', true, '5');
    $addinputs .= wf_Selector('newsst', $allSnmpTemplates, 'SNMP template', '');
    $addinputs .= wf_delimiter() . web_add_icon() . ' ' . wf_Submit('Create');
    $addform = wf_Form('', 'POST', $addinputs, 'glamour');
    $result = $addform;
    return $result;
}