Beispiel #1
0
 public function render()
 {
     $cells = wf_TableCell(__('ID'));
     $cells .= wf_TableCell(__('Date'));
     $cells .= wf_TableCell(__('Text'));
     $cells .= wf_TableCell(__('Processed'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($this->alltickets)) {
         foreach ($this->alltickets as $io => $each) {
             $cells = wf_TableCell($each['id']);
             $cells .= wf_TableCell($each['date']);
             if (strlen($each['text']) > 140) {
                 $textPreview = mb_substr(strip_tags($each['text']), 0, 140, 'utf-8') . '...';
             } else {
                 $textPreview = strip_tags($each['text']);
             }
             $cells .= wf_TableCell($textPreview);
             $cells .= wf_TableCell(web_bool_led($each['status']));
             $cells .= wf_TableCell(wf_Link('?module=ticketing&showticket=' . $each['id'], __('Show'), false, 'ubButton'));
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     $result = wf_TableBody($rows, '100%', 0, 'sortable');
     return $result;
 }
Beispiel #2
0
/**
 * Renders employee list with required controls and creation form
 * 
 * @return void
 */
function em_EmployeeShowForm()
{
    $show_q = "SELECT * from `employee`";
    $allemployee = simple_queryall($show_q);
    $cells = wf_TableCell(__('ID'));
    $cells .= wf_TableCell(__('Real Name'));
    $cells .= wf_TableCell(__('Active'));
    $cells .= wf_TableCell(__('Appointment'));
    $cells .= wf_TableCell(__('Mobile'));
    $cells .= wf_TableCell(__('Administrator'));
    $cells .= wf_TableCell(__('Actions'));
    $rows = wf_TableRow($cells, 'row1');
    if (!empty($allemployee)) {
        foreach ($allemployee as $ion => $eachemployee) {
            $cells = wf_TableCell($eachemployee['id']);
            $cells .= wf_TableCell($eachemployee['name']);
            $cells .= wf_TableCell(web_bool_led($eachemployee['active']));
            $cells .= wf_TableCell($eachemployee['appointment']);
            $cells .= wf_TableCell($eachemployee['mobile']);
            $admlogin = $eachemployee['admlogin'];
            if (!empty($admlogin)) {
                if (file_exists(USERS_PATH . $admlogin)) {
                    $admlogin = wf_Link('?module=permissions&edit=' . $admlogin, web_profile_icon() . ' ' . $admlogin, false);
                }
            }
            $cells .= wf_TableCell($admlogin);
            $actions = wf_JSAlert('?module=employee&delete=' . $eachemployee['id'], web_delete_icon(), 'Removing this may lead to irreparable results');
            $actions .= wf_JSAlert('?module=employee&edit=' . $eachemployee['id'], web_edit_icon(), 'Are you serious');
            $cells .= wf_TableCell($actions);
            $rows .= wf_TableRow($cells, 'row3');
        }
    }
    //new employee create form inputs
    $inputs = wf_HiddenInput('addemployee', 'true');
    $inputs .= wf_TableCell('');
    $inputs .= wf_TableCell(wf_TextInput('employeename', '', '', false, 30));
    $inputs .= wf_TableCell('');
    $inputs .= wf_TableCell(wf_TextInput('employeejob', '', '', false, 20));
    $inputs .= wf_TableCell(wf_TextInput('employeemobile', '', '', false, 15));
    $inputs .= wf_TableCell(wf_TextInput('employeeadmlogin', '', '', false, 10));
    $inputs .= wf_TableCell(wf_Submit(__('Create')));
    $inputs = wf_TableRow($inputs, 'row2');
    $addForm = wf_Form("", 'POST', $inputs, '');
    $rows .= $addForm;
    $result = wf_TableBody($rows, '100%', '0', '');
    show_window(__('Employee'), $result);
}
Beispiel #3
0
function multinet_show_available_networks()
{
    global $ubillingConfig;
    $alter = $ubillingConfig->getAlter();
    // Выбираем все сети
    $query = "SELECT * from `networks`";
    $networks = simple_queryall($query);
    // Заголовок таблицы
    $cells = wf_TableCell(__('ID'));
    $cells .= wf_TableCell(__('First IP'));
    $cells .= wf_TableCell(__('Last IP'));
    $cells .= wf_TableCell(__('Network/CIDR'));
    $cells .= wf_TableCell(__('Network type'));
    if ($alter['FREERADIUS_ENABLED']) {
        $cells .= wf_TableCell(__('Use Radius'));
    }
    $cells .= wf_TableCell(__('Actions'));
    $rows = wf_TableRow($cells, 'row1');
    // Содержимое таблицы
    if (!empty($networks)) {
        foreach ($networks as $network) {
            $cells = wf_TableCell($network['id']);
            $cells .= wf_TableCell($network['startip']);
            $cells .= wf_TableCell($network['endip']);
            $cells .= wf_TableCell($network['desc']);
            $cells .= wf_TableCell($network['nettype']);
            if ($alter['FREERADIUS_ENABLED']) {
                $cells .= wf_TableCell(web_bool_led($network['use_radius']));
            }
            $actions = wf_JSAlert('?module=multinet&deletenet=' . $network['id'], web_delete_icon(), 'Removing this may lead to irreparable results');
            $actions .= wf_JSAlert('?module=multinet&editnet=' . $network['id'], web_edit_icon(), 'Are you serious');
            if ($alter['FREERADIUS_ENABLED'] && $network['use_radius']) {
                $actions .= wf_Link('?module=freeradius&netid=' . $network['id'], web_icon_freeradius('Set RADIUS-attributes'));
            }
            $cells .= wf_TableCell($actions);
            $rows .= wf_TableRow($cells, 'row3');
        }
    }
    // Результат - таблица
    $result = wf_TableBody($rows, '100%', '0', 'sortable');
    // Отображаем результат
    show_window(__('Networks'), $result);
}
Beispiel #4
0
/**
 * Zyxel Port state data parser
 * 
 * @return string
 */
function sp_parse_zyportstates($data)
{
    if (!empty($data)) {
        $data = explode('=', $data);
        $data[0] = trim($data[0]);
        $portnum = substr($data[0], -2);
        $portnum = str_replace('.', '', $portnum);
        if (ispos($data[1], '1')) {
            $cells = wf_TableCell($portnum, '24', '', 'style="height:20px;"');
            $cells .= wf_TableCell(web_bool_led(true));
            $rows = wf_TableRow($cells, 'row3');
            $result = wf_TableBody($rows, '100%', 0, '');
        } else {
            $cells = wf_TableCell($portnum, '24', '', 'style="height:20px;"');
            $cells .= wf_TableCell(web_bool_led(false));
            $rows = wf_TableRow($cells, 'row3');
            $result = wf_TableBody($rows, '100%', 0, '');
        }
        return $result;
    } else {
        return __('Empty reply received');
    }
}
Beispiel #5
0
/**
 * Return contact list 
 * 
 * @return string
 */
function im_ContactList()
{
    $me = whoami();
    @($employeeNames = unserialize(ts_GetAllEmployeeLoginsCached()));
    $alladmins = rcms_scandir(DATA_PATH . "users/");
    $activeAdmins = im_GetActiveAdmins();
    $result = '';
    $rows = '';
    if (!empty($alladmins)) {
        foreach ($alladmins as $eachadmin) {
            if ($eachadmin != $me) {
                //need checks for unread messages for each user
                if (wf_CheckGet(array('checknew'))) {
                    $unreadCounter = im_CheckForUnreadMessagesByUser($eachadmin);
                    if ($unreadCounter != 0) {
                        $blinker = wf_img('skins/icon_mail.gif');
                    } else {
                        $blinker = '';
                    }
                } else {
                    $blinker = '';
                }
                if (isset($activeAdmins[$eachadmin])) {
                    $aliveFlag = web_bool_led(true);
                } else {
                    $aliveFlag = web_bool_led(false);
                }
                $conatactAvatar = gravatar_ShowAdminAvatar($eachadmin, '32') . ' ';
                $adminName = isset($employeeNames[$eachadmin]) ? $employeeNames[$eachadmin] : $eachadmin;
                $threadLink = wf_AjaxLink("?module=ubim&showthread=" . $eachadmin, $adminName . ' ' . $blinker, 'threadContainer', false, 'ubimcontact');
                //$threadLink.=$blinker;
                $cells = wf_TableCell($aliveFlag, '', '', 'valign="center" align="center"');
                $cells .= wf_TableCell($conatactAvatar, '35', '', 'valign="center" align="left"');
                $cells .= wf_TableCell($threadLink, '', '', 'valign="center" align="left"');
                $rows .= wf_TableRow($cells, '');
            }
        }
        $result = wf_TableBody($rows, '100%', '0', 'glamour');
        $result .= wf_delimiter() . wf_Link("?module=ubim&avatarcontrol=true", __('Avatar control'), false, 'ubButton');
    }
    return $result;
}
Beispiel #6
0
 /**
  * Renders tasks list as human readable view
  * 
  * @param array $tasksArray
  * 
  * @return string
  */
 public function renderTasks($tasksArray)
 {
     $result = '';
     $totalCount = 0;
     if (!empty($tasksArray)) {
         $cells = wf_TableCell(__('ID'));
         $cells .= wf_TableCell(__('Address'));
         $cells .= wf_TableCell(__('Job type'));
         $cells .= wf_TableCell(__('Phone'));
         $cells .= wf_TableCell(__('Who should do'));
         $cells .= wf_TableCell(__('Worker done'));
         $cells .= wf_TableCell(__('Target date'));
         $cells .= wf_TableCell(__('Finish date'));
         $cells .= wf_TableCell(__('Status'));
         $cells .= wf_TableCell(__('Actions'));
         $rows = wf_TableRow($cells, 'row1');
         foreach ($tasksArray as $io => $each) {
             $cells = wf_TableCell($each['id']);
             $cells .= wf_TableCell($each['address']);
             $cells .= wf_TableCell(@$this->allJobtypes[$each['jobtype']]);
             $cells .= wf_TableCell($each['phone']);
             $cells .= wf_TableCell(@$this->allEmployee[$each['employee']]);
             $cells .= wf_TableCell(@$this->allEmployee[$each['employeedone']]);
             $cells .= wf_TableCell($each['startdate'] . ' ' . $each['starttime']);
             $cells .= wf_TableCell($each['enddate']);
             $cells .= wf_TableCell(web_bool_led($each['status']), '', '', 'sorttable_customkey="' . $each['status'] . '"');
             $actLinks = wf_Link(self::URL_TASKVIEW . $each['id'], web_edit_icon(), false);
             $cells .= wf_TableCell($actLinks);
             $rows .= wf_TableRow($cells, 'row3');
             $totalCount++;
         }
         $result = wf_TableBody($rows, '100%', 0, 'sortable');
         $result .= __('Total') . ': ' . $totalCount;
     } else {
         $messages = new UbillingMessageHelper();
         $result = $messages->getStyledMessage(__('Nothing found'), 'warning');
     }
     return $result;
 }
Beispiel #7
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;
}
Beispiel #8
0
 public function render()
 {
     $cells = wf_TableCell(__('ID'));
     $cells .= wf_TableCell(__('Public'));
     $cells .= wf_TableCell(__('Type'));
     $cells .= wf_TableCell(__('Title'));
     $cells .= wf_TableCell(__('Text'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($this->data)) {
         foreach ($this->data as $io => $each) {
             $cells = wf_TableCell($each['id']);
             $cells .= wf_TableCell(web_bool_led($each['public']));
             $cells .= wf_TableCell($each['type']);
             $cells .= wf_TableCell(strip_tags($each['title']));
             if (strlen($each['text']) > 100) {
                 $textPreview = mb_substr(strip_tags($each['text']), 0, 100, 'utf-8') . '...';
             } else {
                 $textPreview = strip_tags($each['text']);
             }
             $cells .= wf_TableCell($textPreview);
             $actionLinks = wf_JSAlert('?module=zbsannouncements&delete=' . $each['id'], web_delete_icon(), __('Removing this may lead to irreparable results'));
             $actionLinks .= wf_JSAlert('?module=zbsannouncements&edit=' . $each['id'], web_edit_icon(), __('Are you serious'));
             $actionLinks .= wf_modal(wf_img('skins/icon_search_small.gif', __('Preview')), __('Preview'), $this->preview($each['id']), '', '600', '400');
             $cells .= wf_TableCell($actionLinks);
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     $result = wf_TableBody($rows, '100%', 0, 'sortable');
     return $result;
 }
Beispiel #9
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);
}
Beispiel #10
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;
 }
Beispiel #11
0
 /**
  * Renders subscribtion management form
  * 
  * @param int $subId
  * 
  * @return string
  */
 public function renderSubManagerForm($subId)
 {
     $subId = vf($subId, 3);
     $result = '';
     if (isset($this->allSubscribers[$subId])) {
         $baseUrl = self::URL_ME . '&' . self::URL_SUBVIEW . '&subid=' . $subId;
         $subData = $this->allSubscribers[$subId];
         $cells = wf_TableCell(__('ID'));
         $cells .= wf_TableCell(__('User'));
         $cells .= wf_TableCell(__('Tariff'));
         $cells .= wf_TableCell(__('Date'));
         $cells .= wf_TableCell(__('Active'));
         $cells .= wf_TableCell(__('Primary'));
         $cells .= wf_TableCell(__('Free period'));
         $rows = wf_TableRow($cells, 'row1');
         $cells = wf_TableCell($subData['id']);
         $cells .= wf_TableCell(wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $subData['login']));
         $cells .= wf_TableCell($this->allTariffs[$subData['tariffid']]['name']);
         $cells .= wf_TableCell($subData['actdate']);
         $cells .= wf_TableCell(web_bool_led($subData['active']));
         $cells .= wf_TableCell(web_bool_led($subData['primary']));
         $cells .= wf_TableCell(web_bool_led($subData['freeperiod']));
         $rows .= wf_TableRow($cells, 'row3');
         $result = wf_TableBody($rows, '100%', 0, '');
         $result .= wf_delimiter();
         if (cfr('ROOT')) {
             $controls = wf_Link($baseUrl . '&maction=subscribe', web_bool_star(1) . ' ' . __('Subscribe with Megogo API'), true, 'ubButton') . wf_tag('br');
             $controls .= wf_Link($baseUrl . '&maction=unsubscribe', web_bool_star(0) . ' ' . __('Unubscribe with Megogo API'), true, 'ubButton') . wf_tag('br');
             $controls .= wf_Link($baseUrl . '&maction=activate', web_bool_led(1) . ' ' . __('Activate subscription'), true, 'ubButton') . wf_tag('br');
             $controls .= wf_Link($baseUrl . '&maction=deactivate', web_bool_led(0) . ' ' . __('Deactivate subscription'), true, 'ubButton') . wf_tag('br');
             $controls .= wf_JSAlertStyled($baseUrl . '&maction=delete', web_delete_icon() . ' ' . __('Delete subscription'), $this->messages->getDeleteAlert(), 'ubButton');
             $result .= $controls;
         }
     } else {
         $result = $this->messages->getStyledMessage(__('Something went wrong') . ' EX_ID_NOEXISTS', 'error');
     }
     return $result;
 }
Beispiel #12
0
 /**
  * shows selected signup request by its ID
  * 
  * @param int $requid Existing signup request ID
  * 
  * @return void
  */
 public function showRequest($reqid)
 {
     $requid = vf($reqid, 3);
     $reqdata = $this->getData($reqid);
     if (empty($reqdata['apt'])) {
         $apt = 0;
     } else {
         $apt = $reqdata['apt'];
     }
     $shortaddress = $reqdata['street'] . ' ' . $reqdata['build'] . '/' . $apt;
     $taskCreateControls = wf_modal(wf_img('skins/createtask.gif', __('Create task')), __('Create task'), ts_TaskCreateFormSigreq($shortaddress, $reqdata['phone']), '', '420', '500');
     $cells = wf_TableCell(__('Date'));
     $cells .= wf_TableCell($reqdata['date'] . ' ' . $taskCreateControls);
     $rows = wf_TableRow($cells, 'row3');
     $whoislink = self::URL_WHOIS . $reqdata['ip'];
     $iplookup = wf_Link($whoislink, $reqdata['ip'], false, '');
     $cells = wf_TableCell(__('IP'));
     $cells .= wf_TableCell($iplookup);
     $rows .= wf_TableRow($cells, 'row3');
     $reqAddress = $reqdata['street'] . ' ' . $reqdata['build'] . '/' . $apt;
     //Construct capability create form if enabled
     if ($this->altcfg['CAPABDIR_ENABLED']) {
         $capabDir = new CapabilitiesDirectory(true);
         $capabCreateForm = $capabDir->createForm($reqAddress, $reqdata['phone'], $reqdata['service'] . ' ' . $reqdata['notes']);
         $capabControl = wf_modal(wf_img_sized('skins/icon_cake.png', __('Available connection capabilities'), 10), __('Create connection capability'), $capabCreateForm, '', '400', '300');
     } else {
         $capabControl = '';
     }
     $cells = wf_TableCell(__('Full address'));
     $cells .= wf_TableCell($reqAddress . ' ' . $capabControl);
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Real Name'));
     $cells .= wf_TableCell($reqdata['realname']);
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Phone'));
     $cells .= wf_TableCell($reqdata['phone']);
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Service'));
     $cells .= wf_TableCell($reqdata['service']);
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Processed'));
     $cells .= wf_TableCell(web_bool_led($reqdata['state']));
     $rows .= wf_TableRow($cells, 'row3');
     $cells = wf_TableCell(__('Notes'));
     $notes = nl2br($reqdata['notes']);
     $notes = str_replace('Tariff:', __('Tariff') . ':', $notes);
     $notes = str_replace('Email:', __('Email') . ':', $notes);
     $cells .= wf_TableCell($notes);
     $rows .= wf_TableRow($cells, 'row3');
     $result = wf_TableBody($rows, '100%', '0', 'glamour');
     $actlinks = wf_Link('?module=sigreq', __('Back'), false, 'ubButton');
     if ($reqdata['state'] == 0) {
         $actlinks .= wf_Link('?module=sigreq&reqdone=' . $reqid, wf_img_sized('skins/icon_active.gif', '', '10') . ' ' . __('Close'), false, 'ubButton');
     } else {
         $actlinks .= wf_Link('?module=sigreq&requndone=' . $reqid, wf_img_sized('skins/icon_inactive.gif', '', '10') . ' ' . __('Open'), false, 'ubButton');
     }
     $deletelink = ' ' . wf_JSAlert("?module=sigreq&deletereq=" . $reqid, web_delete_icon(), 'Are you serious');
     show_window(__('Signup request') . ': ' . $reqid . $deletelink, $result);
     show_window('', $actlinks);
     //additional comments
     if ($this->altcfg['ADCOMMENTS_ENABLED']) {
         $adcomments = new ADcomments('SIGREQ');
         show_window(__('Additional comments'), $adcomments->renderComments($requid));
     }
 }
Beispiel #13
0
/**
 * Returns card by serial search results
 * 
 * @param string $serial
 * @return string
 */
function web_CardsSearchBySerial($serial)
{
    $serial = mysql_real_escape_string($serial);
    $query = "SELECT * from `cardbank` WHERE `serial` LIKE '%" . $serial . "%'";
    $allcards = simple_queryall($query);
    $result = __('Nothing found');
    if (!empty($allcards)) {
        $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'));
        $rows = wf_TableRow($cells, 'row1');
        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']);
            $rows .= wf_TableRow($cells, 'row3');
        }
        $result = wf_TableBody($rows, '100%', 0, 'sortable');
    }
    return $result;
}
Beispiel #14
0
 /**
  * shows printable report content
  * 
  * @param $title report title
  * @param $data  report data to printable transform
  * 
  * @return void
  */
 public function reportPrintable($title, $data)
 {
     $style = file_get_contents(CONFIG_PATH . "ukvprintable.css");
     $header = wf_tag('!DOCTYPE', false, '', 'html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"');
     $header .= wf_tag('html', false, '', 'xmlns="http://www.w3.org/1999/xhtml" xml:lang="ru" lang="ru"');
     $header .= wf_tag('head', false);
     $header .= wf_tag('title') . $title . wf_tag('title', true);
     $header .= wf_tag('meta', false, '', 'http-equiv="Content-Type" content="text/html; charset=UTF-8" /');
     $header .= wf_tag('style', false, '', 'type="text/css"');
     $header .= $style;
     $header .= wf_tag('style', true);
     $header .= wf_tag('script', false, '', 'src="modules/jsc/sorttable.js" language="javascript"') . wf_tag('script', true);
     $header .= wf_tag('head', true);
     $header .= wf_tag('body', false);
     $footer = wf_tag('body', true);
     $footer .= wf_tag('html', true);
     $title = !empty($title) ? wf_tag('h2') . $title . wf_tag('h2', true) : '';
     $data = $header . $title . $data . $footer;
     $payedIconMask = web_bool_led(1);
     $unpayedIconMask = web_bool_led(0);
     $submitInputMask = wf_Submit(__('Processing'));
     $data = str_replace($payedIconMask, __('Paid'), $data);
     $data = str_replace($unpayedIconMask, __('Not paid'), $data);
     $data = str_replace($submitInputMask, '', $data);
     die($data);
 }
Beispiel #15
0
/**
 * Returns full map marks for builds with filled GEO field
 * 
 * @return string
 */
function um_MapDrawBuilds()
{
    $ym_conf = rcms_parse_ini_file(CONFIG_PATH . "ymaps.ini");
    $query = "SELECT * from `build` WHERE `geo` != '' ";
    $allbuilds = simple_queryall($query);
    $allstreets = zb_AddressGetStreetAllData();
    $streetData = array();
    $cacheDir = 'exports/';
    $cacheTime = 10;
    $cacheTime = time() - $cacheTime * 60;
    //street id => streetname
    if (!empty($allstreets)) {
        foreach ($allstreets as $ia => $eachstreet) {
            $streetData[$eachstreet['id']] = $eachstreet['streetname'];
        }
    }
    //get apts in all builds aggregated with users logins
    $aptData = array();
    $allapts_q = "SELECT `buildid`,`apt`,`login` from `apt` JOIN `address` ON `apt`.`id`=`address`.`aptid`";
    $allapts = simple_queryall($allapts_q);
    if (!empty($allapts)) {
        $aptData = $allapts;
    }
    //get all user ips
    $alluserips = zb_UserGetAllIPs();
    //form alive ips array
    $aliveIps = array();
    if (file_exists("exports/nmaphostscan")) {
        $nmapData = file_get_contents("exports/nmaphostscan");
        $nmapData = explodeRows($nmapData);
        if (!empty($nmapData)) {
            foreach ($nmapData as $ic => $eachnmaphost) {
                $zhost = zb_ExtractIpAddress($eachnmaphost);
                if ($zhost) {
                    $aliveIps[$zhost] = $zhost;
                }
            }
        }
    }
    $result = '';
    if (!empty($allbuilds)) {
        foreach ($allbuilds as $io => $each) {
            $geo = mysql_real_escape_string($each['geo']);
            @($streetname = $streetData[$each['streetid']]);
            $title = wf_Link("?module=builds&action=editbuild&streetid=" . $each['streetid'] . "&buildid=" . $each['id'], $streetname . ' ' . $each['buildnum'], false);
            $content = '';
            $cells = wf_TableCell(__('apt.'));
            $cells .= wf_TableCell(__('User'));
            $cells .= wf_TableCell(__('Status'));
            $rows = wf_tag('tr', false, '', 'bgcolor=#DCDCDC') . $cells . wf_tag('tr', true);
            $iconlabel = '';
            $footer = '';
            $aliveUsers = 0;
            $usersCount = 0;
            if (!empty($aptData)) {
                //build users data caching
                $cacheName = $cacheDir . $each['id'] . '.inbuildusers';
                if (file_exists($cacheName)) {
                    $updateCache = false;
                    if (filemtime($cacheName) > $cacheTime) {
                        $updateCache = false;
                    } else {
                        $updateCache = true;
                    }
                } else {
                    $updateCache = true;
                }
                if (!$updateCache) {
                    $cachePrev = file_get_contents($cacheName);
                    $cachePrev = unserialize($cachePrev);
                    $rows = $cachePrev['rows'];
                    $usersCount = $cachePrev['userscount'];
                    $aliveUsers = $cachePrev['aliveusers'];
                } else {
                    foreach ($aptData as $ib => $eachapt) {
                        if ($eachapt['buildid'] == $each['id']) {
                            if (isset($alluserips[$eachapt['login']])) {
                                $userIp = $alluserips[$eachapt['login']];
                                $usersCount++;
                                if (isset($aliveIps[$userIp])) {
                                    $aliveFlag = web_bool_led(true);
                                    $aliveUsers++;
                                } else {
                                    $aliveFlag = web_bool_led(false);
                                }
                                $cells = wf_TableCell($eachapt['apt']);
                                $cells .= wf_TableCell(wf_Link('?module=userprofile&username='******'login'], $userIp, false));
                                $cells .= wf_TableCell($aliveFlag);
                                $rows .= wf_TableRow($cells);
                            }
                        }
                    }
                    $cacheStore = array();
                    $cacheStore['rows'] = $rows;
                    $cacheStore['userscount'] = $usersCount;
                    $cacheStore['aliveusers'] = $aliveUsers;
                    $cacheStore = serialize($cacheStore);
                    file_put_contents($cacheName, $cacheStore);
                }
            }
            $footer = __('Active') . ' ' . $aliveUsers . '/' . $usersCount;
            $icon = um_MapBuildIcon($usersCount);
            $content = json_encode(wf_TableBody($rows, '', 0));
            $title = json_encode($title);
            $content = str_replace('"', '', $content);
            $content = str_replace("'", '', $content);
            $content = str_replace("\n", '', $content);
            $title = str_replace('"', '', $title);
            $title = str_replace("'", '', $title);
            $title = str_replace("\n", '', $title);
            $result .= sm_MapAddMark($geo, $title, $content, $footer, $icon, $iconlabel, true);
        }
    }
    return $result;
}
Beispiel #16
0
function bs_ShowHash($hash)
{
    $hash = vf($hash);
    $allrealnames = zb_UserGetAllRealnames();
    $alladdress = zb_AddressGetFulladdresslist();
    $checkarr = bs_SearchCheckArr($alladdress, $allrealnames);
    $alter_conf = rcms_parse_ini_file(CONFIG_PATH . 'alter.ini');
    $query = "SELECT * from `bankstaparsed` WHERE `hash`='" . $hash . "' ORDER BY `id` DESC";
    $alldata = simple_queryall($query);
    // проверяем врублены ли корпоративные пользователи
    if ($alter_conf['USER_LINKING_ENABLED']) {
        $alllinkedusers = cu_GetAllLinkedUsers();
        $allparentusers = cu_GetAllParentUsers();
    }
    if (!empty($alldata)) {
        $tablecells = wf_TableCell(__('ID'));
        $tablecells .= wf_TableCell(__('Real Name'));
        $tablecells .= wf_TableCell(__('Address'));
        $tablecells .= wf_TableCell(__('Cash'));
        $tablecells .= wf_TableCell(__('Login poroposal'));
        $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 = bs_SearchLoginByAddresspart($eachrow['address'], $eachrow['realname'], $checkarr);
                //if no one found
                if (sizeof($proposed_login) == 0) {
                    $proposal_form = bs_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('bankstaparsed', 'login', $proposed_login[0], "WHERE `id`='" . $eachrow['id'] . "'");
                }
                //if many users found
                if (sizeof($proposed_login) > 1) {
                    //считаем что это корпоративный пользователь и достаем для него родительского
                    if ($alter_conf['USER_LINKING_ENABLED']) {
                        foreach ($proposed_login as $eachcorp) {
                            if (bs_cu_IsParent($eachcorp, $allparentusers)) {
                                $proposal_form = web_corporate_icon() . ' ' . $eachcorp;
                                //заполним родительского пользователя
                                simple_update_field('bankstaparsed', 'login', $eachcorp, "WHERE `id`='" . $eachrow['id'] . "'");
                            }
                        }
                    } else {
                        // если корпоративщина не включена - вываливаем екзепшн
                        $proposal_form = __('Multiple users found');
                    }
                }
            } else {
                $proposal_form = bs_LoginProposalForm($eachrow['id'], $eachrow['login']);
            }
            $tablecells .= wf_TableCell($proposal_form);
            $procflag = web_bool_led($eachrow['state']);
            if (!$eachrow['state']) {
                $actlink = wf_JSAlert("?module=bankstatements&lockrow=" . $eachrow['id'] . "&showhash=" . $eachrow['hash'], web_key_icon('Lock'), __('Are you serious'));
            } else {
                $actlink = '';
            }
            $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=bankstatements", 'Back', true, 'ubButton'));
    show_window(__('Bank statement processing'), $result);
}
Beispiel #17
0
/**
 * Returns configuration editor to display in sysconf module
 * 
 * @global bool $hide_passwords
 * @param string $prefix
 * @param array $configdata
 * @param array $optsdata
 * @return string
 */
function web_ConfigEditorShow($prefix, $configdata, $optsdata)
{
    global $hide_passwords;
    global $configOptionsMissed;
    $messages = new UbillingMessageHelper();
    $result = '';
    if (!empty($configdata) and !empty($optsdata)) {
        foreach ($optsdata as $option => $handlers) {
            if (isset($configdata[$option]) or ispos($option, 'CHAPTER')) {
                if (!ispos($option, 'CHAPTER')) {
                    $currentdata = $configdata[$option];
                    $handlers = explode('|', $handlers);
                    $type = $handlers[0];
                    //option description
                    if (!empty($handlers[1])) {
                        $description = trim($handlers[1]);
                        $description = __($description);
                    } else {
                        $description = $option;
                    }
                    //option controls
                    if ($type == 'TRIGGER') {
                        $control = web_bool_led($configdata[$option]);
                    }
                    if ($type == 'VARCHAR') {
                        if ($hide_passwords) {
                            if (isset($handlers[2])) {
                                if ($handlers[2] == 'PASSWD') {
                                    $datavalue = __('Hidden');
                                } else {
                                    $datavalue = $configdata[$option];
                                }
                            } else {
                                $datavalue = $configdata[$option];
                            }
                        } else {
                            $datavalue = $configdata[$option];
                        }
                        $control = wf_tag('input', false, '', 'type="text" name="' . $prefix . '_' . $option . '" size="25" value="' . $datavalue . '" readonly') . "\n";
                    }
                    $result .= $control . ' ' . $description . wf_tag('br');
                } else {
                    if (ispos($option, 'CHAPTER_')) {
                        $result .= wf_tag('div', false, '', 'id="tabs-' . $option . '"');
                        $result .= wf_tag('h2', false);
                        $result .= __($handlers);
                        $result .= wf_tag('h2', true);
                    }
                    if (ispos($option, 'CHAPTEREND_')) {
                        $result .= wf_tag('div', true) . "\n";
                    }
                }
            } else {
                $result .= wf_tag('div', false, '', 'style="vertical-align: top; margin:5px; padding:5px; "');
                $result .= wf_tag('font', false, '', 'style="color: #FF0000;  font-size:100%"');
                $result .= __('You missed an important option') . ': ' . $option . '';
                $configOptionsMissed .= $messages->getStyledMessage(__('You missed an important option') . ': ' . $option, 'error');
                $result .= wf_tag('font', true);
                $result .= wf_tag('div', true);
                $result .= wf_tag('br');
            }
        }
    }
    return $result;
}
Beispiel #18
0
 public function renderAll($cutdata = false)
 {
     $alladdress = zb_AddressGetFulladdresslist();
     $allrealnames = zb_UserGetAllRealnames();
     $userCounter = 0;
     $cells = '';
     if (!$cutdata) {
         $cells .= wf_TableCell(__('Login'));
     }
     $cells .= wf_TableCell(__('Address'));
     $cells .= wf_TableCell(__('Real Name'));
     $cells .= wf_TableCell(__('IP'));
     $cells .= wf_TableCell(__('Tariff'));
     $cells .= wf_TableCell(__('Next month'));
     $cells .= wf_TableCell(__('Cash'));
     $cells .= wf_TableCell(__('Credit'));
     $cells .= wf_TableCell(__('Contract'));
     $cells .= wf_TableCell(__('Service active'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($this->data)) {
         foreach ($this->data as $io => $each) {
             $cells = '';
             if (!$cutdata) {
                 $profileLink = wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $each['login'], false, '');
                 $cells = wf_TableCell($profileLink);
             }
             $cells .= wf_TableCell(@$alladdress[$each['login']]);
             $cells .= wf_TableCell(@$allrealnames[$each['login']]);
             $cells .= wf_TableCell($each['IP']);
             $cells .= wf_TableCell($each['Tariff']);
             $cells .= wf_TableCell($each['TariffChange']);
             $cells .= wf_TableCell($each['Cash']);
             $cells .= wf_TableCell($each['Credit']);
             $cells .= wf_TableCell(@$this->contracts[$each['login']]);
             $actFlag = web_bool_led(@$this->actives[$each['login']], true);
             if ($cutdata) {
                 $actFlag = strip_tags($actFlag);
             }
             $cells .= wf_TableCell($actFlag, '', '', 'sorttable_customkey="' . @$this->actives[$each['login']] . '"');
             $rows .= wf_TableRow($cells, 'row3');
             $userCounter++;
         }
     }
     $result = wf_TableBody($rows, '100%', '0', 'sortable');
     $result .= __('Total') . ': ' . $userCounter;
     return $result;
 }
Beispiel #19
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);
}
Beispiel #20
0
 $cells = wf_TableCell(__('ID'));
 $cells .= wf_TableCell(__('Scenario'));
 $cells .= wf_TableCell(__('Attribute'));
 $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)
Beispiel #21
0
 /**
  * Renders list of available DHCP networks with some controls
  * 
  * @return string
  */
 public function renderNetsList()
 {
     $result = '';
     $cells = wf_TableCell(__('ID'));
     $cells .= wf_TableCell(__('Network/CIDR'));
     $cells .= wf_TableCell(__('DHCP custom subnet template'));
     $cells .= wf_TableCell(__('DHCP config name'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($this->allDhcpNets)) {
         foreach ($this->allDhcpNets as $io => $eachnet) {
             $rowClass = 'row5';
             if (isset($this->allMultinetNets[$eachnet['netid']])) {
                 $cidr = $this->allMultinetNets[$eachnet['netid']]['desc'];
             } else {
                 $cidr = __('Deleted');
             }
             $cells = wf_TableCell($eachnet['id']);
             $cells .= wf_TableCell($cidr);
             $cells .= wf_TableCell(web_bool_led($eachnet['dhcpconfig']));
             $cells .= wf_TableCell($eachnet['confname']);
             $actLinks = wf_JSAlert('?module=dhcp&delete=' . $eachnet['id'], web_delete_icon(), 'Removing this may lead to irreparable results') . ' ';
             $actLinks .= wf_Link('?module=dhcp&edit=' . $eachnet['id'], web_edit_icon(), false);
             $cells .= wf_TableCell($actLinks);
             $rows .= wf_TableRow($cells, 'row5');
         }
         $result = wf_TableBody($rows, '100%', 0, 'sortable');
     } else {
         $result = $this->messages->getStyledMessage(__('No available DHCP networks found'), 'info');
     }
     return $result;
 }
Beispiel #22
0
 /**
  * renders streets report
  * 
  * @return void
  */
 public function reportStreets()
 {
     $ukvCities = array();
     $ukvStreets = array();
     //loads cities and streets occupied by UKV users
     $ukvCities_q = "SELECT DISTINCT `city` from `ukv_users` ORDER BY `city` ASC";
     $ukvCitiesRaw = simple_queryall($ukvCities_q);
     if (!empty($ukvCitiesRaw)) {
         foreach ($ukvCitiesRaw as $ieuc => $euc) {
             $ukvCities[$euc['city']] = $euc['city'];
         }
     }
     $ukvStreets_q = "SELECT DISTINCT `street` from `ukv_users` ORDER BY `street` ASC";
     $ukvStreetsRaw = simple_queryall($ukvStreets_q);
     if (!empty($ukvStreetsRaw)) {
         foreach ($ukvStreetsRaw as $ieus => $eus) {
             $ukvStreets[$eus['street']] = $eus['street'];
         }
     }
     //main codepart
     $citySelected = wf_CheckPost(array('streetreportcity')) ? $_POST['streetreportcity'] : '';
     $streetSelected = wf_CheckPost(array('streetreportstreet')) ? $_POST['streetreportstreet'] : '';
     $inputs = wf_Selector('streetreportcity', $ukvCities, __('City'), $citySelected, false);
     $inputs .= wf_Selector('streetreportstreet', $ukvStreets, __('Street'), $streetSelected, false);
     $inputs .= wf_Submit(__('Show'));
     $form = wf_Form('', 'POST', $inputs, 'glamour');
     show_window(__('Streets report'), $form);
     if (wf_CheckPost(array('streetreportcity', 'streetreportstreet')) or wf_CheckGet(array('rc', 'rs'))) {
         //set form data
         if (wf_CheckPost(array('streetreportcity', 'streetreportstreet'))) {
             $citySearch = $_POST['streetreportcity'];
             $streetSearch = $_POST['streetreportstreet'];
         }
         //or printable report
         if (wf_CheckGet(array('rc', 'rs'))) {
             $citySearch = $_GET['rc'];
             $streetSearch = $_GET['rs'];
         }
         if (!empty($this->users)) {
             $counter = 0;
             $cells = wf_TableCell(__('Contract'), '10%');
             $cells .= wf_TableCell(__('Full address'), '31%');
             $cells .= wf_TableCell(__('Real Name'), '30%');
             $cells .= wf_TableCell(__('Tariff'), '15%');
             $cells .= wf_TableCell(__('Cash'), '7%');
             $cells .= wf_TableCell(__('Status'), '7%');
             $rows = wf_TableRow($cells, 'row1');
             foreach ($this->users as $io => $eachUser) {
                 if ($eachUser['city'] == $citySearch and $eachUser['street'] == $streetSearch) {
                     $cells = wf_TableCell($eachUser['contract']);
                     $fullAddress = $this->userGetFullAddress($eachUser['id']);
                     $profileLink = wf_Link(self::URL_USERS_PROFILE . $eachUser['id'], web_profile_icon() . ' ', false, '');
                     $cells .= wf_TableCell($profileLink . $fullAddress);
                     $cells .= wf_TableCell($eachUser['realname']);
                     $cells .= wf_TableCell($this->tariffs[$eachUser['tariffid']]['tariffname']);
                     $cells .= wf_TableCell($eachUser['cash']);
                     $cells .= wf_TableCell(web_bool_led($eachUser['active'], true));
                     $rows .= wf_TableRow($cells, 'row3');
                     $counter++;
                 }
             }
             $result = wf_TableBody($rows, '100%', '0', 'sortable');
             $result .= __('Total') . ': ' . $counter;
             if (wf_CheckGet(array('printable'))) {
                 $this->reportPrintable($citySearch . ' / ' . $streetSearch, $result);
             } else {
                 $printlink = wf_Link(self::URL_REPORTS_MGMT . 'reportStreets&rc=' . $citySearch . '&rs=' . $streetSearch . '&printable=true', wf_img('skins/icon_print.png', __('Print')), false, '');
                 show_window($citySearch . ' / ' . $streetSearch . ' ' . $printlink, $result);
             }
         } else {
             show_window(__('Result'), __('Any users found'));
         }
     }
 }
Beispiel #23
0
/**
 * Returns preformatted view of CF content preprocessed by its type
 * 
 * @param string $type Type of the data (VARCHAR, TRIGGER,TEXT)
 * @param string $data Data of CF
 * 
 * @return string
 */
function cf_FieldDisplay($type, $data)
{
    if ($type == 'TRIGGER') {
        $data = web_bool_led($data);
    }
    if ($type == 'TEXT') {
        $data = nl2br($data);
    }
    return $data;
}
Beispiel #24
0
 /**
  * Returns list of available sticky notes with it controls as grid
  * 
  * @return string
  */
 public function renderListGrid()
 {
     $cells = wf_TableCell(__('Creation date'));
     $cells .= wf_TableCell(__('Remind date'));
     $cells .= wf_TableCell(__('Status'));
     $cells .= wf_TableCell(__('Text'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($this->allnotes)) {
         foreach ($this->allnotes as $io => $each) {
             $cells = wf_TableCell($each['createdate']);
             $cells .= wf_TableCell($each['reminddate']);
             $cells .= wf_TableCell(web_bool_led($each['active']), '', '', 'sorttable_customkey="' . $each['active'] . '"');
             $viewLink = wf_Link('?module=stickynotes&shownote=' . $each['id'], $this->cutString($each['text'], 100), false, '');
             $cells .= wf_TableCell($viewLink);
             $actLinks = wf_JSAlert('?module=stickynotes&delete=' . $each['id'], web_delete_icon(), __('Removing this may lead to irreparable results')) . ' ';
             $actLinks .= wf_modal(web_edit_icon(), __('Edit'), $this->editForm($each['id']), '', '500', '450') . ' ';
             $actLinks .= wf_modal(wf_img('skins/icon_search_small.gif', __('Preview')), __('Preview'), nl2br(strip_tags($each['text'])), '', '640', '480');
             $cells .= wf_TableCell($actLinks);
             $rows .= wf_TableRow($cells, 'row3');
         }
     }
     $result = wf_TableBody($rows, '100%', 0, 'sortable');
     return $result;
 }
Beispiel #25
0
 /**
  * Retruns json data for jquery data tables with transactions list
  * 
  * @global object $ubillingConfig
  * @return string
  */
 public function transactionAjaxSource()
 {
     $manual_mode = $this->altCfg['OPENPAYZ_MANUAL'];
     $query = "SELECT * from `op_transactions` ORDER by `id` DESC;";
     $alltransactions = simple_queryall($query);
     $result = '{ 
               "aaData": [ ';
     if (!empty($alltransactions)) {
         foreach ($alltransactions as $io => $eachtransaction) {
             if ($manual_mode) {
                 if ($eachtransaction['processed'] == 0) {
                     $control = wf_Link('?module=openpayz&process=' . $eachtransaction['id'], web_add_icon('Payment'));
                     $control = str_replace('"', '', $control);
                     $control = trim($control);
                 } else {
                     $control = '';
                 }
             } else {
                 $control = '';
             }
             @($user_login = $this->allCustomers[$eachtransaction['customerid']]);
             @($user_realname = $this->allRealnames[$user_login]);
             $user_realname = str_replace('"', '', $user_realname);
             $user_realname = trim($user_realname);
             @($user_address = $this->allAddress[$user_login]);
             $user_address = trim($user_address);
             $user_address = str_replace("'", '`', $user_address);
             $user_address = mysql_real_escape_string($user_address);
             if (!empty($user_login)) {
                 $profileLink = wf_Link('?module=userprofile&username='******'"', '', $profileLink);
                 $profileLink = trim($profileLink);
             } else {
                 $profileLink = '';
             }
             $stateIcon = web_bool_led($eachtransaction['processed']);
             $stateIcon = str_replace('"', '', $stateIcon);
             $stateIcon = trim($stateIcon) . ' ' . $control;
             $result .= '
                 [
                 "' . $eachtransaction['id'] . '",
                 "' . $eachtransaction['date'] . '",
                 "' . $eachtransaction['summ'] . '",
                 "' . $eachtransaction['customerid'] . '",
                 "' . $user_realname . '",
                 "' . $profileLink . ' ' . $user_address . '",
                 "' . $eachtransaction['paysys'] . '",
                 "' . $stateIcon . '"
                 ],';
         }
     }
     $result = substr($result, 0, -1);
     $result .= '] 
     }';
     return $result;
 }
Beispiel #26
0
 /**
  * Renders full cemetary log for some user
  * 
  * @param string $login
  * 
  * @return string
  */
 public function renderCemeteryLog($login)
 {
     $result = '';
     if (!empty($this->allDead)) {
         $cells = wf_TableCell(__('Date'));
         $cells .= wf_TableCell(__('Status'));
         $rows = wf_TableRow($cells, 'row1');
         foreach ($this->allDead as $io => $each) {
             if ($each['login'] == $login) {
                 $led = $each['state'] ? web_bool_led(0) : web_bool_led(1);
                 $cells = wf_TableCell($each['date']);
                 $cells .= wf_TableCell($led);
                 $rows .= wf_TableRow($cells, 'row3');
             }
         }
         $result = wf_TableBody($rows, '100%', 0, 'sortable');
     }
     /**
      Ich trink Dutzende von Dosenbier und schalte meinen Fernseher an
      Todesmöpse ohne Gnade, Todesmöpse greifen an
      Super dicke titten, ey die wabbeln und die schwabbeln
      Sowie affengeil Teil drei, die auf'm Affenfelsen rammeln
      Ich komm auf deine Party und ich kotze auf's Buffet
     */
     if (cfr('USERREG')) {
         if ($this->isUserDead($login)) {
             $inputs = wf_HiddenInput('cemeterysetasundead', $login);
             $inputs .= wf_Submit(__('Set user connected'));
             $result .= wf_Form('', 'POST', $inputs, 'glamour');
         } else {
             $inputs = wf_HiddenInput('cemeterysetasdead', $login);
             $inputs .= wf_Submit(__('Set user disconnected'));
             $result .= wf_Form('', 'POST', $inputs, 'glamour');
         }
     }
     return $result;
 }
Beispiel #27
0
 function web_plchecker($login)
 {
     $login = vf($login);
     $result = '<table width="100%" border="0">';
     $emails = zb_plcheckfield('emails', $login);
     $contracts = zb_plcheckfield('contracts', $login);
     $phones = zb_plcheckfield('phones', $login);
     $realname = zb_plcheckfield('realname', $login);
     $userspeeds = zb_plcheckfield('userspeeds', $login);
     $nethosts = zb_plchecknethost($login);
     $result .= '
         <tr class="row1">
             <td>' . __('Current value') . '</td>
             <td>' . __('Parameter') . '</td>
             <td>' . __('Actions') . '</td>
         <tr>
          ';
     $result .= '
         <tr class="row3">
             <td>' . web_bool_led($emails) . '</td>
             <td>' . __('Email') . '</td>
             <td>' . web_plfixerform($login, 'emails', $emails) . '</td>
         </tr>
          <tr class="row3">
             <td>' . web_bool_led($contracts) . '</td>
             <td>' . __('Contract') . '</td>
             <td>' . web_plfixerform($login, 'contracts', $contracts) . '</td>
          </tr>
             <tr class="row3">
             <td>' . web_bool_led($phones) . '</td>
             <td>' . __('Phone') . '/' . __('Mobile') . '</td>
             <td>' . web_plfixerform($login, 'phones', $phones) . '</td>
         </tr>
         <tr class="row3">
             <td>' . web_bool_led($realname) . '</td>
             <td>' . __('Real Name') . '</td>
             <td>' . web_plfixerform($login, 'realname', $realname) . '</td>
         </tr>
         <tr class="row3">
             <td>' . web_bool_led($userspeeds) . '</td>
             <td>' . __('Speed override') . '</td>
             <td>' . web_plfixerform($login, 'userspeeds', $userspeeds) . '</td>
         </tr>
         <tr class="row3">
             <td>' . web_bool_led($nethosts) . '</td>
             <td>' . __('Network') . '</td>
             <td>' . web_plfixerform($login, 'nethosts', $nethosts) . '</td>
         </tr>
         ';
     $result .= '</table>';
     $result .= web_UserControls($login);
     return $result;
 }
Beispiel #28
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;
 }
Beispiel #29
0
 /**
  * Renders full cemetary log for some user
  * 
  * @param string $login
  * 
  * @return string
  */
 public function renderCemeteryLog($login)
 {
     $result = '';
     if (!empty($this->allDead)) {
         $cells = wf_TableCell(__('Date'));
         $cells .= wf_TableCell(__('Status'));
         $rows = wf_TableRow($cells, 'row1');
         foreach ($this->allDead as $io => $each) {
             if ($each['login'] == $login) {
                 $led = $each['state'] ? web_bool_led(0) : web_bool_led(1);
                 $cells = wf_TableCell($each['date']);
                 $cells .= wf_TableCell($led);
                 $rows .= wf_TableRow($cells, 'row3');
             }
         }
         $result = wf_TableBody($rows, '100%', 0, 'sortable');
         if (cfr('USERREG')) {
             if ($this->isUserDead($login)) {
                 $inputs = wf_HiddenInput('cemeterysetasundead', $login);
                 $inputs .= wf_Submit(__('Set user connected'));
                 $result .= wf_Form('', 'POST', $inputs, 'glamour');
             } else {
                 $inputs = wf_HiddenInput('cemeterysetasdead', $login);
                 $inputs .= wf_Submit(__('Set user disconnected'));
                 $result .= wf_Form('', 'POST', $inputs, 'glamour');
             }
         }
     }
     return $result;
 }
Beispiel #30
0
 /**
  * Renders ajax data subscriptions
  * 
  * @return void
  */
 public function subscribtionsListAjax()
 {
     $result = '{ 
               "aaData": [ ';
     if (!empty($this->allSubscribers)) {
         foreach ($this->allSubscribers as $io => $each) {
             $userLink = wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $each['login'], false);
             $userLink = trim($userLink);
             $userLink = str_replace('"', '', $userLink);
             $actFlag = web_bool_led(web_bool_led($each['active'], false));
             $actFlag = str_replace('"', '', $actFlag);
             $primFlag = web_bool_led(web_bool_led($each['primary'], false));
             $primFlag = str_replace('"', '', $primFlag);
             $freeperiodFlag = web_bool_led(web_bool_led($each['freeperiod'], false));
             $freeperiodFlag = str_replace('"', '', $freeperiodFlag);
             $result .= '
                 [
                 "' . $each['id'] . '",
                 "' . $userLink . '",
                 "' . @$this->allTariffs[$each['tariffid']]['name'] . '",
                 "' . $each['actdate'] . '",
                 "' . $actFlag . '",
                 "' . $primFlag . '",
                 "' . $freeperiodFlag . '"
                 ],';
         }
     }
     $result = zb_CutEnd($result);
     $result .= '] 
     }';
     die($result);
 }