Exemple #1
0
 function web_MessagesShowPrevious($login)
 {
     $login = mysql_real_escape_string($login);
     $query = "SELECT * from `ticketing` WHERE `to`='" . $login . "' AND `from`='NULL' AND `status`='1' ORDER BY `date` DESC";
     $allmessages = simple_queryall($query);
     $result = '<table width="100%" class="sortable">';
     $result .= '
                 <tr class="row1">
                 <td>' . __('Date') . '</td>
                 <td>' . __('Text') . '</td>
                 </tr>
                 ';
     if (!empty($allmessages)) {
         foreach ($allmessages as $io => $eachmessage) {
             $result .= '
                 <tr class="row3">
                 <td>' . $eachmessage['date'] . '</td>
                 <td>' . $eachmessage['text'] . '</td>
                 </tr>
                 ';
         }
     }
     $result .= '</table>';
     show_window(__('Previous messages'), $result);
 }
Exemple #2
0
function zbs_ShowUserPayments($login)
{
    $usConfig = zbs_LoadConfig();
    if ($usConfig['PAYMENTS_ENABLED']) {
        $allpayments = zbs_CashGetUserPayments($login);
        $cells = la_TableCell(__('Date'));
        $cells .= la_TableCell(__('Payment'));
        $cells .= la_TableCell(__('Balance'));
        $rows = la_TableRow($cells, 'row1');
        if (!empty($allpayments)) {
            foreach ($allpayments as $io => $eachpayment) {
                if ($usConfig['PAYMENTSTIMEHIDE']) {
                    $timestamp = strtotime($eachpayment['date']);
                    $cleanDate = date("Y-m-d", $timestamp);
                    $dateCells = $cleanDate;
                } else {
                    $dateCells = $eachpayment['date'];
                }
                $cells = la_TableCell($dateCells);
                $cells .= la_TableCell($eachpayment['summ']);
                $cells .= la_TableCell($eachpayment['balance']);
                $rows .= la_TableRow($cells, 'row2');
            }
        }
        $result = la_TableBody($rows, '100%', 0);
        show_window(__('Last payments'), $result);
    } else {
        $result = __('This module is disabled');
        show_window(__('Sorry'), $result);
    }
}
Exemple #3
0
function zbs_AnnouncementsShow()
{
    $query = "SELECT * from `zbsannouncements` WHERE `public`='1' ORDER by `id` DESC";
    $all = simple_queryall($query);
    $result = '';
    if (!empty($all)) {
        foreach ($all as $io => $each) {
            if (!isset($_COOKIE['zbsanread_' . $each['id']])) {
                $readControl = la_Link('?module=announcements&anmarkasread=' . $each['id'], la_img('iconz/anunread.gif', __('Mark as read'))) . ' ';
            } else {
                $readControl = la_Link('?module=announcements&anmarkasunread=' . $each['id'], la_img('iconz/anread.gif', __('Mark as unread'))) . ' ';
            }
            $result .= la_tag('h3', false, 'row1', '') . $readControl . $each['title'] . '&nbsp;' . la_tag('h3', true);
            $result .= la_delimiter();
            if ($each['type'] == 'text') {
                $eachtext = strip_tags($each['text']);
                $result .= nl2br($eachtext);
            }
            if ($each['type'] == 'html') {
                $result .= $each['text'];
            }
            $result .= la_delimiter();
        }
    } else {
        show_window(__('Sorry'), __('There are not any announcements.'));
    }
    show_window('', $result);
}
Exemple #4
0
 /**
  * Shows current FDB cache list container
  * 
  * @param string $fdbSwitchFilter
  */
 function web_FDBTableShowDataTable($fdbSwitchFilter = '')
 {
     $filter = !empty($fdbSwitchFilter) ? '&swfilter=' . $fdbSwitchFilter : '';
     $filtersForm = wf_modalAuto(web_icon_search('MAC filters setup'), __('MAC filters setup'), web_FDBTableFiltersForm(), '');
     $columns = array('Switch IP', 'Port', 'Location', 'MAC', 'User');
     $result = wf_JqDtLoader($columns, '?module=switchpoller&ajax=true' . $filter, true, 'Objects', 100);
     show_window(__('Current FDB cache') . ' ' . $filtersForm, $result);
 }
Exemple #5
0
 function ms_ShowForm()
 {
     $inputs = __('Message') . '<br>';
     $inputs .= wf_TextArea('message', '', '', true, '60x6');
     $inputs .= wf_TextInput('exactuserlogins', 'Exact users, comma delimiter', '', true, '30');
     $inputs .= wf_RadioInput('sendtype', 'Exact users', 'exactusers', true, true);
     $inputs .= wf_RadioInput('sendtype', 'Debtors', 'debtors', true);
     $inputs .= wf_RadioInput('sendtype', 'All users', 'allusers', true);
     $inputs .= wf_Submit('Send');
     $form = wf_Form('', 'POST', $inputs, 'glamour');
     show_window(__('Masssender'), $form);
 }
Exemple #6
0
 function web_AnnihilateFormShow($login)
 {
     $alladdress = zb_AddressGetFulladdresslist();
     $inputs = __('Be careful, this module permanently deletes user and all data associated with it. Opportunities to raise from the dead no longer.');
     $inputs .= wf_tag('br');
     $inputs .= __('To ensure that we have seen the seriousness of your intentions to enter the word сonfirm the field below.');
     $inputs .= wf_tag('br');
     $inputs .= wf_tag('input', false, '', 'type="text" name="confirmation" autocomplete="off"');
     $inputs .= wf_HiddenInput('anihilation', 'true');
     $inputs .= wf_delimiter();
     $inputs .= wf_Submit(__('I really want to stop suffering User'));
     $form = wf_Form('', 'POST', $inputs, 'glamour');
     show_window(__('Deleting user') . ' ' . @$alladdress[$login] . ' (' . $login . ')', $form);
 }
Exemple #7
0
 /**
  * Renders search results for used cards
  * 
  * @param int $year
  * @param string $month
  * 
  * @return void
  */
 function web_CardShowUsageByMonth($year, $month)
 {
     $month = mysql_real_escape_string($month);
     $year = mysql_real_escape_string($year);
     $query = "SELECT * from `cardbank` WHERE `usedate` LIKE '%" . $year . "-" . $month . "-%'";
     $allusedcards = simple_queryall($query);
     $allrealnames = zb_UserGetAllRealnames();
     $alladdress = zb_AddressGetFulladdresslist();
     $totalsumm = 0;
     $totalcount = 0;
     $csvdata = '';
     $tablecells = wf_TableCell(__('ID'));
     $tablecells .= wf_TableCell(__('Serial number'));
     $tablecells .= wf_TableCell(__('Cash'));
     $tablecells .= wf_TableCell(__('Usage date'));
     $tablecells .= wf_TableCell(__('Used login'));
     $tablecells .= wf_TableCell(__('Full address'));
     $tablecells .= wf_TableCell(__('Real name'));
     $tablerows = wf_TableRow($tablecells, 'row1');
     if (!empty($allusedcards)) {
         $csvdata = __('ID') . ';' . __('Serial number') . ';' . __('Cash') . ';' . __('Usage date') . ';' . __('Used login') . ';' . __('Full address') . ';' . __('Real name') . "\n";
         foreach ($allusedcards as $io => $eachcard) {
             $tablecells = wf_TableCell($eachcard['id']);
             $tablecells .= wf_TableCell($eachcard['serial']);
             $tablecells .= wf_TableCell($eachcard['cash']);
             $tablecells .= wf_TableCell($eachcard['usedate']);
             $profilelink = wf_Link("?module=userprofile&username="******"\n";
         }
     }
     if (!empty($csvdata)) {
         $exportFilename = 'exports/cardreport_' . $year . '-' . $month . '.csv';
         $csvdata = iconv('utf-8', 'windows-1251', $csvdata);
         file_put_contents($exportFilename, $csvdata);
         $exportLink = wf_Link('?module=cardreport&dloadcsv=' . base64_encode($exportFilename), wf_img('skins/excel.gif', __('Export')), false, '');
     } else {
         $exportLink = '';
     }
     $result = wf_TableBody($tablerows, '100%', '0', 'sortable');
     $result .= __('Total') . ': ' . $totalcount . ' ' . __('payments') . ', ' . __('with total amount') . ': ' . $totalsumm;
     show_window(__('Payment cards usage report') . ' ' . $exportLink, $result);
 }
Exemple #8
0
 function mrst_FormShow()
 {
     global $altcfg;
     $inputs = __('After clicking the button below for all users will perform the standard procedure reset. By default, this will reinitialize shapers and  MAC bindings.');
     if (!isset($altcfg['MASSRESET_NOCONFIRM'])) {
         $confirmKey = rand(1111, 9999);
         $inputs .= ' ' . __('If you are completely sure of what you wish, enter the following numbers into the next field.') . '<br>';
         $inputs .= wf_HiddenInput('confirmkey', $confirmKey);
         $inputs .= $confirmKey . ' ⇨ ' . wf_TextInput('confirmcheck', '', '', true, 5);
     }
     $inputs .= wf_HiddenInput('runmassreset', 'true') . '<br>';
     $inputs .= wf_Submit(__('I`m ready'));
     $form = wf_Form("", 'POST', $inputs, 'glamour');
     show_window(__('Mass user reset'), $form);
 }
Exemple #9
0
 function dhcp_show_templates()
 {
     $allTemplates = rcms_scandir(CONFIG_PATH . 'dhcp/');
     $result = '';
     if (!empty($allTemplates)) {
         foreach ($allTemplates as $each) {
             $templateData = file_get_contents(CONFIG_PATH . 'dhcp/' . $each);
             $templateData = nl2br($templateData);
             $result .= wf_modal($each, $each, $templateData, 'ubButton', 800, 600);
         }
     } else {
         $result = __('Nothing found');
     }
     show_window(__('Global templates'), $result);
 }
Exemple #10
0
 function web_UserGenForm()
 {
     $alltariffs_raw = zb_TariffsGetAll();
     $alltariffs = array();
     if (!empty($alltariffs_raw)) {
         foreach ($alltariffs_raw as $it => $eachtariff) {
             $alltariffs[$eachtariff['name']] = $eachtariff['name'];
         }
     }
     $inputs = wf_TextInput('gencount', __('Count of users to generate'), '', true);
     $inputs .= wf_Selector('gentariff', $alltariffs, __('Existing tariff for this users'), '', true);
     $inputs .= multinet_service_selector() . ' ' . __('Service for new users') . wf_tag('br');
     $inputs .= wf_CheckInput('fastsqlgen', __('Fast SQL Inserts - need to shutdown stargazer'), true, false);
     $inputs .= wf_Submit(__('Go!'));
     $result = wf_Form("", "POST", $inputs, 'glamour');
     show_window(__('Sample user generator'), $result);
 }
Exemple #11
0
            }
            //reports
            if (wf_CheckGet(array('reports'))) {
                if (wf_CheckGet(array('ajaxtremains'))) {
                    $warehouse->{$avidity}['A']['SEENOEVIL']();
                }
                if (wf_CheckGet(array('calendarops'))) {
                    show_window(__('Operations in the context of time'), $warehouse->reportCalendarOps());
                    $warehouse->{$avidity}['M']['FALL']($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&' . 'totalremains=true');
                }
                if (wf_CheckGet(array('totalremains'))) {
                    $calendarLink = wf_Link($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&calendarops=true', wf_img('skins/icon_calendar.gif', __('Operations in the context of time')), false, '');
                    $dateRemainsLink = wf_Link($warehouse::URL_ME . '&' . $warehouse::URL_REPORTS . '&dateremains=true', wf_img('skins/ukv/report.png', __('Date remains')));
                    show_window(__('The remains in all storages') . ' ' . $calendarLink . ' ' . $dateRemainsLink, $warehouse->reportAllStoragesRemains());
                    $warehouse->{$avidity}['M']['FALL']();
                }
                if (wf_CheckGet(array('dateremains'))) {
                    show_window(__('Date remains'), $warehouse->reportDateRemains());
                    $warehouse->{$avidity}['M']['FALL']();
                }
            }
            $warehouse->{$avidity}['M']['FRONT']();
        } else {
            show_error(__('No license key available'));
        }
    } else {
        show_error(__('This module is disabled'));
    }
} else {
    show_error(__('Permission denied'));
}
Exemple #12
0
<?php

if (!defined('SLIDER_PATH')) {
    define('SLIDER_PATH', DATA_PATH . 'slider/');
}
show_window('', @file_get_contents(SLIDER_PATH . 'code.html'));
Exemple #13
0
<?php

////////////////////////////////////////////////////////////////////////////////
//   Copyright (C) ReloadCMS Development Team                                 //
//   http://reloadcms.com                                                     //
//   This product released under GNU General Public License v2                //
////////////////////////////////////////////////////////////////////////////////
$filesdb = new linksdb(DOWNLOADS_DATAFILE);
$files = array_reverse($filesdb->getLastFiles(10));
$i = 2;
$lst_c_id = -1;
if (!empty($files)) {
    $result = '<ul style="margin: 0px 0px 0px 0px; text-indent: 0px; list-style-type: none; padding: 0px 0px 0px 0px;">';
    foreach ($files as $id) {
        if ($lst_c_id !== $id[0]) {
            $result .= '<li style="text-align: center"><a href="?module=filesdb&amp;id=' . ($id[0] + 1) . '" style="font-weight: bold;">' . $filesdb->data[$id[0]]['name'] . '</a></li>';
            $lst_c_id = $id[0];
        }
        $result .= '<li class="row' . $i . '"><a href="?module=filesdb&amp;id=' . ($id[0] + 1) . '&amp;fid=' . ($id[1] + 1) . '">' . $filesdb->data[$id[0]]['files'][$id[1]]['name'] . '</a></li>';
        $i++;
        if ($i > 3) {
            $i = 2;
        }
    }
    $result .= '</ul>';
    show_window(__('Last files'), $result);
}
Exemple #14
0
<?php

if (cfr('USERPROFILE')) {
    if (isset($_GET['username'])) {
        $login = vf($_GET['username']);
        $login = trim($login);
        try {
            $profile = new UserProfile($login);
            show_window(__('User profile'), $profile->render());
        } catch (Exception $exception) {
            show_window(__('Error'), __('Strange exeption') . ': ' . wf_tag('pre') . $exception->getMessage() . wf_tag('pre', true));
        }
    } else {
        throw new Exception('GET_NO_USERNAME');
    }
}
Exemple #15
0
 /**
  * downloads previous users document and check it validity
  * 
  * @param $documentid id of existing document
  * 
  * @return void
  */
 public function downloadUserDocument($documentid)
 {
     $documentid = vf($documentid, 3);
     if (!empty($documentid)) {
         if (isset($this->userDocuments[$documentid])) {
             $documentFileName = $this->userDocuments[$documentid]['path'];
             $fullPath = $this->dOCUMENTS_PATH . $documentFileName;
             zbs_DownloadFile($fullPath, 'docx');
         } else {
             show_window(__('Sorry'), __('No such document'));
         }
     }
 }
Exemple #16
0
    function zb_SpeedControlGetOverrideUsers()
    {
        $query = "SELECT `login` from `userspeeds` WHERE `speed` NOT LIKE '0'";
        $alloverrides = simple_queryall($query);
        $result = array();
        if (!empty($alloverrides)) {
            foreach ($alloverrides as $io => $eachoverride) {
                $result[] = $eachoverride;
            }
        }
        return $result;
    }
    function zb_SpeedControlFix($login)
    {
    }
    //fixing speed override
    if (isset($_GET['fix'])) {
        $login = vf($_GET['fix']);
        $speed = 0;
        zb_UserDeleteSpeedOverride($login);
        zb_UserCreateSpeedOverride($login, $speed);
        log_register("SPEEDFIX (" . $login . ")");
        $billing->resetuser($login);
        log_register("RESET User (" . $login . ")");
        rcms_redirect("?module=speedcontrol");
    }
    $alloverrides = zb_SpeedControlGetOverrideUsers();
    show_window(__('Users with speed overrides'), web_UsersLister($alloverrides));
} else {
    show_error(__('You cant control this module'));
}
Exemple #17
0
            $nasbwdurl = mysql_real_escape_string($_POST['editnasbwdurl']);
            $netid = vf($_POST['networkselect']);
            simple_update_field('nas', 'nastype', $nastype, $targetnas);
            simple_update_field('nas', 'nasip', $nasip, $targetnas);
            simple_update_field('nas', 'nasname', $nasname, $targetnas);
            simple_update_field('nas', 'bandw', $nasbwdurl, $targetnas);
            simple_update_field('nas', 'netid', $netid, $targetnas);
            zb_NasConfigSave();
            log_register("NAS EDIT " . $nasip);
            rcms_redirect("?module=nas&edit=" . $nasid);
        }
        $nasdata = zb_NasGetData($nasid);
        $currentnetid = $nasdata['netid'];
        $currentnasip = $nasdata['nasip'];
        $currentnasname = $nasdata['nasname'];
        $currentnastype = $nasdata['nastype'];
        $currentbwdurl = $nasdata['bandw'];
        $nastypes = array('local' => 'Local NAS', 'rscriptd' => 'rscriptd', 'mikrotik' => 'MikroTik', 'radius' => 'Radius');
        $editinputs = multinet_network_selector($currentnetid) . "<br>";
        $editinputs .= wf_Selector('editnastype', $nastypes, 'NAS type', $currentnastype, true);
        $editinputs .= wf_TextInput('editnasip', 'IP', $currentnasip, true, '15');
        $editinputs .= wf_TextInput('editnasname', 'NAS name', $currentnasname, true, '15');
        $editinputs .= wf_TextInput('editnasbwdurl', 'Bandwidthd URL', $currentbwdurl, true, '25');
        $editinputs .= wf_Submit('Save');
        $editform = wf_Form('', 'POST', $editinputs, 'glamour');
        show_window(__('Edit') . ' NAS', $editform);
        show_window('', wf_Link("?module=nas", 'Back', true, 'ubButton'));
    }
} else {
    show_error(__('You cant control this module'));
}
Exemple #18
0
/**
 * Show data for some device
 * 
 * @param   $ip device ip
 * @param   $community snmp community
 * @param   $alltemplates all of snmp templates
 * @param   $quiet  no output
 * 
 * @return  void
 */
function sp_SnmpPollDevice($ip, $community, $alltemplates, $deviceTemplate, $allusermacs, $alladdress, $quiet = false)
{
    global $ubillingConfig;
    if (isset($alltemplates[$deviceTemplate])) {
        $currentTemplate = $alltemplates[$deviceTemplate];
        if (!empty($currentTemplate)) {
            $deviceDescription = $currentTemplate['define']['DEVICE'];
            $deviceFdb = $currentTemplate['define']['FDB'];
            $sectionResult = '';
            $sectionName = '';
            $finalResult = '';
            $tempArray = array();
            $alterCfg = $ubillingConfig->getAlter();
            $snmp = new SNMPHelper();
            //selecting FDB processing mode
            if (isset($currentTemplate['define']['FDB_MODE'])) {
                $deviceFdbMode = $currentTemplate['define']['FDB_MODE'];
            } else {
                $deviceFdbMode = 'default';
            }
            //selecting FDB ignored port for skipping MAC-s on it
            if (isset($currentTemplate['define']['FDB_IGNORE_PORTS'])) {
                $deviceFdbIgnore = $currentTemplate['define']['FDB_IGNORE_PORTS'];
                $deviceFdbIgnore = explode(',', $deviceFdbIgnore);
                $deviceFdbIgnore = array_flip($deviceFdbIgnore);
            } else {
                $deviceFdbIgnore = array();
            }
            //parse each section of template
            foreach ($alltemplates[$deviceTemplate] as $section => $eachpoll) {
                if ($section != 'define') {
                    if (!$quiet) {
                        $finalResult .= wf_tag('div', false, 'dashboard', '');
                    }
                    $sectionName = $eachpoll['NAME'];
                    $sectionOids = explode(',', $eachpoll['OIDS']);
                    $sectionParser = $eachpoll['PARSER'];
                    $sectionResult = '';
                    //now parse each oid
                    foreach ($sectionOids as $eachOid) {
                        $eachOid = trim($eachOid);
                        $rawData = $snmp->walk($ip, $community, $eachOid, true);
                        $rawData = str_replace('"', '`', $rawData);
                        $parseCode = '$sectionResult.=' . $sectionParser . '("' . $rawData . '");';
                        eval($parseCode);
                    }
                    if (!$quiet) {
                        $finalResult .= wf_tag('div', false, 'dashtask', '') . wf_tag('strong') . __($sectionName) . wf_tag('strong', true) . '<br>';
                        $finalResult .= $sectionResult . wf_tag('div', true);
                    }
                }
            }
            $finalResult .= wf_tag('div', true);
            $finalResult .= wf_tag('div', false, '', 'style="clear:both;"');
            $finalResult .= wf_tag('div', true);
            if (!$quiet) {
                show_window('', $finalResult);
            }
            //
            //parsing data from FDB table
            //
            if ($deviceFdb == 'true') {
                $portData = array();
                $snmp->setBackground(false);
                // need to process data with system + background
                if ($deviceFdbMode == 'default') {
                    //default zyxel & cisco port table
                    $portTable = $snmp->walk($ip, $community, '.1.3.6.1.2.1.17.4.3.1.2', true);
                } else {
                    if ($deviceFdbMode == 'dlp') {
                        //custom dlink port table with VLANS
                        $portTable = $snmp->walk($ip, $community, '.1.3.6.1.2.1.17.7.1.2.2.1.2', true);
                    }
                }
                if (!empty($portTable)) {
                    if ($deviceFdbMode == 'default') {
                        //default FDB parser
                        $portData = sp_SnmpParseFDB($portTable);
                    } else {
                        if ($deviceFdbMode == 'dlp') {
                            //exotic dlink parser
                            $portData = sp_SnmpParseFdbDl($portTable);
                        }
                    }
                    //skipping some port data if FDB_IGNORE_PORTS option is set
                    if (!empty($deviceFdbIgnore)) {
                        if (!empty($portData)) {
                            foreach ($portData as $some_mac => $some_port) {
                                if (!isset($deviceFdbIgnore[$some_port])) {
                                    $tempArray[$some_mac] = $some_port;
                                }
                            }
                            $portData = $tempArray;
                        }
                    }
                    $fdbCache = serialize($portData);
                    file_put_contents('exports/' . $ip . '_fdb', $fdbCache);
                }
                //show port data User friendly :)
                if (!empty($portData)) {
                    //extracting all needed data for switchport control
                    if ($alterCfg['SWITCHPORT_IN_PROFILE']) {
                        $allswitchesArray = zb_SwitchesGetAll();
                        $allportassigndata = array();
                        $allportassigndata_q = "SELECT * from `switchportassign`;";
                        $allportassigndata_raw = simple_queryall($allportassigndata_q);
                        if (!empty($allportassigndata_raw)) {
                            foreach ($allportassigndata_raw as $iopd => $eachpad) {
                                $allportassigndata[$eachpad['login']] = $eachpad;
                            }
                        }
                    }
                    $allusermacs = array_flip($allusermacs);
                    $cells = wf_TableCell(__('User'), '30%');
                    $cells .= wf_TableCell(__('MAC'));
                    $cells .= wf_TableCell(__('Ports'));
                    $rows = wf_TableRow($cells, 'row1');
                    foreach ($portData as $eachMac => $eachPort) {
                        //user detection
                        if (isset($allusermacs[$eachMac])) {
                            $userLogin = $allusermacs[$eachMac];
                            @($useraddress = $alladdress[$userLogin]);
                            $userlink = wf_Link('?module=userprofile&username='******' ' . $useraddress, false);
                            //switch port assing form
                            if ($alterCfg['SWITCHPORT_IN_PROFILE']) {
                                $assignForm = wf_modal(web_edit_icon(__('Switch port assign')), __('Switch port assign'), web_SnmpSwitchControlForm($userLogin, $allswitchesArray, $allportassigndata, @$_GET['switchid'], $eachPort), '', '500', '250');
                                if (isset($allportassigndata[$userLogin])) {
                                    $assignForm .= wf_img('skins/arrow_right_green.png') . @$allportassigndata[$userLogin]['port'];
                                }
                            } else {
                                $assignForm = '';
                            }
                        } else {
                            $userlink = '';
                            $assignForm = '';
                        }
                        $cells = wf_TableCell($userlink . $assignForm, '', '', 'sorttable_customkey="' . $eachPort . '"');
                        $cells .= wf_TableCell($eachMac);
                        $cells .= wf_TableCell($eachPort);
                        $rows .= wf_TableRow($cells, 'row3');
                    }
                    if (!$quiet) {
                        show_window(__('FDB'), wf_TableBody($rows, '100%', '0', 'sortable'));
                    }
                }
            }
        }
    }
}
Exemple #19
0
function post_remove($id, $file = RCMS_GB_DEFAULT_FILE)
{
    global $_CACHE;
    $data =& $_CACHE['gbook'][$file];
    if (!isset($data)) {
        if (!is_readable($file) || !($data = unserialize(file_get_contents($file)))) {
            $data = array();
        }
    }
    rcms_remove_index($id, $data, true);
    if (file_write_contents($file, serialize($data))) {
        show_window('', __('Comment removed'));
    } else {
        show_window(__('Error'), __('Comment are not removed!'));
    }
}
Exemple #20
0
<?php

// check for right of current admin on this module
if (cfr('CATVSTATS')) {
    catv_GlobalControlsShow();
    if (wf_CheckGet(array('userid'))) {
        $userid = vf($_GET['userid'], 3);
        $userdata = catv_UserGetData($userid);
        $realname = $userdata['realname'];
        $address = $userdata['street'] . ' ' . $userdata['build'] . '/' . $userdata['apt'];
        //target year selection
        $yearforminputs = wf_YearSelector('yearselect', 'Year', false);
        $yearforminputs .= ' ';
        $yearforminputs .= wf_Submit('Show');
        $yearform = wf_Form('', 'POST', $yearforminputs, 'glamour', '');
        show_window($address . ' ' . $realname, $yearform . '<div style="clear: both;"></div>');
        if (wf_CheckPost(array('yearselect'))) {
            $target_year = $_POST['yearselect'];
        } else {
            $target_year = curyear();
        }
        catv_UserStatsByYear($userid, $target_year);
        catv_DecoderShowAllChanges($userid);
        catv_ActivityShowAll($userid);
        catv_ProfileBack($userid);
    }
} else {
    show_error(__('You cant control this module'));
}
Exemple #21
0
<?php

if (cfr('EMPLOYEE')) {
    if (isset($_GET['username'])) {
        $username = $_GET['username'];
        if (isset($_POST['addjob'])) {
            $date = $_POST['jobdate'];
            $worker_id = $_POST['worker'];
            $jobtype_id = $_POST['jobtype'];
            $job_notes = $_POST['notes'];
            stg_add_new_job($username, $date, $worker_id, $jobtype_id, $job_notes);
            rcms_redirect("?module=jobs&username="******"?module=jobs&username=" . $username);
        }
        stg_show_jobs($username);
        show_window('', web_UserControls($username));
    }
} else {
    show_error(__('Access denied'));
}
?>


Exemple #22
0
                            if (method_exists($corps, $beggar['BU']['F'])) {
                                $corpAttachControls = $corps->{$beggar}['BU']['F']($login);
                                show_window(__('Private user'), $corpAttachControls);
                            }
                            if (method_exists($corps, $beggar['BU']['AB'])) {
                                $corpAddAttachControls = $corps->{$beggar}['BU']['AB']($login);
                                show_window(__('Create') . ' ' . __('Corporate user'), $corpAddAttachControls);
                            }
                        }
                    }
                }
                if ($route == Corps::URL_SEARCH) {
                    $searchResults = $corps->searchUsersByCorpName($_POST['searchcorpname']);
                    if (!empty($searchResults)) {
                        show_window(__('Search results'), $searchResults);
                    }
                    show_window('', wf_Link('?module=usersearch', __('Back'), false, 'ubButton'));
                }
            } else {
                //default list route
                rcms_redirect(Corps::URL_CORPS_LIST);
            }
        } else {
            show_error(__('No license key available'));
        }
    } else {
        show_error(__('This module is disabled'));
    }
} else {
    show_error(__('Access denied'));
}
Exemple #23
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'));
         }
     }
 }
Exemple #24
0
            //show webcam snapshot form
            if (wf_CheckGet(array('mode'))) {
                $modeSet = $_GET['mode'];
                //webcamera snapshot
                if ($modeSet == 'cam') {
                    show_window(__('Webcamera snapshot'), $photoStorage->renderWebcamForm(false));
                }
                //webcamera cropped snapshot
                if ($modeSet == 'avacam') {
                    show_window(__('Webcamera snapshot') . ' - ' . __('avatar'), $photoStorage->renderWebcamForm(true));
                }
                //just file upload interface
                if ($modeSet == 'loader') {
                    show_window(__('Upload images'), $photoStorage->renderUploadForm());
                }
                //listing images for some object
                if ($modeSet == 'list') {
                    show_window(__('Upload images'), $photoStorage->uploadControlsPanel());
                    show_window(__('Uploaded images'), $photoStorage->renderImagesList());
                }
            }
        } else {
            // displaying report
            //... soon ....
        }
    } else {
        show_error(__('You cant control this module'));
    }
} else {
    show_error(__('This module disabled'));
}
Exemple #25
0
/**
 * Renders new/unread announcements notification
 * 
 * @return void
 */
function zbs_AnnouncementsNotice()
{
    $result = '';
    if (zbs_AnnouncementsAvailable()) {
        $cells = la_TableCell(la_Link('?module=announcements', la_img('iconz/alert.gif'), true, ''));
        $cells .= la_TableCell(la_Link('?module=announcements', __('Some announcements are available'), true, ''));
        $rows = la_TableRow($cells);
        $result .= la_TableBody($rows, '70%', 0, '');
        show_window('', $result);
    }
}
Exemple #26
0
            $content = $form->text_box('add[Attribute]', '');
            $form->addrow(__('Attribute'), $content);
            //  - Оператор
            $content = $form->select_tag('add[op]', $operators, '');
            $form->addrow(__('op'), $content);
            //  - Значение
            $content = $form->text_box('add[Value]', '');
            $form->addrow(__('Value'), $content);
            /* Кнопка модального окна с формой добавления нового атрибута */
            $html .= wf_modal(__('Append'), __('Adding of RADIUS-attribute'), $form->show(1), 'ubButton', 450, 275);
            // Форма переопределения атрибута 'User-Name'
            $query = "SELECT `value` FROM `radius_reassigns` WHERE `netid` = '{$netid}'";
            $result = simple_query($query);
            $result['value'] = !empty($result['value']) ? $result['value'] : '';
            $form = new InputForm('', 'POST', __('Save'), '', '', '', 'reassignment');
            //  - Значение
            $content = $form->radio_button('reassignment[value]', array('' => __('Login'), 'ip' => __('IP'), 'mac' => __('MAC')), $result['value']);
            $form->addrow(__('Value'), $content);
            /* Кнопка модального окна с формой переназначения атрибута 'User-Name' */
            $html .= wf_modal(__('Reassign User-Name'), __('Reassignment of User-Name'), $form->show(1), 'ubButton', 450, 155);
            /* Атрибуты сети */
            $html .= wf_TableBody($rows, '100%', '0', 'sortable');
        }
        /* Показываем содержимое модуля */
        show_window($title, $html);
    } else {
        show_window(__('Error'), __('This module is disabled'));
    }
} else {
    show_error(__('You cant control this module'));
}
Exemple #27
0
 public function document_add_form_submit($item, $item_id, $data)
 {
     $return = false;
     if (!empty($data['title'])) {
         $file_name = uniqid();
         $file_extention = pathinfo($_FILES[self::FORM_ADD]['name']['file'], PATHINFO_EXTENSION);
         $upload_path = DATA_PATH . 'documents/vols/' . $file_name . '.' . $file_extention;
         if (move_uploaded_file($_FILES[self::FORM_ADD]['tmp_name']['file'], $upload_path)) {
             $return = true;
             $query = "\n                        INSERT INTO `" . self::TABLE_DOCS . "` (\n                            `id`,\n                            `title`,\n                            `date`,\n                            `" . $item . "_id`,\n                            `path`\n                        ) VALUES (\n                            NULL,\n                            '" . $data['title'] . "',\n                            NOW(),\n                            '" . $item_id . "',\n                            '" . $upload_path . "'\n                        )\n                    ";
             nr_query($query);
         } else {
             show_window(__('Error'), __('You should add any file'));
         }
     } else {
         show_window(__('Error'), __('No display title for document'));
     }
     return $return;
 }
Exemple #28
0
if (cfr('REPORTTARIFFS')) {
    $altCfg = $ubillingConfig->getAlter();
    $chartsCache = new UbillingCache();
    show_window(__('Popularity of tariffs among users'), web_TariffShowReport());
    show_window(__('Planned tariff changes'), web_TariffShowMoveReport());
    if (!isset($altCfg['GCHARTS_ENABLED'])) {
        $chartsEnabled = true;
    } else {
        if ($altCfg['GCHARTS_ENABLED']) {
            $chartsEnabled = true;
        } else {
            $chartsEnabled = false;
        }
    }
    //google charts
    if ($chartsEnabled) {
        $cachingTime = 3600;
        $moveCharts = $chartsCache->getCallback('REPORT_TARIFFS_MOVECHART', function () {
            return web_TariffShowMoveCharts();
        }, $cachingTime);
        $tariffCharts = $chartsCache->getCallback('REPORT_TARIFFS_TARIFFHCHART', function () {
            return web_TariffShowTariffCharts();
        }, $cachingTime);
        //rendering charts
        show_window(__('Graphs'), $tariffCharts . wf_delimiter() . $moveCharts);
        zb_BillingStats(true);
    }
} else {
    show_error(__('You cant control this module'));
}
Exemple #29
0
            $show_pdf = la_tag('iframe src="' . $url . '" width="600px" height="800px"');
            $show_pdf .= la_tag('iframe', true);
            $inputs = la_CheckInput('custom_agreement', __('I have read text above and agree with terms of use'), FALSE, FALSE);
            $inputs .= la_delimiter();
            $inputs .= la_Submit(__('Order'));
            $show_pdf .= la_Form("", "POST", $inputs);
            show_window(__("You must accept license agreement"), $show_pdf);
        }
        if (isset($_POST['custom_agreement'])) {
            $date = GetFullApplyDate();
            $action = 'tagadd';
            $param = vf($_GET['service'], 3);
            $param = preg_replace('/\\0/s', '', $param);
            $param = strip_tags($param);
            $param = mysql_real_escape_string($param);
            $note = 'Order from userstats';
            if (checkTask($user_login, $action, $param)) {
                createTask($date, $user_login, $action, $param, $note);
            }
            rcms_redirect('?module=adservice&action=add&wait=true');
        }
    }
    if (!isset($_GET['accept'])) {
        show_window(__('Aditional services'), __('You can order aditional services. Available services - listed below.'));
        show_window(__('Aditional services cost'), AdServicesList($serviceCost, $us_config['currency']));
        show_window(__('Order aditional service'), AdServicesSelector($availableServices, $user_login));
        show_window(__('Activated services'), ShowAllOrderedServices($availableServices, $user_login));
    }
} else {
    show_window(__('Sorry'), __('This module is disabled'));
}
Exemple #30
0
            $cityid = $_GET['cityid'];
            if ($_GET['action'] == 'delete') {
                if (!zb_AddressCityProtected($cityid)) {
                    zb_AddressDeleteCity($cityid);
                    rcms_redirect('?module=city');
                } else {
                    show_window(__('Error'), __('You can not just remove a city where there are streets and possibly survivors'));
                    show_window('', wf_Link('?module=city', __('Back'), true, 'ubButton'));
                }
            }
            if ($_GET['action'] == 'edit') {
                if (isset($_POST['editcityname'])) {
                    if (!empty($_POST['editcityname'])) {
                        zb_AddressChangeCityName($cityid, $_POST['editcityname']);
                    }
                    zb_AddressChangeCityAlias($cityid, $_POST['editcityalias']);
                    rcms_redirect('?module=city');
                }
                show_window(__('Edit City'), web_CityEditForm($cityid));
            }
        }
    }
    // create form
    if (!wf_CheckGet(array('action'))) {
        show_window(__('Create new city'), web_CityCreateForm());
    }
    //list
    show_window(__('Available cities'), web_CityLister());
} else {
    show_error(__('You cant control this module'));
}