Example #1
0
 /**
  * Renders list of available SMS in queue with some controls
  * 
  * @return string
  */
 public function render()
 {
     $result = '';
     if (!empty($this->queue)) {
         $cells = wf_TableCell(__('Date'));
         $cells .= wf_TableCell(__('Mobile'));
         $cells .= wf_TableCell(__('Actions'));
         $rows = wf_TableRow($cells, 'row1');
         foreach ($this->queue as $io => $each) {
             $cells = wf_TableCell($each['date']);
             $cells .= wf_TableCell($each['number']);
             $actLinks = wf_modalAuto(wf_img('skins/icon_search_small.gif', __('Preview')), __('Preview'), $this->smsPreview($each), '');
             $actLinks .= wf_JSAlert('?module=tsmsqueue&deletesms=' . $each['filename'], web_delete_icon(), __('Are you serious'));
             $cells .= wf_TableCell($actLinks);
             $rows .= wf_TableRow($cells, 'row3');
         }
         $result = wf_TableBody($rows, '100%', 0, 'sortable');
     } else {
         $result .= wf_tag('span', false, 'alert_info');
         $result .= wf_tag('center', false);
         $result .= __('Nothing found');
         $result .= wf_tag('center', true);
         $result .= wf_tag('span', true);
     }
     return $result;
 }
Example #2
0
 function web_AvailableDBBackupsList()
 {
     $backupsPath = DATA_PATH . 'backups/sql/';
     $availbacks = rcms_scandir($backupsPath);
     $result = __('No existing DB backups here');
     if (!empty($availbacks)) {
         $cells = wf_TableCell(__('Date'));
         $cells .= wf_TableCell(__('Size'));
         $cells .= wf_TableCell(__('Filename'));
         $cells .= wf_TableCell(__('Actions'));
         $rows = wf_TableRow($cells, 'row1');
         foreach ($availbacks as $eachDump) {
             $fileDate = filectime($backupsPath . $eachDump);
             $fileDate = date("Y-m-d H:i:s", $fileDate);
             $fileSize = filesize($backupsPath . $eachDump);
             $fileSize = stg_convert_size($fileSize);
             $encodedDumpPath = base64_encode($backupsPath . $eachDump);
             $downloadLink = wf_Link('?module=backups&download=' . $encodedDumpPath, $eachDump, false, '');
             $actLinks = wf_JSAlert('?module=backups&deletedump=' . $encodedDumpPath, web_delete_icon(), __('Removing this may lead to irreparable results')) . ' ';
             $actLinks .= wf_Link('?module=backups&download=' . $encodedDumpPath, wf_img('skins/icon_download.png', __('Download')), false, '');
             $actLinks .= wf_JSAlert('?module=backups&restore=true&restoredump=' . $encodedDumpPath, wf_img('skins/icon_restoredb.png', __('Restore DB')), __('Are you serious'));
             $cells = wf_TableCell($fileDate);
             $cells .= wf_TableCell($fileSize);
             $cells .= wf_TableCell($downloadLink);
             $cells .= wf_TableCell($actLinks);
             $rows .= wf_TableRow($cells, 'row3');
         }
         $result = wf_TableBody($rows, '100%', '0', 'sortable');
     }
     return $result;
 }
Example #3
0
/**
 * Render available tag types list with all needed controls
 * 
 * @return string
 */
function stg_show_tagtypes()
{
    $messages = new UbillingMessageHelper();
    $query = "SELECT * from `tagtypes` ORDER BY `id` ASC";
    $alltypes = simple_queryall($query);
    $cells = wf_TableCell(__('ID'));
    $cells .= wf_TableCell(__('Color'));
    $cells .= wf_TableCell(__('Priority'));
    $cells .= wf_TableCell(__('Text'));
    $cells .= wf_TableCell(__('Actions'));
    $rows = wf_TableRow($cells, 'row1');
    if (!empty($alltypes)) {
        foreach ($alltypes as $io => $eachtype) {
            $eachtagcolor = $eachtype['tagcolor'];
            $actions = wf_JSAlert('?module=usertags&delete=' . $eachtype['id'], web_delete_icon(), $messages->getDeleteAlert());
            $actions .= wf_JSAlert('?module=usertags&edit=' . $eachtype['id'], web_edit_icon(), $messages->getEditAlert());
            $cells = wf_TableCell($eachtype['id']);
            $cells .= wf_TableCell(wf_tag('font', false, '', 'color="' . $eachtagcolor . '"') . $eachtagcolor . wf_tag('font', true));
            $cells .= wf_TableCell($eachtype['tagsize']);
            $cells .= wf_TableCell($eachtype['tagname']);
            $cells .= wf_TableCell($actions);
            $rows .= wf_TableRow($cells, 'row3');
        }
    }
    $result = wf_TableBody($rows, '100%', 0, 'sortable');
    //construct adding form
    $inputs = wf_ColPicker('newcolor', __('Color'), '#' . rand(11, 99) . rand(11, 99) . rand(11, 99), false, '10');
    $inputs .= wf_TextInput('newtext', __('Text'), '', false, '15');
    $inputs .= web_priority_selector() . ' ';
    $inputs .= wf_HiddenInput('addnewtag', 'true');
    $inputs .= wf_Submit(__('Create'));
    $form = wf_Form("", 'POST', $inputs, 'glamour');
    $result .= $form;
    return $result;
}
Example #4
0
 /**
  * Returns available administrators list
  * 
  * @return string
  */
 function web_list_admins()
 {
     $alladmins = rcms_scandir(USERS_PATH);
     $cells = wf_TableCell(__('Admin'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($alladmins)) {
         foreach ($alladmins as $eachadmin) {
             $actions = wf_JSAlert('?module=permissions&delete=' . $eachadmin, web_delete_icon(), 'Removing this may lead to irreparable results');
             $actions .= wf_Link('?module=permissions&passwd=' . $eachadmin, web_key_icon());
             $actions .= wf_Link('?module=permissions&edit=' . $eachadmin, web_edit_icon('Rights'));
             $cells = wf_TableCell($eachadmin);
             $cells .= wf_TableCell($actions);
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     $form = wf_TableBody($rows, '100%', '0', 'sortable');
     return $form;
 }
Example #5
0
 function web_UsersLister($users)
 {
     $tablecells = wf_TableCell(__('Login'));
     $tablecells .= wf_TableCell(__('Real Name'));
     $tablecells .= wf_TableCell(__('Full address'));
     $tablecells .= wf_TableCell(__('Tariff'));
     $tablecells .= wf_TableCell(__('Tariff speeds'));
     $tablecells .= wf_TableCell(__('Speed override'));
     $tablecells .= wf_TableCell(__('Actions'));
     $tablerows = wf_TableRow($tablecells, 'row1');
     if (!empty($users)) {
         $udata = array();
         $alluserdata = zb_UserGetAllStargazerData();
         $alladdress = zb_AddressGetFulladdresslist();
         $allrealnames = zb_UserGetAllRealnames();
         $allspeeds = zb_TariffGetAllSpeeds();
         if (!empty($alluserdata)) {
             foreach ($alluserdata as $ia => $eachdata) {
                 $udata[$eachdata['login']]['Tariff'] = $eachdata['Tariff'];
                 @($udata[$eachdata['login']]['Address'] = $alladdress[$eachdata['login']]);
                 @($udata[$eachdata['login']]['RealName'] = $allrealnames[$eachdata['login']]);
                 @($udata[$eachdata['login']]['NormalSpeedDown'] = $allspeeds[$eachdata['Tariff']]['speeddown']);
                 @($udata[$eachdata['login']]['NormalSpeedUp'] = $allspeeds[$eachdata['Tariff']]['speedup']);
             }
         }
         foreach ($users as $io => $eachuser) {
             $tablecells = wf_TableCell(wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $eachuser['login']));
             $tablecells .= wf_TableCell($udata[$eachuser['login']]['RealName']);
             $tablecells .= wf_TableCell($udata[$eachuser['login']]['Address']);
             $tablecells .= wf_TableCell($udata[$eachuser['login']]['Tariff']);
             $tablecells .= wf_TableCell($udata[$eachuser['login']]['NormalSpeedDown'] . '/' . $udata[$eachuser['login']]['NormalSpeedUp']);
             $tablecells .= wf_TableCell(zb_UserGetSpeedOverride($eachuser['login']));
             $fixlink = wf_JSAlert('?module=speedcontrol&fix=' . $eachuser['login'], '<img src="skins/icon_repair.gif" title=' . __('Fix') . '>', 'Are you serious');
             $tablecells .= wf_TableCell($fixlink);
             $tablerows .= wf_TableRow($tablecells, 'row3');
         }
     }
     $result = wf_TableBody($tablerows, '100%', '0', 'sortable');
     return $result;
 }
Example #6
0
function web_NasTemplatesShow()
{
    $query = "SELECT * from `nastemplates`";
    $alltemplates = simple_queryall($query);
    $tablecells = wf_TableCell(__('ID'));
    $tablecells .= wf_TableCell(__('NAS'));
    $tablecells .= wf_TableCell(__('Template'));
    $tablecells .= wf_TableCell(__('Actions'));
    $tablerows = wf_TableRow($tablecells, 'row1');
    if (!empty($alltemplates)) {
        foreach ($alltemplates as $io => $eachtemplate) {
            $nasdata = zb_NasGetData($eachtemplate['nasid']);
            $tablecells = wf_TableCell($eachtemplate['id']);
            $tablecells .= wf_TableCell($eachtemplate['nasid'] . ':' . $nasdata['nasname']);
            $tablecells .= wf_TableCell('<pre>' . $eachtemplate['template'] . '</pre>');
            $actions = wf_JSAlert("?module=radiust&delete=" . $eachtemplate['id'], web_delete_icon(), 'Are you serious');
            $actions .= wf_Link("?module=radiust&edit=" . $eachtemplate['id'], web_edit_icon(), false, '');
            $tablecells .= wf_TableCell($actions);
            $tablerows .= wf_TableRow($tablecells, 'row3');
        }
    }
    $result = wf_TableBody($tablerows, '100%', '0', 'sortable');
    show_window(__('Available NAS Radius attribute templates'), $result);
}
Example #7
0
 function web_PhpConsoleShowTemplates()
 {
     $alltemplatekeys = zb_StorageFindKeys('PHPCONSOLETEMPLATE:');
     $tablecells = wf_TableCell(__('Template'), '80%');
     $tablecells .= wf_TableCell(__('Actions'));
     $tablerows = wf_TableRow($tablecells, 'row1');
     if (!empty($alltemplatekeys)) {
         foreach ($alltemplatekeys as $eachtemplatekey) {
             $templatearray = zb_PhpConsoleGetTemplate($eachtemplatekey['key']);
             $templatename = $templatearray['name'];
             $templatebody = $templatearray['body'];
             //show code template
             $runlink = wf_JSAlert('?module=sqlconsole&devconsole=true&runtpl=' . $eachtemplatekey['key'], $templatename, 'Insert this template into PHP console');
             $tablecells = wf_TableCell($runlink);
             $actionlinks = wf_JSAlert('?module=sqlconsole&devconsole=true&deltemplate=' . $eachtemplatekey['key'], web_delete_icon(), 'Are you serious');
             $actionlinks .= wf_Link('?module=sqlconsole&devconsole=true&edittemplate=' . $eachtemplatekey['key'], web_edit_icon());
             $tablecells .= wf_TableCell($actionlinks);
             $tablerows .= wf_TableRow($tablecells, 'row3');
         }
     }
     $createlink = __('Available code templates') . ' ' . wf_Link("?module=sqlconsole&devconsole=true&templateadd=true", wf_img("skins/icon_add.gif", __('Create')), false);
     $result = $createlink . ' ' . wf_TableBody($tablerows, '100%', '0', 'sortable');
     return $result;
 }
Example #8
0
function multinet_show_available_services()
{
    $allservices = multinet_get_services();
    $tablecells = wf_TableCell(__('ID'));
    $tablecells .= wf_TableCell(__('Network'));
    $tablecells .= wf_TableCell(__('Service name'));
    $tablecells .= wf_TableCell(__('Actions'));
    $tablerows = wf_TableRow($tablecells, 'row1');
    if (!empty($allservices)) {
        foreach ($allservices as $io => $eachservice) {
            $netdesc = multinet_get_network_params($eachservice['netid']);
            $tablecells = wf_TableCell($eachservice['id']);
            $tablecells .= wf_TableCell($netdesc['desc']);
            $tablecells .= wf_TableCell($eachservice['desc']);
            $actionlinks = wf_JSAlert('?module=multinet&deleteservice=' . $eachservice['id'], web_delete_icon(), 'Removing this may lead to irreparable results');
            $actionlinks .= wf_JSAlert('?module=multinet&editservice=' . $eachservice['id'], web_edit_icon(), 'Are you serious');
            $tablecells .= wf_TableCell($actionlinks);
            $tablerows .= wf_TableRow($tablecells, 'row3');
        }
    }
    $result = wf_TableBody($tablerows, '100%', '0', 'sortable');
    show_window(__('Services'), $result);
}
Example #9
0
         //show dead switch time machine
         if (!isset($_GET['snapshot'])) {
             //cleanup subroutine
             if (wf_CheckGet(array('flushalldead'))) {
                 ub_SwitchesTimeMachineCleanup();
                 rcms_redirect("?module=switches&timemachine=true");
             }
             //calendar view time machine
             if (!wf_CheckPost(array('switchdeadlogsearch'))) {
                 $deadTimeMachine = ub_JGetSwitchDeadLog();
                 $timeMachine = wf_FullCalendar($deadTimeMachine);
             } else {
                 //search processing
                 $timeMachine = ub_SwitchesTimeMachineSearch($_POST['switchdeadlogsearch']);
             }
             $timeMachineCleanupControl = wf_JSAlert('?module=switches&timemachine=true&flushalldead=true', wf_img('skins/icon_cleanup.png', __('Cleanup')), __('Are you serious'));
             //here some searchform
             $timeMachineSearchForm = web_SwitchTimeMachineSearchForm() . wf_tag('br');
             show_window(__('Dead switches time machine') . ' ' . $timeMachineCleanupControl, $timeMachineSearchForm . $timeMachine);
         } else {
             //showing dead switches snapshot
             ub_SwitchesTimeMachineShowSnapshot($_GET['snapshot']);
         }
     }
 } else {
     //editing switch form
     $switchid = vf($_GET['edit'], 3);
     $switchdata = zb_SwitchGetData($switchid);
     //if someone edit switch
     if (wf_CheckPost(array('editmodel'))) {
         if (cfr('SWITCHESEDIT')) {
Example #10
0
/**
 * Returns list of all available switch models
 * 
 * @return string
 */
function web_SwitchModelsShow()
{
    $query = 'SELECT * from `switchmodels`';
    $allmodels = simple_queryall($query);
    $tablecells = wf_TableCell(__('ID'));
    $tablecells .= wf_TableCell(__('Model'));
    $tablecells .= wf_TableCell(__('Ports'));
    $tablecells .= wf_TableCell(__('SNMP template'));
    $tablecells .= wf_TableCell(__('Actions'));
    $tablerows = wf_TableRow($tablecells, 'row1');
    /**
     * Now its time to break up with the system
     * Our reasons are clear and listed
     * Come on and change the cause of the history
     * Take off disguise of that rotten mystery
     */
    if (!empty($allmodels)) {
        foreach ($allmodels as $io => $eachmodel) {
            $tablecells = wf_TableCell($eachmodel['id']);
            $tablecells .= wf_TableCell($eachmodel['modelname']);
            $tablecells .= wf_TableCell($eachmodel['ports']);
            $tablecells .= wf_TableCell($eachmodel['snmptemplate']);
            $switchmodelcontrols = wf_JSAlert('?module=switchmodels&deletesm=' . $eachmodel['id'], web_delete_icon(), 'Removing this may lead to irreparable results');
            $switchmodelcontrols .= wf_Link('?module=switchmodels&edit=' . $eachmodel['id'], web_edit_icon());
            $tablecells .= wf_TableCell($switchmodelcontrols);
            $tablerows .= wf_TableRow($tablecells, 'row3');
        }
    }
    $result = wf_TableBody($tablerows, '100%', '0', 'sortable');
    return $result;
}
Example #11
0
 /**
  * Returns available time rules grid
  * 
  * @return string
  */
 public function renderList()
 {
     $messages = new UbillingMessageHelper();
     $allTariffs = zb_TariffGetPricesAll();
     $query = "SELECT * from `dshape_time` ORDER BY `id` ASC";
     $allrules = simple_queryall($query);
     $cells = wf_TableCell(__('ID'));
     $cells .= wf_TableCell(__('Tariff'));
     $cells .= wf_TableCell(__('Time from'));
     $cells .= wf_TableCell(__('Time to'));
     $cells .= wf_TableCell(__('Speed'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($allrules)) {
         foreach ($allrules as $io => $eachrule) {
             $rowClass = isset($allTariffs[$eachrule['tariff']]) ? 'row3' : 'sigdeleteduser';
             $tariffControl = cfr('TARIFFSPEED') ? wf_Link('?module=tariffspeeds&tariff=' . $eachrule['tariff'], $eachrule['tariff'], false) : $eachrule['tariff'];
             $cells = wf_TableCell($eachrule['id']);
             $cells .= wf_TableCell($tariffControl);
             $cells .= wf_TableCell($eachrule['threshold1']);
             $cells .= wf_TableCell($eachrule['threshold2']);
             $cells .= wf_TableCell($eachrule['speed']);
             $actions = wf_JSAlert('?module=dshaper&delete=' . $eachrule['id'], web_delete_icon(), $messages->getDeleteAlert());
             $actions .= wf_JSAlert('?module=dshaper&edit=' . $eachrule['id'], web_edit_icon(), $messages->getEditAlert());
             $cells .= wf_TableCell($actions);
             $rows .= wf_TableRow($cells, $rowClass);
         }
     }
     $result = wf_TableBody($rows, '100%', '0', 'sortable');
     return $result;
 }
Example #12
0
function gen_check_users()
{
    global $etalon_day_band, $control_tariffs, $etalon_speed, $cur_day, $home_band_p;
    $tariff_names = array_keys($control_tariffs);
    $genocide_qarr = array();
    $band_arr = array();
    $geninputs = wf_TextInput('home_band_p', 'Normal bandwidth load', $home_band_p, false, '2') . ' %';
    $geninputs .= wf_HiddenInput('change_settings', 'true') . ' ';
    $geninputs .= wf_Submit('Change');
    $genform = wf_Form('', 'POST', $geninputs, 'glamour');
    $result = $genform;
    $tablecells = wf_TableCell(__('Tariff'));
    $tablecells .= wf_TableCell(__('Normal day band'));
    $tablecells .= wf_TableCell(__('Current date normal band'));
    $tablecells .= wf_TableCell(__('Speed'));
    $tablecells .= wf_TableCell(__('Actions'));
    $tablerows = wf_TableRow($tablecells, 'row1');
    $i = 0;
    foreach ($control_tariffs as $eachtariff) {
        @($cspeed_k = $etalon_speed / $eachtariff);
        @($cband_k = $etalon_day_band / $cspeed_k);
        $dband_l = $cband_k * $cur_day;
        $band_arr[$i][$tariff_names[$i]] = $dband_l * 1024 * 1024;
        $tablecells = wf_TableCell($tariff_names[$i]);
        $tablecells .= wf_TableCell(stg_convert_size($cband_k * 1024 * 1024));
        $tablecells .= wf_TableCell(stg_convert_size($band_arr[$i][$tariff_names[$i]]));
        $tablecells .= wf_TableCell($eachtariff);
        $gactions = wf_JSAlert('?module=genocide&delete=' . $tariff_names[$i], web_delete_icon(), 'Are you serious');
        $tablecells .= wf_TableCell($gactions);
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $i++;
    }
    //controlled tariffs
    $result .= wf_TableBody($tablerows, '100%', '0', '');
    $i = 0;
    foreach ($band_arr as $eachtariff => $eachband) {
        $query = "SELECT * from `users` WHERE `D0`+`U0`>'" . $eachband[$tariff_names[$i]] . "' and `Tariff`='" . $tariff_names[$i] . "';";
        $genocide_qarr[] = $query;
        $i++;
    }
    $tablecells = wf_TableCell(__('Login'));
    $tablecells .= wf_TableCell(__('Full address'));
    $tablecells .= wf_TableCell(__('Real Name'));
    $tablecells .= wf_TableCell(__('Tariff'));
    $tablecells .= wf_TableCell(__('IP'));
    $tablecells .= wf_TableCell(__('Downloaded'));
    $tablecells .= wf_TableCell(__('Uploaded'));
    $tablecells .= wf_TableCell(__('Total'));
    $tablerows = wf_TableRow($tablecells, 'row1');
    foreach ($genocide_qarr as $each_q) {
        $genocide_users = simple_queryall($each_q);
        if (!empty($genocide_users)) {
            $alluseraddress = zb_AddressGetFulladdresslist();
            $allusernames = zb_UserGetAllRealnames();
            foreach ($genocide_users as $io => $eachuser) {
                $profilelink = wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $eachuser['login']);
                $tablecells = wf_TableCell($profilelink);
                $tablecells .= wf_TableCell(@$alluseraddress[$eachuser['login']]);
                $tablecells .= wf_TableCell(@$allusernames[$eachuser['login']]);
                $tablecells .= wf_TableCell($eachuser['Tariff']);
                $tablecells .= wf_TableCell($eachuser['IP'], '', '', 'sorttable_customkey="' . ip2int($eachuser['IP']) . '"');
                $tablecells .= wf_TableCell(stg_convert_size($eachuser['D0']), '', '', 'sorttable_customkey="' . $eachuser['D0'] . '"');
                $tablecells .= wf_TableCell(stg_convert_size($eachuser['U0']), '', '', 'sorttable_customkey="' . $eachuser['U0'] . '"');
                $tablecells .= wf_TableCell(stg_convert_size($eachuser['D0'] + $eachuser['U0']), '', '', 'sorttable_customkey="' . ($eachuser['D0'] + $eachuser['U0']) . '"');
                $tablerows .= wf_TableRow($tablecells, 'row3');
            }
        }
    }
    $result .= wf_TableBody($tablerows, '100%', '0', 'sortable');
    show_window(__('Genocide'), $result);
}
Example #13
0
 function web_TariffLister()
 {
     $alltariffs = billing_getalltariffs();
     $dbSchema = zb_CheckDbSchema();
     global $ubillingConfig;
     $alter = $ubillingConfig->getAlter();
     $cells = wf_TableCell(__('Tariff name'));
     $cells .= wf_TableCell(__('Tariff Fee'));
     if ($dbSchema > 0) {
         $cells .= wf_TableCell(__('Period'));
     }
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row1');
     $result = wf_Link("?module=tariffs&action=new", __('Create new tariff'), true, 'ubButton');
     if (!empty($alltariffs)) {
         foreach ($alltariffs as $io => $eachtariff) {
             $cells = wf_TableCell($eachtariff['name']);
             $cells .= wf_TableCell($eachtariff['Fee']);
             if ($dbSchema > 0) {
                 $cells .= wf_TableCell(__($eachtariff['period']));
             }
             $actions = wf_JSAlert("?module=tariffs&action=delete&tariffname=" . $eachtariff['name'], web_delete_icon(), __('Delete') . ' ' . $eachtariff['name'] . '? ' . __('Removing this may lead to irreparable results'));
             $actions .= wf_JSAlert("?module=tariffs&action=edit&tariffname=" . $eachtariff['name'], web_edit_icon(), __('Edit') . ' ' . $eachtariff['name'] . '? ' . __('Are you serious'));
             $actions .= wf_Link('?module=tariffspeeds&tariff=' . $eachtariff['name'], wf_img('skins/icon_speed.gif', __('Edit speed')), false, '');
             $actions .= isset($alter['SIGNUP_PAYMENTS']) && !empty($alter['SIGNUP_PAYMENTS']) ? wf_Link('?module=signupprices&tariff=' . $eachtariff['name'], wf_img('skins/icons/register.png', __('Edit signup price')), false, '') : null;
             $cells .= wf_TableCell($actions);
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     $result .= wf_TableBody($rows, '100%', 0, 'sortable');
     return $result;
 }
Example #14
0
 $cells .= wf_TableCell(__('op'));
 $cells .= wf_TableCell(__('Value'));
 $cells .= wf_TableCell(__('Foreach'));
 $cells .= wf_TableCell(__('Actions'));
 $rows = wf_TableRow($cells, 'row1');
 if (!empty($results)) {
     foreach ($results as $result) {
         $cells = wf_TableCell($result['id']);
         $cells .= wf_TableCell($result['scenario']);
         $cells .= wf_TableCell($result['Attribute']);
         $cells .= wf_TableCell($result['op']);
         $cells .= wf_TableCell($result['Value']);
         $content = web_bool_led($result['login'] == '*');
         $cells .= wf_TableCell($content);
         $content = wf_Link("?module=freeradius&netid={$netid}&edit=" . $result['id'], web_edit_icon());
         $content .= wf_JSAlert("?module=freeradius&netid={$netid}&delete=" . $result['id'], web_delete_icon(), 'Are you serious');
         $cells .= wf_TableCell($content);
         $rows .= wf_TableRow($cells, 'row3');
     }
 }
 /* Кнопка "Назад" */
 $html .= wf_Link("?module=multinet", __('Back'), false, 'ubButton');
 // Форма добавления нового атрибута
 $form = new InputForm('', 'POST', __('Save'), '', '', '', 'add');
 //  - Сценарий
 $content = $form->radio_button('add[scenario]', $scenarios, 'check');
 $form->addrow(__('Scenario'), $content);
 //  - Сервис (disabled)
 $content = $form->select_tag('add[netid]', getServiceIdDesc(), $netid, 'disabled');
 $content .= $form->checkbox('add[login]', '*', __('Foreach'), '');
 $form->addrow(__('Service'), $content);
Example #15
0
 public function listAllTasks()
 {
     $cells = wf_TableCell(__('ID'));
     $cells .= wf_TableCell(__('Active'));
     $cells .= wf_TableCell(__('Name'));
     $cells .= wf_TableCell(__('Check type'));
     $cells .= wf_TableCell(__('Parameter'));
     $cells .= wf_TableCell(__('Operator'));
     $cells .= wf_TableCell(__('Condition'));
     $cells .= wf_TableCell(__('Actions'));
     $cells .= wf_TableCell(__('Manage'));
     $rows = wf_TableRow($cells, 'row1');
     $lighter = 'onmouseover="this.className = \'row2\';" onmouseout="this.className = \'row3\';" ';
     if (!empty($this->allTasks)) {
         foreach ($this->allTasks as $io => $eachtask) {
             $details = wf_tag('pre') . print_r($eachtask, true) . wf_tag('pre', true);
             $detailLink = wf_modal($eachtask['id'], $eachtask['name'], $details, '', '600', '400');
             $cells = wf_TableCell($detailLink, '', '', 'sorttable_customkey="' . $eachtask['id'] . '"');
             $cells .= wf_TableCell(web_bool_led($eachtask['active']), '', '', 'sorttable_customkey="' . $eachtask['active'] . '"');
             $cells .= wf_TableCell($eachtask['name']);
             $cells .= wf_TableCell($eachtask['checktype']);
             $cells .= wf_TableCell($eachtask['param']);
             $cells .= wf_TableCell($eachtask['operator']);
             $cells .= wf_TableCell($eachtask['condition']);
             $cells .= wf_TableCell($eachtask['action']);
             $controls = wf_JSAlert('?module=watchdog&delete=' . $eachtask['id'], web_delete_icon(), __('Removing this may lead to irreparable results'));
             $controls .= wf_JSAlert('?module=watchdog&edit=' . $eachtask['id'], web_edit_icon(), __('Are you serious'));
             $cells .= wf_TableCell($controls);
             $rows .= wf_tag('tr', false, 'row3', $lighter);
             $rows .= $cells;
             $rows .= wf_tag('tr', true);
         }
     }
     $result = wf_TableBody($rows, '100%', '0', 'sortable');
     return $result;
 }
Example #16
0
function dhcp_show_available_nets()
{
    $query = "SELECT * from `dhcp`";
    $allnets = simple_queryall($query);
    $result = '<table width="100%"  class="sortable" border="0" class="sortable">';
    $result .= '
            <tr class="row1">
                <td>
                ID
                </td>
                  <td>
                ' . __('Network/CIDR') . '
                </td>
                <td>
             ' . __('DHCP custom subnet template') . '
                </td>
                <td>
                ' . __('DHCP config name') . '
                </td>
                <td>
                ' . __('Actions') . '
                </td>
            </tr>
            ';
    if (!empty($allnets)) {
        foreach ($allnets as $io => $eachnet) {
            $netdata = multinet_get_network_params($eachnet['netid']);
            $result .= '
            <tr class="row3">
                <td>
                ' . $eachnet['id'] . '
                </td>
                  <td>
                ' . $netdata['desc'] . '
                </td>
                  <td>
               ' . web_bool_led($eachnet['dhcpconfig']) . ' 
                </td> 
                <td>
                ' . $eachnet['confname'] . '
                </td>
                <td>
                ' . wf_JSAlert('?module=dhcp&delete=' . $eachnet['id'], web_delete_icon(), 'Removing this may lead to irreparable results') . '
                <a href="?module=dhcp&edit=' . $eachnet['id'] . '">' . web_edit_icon() . '</a>
                </td>
            </tr>
            ';
        }
    }
    $result .= '</table>';
    show_window(__('Available DHCP networks'), $result);
}
Example #17
0
/**
 * Returns expresscard address modify form
 * 
 * @param $login - user login for modifying apt
 * 
 * @return string
 */
function web_ExpressAddressAptForm($login)
{
    $login = vf($login);
    $aptdata = zb_AddressGetAptData($login);
    $useraddress = zb_AddressGetFulladdresslist();
    @($useraddress = $useraddress[$login]);
    $buildid = $aptdata['buildid'];
    $builddata = zb_AddressGetBuildData($buildid);
    $buildnum = $builddata['buildnum'];
    $streetid = $builddata['streetid'];
    $streetdata = zb_AddressGetStreetData($streetid);
    $streetname = $streetdata['streetname'];
    $cityid = $streetdata['cityid'];
    $citydata = zb_AddressGetCityData($cityid);
    $cityname = $citydata['cityname'];
    $inputs = __('Full address') . ': ';
    $inputs .= wf_tag('b') . $useraddress . ' ' . wf_tag('b', true);
    $inputs .= __('Entrance');
    $inputs .= wf_TextInput('editentrance', '', @$aptdata['entrance'], false, '5');
    $inputs .= __('Floor');
    $inputs .= wf_TextInput('editfloor', '', @$aptdata['floor'], false, '5');
    $inputs .= __('Apartment');
    $inputs .= wf_TextInput('editapt', '', @$aptdata['apt'], false, '5');
    $inputs .= wf_JSAlert('?module=expresscard&username='******'&orphan=true', web_delete_icon(), __('Are you sure you want to make the homeless this user') . "?");
    //same data for passport apartment
    $inputs .= wf_HiddenInput('samepapt', $aptdata['apt']);
    $inputs .= wf_HiddenInput('samepbuild', $buildnum);
    $inputs .= wf_HiddenInput('samepstreet', $streetname);
    $inputs .= wf_HiddenInput('samepcity', $cityname);
    return $inputs;
}
Example #18
0
/**
 * Renders ticket, all of replies and all needed controls/forms for they
 * 
 * @param int $ticketid
 * 
 * @return string
 */
function web_TicketDialogue($ticketid)
{
    $ticketid = vf($ticketid, 3);
    $ticketdata = zb_TicketGetData($ticketid);
    $ticketreplies = zb_TicketGetReplies($ticketid);
    $result = wf_tag('p', false, '', 'align="right"') . wf_Link('?module=ticketing', 'Back to tickets list', true, 'ubButton') . wf_tag('p', true);
    if (!empty($ticketdata)) {
        $alladdress = zb_AddressGetFulladdresslist();
        $allrealnames = zb_UserGetAllRealnames();
        $alltariffs = zb_TariffsGetAllUsers();
        $allcash = zb_CashGetAllUsers();
        $allcredits = zb_CreditGetAllUsers();
        $alluserips = zb_UserGetAllIPs();
        if ($ticketdata['status']) {
            $actionlink = wf_Link('?module=ticketing&openticket=' . $ticketdata['id'], 'Open', false, 'ubButton');
        } else {
            $actionlink = wf_Link('?module=ticketing&closeticket=' . $ticketdata['id'], 'Close', false, 'ubButton');
        }
        $tablecells = wf_TableCell(__('ID'));
        $tablecells .= wf_TableCell(__('Date'));
        $tablecells .= wf_TableCell(__('Login'));
        $tablecells .= wf_TableCell(__('Real Name'));
        $tablecells .= wf_TableCell(__('Full address'));
        $tablecells .= wf_TableCell(__('IP'));
        $tablecells .= wf_TableCell(__('Tariff'));
        $tablecells .= wf_TableCell(__('Balance'));
        $tablecells .= wf_TableCell(__('Credit'));
        $tablecells .= wf_TableCell(__('Processed'));
        $tablerows = wf_TableRow($tablecells, 'row1');
        $tablecells = wf_TableCell($ticketdata['id']);
        $tablecells .= wf_TableCell($ticketdata['date']);
        $profilelink = wf_Link('?module=userprofile&username='******'from'], web_profile_icon() . ' ' . $ticketdata['from']);
        $tablecells .= wf_TableCell($profilelink);
        $tablecells .= wf_TableCell(@$allrealnames[$ticketdata['from']]);
        $tablecells .= wf_TableCell(@$alladdress[$ticketdata['from']]);
        $tablecells .= wf_TableCell(@$alluserips[$ticketdata['from']]);
        $tablecells .= wf_TableCell(@$alltariffs[$ticketdata['from']]);
        $tablecells .= wf_TableCell(@$allcash[$ticketdata['from']]);
        $tablecells .= wf_TableCell(@$allcredits[$ticketdata['from']]);
        $tablecells .= wf_TableCell(web_bool_led($ticketdata['status']));
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $result .= wf_TableBody($tablerows, '100%', '0');
        //ticket body
        $tickettext = strip_tags($ticketdata['text']);
        $tickettext = nl2br($tickettext);
        $tablecells = wf_TableCell('', '20%');
        $tablecells .= wf_TableCell($ticketdata['date']);
        $tablerows = wf_TableRow($tablecells, 'row2');
        $ticketauthor = wf_tag('center') . wf_tag('b') . @$allrealnames[$ticketdata['from']] . wf_tag('b', true) . wf_tag('center', true);
        $ticketavatar = wf_tag('center') . wf_img('skins/userava.png') . wf_tag('center', true);
        $ticketpanel = $ticketauthor . wf_tag('br') . $ticketavatar;
        $tablecells = wf_TableCell($ticketpanel);
        $tablecells .= wf_TableCell($tickettext);
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $result .= wf_TableBody($tablerows, '100%', '0', 'glamour');
        $result .= $actionlink;
    }
    if (!empty($ticketreplies)) {
        $result .= wf_tag('h2') . __('Replies') . wf_tag('h2', true);
        $result .= wf_CleanDiv();
        foreach ($ticketreplies as $io => $eachreply) {
            //reply
            if ($eachreply['admin']) {
                $replyauthor = wf_tag('center') . wf_tag('b') . $eachreply['admin'] . wf_tag('b', true) . wf_tag('center', true);
                $replyavatar = wf_tag('center') . gravatar_ShowAdminAvatar($eachreply['admin'], '64') . wf_tag('center', true);
            } else {
                $replyauthor = wf_tag('center') . wf_tag('b') . @$allrealnames[$eachreply['from']] . wf_tag('b', true) . wf_tag('center', true);
                $replyavatar = wf_tag('center') . wf_img('skins/userava.png') . wf_tag('center', true);
            }
            $replyactions = wf_tag('center');
            $replyactions .= wf_JSAlert('?module=ticketing&showticket=' . $ticketdata['id'] . '&deletereply=' . $eachreply['id'], web_delete_icon(), 'Removing this may lead to irreparable results') . ' ';
            $replyactions .= wf_JSAlert('?module=ticketing&showticket=' . $ticketdata['id'] . '&editreply=' . $eachreply['id'], web_edit_icon(), 'Are you serious');
            $replyactions .= wf_tag('center', true);
            // reply body
            if (isset($_GET['editreply'])) {
                if ($_GET['editreply'] == $eachreply['id']) {
                    //is this reply editing?
                    $replytext = web_TicketReplyEditForm($eachreply['id']);
                } else {
                    //not this ticket edit
                    $replytext = strip_tags($eachreply['text']);
                }
            } else {
                //normal text by default
                $replytext = strip_tags($eachreply['text']);
                $replytext = nl2br($replytext);
            }
            $replypanel = $replyauthor . wf_tag('br') . $replyavatar . wf_tag('br') . $replyactions;
            $tablecells = wf_TableCell('', '20%');
            $tablecells .= wf_TableCell($eachreply['date']);
            $tablerows = wf_TableRow($tablecells, 'row2');
            $tablecells = wf_TableCell($replypanel);
            $tablecells .= wf_TableCell($replytext);
            $tablerows .= wf_TableRow($tablecells, 'row3');
            $result .= wf_TableBody($tablerows, '100%', '0', 'glamour');
            $result .= wf_CleanDiv();
        }
    }
    //reply form and previous tickets
    $allprevious = zb_TicketsGetAllByUser($ticketdata['from']);
    $previoustickets = '';
    if (!empty($allprevious)) {
        $previoustickets = wf_tag('h2') . __('All tickets by this user') . wf_tag('h2', true);
        foreach ($allprevious as $io => $eachprevious) {
            $tablecells = wf_TableCell($eachprevious['date']);
            $tablecells .= wf_TableCell(web_bool_led($eachprevious['status']));
            $prevaction = wf_Link('?module=ticketing&showticket=' . $eachprevious['id'], 'Show', false, 'ubButton');
            $tablecells .= wf_TableCell($prevaction);
            $tablerows = wf_TableRow($tablecells, 'row3');
            $previoustickets .= wf_TableBody($tablerows, '100%', '0');
        }
    }
    $tablecells = wf_TableCell(web_TicketReplyForm($ticketid), '50%', '', 'valign="top"');
    $tablecells .= wf_TableCell($previoustickets, '50%', '', 'valign="top"');
    $tablerows = wf_TableRow($tablecells);
    $result .= wf_TableBody($tablerows, '100%', '0', 'glamour');
    $result .= wf_CleanDiv();
    return $result;
}
Example #19
0
function zb_LicenseLister()
{
    $avarice = new Avarice();
    $all = $avarice->getLicenseKeys();
    $cells = wf_TableCell(__('Module'));
    $cells .= wf_TableCell(__('Actions'));
    $rows = wf_TableRow($cells, 'row1');
    if (!empty($all)) {
        foreach ($all as $io => $each) {
            //construct edit form
            $editinputs = wf_HiddenInput('editdbkey', $each['KEY']);
            $editinputs .= wf_TextArea('editlicense', '', $each['LICENSE'], true, '50x10');
            $editinputs .= wf_Submit(__('Save'));
            $editform = wf_Form("", 'POST', $editinputs, 'glamour');
            $editcontrol = wf_modal(web_edit_icon(), __('Edit'), $editform, '', '500', '300');
            //construct deletion controls
            $deletecontrol = wf_JSAlert('?module=licensekeys&licensedelete=' . $each['KEY'], web_delete_icon(), __('Removing this may lead to irreparable results'));
            $cells = wf_TableCell($each['MODULE']);
            $cells .= wf_TableCell($deletecontrol . ' ' . $editcontrol);
            $rows .= wf_TableRow($cells, 'row3');
        }
    }
    //constructing license creation form
    $addinputs = wf_TextArea('createlicense', '', '', true, '50x10');
    $addinputs .= wf_Submit(__('Add'));
    $addform = wf_Form("", 'POST', $addinputs, 'glamour');
    $addcontrol = wf_modal(wf_img('skins/icon_add.gif', __('Add')) . ' ' . __('Add'), __('Add'), $addform, 'ubButton', '500', '300');
    $result = wf_TableBody($rows, '100%', 0, '');
    $result .= $addcontrol;
    show_window(__('Installed license keys'), $result);
}
Example #20
0
 /**
  * Renders available tasks list with controls
  * 
  * @param sring $login
  * 
  * @return string
  */
 public function renderTasksList($login = '')
 {
     $result = '';
     $messages = new UbillingMessageHelper();
     $tmpArr = array();
     if (!empty($this->allTasks)) {
         foreach ($this->allTasks as $io => $each) {
             if (empty($login)) {
                 $tmpArr[$io] = $each;
             } else {
                 if ($login == $each['login']) {
                     $tmpArr[$io] = $each;
                 }
             }
         }
     }
     if (!empty($tmpArr)) {
         $cells = wf_TableCell(__('ID'));
         $cells .= wf_TableCell(__('Date'));
         $cells .= wf_TableCell(__('User'));
         $cells .= wf_TableCell(__('Task'));
         $cells .= wf_TableCell(__('Parameter'));
         $cells .= wf_TableCell(__('Notes'));
         $cells .= wf_TableCell(__('Actions'));
         $rows = wf_TableRow($cells, 'row1');
         foreach ($tmpArr as $io => $each) {
             $cells = wf_TableCell($each['id']);
             $cells .= wf_TableCell($each['date']);
             $cells .= wf_TableCell(wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $each['login'], false, ''));
             $cells .= wf_TableCell($this->actionNames[$each['action']]);
             $cells .= wf_TableCell($each['param']);
             $cells .= wf_TableCell($each['note']);
             $taskControls = wf_JSAlert(self::URL_ME . '&username='******'login'] . '&deletetaskid=' . $each['id'], web_delete_icon(), $messages->getDeleteAlert());
             $cells .= wf_TableCell($taskControls);
             $rows .= wf_TableRow($cells, 'row3');
         }
         $result = wf_TableBody($rows, '100%', 0, 'sortable');
     } else {
         $result = $messages->getStyledMessage(__('Nothing found'), 'info');
     }
     return $result;
 }
Example #21
0
 /**
  * Renders previously generated all users documents 
  * 
  * @return string
  */
 public function renderAllUserDocuments()
 {
     $allAddress = zb_AddressGetFulladdresslistCached();
     $allRealnames = zb_UserGetAllRealnames();
     $cells = wf_TableCell(__('ID'));
     $cells .= wf_TableCell(__('Date'));
     $cells .= wf_TableCell(__('Public'));
     $cells .= wf_TableCell(__('Template'));
     $cells .= wf_TableCell(__('Path'));
     $cells .= wf_TableCell(__('Login'));
     $cells .= wf_TableCell(__('Address'));
     $cells .= wf_TableCell(__('Real Name'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($this->allUserDocuments)) {
         foreach ($this->allUserDocuments as $io => $each) {
             $cells = wf_TableCell($each['id']);
             $cells .= wf_TableCell($each['date']);
             $cells .= wf_TableCell(web_bool_led($each['public']));
             @($templateName = $this->templates[$each['templateid']]['name']);
             $cells .= wf_TableCell(wf_tag('abbr', false, '', 'title="' . $each['templateid'] . '"') . $templateName . wf_tag('abbr', true));
             $downloadLink = wf_Link('?module=report_documents&documentdownload=' . $each['path'], $each['path'], false, '');
             $cells .= wf_TableCell($downloadLink);
             $profileLink = wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $each['login']);
             $cells .= wf_TableCell($profileLink);
             $cells .= wf_TableCell(@$allAddress[$each['login']]);
             $cells .= wf_TableCell(@$allRealnames[$each['login']]);
             $actionLinks = wf_JSAlert('?module=report_documents&deletedocument=' . $each['id'], web_delete_icon(), __('Are you serious'));
             $cells .= wf_TableCell($actionLinks);
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     $result = wf_TableBody($rows, '100%', '0', '');
     return $result;
 }
Example #22
0
 /**
  * renders available pools assigned by some network
  * 
  * @param $netid int existing network ID
  * 
  * @return string
  */
 public function renderPools($netid)
 {
     $netid = vf($netid, 3);
     $result = __('Nothing found');
     $netpools = array();
     if (isset($this->networks[$netid])) {
         if (!empty($this->pools)) {
             foreach ($this->pools as $io => $each) {
                 if ($each['netid'] == $netid) {
                     $netpools[$each['id']] = $each;
                 }
             }
         }
     }
     if (!empty($netpools)) {
         $cells = wf_TableCell(__('ID'));
         $cells .= wf_TableCell(__('Pool'));
         $cells .= wf_TableCell(__('Netmask'));
         $cells .= wf_TableCell(__('Gateway'));
         $cells .= wf_TableCell(__('IP'));
         $cells .= wf_TableCell(__('Broadcast'));
         $cells .= wf_TableCell(__('VLAN'));
         $cells .= wf_TableCell(__('Login'));
         $cells .= wf_TableCell(__('Actions'));
         $rows = wf_TableRow($cells, 'row1');
         foreach ($netpools as $io => $each) {
             $cells = wf_TableCell($each['id']);
             $cells .= wf_TableCell($each['pool']);
             $cells .= wf_TableCell($this->cidrToMask[$each['netmask']] . ' (/' . $each['netmask'] . ')');
             $cells .= wf_TableCell($each['gw']);
             $cells .= wf_TableCell(wf_Link('?module=extnets&showipsbypoolid=' . $each['id'], $this->ipsGetAssociated($each['id']), false), '40%');
             $cells .= wf_TableCell($each['broadcast']);
             $cells .= wf_TableCell($each['vlan']);
             if (!empty($each['login'])) {
                 $loginlink = wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $each['login'], 'fasle');
             } else {
                 $loginlink = '';
             }
             $cells .= wf_TableCell($loginlink);
             $actlinks = wf_JSAlert('?module=extnets&showpoolbynetid=' . $netid . '&deletepoolid=' . $each['id'], web_delete_icon(), __('Removing this may lead to irreparable results'));
             $actlinks .= wf_modal(web_edit_icon(), __('Edit') . ' ' . $each['pool'] . '/' . $each['netmask'], $this->poolEditForm($each['id']), '', '300', '200');
             $cells .= wf_TableCell($actlinks);
             $rows .= wf_TableRow($cells, 'row3');
         }
         $result = wf_TableBody($rows, '100%', '0', 'sortable');
     }
     return $result;
 }
Example #23
0
 /**
  * Renders available reports list
  * 
  * @return string
  */
 function web_ReportMasterShowReportsList()
 {
     $messages = new UbillingMessageHelper();
     $reports_path = DATA_PATH . "reports/";
     $allreports = rcms_scandir($reports_path);
     $cells = wf_TableCell(__('Report name'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($allreports)) {
         foreach ($allreports as $eachreport) {
             $report_template = rcms_parse_ini_file($reports_path . $eachreport);
             $cells = wf_TableCell(wf_Link('?module=reportmaster&view=' . $eachreport, __($report_template['REPORT_NAME'])));
             $actControls = wf_JSAlert('?module=reportmaster&delete=' . $eachreport, web_delete_icon(), $messages->getDeleteAlert());
             $actControls .= wf_JSAlert('?module=reportmaster&edit=' . $eachreport, web_edit_icon(), $messages->getEditAlert());
             $cells .= wf_TableCell($actControls);
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     $result = wf_TableBody($rows, '100%', 0, 'sortable');
     return $result;
 }
Example #24
0
 function web_TsmsExcludeOpts()
 {
     $excludedUsers = tsms_GetExcludeUsers();
     $alladdress = zb_AddressGetFulladdresslist();
     $allrealnames = zb_UserGetAllRealnames();
     $allphones = tsms_GetAllMobileNumbers();
     $cells = wf_TableCell(__('Login'));
     $cells .= wf_TableCell(__('Full address'));
     $cells .= wf_TableCell(__('Real Name'));
     $cells .= wf_TableCell(__('Phone'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($excludedUsers)) {
         foreach ($excludedUsers as $eachlogin => $io) {
             $cells = wf_TableCell(wf_Link("?module=userprofile&username="******"?module=turbosms&excludedelete=" . $eachlogin, web_delete_icon(), __('Are you serious')));
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     //adding form
     $inputs = wf_TextInput('newexcludelogin', __('User login to exclude from sending'), '', true, '15');
     $inputs .= wf_Submit('Save');
     $result = wf_TableBody($rows, '100%', '0', 'sortable');
     $result .= wf_delimiter();
     $result .= wf_Form("", 'POST', $inputs, 'glamour');
     return $result;
 }
Example #25
0
/**
 * Shows task editing/management form
 * 
 * @global object $ubillingConfig
 * @param int $taskid
 * 
 * @return void
 */
function ts_TaskChangeForm($taskid)
{
    global $ubillingConfig;
    $altercfg = $ubillingConfig->getAlter();
    $taskid = vf($taskid, 3);
    $taskdata = ts_GetTaskData($taskid);
    $result = '';
    $allemployee = ts_GetAllEmployee();
    $activeemployee = ts_GetActiveEmployee();
    $alljobtypes = ts_GetAllJobtypes();
    $messages = new UbillingMessageHelper();
    $smsData = '';
    if (!empty($taskdata)) {
        //not done task
        if (empty($taskdata['login'])) {
            $login_detected = ts_DetectUserByAddress($taskdata['address']);
            if ($login_detected) {
                $addresslink = wf_Link("?module=userprofile&username="******"?module=userprofile&username="******"H:i", strtotime($taskdata['starttime'])) : '';
                $smsJobNote = mysql_real_escape_string($taskdata['jobnote']);
                $smsEmployee = vf($taskdata['employee']);
                $newSmsText = $smsAddress . ' ' . $smsPhone . ' ' . $smsJobNote . $smsJobTime;
                $smsDataCells = wf_TableCell(__('Employee'), '', 'row2');
                $smsDataCells .= wf_TableCell(@$allemployee[$taskdata['employee']]);
                $smsDataRows = wf_TableRow($smsDataCells, 'row3');
                $smsDataCells = wf_TableCell(__('Message'), '', 'row2');
                $smsDataCells .= wf_TableCell(zb_TranslitString($newSmsText));
                $smsDataRows .= wf_TableRow($smsDataCells, 'row3');
                $smsDataTable = wf_TableBody($smsDataRows, '100%', '0', 'glamour');
                $smsInputs = $smsDataTable;
                $smsInputs .= wf_HiddenInput('postsendemployee', $smsEmployee);
                $smsInputs .= wf_HiddenInput('postsendsmstext', $newSmsText);
                $smsInputs .= wf_Submit(__('Send SMS'));
                $smsForm = wf_Form('', 'POST', $smsInputs, '');
                $smsData = wf_modal(wf_img_sized('skins/icon_mobile.gif', __('Send SMS'), '10'), __('Send SMS'), $smsForm, '', '400', '200');
            }
        }
        $tablecells = wf_TableCell(__('ID'), '30%');
        $tablecells .= wf_TableCell($taskdata['id']);
        $tablerows = wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Task creation date') . ' / ' . __('Administrator'));
        $tablecells .= wf_TableCell($taskdata['date'] . ' / ' . $taskdata['admin']);
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Target date'));
        $tablecells .= wf_TableCell(wf_tag('strong') . $taskdata['startdate'] . ' ' . $taskdata['starttime'] . wf_tag('strong', true));
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Task address'));
        $tablecells .= wf_TableCell($addresslink);
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Login'));
        $tablecells .= wf_TableCell($taskLogin . $loginType);
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Phone'));
        $tablecells .= wf_TableCell($taskdata['phone']);
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Job type'));
        $tablecells .= wf_TableCell(@$alljobtypes[$taskdata['jobtype']]);
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Who should do'));
        $tablecells .= wf_TableCell(@$allemployee[$taskdata['employee']] . ' ' . $smsData);
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Job note'));
        $tablecells .= wf_TableCell(nl2br($taskdata['jobnote']));
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $result .= wf_TableBody($tablerows, '100%', '0', 'glamour');
        $result .= wf_tag('div', false, '', 'style="clear:both;"') . wf_tag('div', true);
        // show task preview
        show_window(__('View task') . ' ' . $modform, $result);
        //Salary accounting
        if ($altercfg['SALARY_ENABLED']) {
            if (cfr('SALARYTASKSVIEW')) {
                $salary = new Salary();
                show_window(__('Additional jobs done'), $salary->taskJobCreateForm($_GET['edittask']));
            }
        }
        //warehouse integration
        if ($altercfg['WAREHOUSE_ENABLED']) {
            if (cfr('WAREHOUSE')) {
                $warehouse = new Warehouse();
                show_window(__('Additionally spent materials'), $warehouse->taskMaterialsReport($_GET['edittask']));
            }
        }
        //if task undone
        if ($taskdata['status'] == 0) {
            $sup = wf_tag('sup') . '*' . wf_tag('sup', false);
            $inputs = wf_HiddenInput('changetask', $taskid);
            $inputs .= wf_DatePicker('editenddate') . wf_tag('label', false) . __('Finish date') . $sup . wf_tag('label', true) . wf_tag('br');
            $inputs .= wf_tag('br');
            $inputs .= wf_Selector('editemployeedone', $activeemployee, __('Worker done'), $taskdata['employee'], true);
            $inputs .= wf_tag('br');
            $inputs .= wf_tag('label', false) . __('Finish note') . wf_tag('label', true) . wf_tag('br');
            $inputs .= wf_TextArea('editdonenote', '', '', true, '35x3');
            $inputs .= wf_tag('br');
            $inputs .= $jobgencheckbox;
            $inputs .= wf_Submit(__('This task is done'));
            $form = wf_Form("", 'POST', $inputs, 'glamour');
            if (cfr('TASKMANDELETE')) {
                show_window('', wf_JSAlertStyled('?module=taskman&deletetask=' . $taskid, web_delete_icon() . ' ' . __('Remove this task - it is an mistake'), $messages->getDeleteAlert(), 'ubButton'));
            }
            //show editing form
            if (cfr('TASKMANDONE')) {
                show_window(__('If task is done'), $form);
            }
        } else {
            $donecells = wf_TableCell(__('Finish date'), '30%');
            $donecells .= wf_TableCell($taskdata['enddate']);
            $donerows = wf_TableRow($donecells, 'row3');
            $donecells = wf_TableCell(__('Worker done'));
            $donecells .= wf_TableCell($allemployee[$taskdata['employeedone']]);
            $donerows .= wf_TableRow($donecells, 'row3');
            $donecells = wf_TableCell(__('Finish note'));
            $donecells .= wf_TableCell($taskdata['donenote']);
            $donerows .= wf_TableRow($donecells, 'row3');
            $doneresult = wf_TableBody($donerows, '100%', '0', 'glamour');
            if (cfr('TASKMANDELETE')) {
                $doneresult .= wf_JSAlertStyled('?module=taskman&deletetask=' . $taskid, web_delete_icon() . ' ' . __('Remove this task - it is an mistake'), $messages->getDeleteAlert(), 'ubButton');
            }
            if (cfr('TASKMANDONE')) {
                $doneresult .= '&nbsp;';
                $doneresult .= wf_JSAlertStyled('?module=taskman&setundone=' . $taskid, wf_img('skins/icon_key.gif') . ' ' . __('No work was done'), $messages->getEditAlert(), 'ubButton');
            }
            show_window(__('Task is done'), $doneresult);
        }
    }
}
Example #26
0
function catvbs_ShowHash($hash)
{
    $hash = vf($hash);
    $allrealnames = catv_GetAllRealnames();
    $alladdress = catv_GetFullAddressList();
    $montharr = months_array();
    $checkarr = catvbs_SearchCheckArr($alladdress, $allrealnames);
    $alter_conf = rcms_parse_ini_file(CONFIG_PATH . 'catv.ini');
    $query = "SELECT * from `catv_bankstaparsed` WHERE `hash`='" . $hash . "' ORDER BY `id` DESC";
    $alldata = simple_queryall($query);
    if (!empty($alldata)) {
        $tablecells = wf_TableCell(__('ID'));
        $tablecells .= wf_TableCell(__('Real Name'));
        $tablecells .= wf_TableCell(__('Address'));
        $tablecells .= wf_TableCell(__('Cash'));
        $tablecells .= wf_TableCell(__('User poroposal'));
        $tablecells .= wf_TableCell(__('Month'));
        $tablecells .= wf_TableCell(__('Processed'));
        $tablecells .= wf_TableCell(__('Actions'));
        $tablerows = wf_TableRow($tablecells, 'row1');
        foreach ($alldata as $io => $eachrow) {
            $tablecells = wf_TableCell($eachrow['id']);
            $tablecells .= wf_TableCell(bs_NameEditForm($eachrow['id'], $eachrow['realname']));
            $tablecells .= wf_TableCell(bs_AddressEditForm($eachrow['id'], $eachrow['address']));
            $tablecells .= wf_TableCell($eachrow['summ']);
            //proposal subroutine
            if (empty($eachrow['login'])) {
                $proposed_login = catvbs_SearchLoginByAddresspart($eachrow['address'], $eachrow['realname'], $checkarr);
                //if no one found
                if (sizeof($proposed_login) == 0) {
                    $proposal_form = catvbs_LoginProposalForm($eachrow['id'], '');
                }
                //if only one user found
                if (sizeof($proposed_login) == 1) {
                    $proposal_form = bs_LoginProposalForm($eachrow['id'], $proposed_login[0]);
                    //заполним со старта что-ли
                    simple_update_field('catv_bankstaparsed', 'login', $proposed_login[0], "WHERE `id`='" . $eachrow['id'] . "'");
                }
                //if many users found
                if (sizeof($proposed_login) > 1) {
                    $proposal_form = __('Multiple users found');
                }
            } else {
                $proposal_form = catvbs_LoginProposalForm($eachrow['id'], $eachrow['login']);
            }
            $tablecells .= wf_TableCell($proposal_form);
            $procflag = web_bool_led($eachrow['state']);
            if (!$eachrow['state']) {
                $actlink = wf_JSAlert("?module=catv_banksta&lockrow=" . $eachrow['id'] . "&showhash=" . $eachrow['hash'], web_key_icon('Lock'), __('Are you serious'));
            } else {
                $actlink = '';
            }
            //month detection here
            $month_detected = catvbs_MonthDetect($eachrow['address']);
            if ($month_detected) {
                $monthname = web_bool_led($month_detected) . ' ' . rcms_date_localise($montharr[$month_detected]);
            } else {
                $monthname = web_bool_led($month_detected);
            }
            $tablecells .= wf_TableCell($monthname);
            $tablecells .= wf_TableCell($procflag);
            $tablecells .= wf_TableCell($actlink);
            $tablerows .= wf_TableRow($tablecells, 'row3');
        }
        $result = wf_TableBody($tablerows, '100%', '0', 'sortable');
    } else {
        $result = __('Strange exeption catched');
    }
    show_window('', wf_Link("?module=catv_banksta", 'Back', true, 'ubButton'));
    show_window(__('Bank statement processing'), $result);
}
Example #27
0
/**
 * Returns available cities lister with some controls
 * 
 * @return string
 */
function web_CityLister()
{
    $allcity = zb_AddressGetCityAllData();
    $cells = wf_TableCell(__('ID'));
    $cells .= wf_TableCell(__('City name'));
    $cells .= wf_TableCell(__('City alias'));
    $cells .= wf_TableCell(__('Actions'));
    $rows = wf_TableRow($cells, 'row1');
    if (!empty($allcity)) {
        foreach ($allcity as $io => $eachcity) {
            $cells = wf_TableCell($eachcity['id']);
            $cells .= wf_TableCell($eachcity['cityname']);
            $cells .= wf_TableCell($eachcity['cityalias']);
            $acts = wf_JSAlert('?module=city&action=delete&cityid=' . $eachcity['id'], web_delete_icon(), 'Removing this may lead to irreparable results') . ' ';
            $acts .= wf_JSAlert('?module=city&action=edit&cityid=' . $eachcity['id'], web_edit_icon(), 'Are you serious') . ' ';
            $acts .= wf_Link('?module=streets', web_street_icon(), false, '');
            $cells .= wf_TableCell($acts);
            $rows .= wf_TableRow($cells, 'row3');
        }
    }
    $result = wf_TableBody($rows, '100%', 0, 'sortable');
    return $result;
}
Example #28
0
 function web_PaySysForm()
 {
     $allpaysys = zb_PaySysPercentGetAll();
     $inputs = wf_TextInput('newmarker', __('Payment system marker'), '', true, '10');
     $inputs .= wf_TextInput('newname', __('Payment system name'), '', true, '10');
     $inputs .= wf_TextInput('newpercent', __('Percent withholding payment system'), '', true, '4');
     $inputs .= wf_Submit(__('Save'));
     $form = wf_Form("", "POST", $inputs, 'glamour');
     $result = $form;
     $result .= wf_Link("?module=payfind", __('Back'), true, 'ubButton');
     if (!empty($allpaysys)) {
         $cells = wf_TableCell(__('Marker'));
         $cells .= wf_TableCell(__('Name'));
         $cells .= wf_TableCell(__('Percent'));
         $cells .= wf_TableCell(__('Actions'));
         $rows = wf_TableRow($cells, 'row1');
         foreach ($allpaysys as $marker => $each) {
             $cells = wf_TableCell($marker);
             $cells .= wf_TableCell($each['name']);
             $cells .= wf_TableCell($each['percent']);
             $cells .= wf_TableCell(wf_JSAlert("?module=payfind&confpaysys=true&delete=" . $marker, web_delete_icon(), __('Removing this may lead to irreparable results')));
             $rows .= wf_TableRow($cells, 'row3');
         }
         $result .= wf_TableBody($rows, '100%', '0', 'sortable');
     }
     return $result;
 }
Example #29
0
 /**
  * renders CaTV tariffs list with some controls
  * 
  * @return void
  */
 public function renderTariffs()
 {
     $cells = wf_TableCell(__('ID'));
     $cells .= wf_TableCell(__('Tariff name'));
     $cells .= wf_TableCell(__('Tariff Fee'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($this->tariffs)) {
         foreach ($this->tariffs as $io => $each) {
             $cells = wf_TableCell($each['id']);
             $cells .= wf_TableCell($each['tariffname']);
             $cells .= wf_TableCell($each['price']);
             $actlinks = wf_JSAlert(self::URL_TARIFFS_MGMT . '&tariffdelete=' . $each['id'], web_delete_icon(), __('Removing this may lead to irreparable results'));
             $actlinks .= wf_modal(web_edit_icon(), __('Edit') . ' ' . $each['tariffname'], $this->tariffEditForm($each['id']), '', '400', '200');
             $cells .= wf_TableCell($actlinks, '', '', $customkey = 'sorttable_customkey="0"');
             //need this to keep table sortable
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     $result = wf_TableBody($rows, '100%', '0', 'sortable');
     $result .= wf_modal(wf_img('skins/plus.png', __('Create new tariff')), __('Create new tariff'), $this->tariffCreateForm(), '', '400', '200');
     return $result;
 }
Example #30
0
 function docsis_ModemProfileShow($modemid)
 {
     $modemid = vf($modemid, 3);
     $data = docsis_ModemGetData($modemid);
     $netdata = array();
     $netdata_q = "SELECT * from `nethosts` where `ip`='" . $data['ip'] . "'";
     $netdata = simple_queryall($netdata_q);
     $netdata = print_r($netdata, true);
     $netdata = nl2br($netdata);
     $alluserips = zb_UserGetAllIPs();
     $alluserips = array_flip($alluserips);
     $result = wf_Link("?module=docsis", __('Back'), false, 'ubButton');
     $ajaxcontainer = wf_AjaxLoader() . wf_AjaxLink("?module=docsis&ajaxsnmp=" . $modemid, __('Renew modem data'), 'ajaxdata', true, 'ubButton') . wf_tag('div', false, '', 'id="ajaxdata"') . wf_tag('div', true);
     $result .= wf_modal(__('Modem diagnostics'), __('Modem diagnostics'), $ajaxcontainer, 'ubButton', '500', '400');
     $result .= wf_modal(__('Networking data'), __('Networking data'), $netdata, 'ubButton', '500', '400');
     $result .= wf_delimiter();
     if (!empty($data)) {
         $cells = wf_TableCell(__('ID'));
         $cells .= wf_TableCell($data['id'] . ' ' . wf_JSAlert("?module=docsis&deletemodem=" . $modemid, web_delete_icon(), __('Removing this may lead to irreparable results')));
         $rows = wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('IP'));
         $cells .= wf_TableCell($data['ip']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('MAC Lan'));
         $cells .= wf_TableCell($data['maclan']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Date'));
         $cells .= wf_TableCell($data['date']);
         $rows .= wf_TableRow($cells, 'row3');
         if (isset($alluserips[$data['userbind']])) {
             $bindedLogin = $alluserips[$data['userbind']];
             $profileLink = ' ' . wf_Link('?module=userprofile&username='******' ' . $bindedLogin, false, '');
         } else {
             $profileLink = '';
         }
         $cells = wf_TableCell(__('Linked user'));
         $cells .= wf_TableCell($data['userbind'] . $profileLink);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Notes'));
         $cells .= wf_TableCell($data['note']);
         $rows .= wf_TableRow($cells, 'row3');
         $result .= wf_TableBody($rows, '100%', '0', '');
         $inputs = wf_TextInput('edituserbind', __('Linked user'), $data['userbind'], true, '40');
         $inputs .= wf_TextInput('editnote', __('Notes'), $data['note'], true, '40');
         $inputs .= wf_Submit(__('Save'));
         $form = wf_Form("", 'POST', $inputs, 'glamour');
         $result .= $form;
         show_window(__('Modem profile'), $result);
     } else {
         show_window(__('Error'), __('Strange exeption'));
     }
 }