EIOS/rabprog/index.php

182 lines
5.7 KiB
PHP
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?php
session_start();
error_reporting(0);
include_once 'config.php';
set_time_limit (0);
ini_set("memory_limit", "12000M");
if(!isset($_SESSION['year_cur'])) $_SESSION['year_cur'] = 2022;
if(isset($_POST['year_change'])) $_SESSION['year_cur'] = (int)$_POST['year_change'];
if(isset($_POST['online'])){ exit(); }
/**
* @var string $WorkDIR
*/
$cSECUR = new class_SECUR();
$CHPU = new class_CHPU($WorkDIR);
$smartyC = new class_smarty();
$smarty = $smartyC->config(__DIR__.'\tpl');
$smarty->assign('TPL',$WorkDIR);
$smarty->assign('year_cur',$_SESSION['year_cur']);
$URLS = $CHPU->uri();
if(!isset($URLS[0])) $URLS[0]='';
$smarty->assign('CHPU',$URLS);
$PAGE['title'] = 'Главная';
//$PAGE['body'] .= '<pre>'.print_r($CHPU->uri(),1).'</pre>';
$PAGE['body'] = '';
if(isset($_POST['prepod_chenge_ADM'])){
if(isset($_SESSION['rabprog_superAdmin'])){
$user_id = $_POST['prepod_chenge_ADM'];
//выйдем под текущим
unset($_SESSION['user']);
$cUSER = new class_USERS();
$cUSER->enter_by_user($user_id);
}
exit();
}
if($URLS[0]=='Q'){
$class = new class_RPD();
$class->RPD_GetHash($URLS[1]);
}
$cUSER = new class_USERS();
$cUSER->check();
$smarty->assign('aUSER',$_SESSION['user']);
//if($_SESSION['user']['id']!=1) die('обновление системы...');
if($_SESSION['user']['id']==1||isset($_SESSION['rabprog_superAdmin'])){
$class = new class_Disciplins();
$PREPOD_ALL = $class->Prepods_Get_all();
$smarty->assign('PREPOD_ALL',$PREPOD_ALL);
$_SESSION['rabprog_superAdmin']=time();
}
if($URLS[0]=='search'){
$class = new class_SEARCH();
$PAGE = $class->HTML();
}
if($URLS[0]=='findRPDnoUP'){
$sql = 'SELECT up.index1,up.name,up.kaf_kod,up.kaf_name,rs.id,rs.id_prepod FROM acs_fshp_rpd_save as rs, acs_fshp_uchebplans as up WHERE rs.id_discip=up.id';
$sql = 'SELECT rs.id,rs.id_prepod FROM acs_fshp_rpd_save as rs WHERE rs.id_discip not in (select up.id from acs_fshp_uchebplans as up)';
$rez = $DB->QUR_SEL($sql);
echo '<pre>'.print_r($rez,1).'</pre>';
exit();
}
if($URLS[0]=='discchangeprepod'){
$class = new class_DisciplinsPrepodsChange();
$PAGE = $class->HTML();
}
if($URLS[0]=='statpur'){
if(isset($_SESSION['user']['statuses'][24])){//Декан
$data['tip'] = 'dekan';
$data['fakultet'] = $_SESSION['user']['teachers']['fakultet'];
$class = new class_StatPUR($data);
$PAGE = $class->HTML();
}
if(isset($_SESSION['user']['statuses'][20])){//УМУ
}
if(isset($_SESSION['user']['statuses'][79])){//ПРОРЕКТОР ПО УР
$data['tip'] = 'prorektor';
$class = new class_StatPUR($data);
$PAGE = $class->HTML();
}
if(isset($_SESSION['user']['statuses'][30])){//ЗАВ КАФЕДРОЙ
$data['tip'] = 'zavkaf';
$data['fakultet'] = $_SESSION['user']['teachers']['fakultet'];
$data['kafedra'] = $_SESSION['user']['teachers']['kafedra'];
$class = new class_StatPUR($data);
$PAGE = $class->HTML();
//if($PAGE['body']=='') header('Location: /rabprog/disciplins/');
}
}
if($URLS[0]=='mat'){
$class = new class_MATERIAL();
$PAGE = $class->Parse();
echo '<pre>'.print_r($PAGE,1).'</pre>';exit();
}
if($URLS[0]=='obrtech'){
$class = new class_OBRTECH();
$PAGE = $class->HTML();
}
if($URLS[0]=='fakkaf'){
$class = new class_FAKKAF();
$PAGE = $class->HTML();
}
if($URLS[0]=='komp_models'){
$class = new class_KOMPMODELS();
$PAGE = $class->HTML();
}
if($URLS[0]=='komp_models_sem'){
//if($_SESSION['user']['id']!=1&&$_SESSION['user']['id']!=2089) die('обновление системы...');
$class = new class_KOMPMODELS_SEM();
$PAGE = $class->HTML();
}
if($URLS[0]=='moduls'){
$class = new class_MODULS();
$PAGE = $class->HTML();
}
if($URLS[0]=='rpd'){
$class = new class_RPD();
$PAGE = $class->HTML();
}
if($URLS[0]=='report_fosy'){
$class = new class_REPORTFOS();
$PAGE = $class->HTML();
}
if($URLS[0]=='rpdsign'){
$class = new class_RPDSign();
$PAGE = $class->HTML();
}
if($URLS[0]=='disciplins'){
$class = new class_Disciplins();
$PAGE = $class->HTML();
}
if($URLS[0]=='shahtplans'){
$class = new class_ShahtPlans();
$PAGE = $class->HTML();
}
if($URLS[0]=='shahtplans_pravka'){
$class = new class_ShahtPlans_Pravka();
$PAGE = $class->HTML();
}
if($URLS[0]=='lib_check'){
$class = new class_LIBRARY_CHECK();
$PAGE = $class->HTML();
}
if($URLS[0]==''){
//$class = new class_Prepods();
//$PAGE = $class->HTML();
if(isset($_SESSION['user']['statuses'][24])){//Декан
$data['tip'] = 'dekan';
$data['fakultet'] = $_SESSION['user']['teachers']['fakultet'];
$class = new class_StatPUR($data);
$PAGE = $class->HTML();
}
if(isset($_SESSION['user']['statuses'][20])){//УМУ
}
if(isset($_SESSION['user']['statuses'][30])){//ЗАВ КАФЕДРОЙ
$data['tip'] = 'zavkaf';
$data['fakultet'] = $_SESSION['user']['teachers']['fakultet'];
$data['kafedra'] = $_SESSION['user']['teachers']['kafedra'];
$class = new class_StatPUR($data);
$PAGE = $class->HTML();
//if($PAGE['body']=='') header('Location: /rabprog/disciplins/');
}
if(isset($_SESSION['user']['statuses'][79])){//ПРОРЕКТОР ПО УР
$data['tip'] = 'prorektor';
$class = new class_StatPUR($data);
$PAGE = $class->HTML();
}
//if(isset($_SESSION['user']['statuses'][23])){//КАФЕДРА
// if($PAGE['body']=='') header('Location: /rabprog/disciplins/');
//}
//$PAGE['body'] = '<pre>'.print_r($_SESSION,1).'</pre>';
}
//echo '<pre>'.print_r($_SESSION,1).'</pre>';
$smarty->assign('PAGE',$PAGE);
$smarty->display('tpl_index.html');