コード例 #1
0
ファイル: index.php プロジェクト: nightflyza/Ubilling
 /**
  * Returns FDB cache lister MAC filters setup form
  * 
  * @return string
  */
 function web_FDBTableFiltersForm()
 {
     $currentFilters = '';
     $oldFilters = zb_StorageGet('FDBCACHEMACFILTERS');
     if (!empty($oldFilters)) {
         $currentFilters = base64_decode($oldFilters);
     }
     $inputs = __('One MAC address per line') . wf_tag('br');
     $inputs .= wf_TextArea('newmacfilters', '', $currentFilters, true, '40x10');
     $inputs .= wf_HiddenInput('setmacfilters', 'true');
     $inputs .= wf_CheckInput('deletemacfilters', __('Cleanup'), true, false);
     $inputs .= wf_Submit(__('Save'));
     $result = wf_Form('', 'POST', $inputs, 'glamour');
     return $result;
 }
コード例 #2
0
ファイル: index.php プロジェクト: l1ght13aby/Ubilling
 function web_UserGenForm()
 {
     $alltariffs_raw = zb_TariffsGetAll();
     $alltariffs = array();
     if (!empty($alltariffs_raw)) {
         foreach ($alltariffs_raw as $it => $eachtariff) {
             $alltariffs[$eachtariff['name']] = $eachtariff['name'];
         }
     }
     $inputs = wf_TextInput('gencount', __('Count of users to generate'), '', true);
     $inputs .= wf_Selector('gentariff', $alltariffs, __('Existing tariff for this users'), '', true);
     $inputs .= multinet_service_selector() . ' ' . __('Service for new users') . wf_tag('br');
     $inputs .= wf_CheckInput('fastsqlgen', __('Fast SQL Inserts - need to shutdown stargazer'), true, false);
     $inputs .= wf_Submit(__('Go!'));
     $result = wf_Form("", "POST", $inputs, 'glamour');
     show_window(__('Sample user generator'), $result);
 }
コード例 #3
0
ファイル: api.megogo.php プロジェクト: l1ght13aby/Ubilling
 /**
  * Returns tariff creation form
  * 
  * @return string
  */
 public function tariffCreateForm()
 {
     $result = '';
     $inputs = wf_TextInput('newtariffname', __('Tariff name'), '', true, '10');
     $inputs .= wf_TextInput('newtarifffee', __('Fee'), '', true, '5');
     $inputs .= wf_TextInput('newtariffserviceid', __('Service ID'), '', true, '10');
     $inputs .= wf_CheckInput('newtariffprimary', __('Primary'), true, false);
     $inputs .= wf_CheckInput('newtarifffreeperiod', __('Free period'), true, false);
     $inputs .= wf_Submit(__('Create'));
     $result = wf_Form('', 'POST', $inputs, 'glamour');
     return $result;
 }
コード例 #4
0
ファイル: api.address.php プロジェクト: l1ght13aby/Ubilling
 /**
  * returns some build passport edit form
  * 
  * @praram $buildid existing build id
  * 
  * @return string
  */
 public function renderEditForm($buildid)
 {
     $buildid = vf($buildid, 3);
     if (isset($this->data[$buildid])) {
         $currentData = $this->data[$buildid];
     } else {
         $currentData = array();
     }
     $inputs = wf_HiddenInput('savebuildpassport', $buildid);
     $inputs .= wf_Selector('powner', $this->ownersArr, __('Owner'), @$currentData['owner'], true);
     $inputs .= wf_TextInput('pownername', __('Owner name'), @$currentData['ownername'], true, 30);
     $inputs .= wf_TextInput('pownerphone', __('Owner phone'), @$currentData['ownerphone'], true, 30);
     $inputs .= wf_TextInput('pownercontact', __('Owner contact person'), @$currentData['ownercontact'], true, 30);
     $keys = @$currentData['keys'] == 1 ? true : false;
     $inputs .= wf_CheckInput('pkeys', __('Keys available'), true, $keys);
     $inputs .= wf_TextInput('paccessnotices', __('Build access notices'), @$currentData['accessnotices'], true, 40);
     $inputs .= wf_Selector('pfloors', $this->floorsArr, __('Floors'), @$currentData['floors'], false);
     $inputs .= wf_Selector('pentrances', $this->entrancesArr, __('Entrances'), @$currentData['entrances'], false);
     $inputs .= wf_TextInput('papts', __('Apartments'), @$currentData['apts'], true, 5);
     $inputs .= __('Notes') . wf_tag('br');
     $inputs .= wf_TextArea('pnotes', '', @$currentData['notes'], true, '50x6');
     $inputs .= wf_Submit(__('Save'));
     $result = wf_Form('', 'POST', $inputs, 'glamour');
     return $result;
 }
コード例 #5
0
 /**
  * returns template upload form 
  * 
  * @return string
  */
 public function uploadForm()
 {
     $uploadinputs = wf_HiddenInput('uploadtemplate', 'true');
     $uploadinputs .= wf_TextInput('templatedisplayname', __('Template display name'), '', true, '15');
     $uploadinputs .= wf_CheckInput('publictemplate', __('Template is public'), true, false);
     $uploadinputs .= __('Upload new document template from HDD') . wf_tag('br');
     $uploadinputs .= wf_tag('input', false, '', 'id="fileselector" type="file" name="uldocxtempplate"') . wf_tag('br');
     $uploadinputs .= wf_Submit('Upload');
     $uploadform = bs_UploadFormBody('', 'POST', $uploadinputs, 'glamour');
     return $uploadform;
 }
コード例 #6
0
ファイル: index.php プロジェクト: l1ght13aby/Ubilling
 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 .= '        ' . 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;
 }
コード例 #7
0
ファイル: index.php プロジェクト: l1ght13aby/Ubilling
 /**
  * Renders search form. Deal with it.
  * 
  * @return string
  */
 public function renderSearchForm()
 {
     $result = '';
     $datefromDefault = wf_CheckPost(array('datefrom')) ? $_POST['datefrom'] : curdate();
     $datetoDefault = wf_CheckPost(array('dateto')) ? $_POST['dateto'] : curdate();
     $inputs = __('Date') . ' ' . wf_DatePickerPreset('datefrom', $datefromDefault, true) . ' ' . __('From') . ' ' . wf_DatePickerPreset('dateto', $datetoDefault, true) . ' ' . __('To');
     $inputs .= wf_tag('br');
     $inputs .= wf_CheckInput('cb_id', '', false, false);
     $inputs .= wf_TextInput('taskid', __('ID'), '', true, 4);
     $inputs .= wf_CheckInput('cb_taskdays', '', false, false);
     $inputs .= wf_TextInput('taskdays', __('Implementation took more days'), '', true, 4);
     $inputs .= wf_CheckInput('cb_taskaddress', '', false, false);
     $inputs .= wf_TextInput('taskaddress', __('Task address'), '', true, 20);
     $inputs .= wf_CheckInput('cb_taskphone', '', false, false);
     $inputs .= wf_TextInput('taskphone', __('Phone'), '', true, 20);
     $inputs .= wf_CheckInput('cb_employee', '', false, false);
     $inputs .= wf_Selector('employee', $this->activeEmployee, __('Who should do'), '', true);
     $inputs .= wf_CheckInput('cb_employeedone', '', false, false);
     $inputs .= wf_Selector('employeedone', $this->activeEmployee, __('Worker done'), '', true);
     $inputs .= wf_CheckInput('cb_duplicateaddress', __('Duplicate address'), true, false);
     $inputs .= wf_CheckInput('cb_showlate', __('Show late'), true, false);
     $inputs .= wf_CheckInput('cb_onlydone', __('Done tasks'), true, false);
     $inputs .= wf_CheckInput('cb_onlyundone', __('Undone tasks'), true, false);
     if ($this->altCfg['SALARY_ENABLED']) {
         $inputs .= wf_CheckInput('cb_nosalsaryjobs', __('Tasks without jobs'), true, false);
     }
     $inputs .= wf_Submit(__('Search'));
     $result = wf_Form('', 'POST', $inputs, 'glamour');
     $result .= wf_CleanDiv();
     return $result;
 }
コード例 #8
0
ファイル: index.php プロジェクト: l1ght13aby/Ubilling
                 rcms_redirect("?module=corporate&userlink=" . $userlink . "&control=cash");
             }
         }
     }
 }
 //cash control end
 if ($_GET['control'] == 'tariff') {
     //group tariff operations
     $allchildusers = cu_GetAllChildUsers($userlink);
     //construct form
     $current_tariff = zb_UserGetStargazerData($parent_login);
     $current_tariff = $current_tariff['Tariff'];
     $tariffinputs = '<h3>' . __('Current tariff') . ': ' . $current_tariff . '</h3> <br>';
     $tariffinputs .= web_tariffselector('newtariff');
     $tariffinputs .= '<br>';
     $tariffinputs .= wf_CheckInput('nextmonth', 'Next month', true, false);
     $tariffinputs .= '<br>';
     $tariffinputs .= wf_Submit('Save');
     $tariffform = wf_Form('', 'POST', $tariffinputs, 'glamour');
     show_window(__('Edit tariff'), $tariffform);
     //if group tariff change
     if (wf_CheckPost(array('newtariff'))) {
         $alter_conf = rcms_parse_ini_file(CONFIG_PATH . "alter.ini");
         $tariff = $_POST['newtariff'];
         if (!isset($_POST['nextmonth'])) {
             $billing->settariff($parent_login, $tariff);
             log_register('CHANGE Tariff ' . $parent_login . ' ON ' . $tariff);
             //optional user reset
             if ($alter_conf['TARIFFCHGRESET']) {
                 $billing->resetuser($parent_login);
                 log_register('RESET User ' . $parent_login);
コード例 #9
0
ファイル: api.megogo.php プロジェクト: carriercomm/Ubilling
 /**
  * Returns tariff editing form
  * 
  * @param int $tariffId
  * 
  * @return string
  */
 protected function tariffEditForm($tariffId)
 {
     $result = '';
     $inputs = wf_HiddenInput('edittariffid', $tariffId);
     $inputs .= wf_TextInput('edittariffname', __('Tariff name'), $this->allTariffs[$tariffId]['name'], true, '20');
     $inputs .= wf_TextInput('edittarifffee', __('Fee'), $this->allTariffs[$tariffId]['fee'], true, '5');
     $inputs .= wf_TextInput('edittariffserviceid', __('Service ID'), $this->allTariffs[$tariffId]['serviceid'], true, '10');
     $primaryFlag = $this->allTariffs[$tariffId]['primary'] ? true : false;
     $inputs .= wf_CheckInput('edittariffprimary', __('Primary'), true, $primaryFlag);
     $freePeriodFlag = $this->allTariffs[$tariffId]['freeperiod'] ? true : false;
     $inputs .= wf_CheckInput('edittarifffreeperiod', __('Free period'), true, $freePeriodFlag);
     $inputs .= wf_Submit(__('Save'));
     $result = wf_Form('', 'POST', $inputs, 'glamour');
     return $result;
 }
コード例 #10
0
ファイル: index.php プロジェクト: l1ght13aby/Ubilling
            simple_update_field('employee', 'name', $_POST['editname'], "WHERE `id`='" . $editemployee . "'");
            simple_update_field('employee', 'appointment', $_POST['editappointment'], "WHERE `id`='" . $editemployee . "'");
            simple_update_field('employee', 'mobile', $_POST['editmobile'], "WHERE `id`='" . $editemployee . "'");
            simple_update_field('employee', 'admlogin', $_POST['editadmlogin'], "WHERE `id`='" . $editemployee . "'");
            if (wf_CheckPost(array('editactive'))) {
                simple_update_field('employee', 'active', '1', "WHERE `id`='" . $editemployee . "'");
            } else {
                simple_update_field('employee', 'active', '0', "WHERE `id`='" . $editemployee . "'");
            }
            log_register('EMPLOYEE CHANGE [' . $editemployee . ']');
            rcms_redirect("?module=employee");
        }
        $employeedata = stg_get_employee_data($editemployee);
        if ($employeedata['active']) {
            $actflag = true;
        } else {
            $actflag = false;
        }
        $editinputs = wf_TextInput('editname', 'Real Name', $employeedata['name'], true, 20);
        $editinputs .= wf_TextInput('editappointment', 'Appointment', $employeedata['appointment'], true, 20);
        $editinputs .= wf_TextInput('editmobile', __('Mobile'), $employeedata['mobile'], true, 20);
        $editinputs .= wf_TextInput('editadmlogin', __('Administrator'), $employeedata['admlogin'], true, 20);
        $editinputs .= wf_CheckInput('editactive', 'Active', true, $actflag);
        $editinputs .= wf_Submit('Save');
        $editform = wf_Form('', 'POST', $editinputs, 'glamour');
        show_window(__('Edit'), $editform);
        show_window('', wf_Link('?module=employee', 'Back', true, 'ubButton'));
    }
} else {
    show_error(__('You cant control this module'));
}
コード例 #11
0
 /**
  * Returns edit form
  * 
  * @return string
  */
 protected function editForm($noteId)
 {
     $noteData = $this->getNoteData($noteId);
     if (!empty($noteData)) {
         $inputs = wf_HiddenInput('editnoteid', $noteId);
         $inputs .= wf_tag('label') . __('Text') . ': ' . wf_tag('br') . wf_tag('label', true);
         $inputs .= wf_TextArea('edittext', '', $noteData['text'], true, '50x15');
         $checkState = $noteData['active'] == 1 ? true : false;
         $inputs .= wf_CheckInput('editactive', __('Personal note active'), true, $checkState);
         $inputs .= wf_DatePickerPreset('editreminddate', $noteData['reminddate']);
         $inputs .= wf_tag('label') . __('Remind only after this date') . wf_tag('label', true);
         $inputs .= wf_tag('br');
         $inputs .= wf_tag('br');
         $inputs .= wf_Submit(__('Save'));
         $result = wf_Form('', 'POST', $inputs, 'glamour');
     } else {
         $result = __('Strange exeption');
     }
     return $result;
 }
コード例 #12
0
ファイル: api.cardpay.php プロジェクト: l1ght13aby/Ubilling
/**
 * Returns available list with some controls
 * 
 * @return string
 */
function web_CardsShow()
{
    $result = '';
    $totalcount = zb_CardsGetCount();
    $perpage = 100;
    //pagination
    if (!isset($_GET['page'])) {
        $current_page = 1;
    } else {
        $current_page = vf($_GET['page'], 3);
    }
    if ($totalcount > $perpage) {
        $paginator = wf_pagination($totalcount, $perpage, $current_page, "?module=cards", 'ubButton');
        $from = $perpage * ($current_page - 1);
        $to = $perpage;
        $query = "SELECT * from `cardbank` ORDER by `id` DESC LIMIT " . $from . "," . $to . ";";
        $alluhw = simple_queryall($query);
    } else {
        $paginator = '';
        $query = "SELECT * from `cardbank` ORDER by `id` DESC;";
        $alluhw = simple_queryall($query);
    }
    $allcards = simple_queryall($query);
    $cells = wf_TableCell(__('ID'));
    $cells .= wf_TableCell(__('Serial number'));
    $cells .= wf_TableCell(__('Price'));
    $cells .= wf_TableCell(__('Admin'));
    $cells .= wf_TableCell(__('Date'));
    $cells .= wf_TableCell(__('Active'));
    $cells .= wf_TableCell(__('Used'));
    $cells .= wf_TableCell(__('Usage date'));
    $cells .= wf_TableCell(__('Used login'));
    $cells .= wf_TableCell(__('Used IP'));
    $cells .= wf_TableCell('');
    $rows = wf_TableRow($cells, 'row1');
    if (!empty($allcards)) {
        foreach ($allcards as $io => $eachcard) {
            $cells = wf_TableCell($eachcard['id']);
            $cells .= wf_TableCell($eachcard['serial']);
            $cells .= wf_TableCell($eachcard['cash']);
            $cells .= wf_TableCell($eachcard['admin']);
            $cells .= wf_TableCell($eachcard['date']);
            $cells .= wf_TableCell(web_bool_led($eachcard['active']));
            $cells .= wf_TableCell(web_bool_led($eachcard['used']));
            $cells .= wf_TableCell($eachcard['usedate']);
            $cells .= wf_TableCell($eachcard['usedlogin']);
            $cells .= wf_TableCell($eachcard['usedip']);
            $cells .= wf_TableCell(wf_CheckInput('_cards[' . $eachcard['id'] . ']', '', false, false));
            $rows .= wf_TableRow($cells, 'row3');
        }
    }
    $result = wf_TableBody($rows, '100%', 0, '');
    $result .= $paginator . wf_delimiter();
    $cardActions = array('caexport' => __('Export serials'), 'caactive' => __('Mark as active'), 'cainactive' => __('Mark as inactive'), 'cadelete' => __('Delete'));
    $actionSelect = wf_Selector('cardactions', $cardActions, '', '', false);
    $actionSelect .= wf_Submit(__('With selected'));
    $result .= $actionSelect;
    $result = wf_Form('', 'POST', $result, '');
    return $result;
}
コード例 #13
0
ファイル: api.exhorse.php プロジェクト: nightflyza/Ubilling
 /**
  * Renders report for some year
  * 
  * @return string
  */
 public function renderReport()
 {
     $result = '';
     $months = months_array_localized();
     $yearData = $this->loadStoredData();
     $inputs = wf_YearSelectorPreset('yearsel', __('Year'), false, $this->showYear) . ' ';
     $chartsFlag = wf_CheckPost(array('showcharts')) ? true : false;
     $inputs .= wf_CheckInput('showcharts', __('Graphs'), false, $chartsFlag) . ' ';
     $inputs .= wf_Submit(__('Show'));
     $yearForm = wf_Form('', 'POST', $inputs, 'glamour');
     $yearForm .= wf_CleanDiv();
     $result .= $yearForm;
     //charts presets
     $chartsOptions = "\n            'focusTarget': 'category',\n                        'hAxis': {\n                        'color': 'none',\n                            'baselineColor': 'none',\n                    },\n                        'vAxis': {\n                        'color': 'none',\n                            'baselineColor': 'none',\n                    },\n                        'curveType': 'function',\n                        'pointSize': 5,\n                        'crosshair': {\n                        trigger: 'none'\n                    },";
     $usersChartData = array(0 => array(__('Month'), __('Total'), __('Active'), __('Inactive'), __('Frozen'), __('Signups')));
     $complexChartData = array(0 => array(__('Month'), __('Total'), __('Active'), __('Inactive')));
     $financeChartsData = array(0 => array(__('Month'), __('Money'), __('Payments count'), __('ARPU'), __('ARPAU')));
     $ukvChartData = array(0 => array(__('Month'), __('Total'), __('Active'), __('Inactive'), __('Illegal'), __('Complex'), __('Social'), __('Signups')));
     $ukvfChartData = array(0 => array(__('Month'), __('Money'), __('Payments count'), __('ARPU'), __('ARPAU'), __('Debt')));
     $askoziaChartData = array(0 => array(__('Month'), __('Total calls'), __('Total answered'), __('No answer')));
     $equipChartData = array(0 => array(__('Month'), __('Switches'), __('PON ONU'), __('DOCSIS modems')));
     if (!empty($yearData)) {
         //internet users
         $cells = wf_TableCell(__('Month'));
         $cells .= wf_TableCell(__('Total'));
         $cells .= wf_TableCell(__('Active'));
         $cells .= wf_TableCell(__('Inactive'));
         $cells .= wf_TableCell(__('Frozen'));
         $cells .= wf_TableCell(__('Signups'));
         $rows = wf_TableRow($cells, 'row1');
         foreach ($yearData as $monthNum => $each) {
             $cells = wf_TableCell($months[$monthNum]);
             $cells .= wf_TableCell($each['u_totalusers']);
             $cells .= wf_TableCell($each['u_activeusers'] . ' (' . $this->percentValue($each['u_totalusers'], $each['u_activeusers']) . '%)');
             $cells .= wf_TableCell($each['u_inactiveusers'] . ' (' . $this->percentValue($each['u_totalusers'], $each['u_inactiveusers']) . '%)');
             $cells .= wf_TableCell($each['u_frozenusers'] . ' (' . $this->percentValue($each['u_totalusers'], $each['u_frozenusers']) . '%)');
             if (!empty($each['u_citysignups'])) {
                 $signupData = '';
                 $sigDataTmp = base64_decode($each['u_citysignups']);
                 $sigDataTmp = unserialize($sigDataTmp);
                 $citySigs = '';
                 $cityRows = '';
                 if (!empty($sigDataTmp)) {
                     $cityCells = wf_TableCell(__('City'));
                     $cityCells .= wf_TableCell(__('Signups'));
                     $cityRows .= wf_TableRow($cityCells, 'row1');
                     foreach ($sigDataTmp as $sigCity => $cityCount) {
                         $cityCells = wf_TableCell($sigCity);
                         $cityCells .= wf_TableCell($cityCount);
                         $cityRows .= wf_TableRow($cityCells, 'row3');
                     }
                     $citySigs .= wf_TableBody($cityRows, '100%', 0, '');
                 }
                 $signupData .= wf_modalAuto($each['u_signups'], __('Cities'), $citySigs);
             } else {
                 $signupData = $each['u_signups'];
             }
             $cells .= wf_TableCell($signupData);
             $rows .= wf_TableRow($cells, 'row3');
             //chart data
             $usersChartData[] = array($months[$monthNum], $each['u_totalusers'], $each['u_activeusers'], $each['u_inactiveusers'], $each['u_frozenusers'], $each['u_signups']);
         }
         $result .= wf_tag('h2') . __('Internets users') . wf_tag('h2', true);
         $result .= wf_TableBody($rows, '100%', 0, '');
         if ($chartsFlag) {
             $result .= wf_gchartsLine($usersChartData, __('Internets users'), '100%', '300px', $chartsOptions);
         }
         //complex data
         if ($this->complexFlag) {
             $result .= wf_tag('h2') . __('Complex services') . wf_tag('h2', true);
             $cells = wf_TableCell(__('Month'));
             $cells .= wf_TableCell(__('Total'));
             $cells .= wf_TableCell(__('Active'));
             $cells .= wf_TableCell(__('Inactive'));
             $rows = wf_TableRow($cells, 'row1');
             foreach ($yearData as $monthNum => $each) {
                 $cells = wf_TableCell($months[$monthNum]);
                 $cells .= wf_TableCell($each['u_complextotal']);
                 $cells .= wf_TableCell($each['u_complexactive'] . ' (' . $this->percentValue($each['u_complextotal'], $each['u_complexactive']) . '%)');
                 $cells .= wf_TableCell($each['u_complexinactive'] . ' (' . $this->percentValue($each['u_complextotal'], $each['u_complexinactive']) . '%)');
                 $rows .= wf_TableRow($cells, 'row3');
                 //chart data
                 $complexChartData[] = array($months[$monthNum], $each['u_complextotal'], $each['u_complexactive'], $each['u_complexinactive']);
             }
             $result .= wf_TableBody($rows, '100%', 0, '');
             if ($chartsFlag) {
                 $result .= wf_gchartsLine($complexChartData, __('Complex services'), '100%', '300px', $chartsOptions);
             }
         }
         //finance data
         $result .= wf_tag('h2') . __('Financial highlights') . wf_tag('h2', true);
         $cells = wf_TableCell(__('Month'));
         $cells .= wf_TableCell(__('Money'));
         $cells .= wf_TableCell(__('Payments count'));
         $cells .= wf_TableCell(__('Cash payments'));
         $cells .= wf_TableCell(__('Cash payments count'));
         $cells .= wf_TableCell(__('ARPU'));
         $cells .= wf_TableCell(__('ARPAU'));
         $rows = wf_TableRow($cells, 'row1');
         foreach ($yearData as $monthNum => $each) {
             $cells = wf_TableCell($months[$monthNum]);
             $cells .= wf_TableCell($each['f_totalmoney']);
             $cells .= wf_TableCell($each['f_paymentscount']);
             $cells .= wf_TableCell($each['f_cashmoney'] . ' (' . $this->percentValue($each['f_totalmoney'], $each['f_cashmoney']) . '%)');
             $cells .= wf_TableCell($each['f_cashcount'] . ' (' . $this->percentValue($each['f_paymentscount'], $each['f_cashcount']) . '%)');
             $cells .= wf_TableCell($each['f_arpu']);
             $cells .= wf_TableCell($each['f_arpau']);
             $rows .= wf_TableRow($cells, 'row3');
             //chart data
             $financeChartsData[] = array($months[$monthNum], $each['f_totalmoney'], $each['f_paymentscount'], $each['f_arpu'], $each['f_arpau']);
         }
         $result .= wf_TableBody($rows, '100%', 0, '');
         if ($chartsFlag) {
             $result .= wf_gchartsLine($financeChartsData, __('Financial highlights'), '100%', '300px', $chartsOptions);
         }
         // UKV cable users
         if ($this->ukvFlag) {
             $result .= wf_tag('h2') . __('UKV users') . wf_tag('h2', true);
             $cells = wf_TableCell(__('Month'));
             $cells .= wf_TableCell(__('Total'));
             $cells .= wf_TableCell(__('Active'));
             $cells .= wf_TableCell(__('Inactive'));
             $cells .= wf_TableCell(__('Illegal'));
             if ($this->complexFlag) {
                 $cells .= wf_TableCell(__('Complex'));
             }
             $cells .= wf_TableCell(__('Social'));
             $cells .= wf_TableCell(__('Signups'));
             $rows = wf_TableRow($cells, 'row1');
             foreach ($yearData as $monthNum => $each) {
                 $cells = wf_TableCell($months[$monthNum]);
                 $cells .= wf_TableCell($each['c_totalusers']);
                 $cells .= wf_TableCell($each['c_activeusers'] . ' (' . $this->percentValue($each['c_totalusers'], $each['c_activeusers']) . '%)');
                 $cells .= wf_TableCell($each['c_inactiveusers'] . ' (' . $this->percentValue($each['c_totalusers'], $each['c_inactiveusers']) . '%)');
                 $cells .= wf_TableCell($each['c_illegal'] . ' (' . $this->percentValue($each['c_totalusers'], $each['c_illegal']) . '%)');
                 if ($this->complexFlag) {
                     $cells .= wf_TableCell($each['c_complex'] . ' (' . $this->percentValue($each['c_totalusers'], $each['c_complex']) . '%)');
                 }
                 $cells .= wf_TableCell($each['c_social'] . ' (' . $this->percentValue($each['c_totalusers'], $each['c_social']) . '%)');
                 $cells .= wf_TableCell($each['c_signups']);
                 $rows .= wf_TableRow($cells, 'row3');
                 //chart data
                 $ukvChartData[] = array($months[$monthNum], $each['c_totalusers'], $each['c_activeusers'], $each['c_inactiveusers'], $each['c_illegal'], $each['c_complex'], $each['c_social'], $each['c_signups']);
             }
             $result .= wf_TableBody($rows, '100%', 0, '');
             if ($chartsFlag) {
                 $result .= wf_gchartsLine($ukvChartData, __('UKV users'), '100%', '300px', $chartsOptions);
             }
             //UKV financial data
             $result .= wf_tag('h2') . __('UKV finance') . wf_tag('h2', true);
             $cells = wf_TableCell(__('Month'));
             $cells .= wf_TableCell(__('Money'));
             $cells .= wf_TableCell(__('Payments count'));
             $cells .= wf_TableCell(__('ARPU'));
             $cells .= wf_TableCell(__('ARPAU'));
             $cells .= wf_TableCell(__('Debt'));
             $rows = wf_TableRow($cells, 'row1');
             foreach ($yearData as $monthNum => $each) {
                 $cells = wf_TableCell($months[$monthNum]);
                 $cells .= wf_TableCell($each['c_totalmoney']);
                 $cells .= wf_TableCell($each['c_paymentscount']);
                 $cells .= wf_TableCell($each['c_arpu']);
                 $cells .= wf_TableCell($each['c_arpau']);
                 $cells .= wf_TableCell($each['c_totaldebt']);
                 $rows .= wf_TableRow($cells, 'row3');
                 //chart data
                 $ukvfChartData[] = array($months[$monthNum], $each['c_totalmoney'], $each['c_paymentscount'], $each['c_arpu'], $each['c_arpau'], $each['c_totaldebt']);
             }
             $result .= wf_TableBody($rows, '100%', 0, '');
             if ($chartsFlag) {
                 $result .= wf_gchartsLine($ukvfChartData, __('UKV users'), '100%', '300px', $chartsOptions);
             }
         }
         //Askozia PBX
         if ($this->askoziaFlag) {
             $result .= wf_tag('h2') . __('AskoziaPBX integration') . wf_tag('h2', true);
             $cells = wf_TableCell(__('Month'));
             $cells .= wf_TableCell(__('Incoming calls'));
             $cells .= wf_TableCell(__('Total answered'));
             $cells .= wf_TableCell(__('No answer'));
             $cells .= wf_TableCell(__('Total duration'));
             $cells .= wf_TableCell(__('Average duration'));
             $cells .= wf_TableCell(__('Answers percent'));
             $rows = wf_TableRow($cells, 'row1');
             foreach ($yearData as $monthNum => $each) {
                 $cells = wf_TableCell($months[$monthNum]);
                 $cells .= wf_TableCell($each['a_totalcalls']);
                 $cells .= wf_TableCell($each['a_totalanswered']);
                 $cells .= wf_TableCell($each['a_totalcalls'] - $each['a_totalanswered']);
                 $cells .= wf_TableCell($this->formatTime($each['a_totalcallsduration']));
                 $cells .= wf_TableCell($this->formatTime($each['a_averagecallduration']));
                 $cells .= wf_TableCell($this->percentValue($each['a_totalcalls'], $each['a_totalanswered']) . '%');
                 $rows .= wf_TableRow($cells, 'row3');
                 //chart data
                 $askoziaChartData[] = array($months[$monthNum], $each['a_totalcalls'], $each['a_totalanswered'], $each['a_totalcalls'] - $each['a_totalanswered']);
             }
             $result .= wf_TableBody($rows, '100%', 0, '');
             if ($chartsFlag) {
                 $result .= wf_gchartsLine($askoziaChartData, __('Askozia'), '100%', '300px', $chartsOptions);
             }
         }
         //Equipment
         $result .= wf_tag('h2') . __('Equipment') . wf_tag('h2', true);
         $cells = wf_TableCell(__('Month'));
         $cells .= wf_TableCell(__('Switches'));
         if ($this->ponFlag) {
             $cells .= wf_TableCell(__('PON ONU'));
         }
         if ($this->docsisFlag) {
             $cells .= wf_TableCell(__('DOCSIS Modems'));
         }
         $rows = wf_TableRow($cells, 'row1');
         foreach ($yearData as $monthNum => $each) {
             $cells = wf_TableCell($months[$monthNum]);
             $cells .= wf_TableCell($each['e_switches']);
             if ($this->ponFlag) {
                 $cells .= wf_TableCell($each['e_pononu']);
             }
             if ($this->docsisFlag) {
                 $cells .= wf_TableCell($each['e_docsis']);
             }
             $rows .= wf_TableRow($cells, 'row3');
             //chart data
             $equipChartData[] = array($months[$monthNum], $each['e_switches'], $each['e_pononu'], $each['e_docsis']);
         }
         $result .= wf_TableBody($rows, '100%', 0, '');
         if ($chartsFlag) {
             $result .= wf_gchartsLine($equipChartData, __('Equipment'), '100%', '300px', $chartsOptions);
         }
     } else {
         $result .= $this->messages->getStyledMessage(__('Nothing found'), 'info');
     }
     return $result;
 }
コード例 #14
0
ファイル: api.warehouse.php プロジェクト: nightflyza/Ubilling
 /**
  * Renders date remains report
  * 
  * @return string
  */
 public function reportDateRemains()
 {
     $result = '';
     $curyear = wf_CheckPost(array('yearsel')) ? vf($_POST['yearsel'], 3) : date("Y");
     $curmonth = wf_CheckPost(array('monthsel')) ? vf($_POST['monthsel'], 3) : date("m");
     $inputs = wf_YearSelector('yearsel', __('Year')) . ' ';
     $inputs .= wf_MonthSelector('monthsel', __('Month'), $curmonth) . ' ';
     $inputs .= wf_CheckInput('printmode', __('Print'), false, false);
     $inputs .= wf_Submit(__('Show'));
     $searchForm = wf_Form('', 'POST', $inputs, 'glamour');
     $searchForm .= wf_CleanDiv();
     //append form to result
     if (!wf_CheckPost(array('printmode'))) {
         $result .= $searchForm;
     }
     $lowerOffset = strtotime($curyear . '-' . $curmonth . '-01');
     $upperOffset = strtotime($curyear . '-' . $curmonth . '-01');
     $upperOffset = date("t", $upperOffset);
     $upperOffset = strtotime($curyear . '-' . $curmonth . '-' . $upperOffset);
     $incomingLower = array();
     $outcomingLower = array();
     if (!empty($this->allIncoming)) {
         foreach ($this->allIncoming as $io => $each) {
             $incomingDate = strtotime($each['date']);
             if ($incomingDate < $lowerOffset) {
                 if ($each['contractorid'] != 0) {
                     //ignoring move ops
                     $incomingLower[$each['id']] = $each;
                 }
             }
         }
     }
     if (!empty($this->allOutcoming)) {
         foreach ($this->allOutcoming as $io => $each) {
             $outcomingDate = strtotime($each['date']);
             if ($outcomingDate < $lowerOffset) {
                 if ($each['desttype'] != 'storage') {
                     // ignoring move ops
                     $outcomingLower[$each['id']] = $each;
                 }
             }
         }
     }
     $lowerIncome = array();
     if (!empty($incomingLower)) {
         foreach ($incomingLower as $io => $each) {
             if (isset($lowerIncome[$each['itemtypeid']])) {
                 $lowerIncome[$each['itemtypeid']]['count'] = $lowerIncome[$each['itemtypeid']]['count'] + $each['count'];
                 $lowerIncome[$each['itemtypeid']]['price'] = $lowerIncome[$each['itemtypeid']]['price'] + $each['count'] * $each['price'];
             } else {
                 $lowerIncome[$each['itemtypeid']]['count'] = $each['count'];
                 $lowerIncome[$each['itemtypeid']]['price'] = $each['count'] * $each['price'];
             }
         }
     }
     $lowerOutcome = array();
     if (!empty($outcomingLower)) {
         foreach ($outcomingLower as $io => $each) {
             if ($each['price'] == 0) {
                 $each['price'] = $this->getIncomeMiddlePrice($each['itemtypeid']);
             }
             if (isset($lowerOutcome[$each['itemtypeid']])) {
                 $lowerOutcome[$each['itemtypeid']]['count'] = $lowerOutcome[$each['itemtypeid']]['count'] + $each['count'];
                 $lowerOutcome[$each['itemtypeid']]['price'] = $lowerOutcome[$each['itemtypeid']]['price'] + $each['count'] * $each['price'];
             } else {
                 $lowerOutcome[$each['itemtypeid']]['count'] = $each['count'];
                 $lowerOutcome[$each['itemtypeid']]['price'] = $each['count'] * $each['price'];
             }
         }
     }
     //first report column here
     $lowerRemains = array();
     if (!empty($incomingLower)) {
         foreach ($incomingLower as $io => $each) {
             $outcomeCount = isset($lowerOutcome[$each['itemtypeid']]) ? $lowerOutcome[$each['itemtypeid']]['count'] : 0;
             $outcomePrice = isset($lowerOutcome[$each['itemtypeid']]) ? $lowerOutcome[$each['itemtypeid']]['price'] : 0;
             $lowerRemains[$each['itemtypeid']]['count'] = $lowerIncome[$each['itemtypeid']]['count'] - $outcomeCount;
             $lowerRemains[$each['itemtypeid']]['price'] = $lowerIncome[$each['itemtypeid']]['price'] - $outcomePrice;
         }
     }
     //second column
     $upperIncome = array();
     if (!empty($this->allIncoming)) {
         foreach ($this->allIncoming as $io => $each) {
             $incomeDate = strtotime($each['date']);
             if ($incomeDate >= $lowerOffset and $incomeDate <= $upperOffset) {
                 if ($each['contractorid'] != 0) {
                     //ignoring move ops
                     if (isset($upperIncome[$each['itemtypeid']])) {
                         $upperIncome[$each['itemtypeid']]['count'] = $upperIncome[$each['itemtypeid']]['count'] + $each['count'];
                         $upperIncome[$each['itemtypeid']]['price'] = $upperIncome[$each['itemtypeid']]['price'] + $each['count'] * $each['price'];
                     } else {
                         $upperIncome[$each['itemtypeid']]['count'] = $each['count'];
                         $upperIncome[$each['itemtypeid']]['price'] = $each['count'] * $each['price'];
                     }
                 }
             }
         }
     }
     //third column
     $upperOutcome = array();
     if (!empty($this->allOutcoming)) {
         foreach ($this->allOutcoming as $io => $each) {
             $outcomeDate = strtotime($each['date']);
             if ($outcomeDate >= $lowerOffset and $outcomeDate <= $upperOffset) {
                 if ($each['desttype'] != 'storage') {
                     //ignoring move ops
                     if ($each['price'] == 0) {
                         $each['price'] = $this->getIncomeMiddlePrice($each['itemtypeid']);
                     }
                     if (isset($upperOutcome[$each['itemtypeid']])) {
                         $upperOutcome[$each['itemtypeid']]['count'] = $upperOutcome[$each['itemtypeid']]['count'] + $each['count'];
                         $upperOutcome[$each['itemtypeid']]['price'] = $upperOutcome[$each['itemtypeid']]['price'] + $each['count'] * $each['price'];
                     } else {
                         $upperOutcome[$each['itemtypeid']]['count'] = $each['count'];
                         $upperOutcome[$each['itemtypeid']]['price'] = $each['count'] * $each['price'];
                     }
                 }
             }
         }
     }
     //mixing earlier non exists items into lower remains array
     if (!empty($upperIncome)) {
         foreach ($upperIncome as $io => $each) {
             if (!isset($lowerRemains[$io])) {
                 $lowerRemains[$io]['count'] = 0;
                 $lowerRemains[$io]['price'] = 0;
             }
         }
     }
     $result .= $this->reportDateRemainsHeader($curyear, $curmonth);
     if (!empty($lowerRemains)) {
         $firstColumnTotal = 0;
         $secondColumnTotal = 0;
         $thirdColumnTotal = 0;
         $fourthColumnTotal = 0;
         foreach ($lowerRemains as $io => $each) {
             $itemtypeId = $io;
             $firstColumnCount = isset($lowerRemains[$itemtypeId]) ? $lowerRemains[$itemtypeId]['count'] : 0;
             $firstColumnPrice = isset($lowerRemains[$itemtypeId]) ? $lowerRemains[$itemtypeId]['price'] : 0;
             $secondColumnCount = isset($upperIncome[$itemtypeId]) ? $upperIncome[$itemtypeId]['count'] : 0;
             $secondColumnPrice = isset($upperIncome[$itemtypeId]) ? $upperIncome[$itemtypeId]['price'] : 0;
             $thirdColumnCount = isset($upperOutcome[$itemtypeId]) ? $upperOutcome[$itemtypeId]['count'] : 0;
             $thirdColumnPrice = isset($upperOutcome[$itemtypeId]) ? $upperOutcome[$itemtypeId]['price'] : 0;
             $fourthColumnCount = $lowerRemains[$itemtypeId]['count'] + $secondColumnCount - $thirdColumnCount;
             $fourthColumnPrice = $lowerRemains[$itemtypeId]['price'] + $secondColumnPrice - $thirdColumnPrice;
             $result .= $this->reportDateRemainsAddRow($itemtypeId, array($firstColumnCount, round($firstColumnPrice, 2), $secondColumnCount, round($secondColumnPrice, 2), $thirdColumnCount, round($thirdColumnPrice, 2), $fourthColumnCount, round($fourthColumnPrice, 2)));
             $firstColumnTotal += $firstColumnPrice;
             $secondColumnTotal += $secondColumnPrice;
             $thirdColumnTotal += $thirdColumnPrice;
             $fourthColumnTotal += $firstColumnPrice;
         }
         $result .= $this->reportDateRemainsAddRow('', array('', $firstColumnTotal, '', $secondColumnTotal, '', $thirdColumnTotal, '', $fourthColumnTotal));
     }
     $result .= wf_tag('tbody', true);
     $result .= wf_tag('table', true);
     if (wf_CheckPost(array('printmode'))) {
         die($this->reportPrintable(__('Date remains'), $result));
     }
     return $result;
 }
コード例 #15
0
ファイル: index.php プロジェクト: l1ght13aby/Ubilling
 /**
  * Shows permissions editor for some user
  * 
  * @global object $system
  * @param string $login
  */
 function web_permissions_editor($login)
 {
     global $system;
     $regperms = zb_PermissionGroup('USERREG');
     $geoperms = zb_PermissionGroup('GEO');
     $sysperms = zb_PermissionGroup('SYSTEM');
     $finperms = zb_PermissionGroup('FINANCE');
     $repperms = zb_PermissionGroup('REPORTS');
     $catvperms = zb_PermissionGroup('CATV');
     $reginputs = '';
     $geoinputs = '';
     $sysinputs = '';
     $fininputs = '';
     $repinputs = '';
     $catvinputs = '';
     $miscinputs = '';
     $inputs = wf_Link('?module=permissions', 'Back', true, 'ubButton') . '<br>';
     $inputs .= wf_HiddenInput('save', '1');
     if ($system->getRightsForUser($login, $rights, $root, $level)) {
         if ($root) {
             $inputs .= wf_tag('p', false, 'glamour') . wf_CheckInput('rootuser', __('Root administrator'), true, true) . wf_tag('p', true) . wf_CleanDiv();
         } else {
             $inputs .= wf_tag('p', false, 'glamour') . wf_CheckInput('rootuser', __('Root administrator'), true, false) . wf_tag('p', true) . wf_CleanDiv();
             foreach ($system->rights_database as $right_id => $right_desc) {
                 //sorting inputs
                 if (!isset($regperms[$right_id]) and !isset($geoperms[$right_id]) and !isset($sysperms[$right_id]) and !isset($finperms[$right_id]) and !isset($repperms[$right_id]) and !isset($catvperms[$right_id])) {
                     $miscinputs .= wf_CheckInput('_rights[' . $right_id . ']', $right_desc . ' - ' . $right_id, true, user_check_right($login, $right_id));
                 }
                 //user register rights
                 if (isset($regperms[$right_id])) {
                     $reginputs .= wf_CheckInput('_rights[' . $right_id . ']', $right_desc . ' - ' . $right_id, true, user_check_right($login, $right_id));
                 }
                 //geo rights
                 if (isset($geoperms[$right_id])) {
                     $geoinputs .= wf_CheckInput('_rights[' . $right_id . ']', $right_desc . ' - ' . $right_id, true, user_check_right($login, $right_id));
                 }
                 //system config perms
                 if (isset($sysperms[$right_id])) {
                     $sysinputs .= wf_CheckInput('_rights[' . $right_id . ']', $right_desc . ' - ' . $right_id, true, user_check_right($login, $right_id));
                 }
                 //financial inputs
                 if (isset($finperms[$right_id])) {
                     $fininputs .= wf_CheckInput('_rights[' . $right_id . ']', $right_desc . ' - ' . $right_id, true, user_check_right($login, $right_id));
                 }
                 //reports rights
                 if (isset($repperms[$right_id])) {
                     $repinputs .= wf_CheckInput('_rights[' . $right_id . ']', $right_desc . ' - ' . $right_id, true, user_check_right($login, $right_id));
                 }
                 //catv rights
                 if (isset($catvperms[$right_id])) {
                     $catvinputs .= wf_CheckInput('_rights[' . $right_id . ']', $right_desc . ' - ' . $right_id, true, user_check_right($login, $right_id));
                 }
             }
         }
     }
     //rights grid
     $label = wf_tag('h3') . __('Users registration') . wf_tag('h3', true);
     $tablecells = wf_TableCell($label . $reginputs, '', '', 'valign="top"');
     $label = wf_tag('h3') . __('System settings') . wf_tag('h3', true);
     $tablecells .= wf_TableCell($label . $sysinputs, '', '', 'valign="top"');
     $tablerows = wf_TableRow($tablecells);
     $label = wf_tag('h3') . __('Reports') . wf_tag('h3', true);
     $tablecells = wf_TableCell($label . $repinputs, '', '', 'valign="top"');
     $label = wf_tag('h3') . __('Financial management') . wf_tag('h3', true);
     $tablecells .= wf_TableCell($label . $fininputs, '', '', 'valign="top"');
     $tablerows .= wf_TableRow($tablecells);
     $label = wf_tag('h3') . __('CaTV') . wf_tag('h3', true);
     $tablecells = wf_TableCell($label . $catvinputs, '', '', 'valign="top"');
     $label = wf_tag('h3') . __('Geography') . wf_tag('h3', true);
     $tablecells .= wf_TableCell($label . $geoinputs, '', '', 'valign="top"');
     $tablerows .= wf_TableRow($tablecells);
     $label = wf_tag('h3') . __('Misc rights') . wf_tag('h3', true);
     $tablecells = wf_TableCell($label . $miscinputs, '', '', 'valign="top"');
     $tablerows .= wf_TableRow($tablecells);
     $rightsgrid = $inputs;
     $rightsgrid .= wf_Submit('Save') . wf_delimiter();
     $rightsgrid .= wf_TableBody($tablerows, '100%', 0, 'glamour');
     $permission_forms = wf_Form("", 'POST', $rightsgrid, '');
     $permission_forms .= wf_CleanDiv();
     $permission_forms .= wf_tag('br');
     //copy permissions form
     $copyinputs = wf_tag('h2') . __('Rights cloning') . wf_tag('h2', true);
     $copyinputs .= web_AdminLoginSelector($login);
     $copyinputs .= wf_HiddenInput('clonerightsnow', 'true');
     $copyinputs .= wf_Submit(__('Clone'));
     $copyform = wf_Form("", 'POST', $copyinputs, 'glamour');
     $permission_forms .= $copyform;
     show_window(__('Rights for') . ' ' . $login, $permission_forms);
 }
コード例 #16
0
ファイル: api.sigreq.php プロジェクト: nightflyza/Ubilling
 /**
  * renders editing form
  * 
  * @return string
  */
 public function renderForm()
 {
     $inputs = '';
     $cityDispFlag = $this->checkConf('CITY_DISPLAY');
     $citySelFlag = $this->checkConf('CITY_SELECTABLE');
     $streetSelFlag = $this->checkConf('STREET_SELECTABLE');
     $emailDispFlag = $this->checkConf('EMAIL_DISPLAY');
     $spamDispFlag = $this->checkConf('SPAM_TRAPS');
     $cachingFlag = $this->checkConf('CACHING');
     $inputs .= wf_CheckInput('newcitydisplay', __('Display city input'), true, $cityDispFlag);
     $inputs .= wf_CheckInput('newcityselectable', __('Show city input as combobox'), true, $citySelFlag);
     $inputs .= wf_CheckInput('newstreetselectable', __('Show street input as combobox'), true, $streetSelFlag);
     $inputs .= wf_CheckInput('newemaildisplay', __('Display email field'), true, $emailDispFlag);
     $inputs .= wf_CheckInput('newespamtraps', __('Render spambots protection traps'), true, $spamDispFlag);
     $inputs .= wf_CheckInput('newcaching', __('Database connections caching'), true, $cachingFlag);
     $inputs .= wf_TextInput('newispname', __('Your ISP Name'), @$this->configRaw['ISP_NAME'], true, 25);
     $inputs .= wf_TextInput('newispurl', __('Your ISP site URL'), @$this->configRaw['ISP_URL'], true, 25);
     $inputs .= wf_TextInput('newisplogo', __('Your ISP logo URL'), @$this->configRaw['ISP_LOGO'], true, 25);
     $inputs .= wf_tag('label') . __('Sidebar text - contacts, phones etc.') . ' (HTML)' . wf_tag('label', true) . wf_tag('br');
     $inputs .= wf_TextArea('newsidebartext', '', @$this->configRaw['SIDEBAR_TEXT'], true, '50x10');
     $inputs .= wf_tag('label') . __('Greeting text') . ' (HTML)' . wf_tag('label', true) . wf_tag('br');
     $inputs .= wf_TextArea('newgreetingtext', '', @$this->configRaw['GREETING_TEXT'], true, '50x5');
     $inputs .= wf_TextInput('newservices', __('Services offered') . ' ' . __('(separator - comma)'), @$this->configRaw['SERVICES'], true, 25);
     $inputs .= wf_TextInput('newtariffs', __('Tariffs offered') . ' ' . __('(separator - comma)'), @$this->configRaw['TARIFFS'], true, 25);
     $inputs .= wf_TextInput('newhideouts', __('City and streets hide lists') . ' ' . __('(separator - comma)'), @$this->configRaw['HIDEOUTS'], true, 25);
     $inputs .= wf_HiddenInput('changesettings', 'true');
     $inputs .= wf_delimiter();
     $inputs .= wf_Submit(__('Save'));
     $result = wf_Form('', 'POST', $inputs, 'glamour');
     $result .= wf_Link('?module=sigreq', __('Back'), true, 'ubButton');
     return $result;
 }
コード例 #17
0
/**
 * Returns swtitch and port assign form. Includes internal controller.
 * 
 * @param string $login
 * @param array $allswitches
 * @param array $allportassigndata
 * @param int $suggestswitchid
 * @param int $suggestswitchport
 * @return string
 */
function web_SnmpSwitchControlForm($login, $allswitches, $allportassigndata, $suggestswitchid = '', $suggestswitchport = '')
{
    $login = mysql_real_escape_string($login);
    $switcharr = array();
    if (!empty($allswitches)) {
        foreach ($allswitches as $io => $eachswitch) {
            $switcharr[$eachswitch['id']] = $eachswitch['ip'] . ' - ' . $eachswitch['location'];
        }
    }
    //getting current data
    $assignData = array();
    if (isset($allportassigndata[$login])) {
        $assignData = $allportassigndata[$login];
    }
    $sameUsers = '';
    if (!empty($assignData)) {
        $currentSwitchPort = $assignData['port'];
        $currentSwitchId = $assignData['switchid'];
    } else {
        $currentSwitchPort = '';
        $currentSwitchId = '';
    }
    //control form construct
    $inputs = wf_HiddenInput('swassignlogin', $login);
    $inputs .= wf_Selector('swassignswid', $switcharr, __('Switch'), $suggestswitchid, true);
    $inputs .= wf_TextInput('swassignswport', __('Port'), $suggestswitchport, false, '2');
    $inputs .= wf_CheckInput('swassigndelete', __('Delete'), true, false);
    $inputs .= wf_Submit('Save');
    $controlForm = wf_Form('', "POST", $inputs, 'glamour');
    //form end
    $switchAssignController = wf_modal(web_edit_icon(), __('Switch port assign'), $controlForm, '', '450', '200');
    $cells = wf_TableCell(__('Switch'), '30%', 'row2');
    $cells .= wf_TableCell(@$switcharr[$currentSwitchId]);
    $rows = wf_TableRow($cells, 'row3');
    $cells = wf_TableCell(__('Port'), '30%', 'row2');
    $cells .= wf_TableCell($currentSwitchPort);
    $rows .= wf_TableRow($cells, 'row3');
    $cells = wf_TableCell(__('Change'), '30%', 'row2');
    $cells .= wf_TableCell($switchAssignController);
    $rows .= wf_TableRow($cells, 'row3');
    $result = wf_TableBody($rows, '100%', '0');
    //update subroutine
    if (wf_CheckPost(array('swassignlogin', 'swassignswid', 'swassignswport'))) {
        $newswid = vf($_POST['swassignswid'], 3);
        $newport = vf($_POST['swassignswport'], 3);
        nr_query("DELETE from `switchportassign` WHERE `login`='" . $_POST['swassignlogin'] . "'");
        nr_query("INSERT INTO `switchportassign` (`id` ,`login` ,`switchid` ,`port`) VALUES (NULL , '" . $_POST['swassignlogin'] . "', '" . $newswid . "', '" . $newport . "');");
        log_register("CHANGE SWITCHPORT (" . $login . ") ON SWITCHID [" . $newswid . "] PORT [" . $newport . "]");
        rcms_redirect('?module=switchpoller&switchid=' . $suggestswitchid);
    }
    //delete subroutine
    if (isset($_POST['swassigndelete'])) {
        nr_query("DELETE from `switchportassign` WHERE `login`='" . $_POST['swassignlogin'] . "'");
        log_register("DELETE SWITCHPORT (" . $login . ")");
        rcms_redirect('?module=switchpoller&switchid=' . $suggestswitchid);
    }
    return $result;
}
コード例 #18
0
ファイル: api.watchdog.php プロジェクト: l1ght13aby/Ubilling
 public function editTaskForm($taskID)
 {
     $taskID = vf($taskID, 3);
     if (empty($taskID)) {
         throw new Exception(self::TASKID_EX);
     }
     $checktypes = array('icmpping' => 'icmpping', 'tcpping' => 'tcpping', 'script' => 'script', 'getusertraff' => 'getusertraff', 'fileexists' => 'fileexists');
     $operators = array('=true' => '=true', '=false' => '=false', '==' => '==', '!=' => '!=', '>' => '>', '<' => '<', 'empty' => 'empty', 'changed' => 'changed', 'notchanged' => 'notchanged', 'like' => 'like', 'notlike' => 'notlike');
     $inputs = wf_TextInput('editname', __('Name'), $this->allTasks[$taskID]['name'], true);
     $inputs .= wf_Selector('editchecktype', $checktypes, __('Check type'), $this->allTasks[$taskID]['checktype'], true);
     $inputs .= wf_TextInput('editparam', __('Parameter'), $this->allTasks[$taskID]['param'], true);
     $inputs .= wf_Selector('editoperator', $operators, __('Operator'), $this->allTasks[$taskID]['operator'], true);
     $inputs .= wf_TextInput('editcondition', __('Condition'), $this->allTasks[$taskID]['condition'], true);
     $inputs .= wf_TextInput('editaction', __('Actions'), $this->allTasks[$taskID]['action'], true);
     $inputs .= wf_CheckInput('editactive', __('Active'), true, $this->allTasks[$taskID]['active']);
     $inputs .= wf_Submit(__('Save'));
     $form = wf_Form("", 'POST', $inputs, 'glamour');
     $form .= wf_Link("?module=watchdog", __('Back'), true, 'ubButton');
     return $form;
 }
コード例 #19
0
ファイル: index.php プロジェクト: nightflyza/Ubilling
 /**
  * Returns modal window with SMS creation form
  * 
  * @return string
  */
 public function smsCreateForm()
 {
     $result = '';
     $inputs = wf_TextInput('newsmsnumber', __('Mobile'), '', true, '20');
     $inputs .= wf_TextArea('newsmsmessage', '', '', true, '30x5');
     $inputs .= wf_CheckInput('newsmstranslit', __('Forced transliteration'), true, true);
     $inputs .= wf_Submit(__('Create'));
     $form = wf_Form('', 'POST', $inputs, 'glamour');
     $result = wf_modalAuto(wf_img('skins/add_icon.png', __('Create new SMS')), __('Create new SMS'), $form, '');
     return $result;
 }
コード例 #20
0
 /**
  * Formats existing menu data into printable HTML code as personalization form
  * 
  * @return string
  */
 public function getEditForm()
 {
     $result = '';
     $tmpArr = array();
     if (!empty($this->categories)) {
         if (!empty($this->rawData)) {
             foreach ($this->rawData as $io => $each) {
                 //table headers
                 if (!isset($tmpArr[$each['CATEGORY']])) {
                     $formCells = wf_TableCell(__('Module'), '50%');
                     $formCells .= wf_TableCell(__('Hidden'));
                     $formCells .= wf_TableCell(__('Fast access'));
                     $formRows = wf_TableRow($formCells, 'row1');
                     $tmpArr[$each['CATEGORY']] = $formRows;
                 }
                 //table rows
                 $icon = !empty($each['ICON']) ? $each['ICON'] : self::DEFAULT_ICON;
                 $icon = $this->iconsPath . $icon;
                 $name = __($each['NAME']);
                 $checkRight = !empty($each['NEED_RIGHT']) ? cfr($each['NEED_RIGHT']) : true;
                 $checkOption = !empty($each['NEED_OPTION']) ? @$this->altCfg[$each['NEED_OPTION']] : true;
                 if ($checkRight and $checkOption) {
                     $formCells = wf_TableCell(wf_Link($each['URL'], wf_img($icon) . ' ' . $name, false));
                     $disabledFlag = isset($this->disabled[$io]) ? true : false;
                     $formCells .= wf_TableCell(wf_CheckInput('_glmdisabled[' . $io . ']', '', false, $disabledFlag));
                     $fastAccessFlag = isset($this->fastAccess[$io]) ? true : false;
                     $formCells .= wf_TableCell(wf_CheckInput('_glmfastacc[' . $io . ']', '', false, $fastAccessFlag));
                     $formRows = wf_TableRow($formCells, 'row3');
                     $tmpArr[$each['CATEGORY']] .= $formRows;
                 }
             }
         }
         foreach ($this->categories as $eachCategoryName => $eachCategoryId) {
             $result .= wf_tag('h3', false) . __($eachCategoryName) . wf_tag('h3', true);
             $result .= wf_TableBody($tmpArr[$eachCategoryId], '100%', 0, '');
         }
     }
     if (!empty($result)) {
         $result .= wf_HiddenInput('glcustomconfedit', 'true');
         $result .= wf_tag('br');
         $result .= wf_Submit(__('Save'));
         $result = wf_Form('', 'POST', $result, '');
     }
     return $result;
 }
コード例 #21
0
ファイル: index.php プロジェクト: l1ght13aby/Ubilling
 function web_ZbsManEditForm($login)
 {
     $access = zb_GetUserStatsDeniedAll();
     $helpdesk = zb_GetHelpdeskDeniedAll();
     if (isset($access[$login])) {
         $checked_us = true;
     } else {
         $checked_us = false;
     }
     if (isset($helpdesk[$login])) {
         $checked_hd = true;
     } else {
         $checked_hd = false;
     }
     $inputs = wf_CheckInput('access_denied', __('Userstats access denied for this user'), true, $checked_us);
     $inputs .= wf_CheckInput('helpdesk_denied', __('Helpdesk access denied for this user'), true, $checked_hd);
     $inputs .= wf_HiddenInput('zbsman_change', 'true');
     $inputs .= wf_Submit(__('Save'));
     $result = wf_Form('', "POST", $inputs, 'glamour');
     return $result;
 }
コード例 #22
0
ファイル: index.php プロジェクト: nightflyza/Ubilling
 /**
  * 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;
 }
コード例 #23
0
ファイル: api.cess.php プロジェクト: l1ght13aby/Ubilling
/**
 * Renders agent strict assign form
 * 
 * @return string
 */
function web_AgentAssignStrictForm($login, $currentassign)
{
    if (!empty($currentassign)) {
        $agentData = zb_ContrAhentGetData($currentassign);
        @($currentAgentName = $agentData['contrname']);
    } else {
        $currentAgentName = __('No');
    }
    $inputs = zb_ContrAhentSelectPreset($currentassign);
    $inputs .= wf_HiddenInput('assignstrictlogin', $login);
    $deleteCheckbox = wf_CheckInput('deleteassignstrict', __('Delete'), false, false);
    $cells = wf_TableCell(__('Service provider'), '', 'row2');
    $cells .= wf_TableCell($currentAgentName, '', 'row3');
    $rows = wf_tablerow($cells);
    $cells = wf_TableCell(__('New assign'), '', 'row2');
    $cells .= wf_TableCell($inputs, '', 'row3');
    $rows .= wf_tablerow($cells);
    $cells = wf_TableCell('', '', 'row2');
    $cells .= wf_TableCell($deleteCheckbox, '', 'row3');
    $rows .= wf_tablerow($cells);
    $form = wf_TableBody($rows, '100%', 0);
    $form .= wf_Submit('Save');
    $result = wf_Form("", 'POST', $form, '');
    return $result;
}
コード例 #24
0
ファイル: index.php プロジェクト: l1ght13aby/Ubilling
 if (cfr('ROOT')) {
     $phpinputs .= wf_Link("?module=migration", 'Migration', false, 'ubButton');
     $phpinputs .= wf_Link("?module=migration2", __('Migration') . ' 2', false, 'ubButton');
 }
 if (cfr('MIKMIGR')) {
     $sqlinputs .= wf_Link("?module=mikbill_migration", __('Migration') . ' mikbill', true, 'ubButton');
 }
 //is template run or clear area?
 if (wf_CheckGet(array('runtpl'))) {
     $rawtemplate = zb_PhpConsoleGetTemplate($_GET['runtpl']);
     $runcode = $rawtemplate['body'];
 } else {
     $runcode = '';
 }
 $phpinputs .= wf_TextArea('phpq', '', $runcode, true, '80x10');
 $phpinputs .= wf_CheckInput('phphightlight', 'Hightlight this PHP code', true, true);
 $phpinputs .= wf_Submit('Run this code inside framework');
 $phpform = wf_Form('?module=sqlconsole&devconsole=true', 'POST', $phpinputs, 'glamour');
 //php console grid assemble
 $phpcells = wf_TableCell($phpform, '50%', '', 'valign="top"');
 if (wf_CheckGet(array('templateadd'))) {
     //show template creation form
     $phpcells .= wf_TableCell(web_PhpConsoleTemplateCreateForm(), '50%', '', 'valign="top"');
 } else {
     if (wf_CheckGet(array('edittemplate'))) {
         //show template edit form
         $phpcells .= wf_TableCell(web_PhpConsoleTemplateEditForm($_GET['edittemplate']), '50%', '', 'valign="top"');
     } else {
         //show template list
         $phpcells .= wf_TableCell(web_PhpConsoleShowTemplates(), '50%', '', 'valign="top"');
     }
コード例 #25
0
ファイル: index.php プロジェクト: l1ght13aby/Ubilling
 } else {
     //database restoration functionality
     if (cfr('ROOT')) {
         if (!empty($alterConf['MYSQL_PATH'])) {
             if (wf_CheckGet(array('restoredump'))) {
                 $mysqlConf = rcms_parse_ini_file(CONFIG_PATH . 'mysql.ini');
                 $billingConf = $ubillingConfig->getBilling();
                 $restoreFilename = base64_decode($_GET['restoredump']);
                 if (file_exists($restoreFilename)) {
                     if ($billingConf['NOSTGCHECKPID'] and !file_exists($billingConf['STGPID'])) {
                         if (!isset($_POST['lastchanceok'])) {
                             $lastChanceInputs = __('Restoring a database from a dump, completely and permanently destroy your current database. Think again if you really want it.');
                             $lastChanceInputs .= wf_tag('br');
                             $lastChanceInputs .= __('Filename') . ': ' . $restoreFilename;
                             $lastChanceInputs .= wf_tag('br');
                             $lastChanceInputs .= wf_CheckInput('lastchanceok', __('I`m ready'), true, false);
                             $lastChanceInputs .= wf_Submit(__('Restore DB'));
                             $lastChanceForm = wf_Form('', 'POST', $lastChanceInputs, 'glamour');
                             show_window(__('Warning'), $lastChanceForm);
                             show_window('', wf_Link('?module=backups', __('Back'), true, 'ubButton'));
                         } else {
                             $restoreCommand = $alterConf['MYSQL_PATH'] . ' -u ' . $mysqlConf['username'] . ' -p' . $mysqlConf['password'] . ' ' . $mysqlConf['db'] . ' --default-character-set=utf8 < ' . $restoreFilename;
                             //show_window(__('Debug'),$restoreCommand);
                             show_window(__('Result'), shell_exec($restoreCommand));
                         }
                     } else {
                         log_register("BACKUP RESTORE TRY WITH RUNNING STARGAZER");
                         show_error(__('You can restore database only with enabled NOSTGCHECKPID option and stopped Stargazer'));
                         show_window('', wf_Link('?module=backups', __('Back'), true, 'ubButton'));
                     }
                 } else {
コード例 #26
0
ファイル: api.teskman.php プロジェクト: carriercomm/Ubilling
/**
 * 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);
        }
    }
}
コード例 #27
0
ファイル: api.salary.php プロジェクト: carriercomm/Ubilling
 /**
  * Renders timesheet editing form
  * 
  * @param string $timesheetDate
  * 
  * @return string
  */
 public function timesheetEditForm($timesheetDate)
 {
     $result = '';
     $timesheetData = $this->timesheetFilterDate($timesheetDate);
     if (!empty($timesheetData)) {
         $headers = wf_TableCell(__('Worker'));
         $headers .= wf_TableCell(__('Hours'));
         $headers .= wf_TableCell(__('Hospitalized'));
         $headers .= wf_TableCell(__('Holidays'));
         $headers .= wf_TableCell(__('Actions'));
         $rows = wf_TableRow($headers, 'row1');
         foreach ($timesheetData as $io => $each) {
             $hospitalFlag = $each['hospital'] ? true : false;
             $holidayFlag = $each['holiday'] ? true : false;
             $cells = wf_TableCell(@$this->allEmployeeRaw[$each['employeeid']]);
             $cells .= wf_TableCell(wf_TextInput('editemployeehours', '', $each['hours'], false, '2'));
             $cells .= wf_TableCell(wf_CheckInput('edithospital', '', false, $hospitalFlag));
             $cells .= wf_TableCell(wf_CheckInput('editholiday', '', false, $holidayFlag));
             $cells .= wf_TableCell(wf_HiddenInput('edittimesheetid', $each['id']) . wf_Submit(__('Save')));
             $cells = wf_Form('', 'POST', $cells, '');
             $rows .= wf_TableRow($cells, 'row3');
         }
         $result .= wf_TableBody($rows, '100%', '0', '');
         $result .= wf_tag('br', false);
     }
     return $result;
 }
コード例 #28
0
ファイル: api.ukv.php プロジェクト: l1ght13aby/Ubilling
 /**
  * returns banksta processing form for some hash
  * 
  * @param string $hash  existing preprocessing bank statement hash
  * 
  * @return string
  */
 public function bankstaProcessingForm($hash)
 {
     $hash = mysql_real_escape_string($hash);
     $query = "SELECT * from `ukv_banksta` WHERE `hash`='" . $hash . "' ORDER BY `id` ASC;";
     $all = simple_queryall($query);
     $cashPairs = array();
     $cells = wf_TableCell(__('ID'));
     $cells .= wf_TableCell(__('Address'));
     $cells .= wf_TableCell(__('Real Name'));
     $cells .= wf_TableCell(__('Contract'));
     $cells .= wf_TableCell(__('Cash'));
     $cells .= wf_TableCell(__('Processed'));
     $cells .= wf_TableCell(__('Contract'));
     $cells .= wf_TableCell(__('Real Name'));
     $cells .= wf_TableCell(__('Address'));
     $cells .= wf_TableCell(__('Tariff'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($all)) {
         foreach ($all as $io => $each) {
             $AddInfoControl = wf_Link(self::URL_BANKSTA_DETAILED . $each['id'], $each['id'], false, '');
             $processed = $each['processed'] ? true : false;
             $cells = wf_TableCell($AddInfoControl);
             $cells .= wf_TableCell($each['address']);
             $cells .= wf_TableCell($each['realname']);
             if (!$processed) {
                 $editInputs = wf_TextInput('newbankcontr', '', $each['contract'], false, '6');
                 $editInputs .= wf_CheckInput('lockbankstarow', __('Lock'), false, false);
                 $editInputs .= wf_HiddenInput('bankstacontractedit', $each['id']);
                 $editInputs .= wf_Submit(__('Save'));
                 $editForm = wf_Form('', 'POST', $editInputs);
             } else {
                 $editForm = $each['contract'];
             }
             $cells .= wf_TableCell($editForm);
             $cells .= wf_TableCell($each['summ']);
             $cells .= wf_TableCell(web_bool_led($processed));
             //user detection
             if (isset($this->contracts[$each['contract']])) {
                 $detectedUser = $this->users[$this->contracts[$each['contract']]];
                 $detectedContract = wf_Link(self::URL_USERS_PROFILE . $detectedUser['id'], web_profile_icon() . ' ' . $detectedUser['contract'], false, '');
                 $detectedAddress = $detectedUser['street'] . ' ' . $detectedUser['build'] . '/' . $detectedUser['apt'];
                 $detectedRealName = $detectedUser['realname'];
                 $detectedTariff = $detectedUser['tariffid'];
                 $detectedTariff = $this->tariffs[$detectedTariff]['tariffname'];
                 if (!$processed) {
                     $cashPairs[$each['id']]['bankstaid'] = $each['id'];
                     $cashPairs[$each['id']]['userid'] = $detectedUser['id'];
                     $cashPairs[$each['id']]['usercontract'] = $detectedUser['contract'];
                     $cashPairs[$each['id']]['summ'] = $each['summ'];
                     $cashPairs[$each['id']]['payid'] = $each['payid'];
                 }
                 $rowClass = 'row3';
                 //try to highlight multiple payments
                 if (!isset($this->bankstafoundusers[$each['contract']])) {
                     $this->bankstafoundusers[$each['contract']] = $detectedUser['id'];
                 } else {
                     $rowClass = 'ukvbankstadup';
                 }
             } else {
                 $detectedContract = '';
                 $detectedAddress = '';
                 $detectedRealName = '';
                 $detectedTariff = '';
                 if ($each['processed'] == 1) {
                     $rowClass = 'row2';
                 } else {
                     $rowClass = 'undone';
                 }
             }
             $cells .= wf_TableCell($detectedContract);
             $cells .= wf_TableCell($detectedRealName);
             $cells .= wf_TableCell($detectedAddress);
             $cells .= wf_TableCell($detectedTariff);
             $rows .= wf_TableRow($cells, $rowClass);
         }
     }
     $result = wf_TableBody($rows, '100%', '0', '');
     if (!empty($cashPairs)) {
         $cashPairs = serialize($cashPairs);
         $cashPairs = base64_encode($cashPairs);
         $cashInputs = wf_HiddenInput('bankstaneedpaymentspush', $cashPairs);
         $cashInputs .= wf_Submit(__('Bank statement processing'));
         $result .= wf_Form('', 'POST', $cashInputs, 'glamour');
     }
     return $result;
 }
コード例 #29
0
ファイル: api.corps.php プロジェクト: l1ght13aby/Ubilling
 /**
  * returns user unbind form
  * 
  * @param $login string Existing user login
  * 
  * @return string
  */
 public function userUnbindForm($login)
 {
     $login = mysql_real_escape_string($login);
     $result = '';
     if (isset($this->users[$login])) {
         $inputs = wf_HiddenInput('corpsunbindlogin', $login);
         $inputs .= wf_CheckInput('unbindagree', __('I am quite sure that I was going to do'), false, false);
         $inputs .= wf_Submit(__('Destroy user link'));
         $result = wf_Form("", 'POST', $inputs, 'glamour');
         $result .= wf_delimiter();
         $result .= web_UserControls($login);
     } else {
         $result = __('Not existing item');
     }
     return $result;
 }