Ejemplo n.º 1
0
 /**
  * Returns available time rules grid
  * 
  * @return string
  */
 public function renderList()
 {
     $messages = new UbillingMessageHelper();
     $allTariffs = zb_TariffGetPricesAll();
     $query = "SELECT * from `dshape_time` ORDER BY `id` ASC";
     $allrules = simple_queryall($query);
     $cells = wf_TableCell(__('ID'));
     $cells .= wf_TableCell(__('Tariff'));
     $cells .= wf_TableCell(__('Time from'));
     $cells .= wf_TableCell(__('Time to'));
     $cells .= wf_TableCell(__('Speed'));
     $cells .= wf_TableCell(__('Actions'));
     $rows = wf_TableRow($cells, 'row1');
     if (!empty($allrules)) {
         foreach ($allrules as $io => $eachrule) {
             $rowClass = isset($allTariffs[$eachrule['tariff']]) ? 'row3' : 'sigdeleteduser';
             $tariffControl = cfr('TARIFFSPEED') ? wf_Link('?module=tariffspeeds&tariff=' . $eachrule['tariff'], $eachrule['tariff'], false) : $eachrule['tariff'];
             $cells = wf_TableCell($eachrule['id']);
             $cells .= wf_TableCell($tariffControl);
             $cells .= wf_TableCell($eachrule['threshold1']);
             $cells .= wf_TableCell($eachrule['threshold2']);
             $cells .= wf_TableCell($eachrule['speed']);
             $actions = wf_JSAlert('?module=dshaper&delete=' . $eachrule['id'], web_delete_icon(), $messages->getDeleteAlert());
             $actions .= wf_JSAlert('?module=dshaper&edit=' . $eachrule['id'], web_edit_icon(), $messages->getEditAlert());
             $cells .= wf_TableCell($actions);
             $rows .= wf_TableRow($cells, $rowClass);
         }
     }
     $result = wf_TableBody($rows, '100%', '0', 'sortable');
     return $result;
 }
Ejemplo n.º 2
0
/**
 *  Shows help icon if context chapter available for current language
 *  
 *  @return  string
 */
function web_HelpIconShow()
{
    $lang = curlang();
    $result = '';
    if (cfr('HELP')) {
        if (isset($_GET['module'])) {
            $modulename = vf($_GET['module']);
            if (file_exists(DATA_PATH . "help/" . $lang . "/" . $modulename)) {
                $help_chapter = web_HelpChapterGet($modulename);
                $result = wf_modal(wf_img_sized("skins/help.gif", __('Context help'), 20), __('Context help'), $help_chapter, '', '600', '300');
            }
        }
    }
    return $result;
}
Ejemplo n.º 3
0
 function build_task($right, $link, $icon, $text)
 {
     global $system;
     global $billing_config;
     global $altconf;
     $icon_path = CUR_SKIN_PATH . 'taskbar/';
     if (cfr($right)) {
         $task_link = $link;
         $task_icon = $icon_path . $icon;
         if (!file_exists($task_icon)) {
             $task_icon = 'skins/taskbar/' . $icon;
         }
         $task_text = $text;
         if (isset($_COOKIE['tb_iconsize'])) {
             //is icon customize enabled?
             if ($altconf['TB_ICONCUSTOMSIZE']) {
                 $tbiconsize = vf($_COOKIE['tb_iconsize'], 3);
             } else {
                 $tbiconsize = $billing_config['TASKBAR_ICON_SIZE'];
             }
         } else {
             $tbiconsize = $billing_config['TASKBAR_ICON_SIZE'];
         }
         if ($altconf['TB_LABELED']) {
             if ($tbiconsize > 63) {
                 $template = '<div class="dashtask" style="height:' . ($tbiconsize + 30) . 'px; width:' . ($tbiconsize + 30) . 'px;"> <a href="' . $task_link . '"><img  src="' . $task_icon . '" border="0" width="' . $tbiconsize . '"  height="' . $tbiconsize . '" alt="' . $task_text . '" title="' . $task_text . '"></a> <br><br>' . $task_text . ' </div>';
             } else {
                 $template = '<a href="' . $task_link . '"><img  src="' . $task_icon . '" border="0" width="' . $tbiconsize . '"  height="' . $tbiconsize . '" alt="' . $task_text . '" title="' . $task_text . '"></a><img src="' . $icon_path . 'spacer.gif">  ';
             }
         } else {
             $template = '<a href="' . $task_link . '"><img  src="' . $task_icon . '" border="0" width="' . $tbiconsize . '"  height="' . $tbiconsize . '" alt="' . $task_text . '" title="' . $task_text . '"></a><img src="' . $icon_path . 'spacer.gif">  ';
         }
     } else {
         $template = '';
     }
     return $template;
 }
Ejemplo n.º 4
0
<?php

if (cfr('VOLS')) {
    /**
     * Класс:
     */
    class VOLS
    {
        /* Private variablesЖ */
        private $html;
        private $config = array();
        private $polylines = '';
        private $placemarks = '';
        /* Names of forms: */
        const FORM_ADD = 'form_add';
        const FORM_EDIT = 'form_edit';
        /* URLs: */
        const URL_HOME = '?module=vols&item=map&action=show';
        const URL_MAP_SHOW = '?module=vols&item=map&action=show';
        const URL_MAP_EDIT = '?module=vols&item=map&action=edit';
        const URL_MARK_TYPES_LIST = '?module=vols&item=mark_type&action=list';
        const URL_MARK_TYPE_EDIT = '?module=vols&item=mark_type&action=edit&id=';
        const URL_MARK_TYPE_DEL = '?module=vols&item=mark_type&action=delete&id=';
        const URL_MARK_TYPE_ADD = '?module=vols&item=mark_type&action=add';
        const URL_MARKS_LIST = '?module=vols&item=mark&action=list';
        const URL_MARK_PLACE = '?module=vols&item=mark&action=place&id=';
        const URL_MARK_DOCS = '?module=vols&item=mark&action=documents&id=';
        const URL_MARK_EDIT = '?module=vols&item=mark&action=edit&id=';
        const URL_MARK_DEL = '?module=vols&item=mark&action=delete&id=';
        const URL_MARK_ADD = '?module=vols&item=mark&action=add';
        const URL_LINES_LIST = '?module=vols&item=line&action=list';
Ejemplo n.º 5
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;
 }
Ejemplo n.º 6
0
<?php

if (cfr('SPEEDCONTROL')) {
    function web_UsersLister($users)
    {
        $tablecells = wf_TableCell(__('Login'));
        $tablecells .= wf_TableCell(__('Real Name'));
        $tablecells .= wf_TableCell(__('Full address'));
        $tablecells .= wf_TableCell(__('Tariff'));
        $tablecells .= wf_TableCell(__('Tariff speeds'));
        $tablecells .= wf_TableCell(__('Speed override'));
        $tablecells .= wf_TableCell(__('Actions'));
        $tablerows = wf_TableRow($tablecells, 'row1');
        if (!empty($users)) {
            $udata = array();
            $alluserdata = zb_UserGetAllStargazerData();
            $alladdress = zb_AddressGetFulladdresslist();
            $allrealnames = zb_UserGetAllRealnames();
            $allspeeds = zb_TariffGetAllSpeeds();
            if (!empty($alluserdata)) {
                foreach ($alluserdata as $ia => $eachdata) {
                    $udata[$eachdata['login']]['Tariff'] = $eachdata['Tariff'];
                    @($udata[$eachdata['login']]['Address'] = $alladdress[$eachdata['login']]);
                    @($udata[$eachdata['login']]['RealName'] = $allrealnames[$eachdata['login']]);
                    @($udata[$eachdata['login']]['NormalSpeedDown'] = $allspeeds[$eachdata['Tariff']]['speeddown']);
                    @($udata[$eachdata['login']]['NormalSpeedUp'] = $allspeeds[$eachdata['Tariff']]['speedup']);
                }
            }
            foreach ($users as $io => $eachuser) {
                $tablecells = wf_TableCell(wf_Link('?module=userprofile&username='******'login'], web_profile_icon() . ' ' . $eachuser['login']));
                $tablecells .= wf_TableCell($udata[$eachuser['login']]['RealName']);
Ejemplo n.º 7
0
<?php

if (cfr('NAS')) {
    if (isset($_GET['delete'])) {
        $deletenas = $_GET['delete'];
        zb_NasDelete($deletenas);
        zb_NasConfigSave();
        rcms_redirect("?module=nas");
    }
    if (isset($_POST['newnasip'])) {
        $newnasip = $_POST['newnasip'];
        $newnetid = $_POST['networkselect'];
        $newnasname = $_POST['newnasname'];
        $newnastype = $_POST['newnastype'];
        $newbandw = $_POST['newbandw'];
        if (!empty($newnasip) and !empty($newnasname)) {
            zb_NasAdd($newnetid, $newnasip, $newnasname, $newnastype, $newbandw);
            zb_NasConfigSave();
            rcms_redirect("?module=nas");
        }
    }
    // Show available NASes
    $allnas = zb_NasGetAllData();
    // construct needed editor
    $titles = array('ID', 'Network', 'IP', 'NAS name', 'NAS type', 'Bandwidthd URL');
    $keys = array('id', 'netid', 'nasip', 'nasname', 'nastype', 'bandw');
    if (!wf_CheckGet(array('edit'))) {
        $altCfg = $ubillingConfig->getAlter();
        if ($altCfg['FREERADIUS_ENABLED']) {
            $freeRadiusClientsData = web_FreeRadiusListClients();
            $radiusControls = wf_modal(web_icon_extended(__('FreeRADIUS NAS parameters')), __('FreeRADIUS NAS parameters'), $freeRadiusClientsData, '', '600', '300');
Ejemplo n.º 8
0
<?php

// check for right of current admin on this module
if (cfr('CITY')) {
    if (isset($_POST['newcityname'])) {
        $newcityname = $_POST['newcityname'];
        if (isset($_POST['newcityalias'])) {
            $newcityalias = $_POST['newcityalias'];
        } else {
            $newcityalias = '';
        }
        if (!empty($newcityname)) {
            zb_AddressCreateCity($newcityname, $newcityalias);
            rcms_redirect('?module=city');
        } else {
            show_error(__('Empty city name'));
        }
    }
    if (isset($_GET['action'])) {
        if (isset($_GET['cityid'])) {
            $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') {
Ejemplo n.º 9
0
<?php

if (cfr('FREERADIUS')) {
    $alter = $ubillingConfig->getAlter();
    if ($alter['FREERADIUS_ENABLED']) {
        // Содержимое страницы
        $title = '';
        $html = '';
        // Доступные сценарии
        $scenarios = array('check' => 'check', 'reply' => 'reply');
        // Доступные операторы
        $operators = array('=' => '=', ':=' => ':=', '==' => '==', '+=' => '+=', '!=' => '!=', '>' => '>', '>=' => '>=', '<' => '<', '<=' => '<=', '=~' => '=~', '!~' => '!~', '=*' => '=*', '!*' => '!*');
        /**
         * Возвращает массив, в котором ключи - это IP-адреса серверов, а
         * значения - "IP-адрес NAS - Имя NAS"
         * @return  array
         */
        function getNasIPName()
        {
            $return = array('');
            $nasses = zb_NasGetAllData();
            foreach ($nasses as $nas) {
                $return[$nas['nasip']] = $nas['nasip'] . ' - ' . $nas['nasname'];
            }
            return $return;
        }
        /**
         * Возвращает массив, в котором ключи - это ID сети, а
         * значения - "ID сети - Название сервиса"
         * @return  array
         */
Ejemplo n.º 10
0
         rcms_redirect("?module=reportmaster");
     } else {
         show_error(__('You cant control this module'));
     }
 }
 //if adding new report
 if (isset($_GET['add'])) {
     if (cfr('REPORTMASTERADM')) {
         web_ReportMasterShowAddForm();
     } else {
         show_error(__('You cant control this module'));
     }
 }
 //and if editing
 if (isset($_GET['edit'])) {
     if (cfr('REPORTMASTERADM')) {
         web_ReportMasterShowEditForm($_GET['edit']);
         if (isset($_POST['editreportname']) and isset($_POST['editsqlquery']) and isset($_POST['editdatakeys']) and isset($_POST['editfieldnames'])) {
             zb_RMEditReport($_GET['edit'], $_POST['editreportname'], $_POST['editsqlquery'], $_POST['editdatakeys'], $_POST['editfieldnames'], $_POST['editaddr'], $_POST['editrnames'], $_POST['editrowcount']);
             rcms_redirect("?module=reportmaster");
         }
     } else {
         show_error(__('You cant control this module'));
     }
 }
 // view reports
 if (isset($_GET['view'])) {
     if (!isset($_GET['printable'])) {
         // natural view
         web_ReportMasterViewReport($_GET['view']);
     } else {
Ejemplo n.º 11
0
<?php

if (cfr('SALARYTSHEETS')) {
    $altcfg = $ubillingConfig->getAlter();
    if ($altcfg['SALARY_ENABLED']) {
        $greed = new Avarice();
        $beggar = $greed->runtime('SALARY');
        if (!empty($beggar)) {
            $salary = new Salary();
            //creating of new timesheet
            if (wf_CheckPost(array('newtimesheet', 'newtimesheetdate', '_employeehours'))) {
                $tsSheetCreateResult = $salary->timesheetCreate();
                if ($tsSheetCreateResult == 0) {
                    //succeful creation
                    rcms_redirect('?module=salary_timesheets');
                } else {
                    if ($tsSheetCreateResult == 1) {
                        //date duplicate
                        show_error(__('Timesheets with that date already exist'));
                    }
                }
            }
            $tsCf = $salary->timesheetCreateForm();
            if ($tsCf) {
                $timesheetsControls = wf_modal(web_add_icon() . ' ' . __('Create'), __('Create') . ' ' . __('Timesheet'), $tsCf, 'ubButton', '800', '600');
                show_window('', $timesheetsControls);
                if (!wf_CheckGet(array('showdate'))) {
                    //render available timesheets list by date
                    show_window(__('Timesheets'), $salary->timesheetsListRender('?module=salary_timesheets'));
                } else {
                    //saving changes for single timesheet row
Ejemplo n.º 12
0
<?php

if (cfr('REPORTNOSWPORT')) {
    class ReportNoSwitchPort
    {
        protected $data = array();
        protected $allusers = array();
        protected $diff = array();
        public function __construct()
        {
            //load actual data by switch port assing
            $this->loadData();
            //loads full user list
            $this->loadAllUsers();
        }
        /*
         * get all users with switch port assing and push it into data prop
         * 
         * @return void
         */
        protected function loadData()
        {
            $query = "SELECT * from `switchportassign`;";
            $alldata = simple_queryall($query);
            if (!empty($alldata)) {
                foreach ($alldata as $io => $each) {
                    $this->data[$each['login']] = $each['login'];
                }
            }
        }
        /*
Ejemplo n.º 13
0
<?php

if (cfr('SENDDOG')) {
    $altCfg = $ubillingConfig->getAlter();
    if ($altCfg['SENDDOG_ENABLED']) {
        $sendDog = new SendDog();
        //editing config
        if (wf_CheckPost(array('editconfig'))) {
            $sendDog->saveConfig();
            rcms_redirect($sendDog->getBaseUrl());
        }
        if (!wf_CheckGet(array('showmisc'))) {
            //render config interface
            show_window(__('SendDog configuration'), $sendDog->renderConfigForm());
        } else {
            //render SMS queue
            $smsQueue = $_GET['showmisc'];
            switch ($smsQueue) {
                case 'tsms':
                    show_window(__('View SMS sending queue'), $sendDog->renderTurboSMSQueue());
                    break;
                case 'smsflybalance':
                    show_window(__('SMS-Fly') . ' ' . __('Balance'), $sendDog->renderSmsflyBalance());
                    break;
                case 'telegramcontacts':
                    show_window(__('Telegram bot contacts'), $sendDog->renderTelegramContacts());
                    break;
            }
        }
    } else {
        show_error(__('This module is disabled'));
Ejemplo n.º 14
0
<?php

if (cfr('PLDOCS')) {
    $altcfg = $ubillingConfig->getAlter();
    if ($altcfg['DOCX_SUPPORT']) {
        $documents = new ProfileDocuments();
        $date = wf_CheckPost(array('showdate')) ? $_POST['showdate'] : '';
        $documents->loadAllUsersDocuments($date);
        //existing document downloading
        if (wf_CheckGet(array('documentdownload'))) {
            zb_DownloadFile($documents::DOCUMENTS_PATH . $_GET['documentdownload'], 'docx');
        }
        //document deletion from database
        if (wf_CheckGet(array('deletedocument'))) {
            $documents->unregisterDocument($_GET['deletedocument']);
            rcms_redirect('?module=report_documents');
        }
        //controls
        $actionLinks = wf_Link('?module=report_documents', __('Grid view') . ' ' . wf_img('skins/icon_table.png'), false, 'ubButton');
        $actionLinks .= wf_Link('?module=report_documents&calendarview=true', __('As calendar') . ' ' . wf_img('skins/icon_calendar.gif'), false, 'ubButton');
        show_window('', $actionLinks);
        if (!wf_CheckGet(array('calendarview'))) {
            //show calendar control
            show_window(__('By date'), $documents->dateControl());
            //list available documents
            show_window(__('Previously generated documents'), $documents->renderAllUserDocuments());
        } else {
            //or calendar view
            show_window(__('Previously generated documents'), $documents->renderAllUserDocumentsCalendar());
        }
    } else {
Ejemplo n.º 15
0
 /**
  * Returns coment controls for own comments or if im root user
  * 
  * @param int $commentid existing additional comment ID
  * @return string
  */
 protected function commentControls($commentid)
 {
     $result = '';
     if (isset($this->data[$commentid])) {
         if ($this->data[$commentid]['admin'] == $this->mylogin or cfr('ROOT')) {
             $deleteInputs = wf_HiddenInput('adcommentsdeleteid', $commentid);
             $deleteInputs .= wf_tag('input', false, '', 'type="image" src="skins/icon_del.gif" title="' . __('Delete') . '" ' . $this->jsAlert(__('Removing this may lead to irreparable results')));
             $deleteForm = wf_Form('', 'POST', $deleteInputs, '');
             $editInputs = wf_HiddenInput('adcommentseditid', $commentid);
             $editInputs .= wf_tag('input', false, '', 'type="image" src="skins/icon_edit.gif"  title="' . __('Edit') . '" ' . $this->jsAlert(__('Are you serious')));
             $editForm = wf_Form('', 'POST', $editInputs, '');
             $result .= wf_tag('div', false, '', 'style="display:inline-block;"') . $deleteForm . wf_tag('div', true);
             $result .= wf_tag('div', false, '', 'style="display:inline-block;"') . $editForm . wf_tag('div', true);
         }
     }
     return $result;
 }
Ejemplo n.º 16
0
<?php

if (cfr('CORPS')) {
    $altcfg = $ubillingConfig->getAlter();
    if ($altcfg['CORPS_ENABLED']) {
        $greed = new Avarice();
        $beggar = $greed->runtime('CORPS');
        if (!empty($beggar)) {
            /*
             * controller section
             */
            $corps = new Corps();
            if (wf_CheckGet(array(Corps::ROUTE_PREFIX))) {
                $route = $_GET[Corps::ROUTE_PREFIX];
                //taxtypes controller
                if ($route == Corps::URL_TAXTYPE) {
                    //del
                    if (wf_CheckGet(array('deltaxtypeid'))) {
                        if (!$corps->taxtypeProtected($_GET['deltaxtypeid'])) {
                            if (method_exists($corps, $beggar['METH']['TTFLUSH'])) {
                                $corps->{$beggar}['METH']['TTFLUSH']($_GET['deltaxtypeid']);
                            }
                            rcms_redirect(Corps::URL_TAXTYPE_LIST);
                        } else {
                            show_window(__('Error'), __('This item is used by something'));
                        }
                    }
                    //edit
                    if (wf_CheckPost(array('edittaxtypeid', 'edittaxtype'))) {
                        $corps->taxtypeEdit($_POST['edittaxtypeid'], $_POST['edittaxtype']);
                        rcms_redirect(Corps::URL_TAXTYPE_LIST);
Ejemplo n.º 17
0
<?php

$altCfg = $ubillingConfig->getAlter();
if ($altCfg['PHOTOSTORAGE_ENABLED']) {
    if (cfr('PHOTOSTORAGE')) {
        if (wf_CheckGet(array('scope', 'itemid'))) {
            $photoStorage = new PhotoStorage($_GET['scope'], $_GET['itemid']);
            //catch ajax webcam upload request
            if (wf_CheckGet(array('uploadcamphoto'))) {
                $photoStorage->catchWebcamUpload();
            }
            //catch file upload request
            if (wf_CheckGet(array('uploadfilephoto'))) {
                $photoStorage->catchFileUpload();
            }
            //catch file download
            if (wf_CheckGet(array('download'))) {
                $photoStorage->catchDownloadImage($_GET['download']);
            }
            //catch file deletion event
            if (wf_CheckGet(array('delete'))) {
                $photoStorage->catchDeleteImage($_GET['delete']);
            }
            //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
Ejemplo n.º 18
0
<?php

if (cfr('DOWN')) {
    if (isset($_GET['username'])) {
        $login = vf($_GET['username']);
        // change down  if need
        if (isset($_POST['newdown'])) {
            $down = $_POST['newdown'];
            $billing->setdown($login, $down);
            log_register('CHANGE Down (' . $login . ') ON ' . $down);
            rcms_redirect("?module=downedit&username=" . $login);
        }
        $current_down = zb_UserGetStargazerData($login);
        $current_down = $current_down['Down'];
        $useraddress = zb_UserGetFullAddress($login) . ' (' . $login . ')';
        // Edit form construct
        $fieldname = __('Current Down state');
        $fieldkey = 'newdown';
        $form = web_EditorTrigerDataForm($fieldname, $fieldkey, $useraddress, $current_down);
        $form .= web_UserControls($login);
        // show form
        show_window(__('Edit Down'), $form);
    }
} else {
    show_error(__('You cant control this module'));
}
Ejemplo n.º 19
0
<?php

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'));
Ejemplo n.º 20
0
<?php

$altCfg = $ubillingConfig->getAlter();
if ($altCfg['WATCHDOG_ENABLED']) {
    if (cfr('WATCHDOG')) {
        class TSMSQueue
        {
            protected $queue = array();
            protected $smsObj = '';
            public function __construct()
            {
                $this->initSmsObj();
                $this->loadQueue();
            }
            /**
             * Creates protected instance of UbillingSMS class for internal usage
             * 
             * @return void
             */
            protected function initSmsObj()
            {
                $this->smsObj = new UbillingSMS();
            }
            /**
             * Loads data from current SMS queue directory to private prop
             * 
             * @return void
             */
            protected function loadQueue()
            {
                $this->queue = $this->smsObj->getQueueData();
Ejemplo n.º 21
0
<?php

if (cfr('WAREHOUSE')) {
    $altcfg = $ubillingConfig->getAlter();
    if ($altcfg['WAREHOUSE_ENABLED']) {
        $greed = new Avarice();
        $avidity = $greed->runtime('WAREHOUSE');
        if (!empty($avidity)) {
            $warehouse = new Warehouse();
            show_window('', $warehouse->{$avidity}['M']['WARLOCK']());
            //categories
            if (wf_CheckGet(array($avidity['S']['C']))) {
                if (wf_CheckPost(array($avidity['S']['CC']))) {
                    $warehouse->{$avidity}['M']['CC']($_POST[$avidity['S']['CC']]);
                    rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_CATEGORIES);
                }
                if (wf_CheckGet(array($avidity['S']['CD']))) {
                    $deletionResult = $warehouse->{$avidity}['M']['CD']($_GET[$avidity['S']['CD']]);
                    if ($deletionResult) {
                        rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_CATEGORIES);
                    } else {
                        show_error(__('You cant do this'));
                    }
                }
                if (wf_CheckPost(array($avidity['S']['CE1'], $avidity['S']['CE2']))) {
                    $warehouse->{$avidity}['M']['CS']();
                    rcms_redirect($warehouse::URL_ME . '&' . $warehouse::URL_CATEGORIES);
                }
                show_window(__('Categories'), $warehouse->{$avidity}['M']['CF']());
                show_window(__('Available categories'), $warehouse->{$avidity}['M']['CL']());
                $warehouse->{$avidity}['M']['FALL']();
Ejemplo n.º 22
0
/**
 * Shows task editing/management form
 * 
 * @global object $ubillingConfig
 * @param int $taskid
 * 
 * @return void
 */
function ts_TaskChangeForm($taskid)
{
    global $ubillingConfig;
    $altercfg = $ubillingConfig->getAlter();
    $taskid = vf($taskid, 3);
    $taskdata = ts_GetTaskData($taskid);
    $result = '';
    $allemployee = ts_GetAllEmployee();
    $activeemployee = ts_GetActiveEmployee();
    $alljobtypes = ts_GetAllJobtypes();
    $messages = new UbillingMessageHelper();
    $smsData = '';
    if (!empty($taskdata)) {
        //not done task
        if (empty($taskdata['login'])) {
            $login_detected = ts_DetectUserByAddress($taskdata['address']);
            if ($login_detected) {
                $addresslink = wf_Link("?module=userprofile&username="******"?module=userprofile&username="******"H:i", strtotime($taskdata['starttime'])) : '';
                $smsJobNote = mysql_real_escape_string($taskdata['jobnote']);
                $smsEmployee = vf($taskdata['employee']);
                $newSmsText = $smsAddress . ' ' . $smsPhone . ' ' . $smsJobNote . $smsJobTime;
                $smsDataCells = wf_TableCell(__('Employee'), '', 'row2');
                $smsDataCells .= wf_TableCell(@$allemployee[$taskdata['employee']]);
                $smsDataRows = wf_TableRow($smsDataCells, 'row3');
                $smsDataCells = wf_TableCell(__('Message'), '', 'row2');
                $smsDataCells .= wf_TableCell(zb_TranslitString($newSmsText));
                $smsDataRows .= wf_TableRow($smsDataCells, 'row3');
                $smsDataTable = wf_TableBody($smsDataRows, '100%', '0', 'glamour');
                $smsInputs = $smsDataTable;
                $smsInputs .= wf_HiddenInput('postsendemployee', $smsEmployee);
                $smsInputs .= wf_HiddenInput('postsendsmstext', $newSmsText);
                $smsInputs .= wf_Submit(__('Send SMS'));
                $smsForm = wf_Form('', 'POST', $smsInputs, '');
                $smsData = wf_modal(wf_img_sized('skins/icon_mobile.gif', __('Send SMS'), '10'), __('Send SMS'), $smsForm, '', '400', '200');
            }
        }
        $tablecells = wf_TableCell(__('ID'), '30%');
        $tablecells .= wf_TableCell($taskdata['id']);
        $tablerows = wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Task creation date') . ' / ' . __('Administrator'));
        $tablecells .= wf_TableCell($taskdata['date'] . ' / ' . $taskdata['admin']);
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Target date'));
        $tablecells .= wf_TableCell(wf_tag('strong') . $taskdata['startdate'] . ' ' . $taskdata['starttime'] . wf_tag('strong', true));
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Task address'));
        $tablecells .= wf_TableCell($addresslink);
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Login'));
        $tablecells .= wf_TableCell($taskLogin . $loginType);
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Phone'));
        $tablecells .= wf_TableCell($taskdata['phone']);
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Job type'));
        $tablecells .= wf_TableCell(@$alljobtypes[$taskdata['jobtype']]);
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Who should do'));
        $tablecells .= wf_TableCell(@$allemployee[$taskdata['employee']] . ' ' . $smsData);
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $tablecells = wf_TableCell(__('Job note'));
        $tablecells .= wf_TableCell(nl2br($taskdata['jobnote']));
        $tablerows .= wf_TableRow($tablecells, 'row3');
        $result .= wf_TableBody($tablerows, '100%', '0', 'glamour');
        $result .= wf_tag('div', false, '', 'style="clear:both;"') . wf_tag('div', true);
        // show task preview
        show_window(__('View task') . ' ' . $modform, $result);
        //Salary accounting
        if ($altercfg['SALARY_ENABLED']) {
            if (cfr('SALARYTASKSVIEW')) {
                $salary = new Salary();
                show_window(__('Additional jobs done'), $salary->taskJobCreateForm($_GET['edittask']));
            }
        }
        //warehouse integration
        if ($altercfg['WAREHOUSE_ENABLED']) {
            if (cfr('WAREHOUSE')) {
                $warehouse = new Warehouse();
                show_window(__('Additionally spent materials'), $warehouse->taskMaterialsReport($_GET['edittask']));
            }
        }
        //if task undone
        if ($taskdata['status'] == 0) {
            $sup = wf_tag('sup') . '*' . wf_tag('sup', false);
            $inputs = wf_HiddenInput('changetask', $taskid);
            $inputs .= wf_DatePicker('editenddate') . wf_tag('label', false) . __('Finish date') . $sup . wf_tag('label', true) . wf_tag('br');
            $inputs .= wf_tag('br');
            $inputs .= wf_Selector('editemployeedone', $activeemployee, __('Worker done'), $taskdata['employee'], true);
            $inputs .= wf_tag('br');
            $inputs .= wf_tag('label', false) . __('Finish note') . wf_tag('label', true) . wf_tag('br');
            $inputs .= wf_TextArea('editdonenote', '', '', true, '35x3');
            $inputs .= wf_tag('br');
            $inputs .= $jobgencheckbox;
            $inputs .= wf_Submit(__('This task is done'));
            $form = wf_Form("", 'POST', $inputs, 'glamour');
            if (cfr('TASKMANDELETE')) {
                show_window('', wf_JSAlertStyled('?module=taskman&deletetask=' . $taskid, web_delete_icon() . ' ' . __('Remove this task - it is an mistake'), $messages->getDeleteAlert(), 'ubButton'));
            }
            //show editing form
            if (cfr('TASKMANDONE')) {
                show_window(__('If task is done'), $form);
            }
        } else {
            $donecells = wf_TableCell(__('Finish date'), '30%');
            $donecells .= wf_TableCell($taskdata['enddate']);
            $donerows = wf_TableRow($donecells, 'row3');
            $donecells = wf_TableCell(__('Worker done'));
            $donecells .= wf_TableCell($allemployee[$taskdata['employeedone']]);
            $donerows .= wf_TableRow($donecells, 'row3');
            $donecells = wf_TableCell(__('Finish note'));
            $donecells .= wf_TableCell($taskdata['donenote']);
            $donerows .= wf_TableRow($donecells, 'row3');
            $doneresult = wf_TableBody($donerows, '100%', '0', 'glamour');
            if (cfr('TASKMANDELETE')) {
                $doneresult .= wf_JSAlertStyled('?module=taskman&deletetask=' . $taskid, web_delete_icon() . ' ' . __('Remove this task - it is an mistake'), $messages->getDeleteAlert(), 'ubButton');
            }
            if (cfr('TASKMANDONE')) {
                $doneresult .= '&nbsp;';
                $doneresult .= wf_JSAlertStyled('?module=taskman&setundone=' . $taskid, wf_img('skins/icon_key.gif') . ' ' . __('No work was done'), $messages->getEditAlert(), 'ubButton');
            }
            show_window(__('Task is done'), $doneresult);
        }
    }
}
Ejemplo n.º 23
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'));
}
?>


Ejemplo n.º 24
0
<?php

if (cfr('REPORTSIGNUP')) {
    $altercfg = $ubillingConfig->getAlter();
    /**
     * Returns signups array with some custom options
     * 
     * @param string $where
     * 
     * @return array
     */
    function zb_SignupsGet($where)
    {
        $query = "SELECT * from `userreg` " . $where;
        $result = simple_queryall($query);
        return $result;
    }
    /**
     * returns array like $month_num=>$signup_count
     * 
     * @param int $year
     * @return array
     */
    function zb_SignupsGetCountYear($year)
    {
        $months = months_array();
        $result = array();
        foreach ($months as $monthNum => $monthName) {
            $result[$monthNum] = 0;
        }
        $allYearSignups_q = "SELECT * from `userreg` WHERE `date` LIKE '" . $year . "-%';";
Ejemplo n.º 25
0
 /**
  * returns some existing user profile
  * 
  * @param int $userid existing user`s ID
  * 
  * @return string
  */
 public function userProfile($userid)
 {
     global $ubillingConfig;
     $altcfg = $ubillingConfig->getAlter();
     $userid = vf($userid, 3);
     if (isset($this->users[$userid])) {
         $userData = $this->users[$userid];
         $rows = '';
         //zero apt numbers as private builds
         if ($altcfg['ZERO_TOLERANCE']) {
             $apt = $userData['apt'] == '0' ? '' : '/' . $userData['apt'];
         } else {
             $apt = '/' . $userData['apt'];
         }
         $cells = wf_TableCell(__('Full address'), '20%', 'row2');
         $cells .= wf_TableCell($userData['city'] . ' ' . $userData['street'] . ' ' . $userData['build'] . $apt);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Real Name'), '20%', 'row2');
         $cells .= wf_TableCell($userData['realname']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Phone'), '20%', 'row2');
         $cells .= wf_TableCell($userData['phone']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Mobile'), '20%', 'row2');
         $cells .= wf_TableCell($userData['mobile']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(wf_tag('b') . __('Contract') . wf_tag('b', true), '20%', 'row2');
         $cells .= wf_TableCell(wf_tag('b') . $userData['contract'] . wf_tag('b', true));
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Tariff'), '20%', 'row2');
         $cells .= wf_TableCell(@$this->tariffs[$userData['tariffid']]['tariffname']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(wf_tag('b') . __('Cash') . wf_tag('b', true), '20%', 'row2');
         $cells .= wf_TableCell(wf_tag('b') . $userData['cash'] . wf_tag('b', true));
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Connected'), '20%', 'row2');
         $cells .= wf_TableCell(web_bool_led($userData['active']));
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('User contract date'), '20%', 'row2');
         $cells .= wf_TableCell($userData['regdate']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Internet account'), '20%', 'row2');
         $inetLink = !empty($userData['inetlogin']) ? wf_Link(self::URL_INET_USER_PROFILE . $userData['inetlogin'], web_profile_icon() . ' ' . $userData['inetlogin'], false, '') : '';
         $cells .= wf_TableCell($inetLink);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Cable seal'), '20%', 'row2');
         $cells .= wf_TableCell($userData['cableseal']);
         $rows .= wf_TableRow($cells, 'row3');
         $cells = wf_TableCell(__('Notes'), '20%', 'row2');
         $cells .= wf_TableCell($userData['notes']);
         $rows .= wf_TableRow($cells, 'row3');
         $profileData = wf_TableBody($rows, '100%', 0, '');
         $profilePlugins = '';
         if (cfr('UKV')) {
             $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modal(wf_img('skins/icon_orb_big.gif', __('User lifestory')), __('User lifestory'), $this->userLifeStoryForm($userid), '', '800', '600') . __('Details') . wf_tag('div', true);
         }
         if (cfr('UKVCASH')) {
             $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modal(wf_img('skins/ukv/money.png', __('Cash')), __('Finance operations'), $this->userManualPaymentsForm($userid), '', '600', '250') . __('Cash') . wf_tag('div', true);
         }
         if (cfr('UKVREG')) {
             $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modalAuto(wf_img('skins/ukv/useredit.png', __('Edit user')), __('Edit user'), $this->userEditForm($userid), '') . __('Edit') . wf_tag('div', true);
         }
         if (cfr('UKVSEAL')) {
             $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modalAuto(wf_img('skins/ukv/cableseal.png', __('Cable seal')), __('Cable seal'), $this->userCableSealForm($userid), '') . __('Cable seal') . wf_tag('div', true);
         }
         if (cfr('UKVDEL')) {
             $profilePlugins .= wf_tag('div', false, 'dashtask', 'style="height:75px; width:75px;"') . wf_modal(wf_img('skins/annihilation.gif', __('Deleting user')), __('Deleting user'), $this->userDeletionForm($userid), '', '800', '300') . __('Delete') . wf_tag('div', true);
         }
         //main view construction
         $profilecells = wf_tag('td', false, '', 'valign="top"') . $profileData . wf_tag('td', true);
         $profilerows = wf_TableRow($profilecells);
         $profilecells = wf_tag('td', false, '', 'width="128" valign="top"') . $profilePlugins . wf_tag('td', true);
         $profilerows .= wf_TableRow($profilecells);
         $result = wf_TableBody($profilerows, '100%', '0');
         $result .= $this->userPaymentsRender($userid);
         return $result;
     } else {
         throw new Exception(self::EX_USER_NOT_EXISTS);
     }
 }
Ejemplo n.º 26
0
 /**
  * Renders user profile with all loaded data
  * 
  * @return string
  */
 public function render()
 {
     //all configurable features must be received via getters
     $profile = '';
     //activity and other flags
     $passiveicon = $this->userdata['Passive'] ? wf_img_sized('skins/icon_passive.gif', '', '', '12') . ' ' : '';
     $downicon = $this->userdata['Down'] ? wf_img_sized('skins/icon_down.gif', '', '', '12') . ' ' : '';
     $activity = $this->userdata['Cash'] < '-' . $this->userdata['Credit'] ? wf_img_sized('skins/icon_inactive.gif', '', '', '12') . ' ' . __('No') : wf_img_sized('skins/icon_active.gif', '', '', '12') . ' ' . __('Yes');
     // user linking controller
     $profile .= $this->getUserLinking();
     $profile .= wf_tag('table', false, '', self::MAIN_TABLE_STYLE);
     //external profile container
     $profile .= wf_tag('tbody', false);
     $profile .= wf_tag('tr', false);
     $profile .= wf_tag('td', false, '', 'valign="top"');
     $profile .= wf_tag('table', false, '', self::MAIN_TABLE_STYLE);
     //main profile data
     $profile .= wf_tag('tbody', false);
     //address row and controls
     $profile .= $this->addRow(__('Full address') . $this->getTaskCreateControl(), $this->useraddress . $this->getBuildControls());
     //apt data like floor and entrance row
     $profile .= $this->addRow(__('Entrance') . ', ' . __('Floor'), @$this->aptdata['entrance'] . ' ' . @$this->aptdata['floor']);
     //realname row
     $profile .= $this->addRow(__('Real name') . $this->getPhotostorageControls() . $this->getPassportDataControl(), $this->realname, true);
     //contract row
     $profile .= $this->addRow(__('Contract'), $this->contract, false);
     //contract date row
     $profile .= $this->getContractDate();
     //assigned agents row
     $profile .= $this->getAgentsControls();
     //old corporate users aka userlinking
     $profile .= $this->getCorporateControls();
     //phone
     $profile .= $this->addRow(__('Phone'), $this->phone);
     //and mobile data rows
     $profile .= $this->addRow(__('Mobile'), $this->mobile);
     //Email data row
     $profile .= $this->addRow(__('Email'), $this->mail);
     //payment ID data
     $profile .= $this->addRow(__('Payment ID'), $this->paymentid, true);
     //LAT data row
     $profile .= $this->getUserLat();
     //login row
     $profile .= $this->addRow(__('Login'), $this->userdata['login'], true);
     //password row
     $profile .= $this->addRow(__('Password'), $this->getUserPassword(), true);
     //User IP data and extended networks controls if available
     $profile .= $this->addRow(__('IP'), $this->userdata['IP'] . $this->getExtNetsControls(), true);
     //MAC address row
     $profile .= $this->addRow(__('MAC') . ' ' . $this->getSearchmacControl() . ' ' . $this->getProfileFdbSearchControl(), $this->mac);
     //User tariff row
     $profile .= $this->addRow(__('Tariff') . $this->getTariffInfoControls($this->userdata['Tariff']), $this->userdata['Tariff'] . $this->getTariffInfoContrainer(), true);
     //Tariff change row
     $profile .= $this->addRow(__('Planned tariff change') . $this->getTariffInfoControls($this->userdata['TariffChange']), $this->userdata['TariffChange']);
     //old CaTv backlink if needed
     $profile .= $this->getCatvBacklinks();
     //Speed override row
     $profile .= $this->addRow(__('Speed override'), $this->speedoverride);
     // signup pricing row
     $profile .= $this->getSignupPricing();
     //User current cash row
     $profile .= $this->addRow(__('Balance'), $this->getUserCash(), true);
     //User credit row & easycredit control if needed
     $profile .= $this->addRow(__('Credit') . ' ' . $this->getEasyCreditController(), $this->userdata['Credit'], true);
     //credit expire row
     $profile .= $this->addRow(__('Credit expire'), $this->getUserCreditExpire());
     //Prepayed traffic
     $profile .= $this->addRow(__('Prepayed traffic'), $this->userdata['FreeMb']);
     //finance activity row
     $profile .= $this->addRow(__('Active') . $this->getCemeteryControls(), $activity);
     //DN online detection row
     $profile .= $this->getUserOnlineDN();
     //Always online flag row
     $profile .= $this->addRow(__('Always Online'), web_trigger($this->userdata['AlwaysOnline']));
     //Detail stats flag row
     $profile .= $this->addRow(__('Disable detailed stats'), web_trigger($this->userdata['DisabledDetailStat']));
     //Frozen aka passive flag row
     $profile .= $this->addRow(__('Freezed'), $passiveicon . web_trigger($this->userdata['Passive']), true);
     //Disable aka Down flag row
     $profile .= $this->addRow(__('Disabled'), $downicon . web_trigger($this->userdata['Down']), true);
     //Connection details  row
     $profile .= $this->getUserConnectionDetails();
     //User notes row
     $profile .= $this->addRow(__('Notes'), zb_UserGetNotes($this->login) . $this->getAdcommentsIndicator());
     $profile .= wf_tag('tbody', true);
     $profile .= wf_tag('table', true);
     $profile .= wf_tag('td', true);
     //end of main profile container
     $profile .= wf_tag('td', false, '', 'valign="top" width="10%"');
     //profile plugins container
     $profile .= $this->plugins;
     $profile .= wf_tag('td', true);
     // end of plugins container
     $profile .= wf_tag('tr', true);
     // close profile+plugins row
     $profile .= wf_tag('tbody', true);
     $profile .= wf_tag('table', true);
     //end of all profile container
     //profile switch port controls
     $profile .= $this->getSwitchAssignControls();
     //profile onu signal controls
     $profile .= $this->getPonSignalControl();
     //profile vlan controls
     $profile .= $this->getVlanAssignControls();
     //profile vlan online
     $profile .= $this->getVlanOnline();
     //Custom filelds display
     $profile .= cf_FieldShower($this->login);
     //Tags add control and exiting tags listing
     if (cfr('TAGS')) {
         $profile .= wf_Link('?module=usertags&username='******'Tags')), false);
     }
     $profile .= stg_show_user_tags($this->login);
     //main profile controls here
     $profile .= $this->getMainControls();
     //Profile ending anchor for addcash links scroll
     $profile .= wf_tag('a', false, '', 'id="profileending"') . wf_tag('a', true);
     return $profile;
 }
Ejemplo n.º 27
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');
    }
}
Ejemplo n.º 28
0
<?php

$altCfg = $ubillingConfig->getAlter();
if ($altCfg['PON_ENABLED']) {
    if (cfr('PON')) {
        $pon = new PONizer();
        //getting ONU json data for list
        if (wf_CheckGet(array('ajaxonu'))) {
            die($pon->ajaxOnuData());
        }
        //creating new ONU device
        if (wf_CheckPost(array('createnewonu', 'newoltid', 'newmac'))) {
            $onuCreateResult = $pon->onuCreate($_POST['newonumodelid'], $_POST['newoltid'], $_POST['newip'], $_POST['newmac'], $_POST['newserial'], $_POST['newlogin']);
            if ($onuCreateResult) {
                multinet_rebuild_all_handlers();
                rcms_redirect('?module=ponizer');
            } else {
                show_error(__('This MAC have wrong format'));
            }
        }
        //edits existing ONU in database
        if (wf_CheckPost(array('editonu', 'editoltid', 'editmac'))) {
            $pon->onuSave($_POST['editonu'], $_POST['editonumodelid'], $_POST['editoltid'], $_POST['editip'], $_POST['editmac'], $_POST['editserial'], $_POST['editlogin']);
            multinet_rebuild_all_handlers();
            rcms_redirect('?module=ponizer&editonu=' . $_POST['editonu']);
        }
        //deleting existing ONU
        if (wf_CheckGet(array('deleteonu'))) {
            $pon->onuDelete($_GET['deleteonu']);
            multinet_rebuild_all_handlers();
            rcms_redirect('?module=ponizer');
Ejemplo n.º 29
0
$msg = '';
$insertlink = '';
function user_can_delete($file)
{
    if (!empty($file) && $file != '.' && $file != '..') {
        return true;
    } else {
        return false;
    }
}
if (!user_can_upload_images()) {
    return false;
}
$start_path = realpath(RCMS_ROOT_PATH . 'uploads/');
if (!empty($lightbox_config['distribute_enable'])) {
    if (!cfr('GENERAL')) {
        $start_path .= $system->user['username'];
    }
    if (!@is_dir($start_path)) {
        $msg = __('Nothing founded');
        rcms_mkdir(RCMS_ROOT_PATH . 'uploads/' . $system->user['username']);
        //rcms_redirect('');
    }
}
if (empty($_GET['path'])) {
    $user_path = $start_path;
} else {
    $user_path = realpath($_GET['path']);
    if (strlen($start_path) > strlen($user_path)) {
        $user_path = $start_path;
    }
Ejemplo n.º 30
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'));
}