public function __construct($mode)
 {
     if (!in_array($mode, array_keys($this->menu))) {
         $mode = self::MODE_REESTRES;
     }
     $this->mode = $mode;
     parent::__construct();
 }
Example #2
0
<?php

define('IS_SITE_ADMIN', 1);
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/stdf.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/template.php';
require_once $_SERVER['DOCUMENT_ROOT'] . '/classes/reserves/ReservesAdmin.php';
session_start();
$no_banner = 1;
$rpath = '../../';
$uid = get_uid();
if (!hasPermissions('sbr') && !hasPermissions('sbr_finance')) {
    header_location_exit('/404.php');
}
$reservesAdmin = new ReservesAdmin();
$action = __paramInit('string', 'action', null, 'export');
switch ($action) {
    case 'import':
        $inner_page = 'content_import.php';
        $file = $reservesAdmin->saveUploadedFile();
        if ($file) {
            $reservesAdmin->parseFile($file);
        }
        $reestrArray = $reservesAdmin->getReestrs(true);
        $list = Template::render('list_uploaded.php', array('dir' => $reservesAdmin->path, 'data' => $reestrArray));
        break;
    case 'export':
    default:
        $inner_page = 'content.php';
        $date_s = __paramInit('string', null, 'date_s_eng_format');
        $date_e = __paramInit('string', null, 'date_e_eng_format');
        $time_s = __paramInit('string', null, 'time_s', '00:00');