559 lines
24 KiB
PHP
559 lines
24 KiB
PHP
|
<?php
|
|||
|
session_start();
|
|||
|
$info = array();
|
|||
|
|
|||
|
|
|||
|
if(isset($_GET['page'])){
|
|||
|
|
|||
|
//СПРАВКА ПО КАДРОВОМУ ОБЕСПЕЧЕНИЮ ОБРАЗОВАТЕЛЬНЫХ ПРОГРАММ
|
|||
|
if ($_GET['page'] == 'reference'){
|
|||
|
$msg = 0; //нет сообщений
|
|||
|
|
|||
|
//сохраняем информацию по кадрам
|
|||
|
if (isset($_POST['save_ref'])){
|
|||
|
$id_plan = (int) $_POST['id_plan'];
|
|||
|
|
|||
|
//т.к. данная информация будет выводиться только на печать и никакой связи больше иметь не должна, то перед сохранением, мы удаляем то, что было - искусственно создаем обновление данных
|
|||
|
$rez = $DB->QUR('DELETE FROM '.$ST['dbpf'].'_personnel WHERE id_plan = "'.$id_plan.'"');
|
|||
|
|
|||
|
//перебираем дисциплины, точнее преподов, а по ключу будет очевиден айдишник дисциплины
|
|||
|
foreach ($_POST['teacher'] as $key => $val) if ($key){
|
|||
|
$id_teacher = $val;
|
|||
|
$condition_pr = $_POST['usl'][$key];
|
|||
|
$edu_profile = $_POST['edu_profile'][$key];
|
|||
|
|
|||
|
$rez = $DB->QUR('INSERT INTO '.$ST['dbpf'].'_personnel (`id_plan`, `id_predmet`, `id_user`, `condition_pr`, `edu_profile_is`) VALUES ("'.$id_plan.'", "'.$key.'", "'.$id_teacher.'", "'.$condition_pr.'", "'.$edu_profile.'") ');
|
|||
|
}
|
|||
|
|
|||
|
$msg = 1;
|
|||
|
save_logs('Сохранена информация по кадровой справке по плану №'.$id_plan);
|
|||
|
}
|
|||
|
|
|||
|
if (!isset($_GET['des'])){ //если не выбрано конкретное направление подготовки
|
|||
|
//достаем направления подготовки из БАЗЫ ПЛАНОВ с профилями
|
|||
|
$profiles = array();
|
|||
|
//$sql = 'SELECT pl.* FROM '.$ST['dbpf'].'_iup_shahtplans_plans as pl, '.$ST['dbpf'].'_kafedres as kaf WHERE kaf.code = pl.kodkaf AND kaf.name="'.$kafedra.'" ';
|
|||
|
$sql = 'SELECT pl.* FROM '.$ST['dbpf'].'_iup_shahtplans_plans as pl, '.$ST['dbpf'].'_kafedres as kaf WHERE kaf.code = pl.kodkaf ORDER BY id DESC LIMIT 240 ';
|
|||
|
//echo $sql;
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez){
|
|||
|
foreach ($rez as $key => $val) if ($key){
|
|||
|
|
|||
|
$profiles[] = $val;
|
|||
|
}
|
|||
|
}
|
|||
|
//print_r($profiles);
|
|||
|
$smarty->assign('profiles', $profiles);
|
|||
|
} else{
|
|||
|
$id = $_GET['des'];
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_iup_shahtplans_plans WHERE id = "'.$id.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
|
|||
|
//дисциплины
|
|||
|
$disciplins = array();
|
|||
|
$sql1 = 'SELECT * FROM '.$ST['dbpf'].'_iup_shahtplans_stroki WHERE id_plans = "'.$id.'" ORDER BY sem ';
|
|||
|
$rez1 = $DB->QUR_SEL($sql1);
|
|||
|
if ($rez1){
|
|||
|
foreach ($rez1 as $key => $val) if ($key){
|
|||
|
|
|||
|
//также смотрим сохранную информацию
|
|||
|
$sql_save = 'SELECT * FROM '.$ST['dbpf'].'_personnel WHERE id_predmet = "'.$val['id'].'" LIMIT 1 ';
|
|||
|
$rez_save = $DB->QUR_SEL($sql_save);
|
|||
|
|
|||
|
$val['id_user'] = $rez_save[1]['id_user'];
|
|||
|
$val['condition_pr'] = $rez_save[1]['condition_pr'];
|
|||
|
$val['edu_profile_is'] = $rez_save[1]['edu_profile_is'];
|
|||
|
|
|||
|
/***/
|
|||
|
$disciplins[] = $val;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//echo $kafedra;
|
|||
|
$smarty->assign('profile', $rez[1]);
|
|||
|
$smarty->assign('teachers', all_teachers()); //список всех преподавателей
|
|||
|
$smarty->assign('save_info', $save_info); //сохраненная информация
|
|||
|
$smarty->assign('disciplins', $disciplins);
|
|||
|
|
|||
|
}
|
|||
|
|
|||
|
$smarty->assign('msg', $msg);
|
|||
|
$maincontent = $smarty->fetch('tpl_umu_reference.html');
|
|||
|
}
|
|||
|
|
|||
|
//анкеты - опрос о качестве дистанционного обучения
|
|||
|
if ($_GET['page'] == 'anketes'){
|
|||
|
|
|||
|
|
|||
|
|
|||
|
|
|||
|
//для работы выводим 50 анкет
|
|||
|
$anketes = array();
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE status = 0 AND content LIKE "%Комментарий%" ORDER BY date_create DESC LIMIT 25';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez){
|
|||
|
foreach ($rez as $key => $val) if ($key){
|
|||
|
$val['date_create'] = date('d.m.Y H:i', $val['date_create']);
|
|||
|
$val['user'] = get_user($val['id_user']);
|
|||
|
|
|||
|
$anketes[] = $val;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
$date_start = 0;
|
|||
|
$date_end = date("U");
|
|||
|
|
|||
|
//если выбран диапазо
|
|||
|
if (isset($_POST['search_date'])){
|
|||
|
$date_start = strtotime($_POST['date_search']);
|
|||
|
$date_end = $date_start + 15*24*60*60;
|
|||
|
}
|
|||
|
|
|||
|
//статистика
|
|||
|
$stat = array();
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
$stat['read'] = 0;
|
|||
|
|
|||
|
$stat['all'] = 1;
|
|||
|
|
|||
|
if ($rez){
|
|||
|
$stat['all'] = $rez[0];
|
|||
|
foreach ($rez as $key => $val) if ($key){
|
|||
|
if ($val['status'] == 1) $stat['read']++;
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
//ПЕРВЫЙ ВОПРОС
|
|||
|
//1
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%полностью удовлетворен%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[1][1] = $rez[0];
|
|||
|
//2
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%частично удовлетворен%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[1][2] = $rez[0];
|
|||
|
//3
|
|||
|
$stat[1][3] = $stat['all'] - $stat[1][1] - $stat[1][2];
|
|||
|
|
|||
|
//ВТОРОЙ ВОПРОС
|
|||
|
//1
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%оnline лекции%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[2][1] = $rez[0];
|
|||
|
//2
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%вебинары%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[2][2] = $rez[0];
|
|||
|
//3
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%чат-занятия в ЭИОС %" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[2][3] = $rez[0];
|
|||
|
//4
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%оnline занятия с использованием видеосервисов%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[2][4] = $rez[0];
|
|||
|
//5
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%консультации с использованием телефонной связи%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[2][5] = $rez[0];
|
|||
|
//6
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%работа в электронных библиотечных системах%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[2][6] = $rez[0];
|
|||
|
//7
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%прочие инструменты%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[2][7] = $rez[0];
|
|||
|
|
|||
|
//ТРЕТИЙ ВОПРОС
|
|||
|
//1
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%отлично%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[3][1] = $rez[0];
|
|||
|
//2
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%хорошо%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[3][2] = $rez[0];
|
|||
|
//3
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%удовлетворительно%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[3][3] = $rez[0];
|
|||
|
//4
|
|||
|
$stat[3][4] = $stat['all'] - $stat[3][1] - $stat[3][2] - $stat[3][3];
|
|||
|
|
|||
|
//ЧЕТВЕРТЫЙ ВОПРОС
|
|||
|
//1
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%не изменилась%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[4][1] = $rez[0];
|
|||
|
//2
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%возросла%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[4][2] = $rez[0];
|
|||
|
//3
|
|||
|
$stat[4][3] = $stat['all'] - $stat[4][1] - $stat[4][2];
|
|||
|
|
|||
|
//ПЯТЫЙ ВОПРОС
|
|||
|
//1
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%гибкость учебного процесса%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[5][1] = $rez[0];
|
|||
|
//2
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%обучение в комфортной и привычной домашней обстановке%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[5][2] = $rez[0];
|
|||
|
//3
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%использование современных информационных и телекоммуникационных технологий%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[5][3] = $rez[0];
|
|||
|
//4
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%иные преимущества%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[5][4] = $rez[0];
|
|||
|
//5
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%не вижу преимуществ%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[5][5] = $rez[0];
|
|||
|
|
|||
|
//ШЕСТОЙ ВОПРОС
|
|||
|
//1
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%дороговизна мобильной связи и интернета%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[6][1] = $rez[0];
|
|||
|
//2
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%недостаточная скорость интернета, сбои в его работе%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[6][2] = $rez[0];
|
|||
|
//3
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%недостаточный уровень владения компьютером и гаджетами%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[6][3] = $rez[0];
|
|||
|
//4
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%технические перебои в работе официального сайта вуза%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[6][4] = $rez[0];
|
|||
|
//5
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%непонятный или сложный интерфейс ЭИОС%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[6][5] = $rez[0];
|
|||
|
//6
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%недостаточность предлагаемого к изучению материала%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[6][6] = $rez[0];
|
|||
|
//7
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%прочие проблемы%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[6][7] = $rez[0];
|
|||
|
|
|||
|
//СЕДЬМОЙ ВОПРОС
|
|||
|
//1
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%работаю%" AND NOT (content LIKE "%не работаю%") AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[7][1] = $rez[0];
|
|||
|
//2
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_anketes WHERE content LIKE "%не работаю%" AND date_create > "'.$date_start.'" AND date_create < "'.$date_end.'" ';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if ($rez) $stat[7][2] = $rez[0];
|
|||
|
//3
|
|||
|
$stat[7][3] = $stat['all'] - $stat[7][1] - $stat[7][2];
|
|||
|
|
|||
|
$smarty->assign('anketes',$anketes);
|
|||
|
$smarty->assign('stat',$stat);
|
|||
|
$maincontent = $smarty->fetch('tpl_umu_anketes.html');
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
if($_GET['page']=='ocenki'){
|
|||
|
$info['descrip'] = 'В данном разделе представлены оценки выставленные в системе.';
|
|||
|
$info['ocenkis'] = array();
|
|||
|
$sql = 'SELECT id_grupp FROM '.$ST['dbpf'].'_ocenki GROUP BY id_grupp ORDER BY id_grupp';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if($rez){
|
|||
|
//$info['err'][] = $sql.': '.print_r($rez,1);
|
|||
|
foreach($rez as $key => $val)if($key){
|
|||
|
$id_grupp = $val['id_grupp'];
|
|||
|
$sql1 = 'SELECT `what` FROM '.$ST['dbpf'].'_ocenki WHERE id_grupp='.$id_grupp.' GROUP BY `what` ORDER BY id_grupp';
|
|||
|
$rez1 = $DB->QUR_SEL($sql1);
|
|||
|
//$info['err'][] = $sql1.': '.print_r($rez1,1);
|
|||
|
if($rez1){
|
|||
|
//$info['err'][] = $sql1.': '.print_r($rez1,1);
|
|||
|
foreach($rez1 as $key1 => $val1)if($key1){
|
|||
|
$what = $val1['what'];
|
|||
|
$sql2 = 'SELECT * FROM '.$ST['dbpf'].'_ocenki WHERE id_grupp='.$id_grupp.' AND what="'.$what.'" ORDER BY id_what';
|
|||
|
$rez2 = $DB->QUR_SEL($sql2);
|
|||
|
if($rez2){
|
|||
|
//$info['err'][] = $sql2.': '.print_r($rez2,1);
|
|||
|
foreach($rez2 as $key2 => $val2)if($key2){
|
|||
|
$val2['prepod'] = uo_get_prepod($val2['id_prepod']);
|
|||
|
$val2['grupp'] = uo_get_grupp($val2['id_grupp']);
|
|||
|
$val2['student'] = uo_get_student($val2['id_student']);
|
|||
|
$val2['ocwhat'] = uo_get_ocenkawhat($val2['id_what'],$val2['what']);
|
|||
|
$info['ocenkis'][] = $val2;
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
/*
|
|||
|
if (isset($_GET['des'])){
|
|||
|
if($_GET['des']=='add_block'){//ДОБАВЛЕНИЕ БЛОКА В АНКЕТУ
|
|||
|
$info['des']='add_block';
|
|||
|
$info['form']['pars']=recursiv();
|
|||
|
$info['form']['types']=get_type();
|
|||
|
}
|
|||
|
if($_GET['des']=='edit_block'){//РЕДАКТИРВОАНИЕ БЛОКА В АНКЕТЕ
|
|||
|
$info['des']='edit_block';
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_trudo_blocks WHERE id='.(int)$_GET['id'].' LIMIT 1';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if($rez) $info['form']=$rez[1];
|
|||
|
$info['form']['pars']=recursiv(0,0,$rez[1]['par']);
|
|||
|
$info['form']['types']=get_type($rez[1]['type']);
|
|||
|
}
|
|||
|
if($_GET['des']=='delete_block'){//Удаление БЛОКА В АНКЕТЕ
|
|||
|
$info['des']='delete_block';
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_trudo_blocks WHERE id='.(int)$_GET['id'].' LIMIT 1';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if($rez) $info['form']=$rez[1];
|
|||
|
$info['form']['pars']=recursiv(0,0,$rez[1]['par']);
|
|||
|
}
|
|||
|
if($_GET['des']=='add_item'){//ДОБАВЛЕНИЕ ПУНКТА В БЛОК
|
|||
|
$info['des']='add_item';
|
|||
|
$info['form']['id_block']=(int)$_GET['id'];
|
|||
|
$info['form']['types']=get_type();
|
|||
|
}
|
|||
|
if($_GET['des']=='edit_item'){//РЕДАКТИРВОАНИЕ ПУНКТА В БЛОКЕ
|
|||
|
$info['des']='edit_item';
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_trudo_items WHERE id='.(int)$_GET['id'].' LIMIT 1';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if($rez) $info['form']=$rez[1];
|
|||
|
$info['form']['types']=get_type($rez[1]['type']);
|
|||
|
}
|
|||
|
if($_GET['des']=='delete_item'){//Удаление ПУНКТА В БЛОКЕ
|
|||
|
$info['des']='delete_item';
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_trudo_items WHERE id='.(int)$_GET['id'].' LIMIT 1';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if($rez) $info['form']=$rez[1];
|
|||
|
}
|
|||
|
|
|||
|
}
|
|||
|
$info['blocks']=array();
|
|||
|
$info['blocks']=recursiv_show();*/
|
|||
|
$smarty->assign('info',$info);
|
|||
|
$smarty->assign('infop',print_r($info,1));
|
|||
|
$maincontent = $smarty->fetch('tpl_umu_ocenki.html');
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
function uo_get_ocenkawhat($id_what,$what){
|
|||
|
GLOBAL $ST,$DB; $out = array();
|
|||
|
if($what == 'lection') $sql = 'SELECT * FROM '.$ST['dbpf'].'_lections WHERE id='.$id_what.' LIMIT 1';
|
|||
|
if($what == 'practich') $sql = 'SELECT * FROM '.$ST['dbpf'].'_practich WHERE id='.$id_what.' LIMIT 1';
|
|||
|
if($what == 'controln') $sql = 'SELECT * FROM '.$ST['dbpf'].'_controln WHERE id='.$id_what.' LIMIT 1';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if($rez){
|
|||
|
if($what == 'lection'){
|
|||
|
$rez[1]['specialnost'] = stripslashes($rez[1]['specialnost']);
|
|||
|
$rez[1]['kurs'] = stripslashes($rez[1]['kurs']);
|
|||
|
$rez[1]['semestr'] = stripslashes($rez[1]['semestr']);
|
|||
|
$rez[1]['name'] = stripslashes($rez[1]['name']);
|
|||
|
$rez[1]['descrip'] = stripslashes($rez[1]['descrip']);
|
|||
|
}
|
|||
|
if($what == 'practich'){
|
|||
|
$rez[1]['lection'] = uo_get_ocenkawhat($rez[1]['id_lection'],'lection');
|
|||
|
$rez[1]['kurs'] = stripslashes($rez[1]['kurs']);
|
|||
|
$rez[1]['semestr'] = stripslashes($rez[1]['semestr']);
|
|||
|
$rez[1]['name'] = stripslashes($rez[1]['name']);
|
|||
|
$rez[1]['descrip'] = stripslashes($rez[1]['descrip']);
|
|||
|
}
|
|||
|
if($what == 'controln'){
|
|||
|
$rez[1]['lection'] = uo_get_ocenkawhat($rez[1]['id_lection'],'lection');
|
|||
|
$rez[1]['name'] = stripslashes($rez[1]['name']);
|
|||
|
$rez[1]['descrip'] = stripslashes($rez[1]['descrip']);
|
|||
|
}
|
|||
|
$out = $rez[1];
|
|||
|
}
|
|||
|
return $out;
|
|||
|
}
|
|||
|
function uo_get_grupp($id){
|
|||
|
GLOBAL $ST,$DB; $out = array();
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_grupp WHERE id='.$id.' LIMIT 1';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if($rez){
|
|||
|
$rez[1]['name'] = stripslashes($rez[1]['name']);
|
|||
|
$rez[1]['descrip'] = stripslashes($rez[1]['descrip']);
|
|||
|
$rez[1]['specialnost'] = stripslashes($rez[1]['specialnost']);
|
|||
|
$rez[1]['kurs'] = stripslashes($rez[1]['kurs']);
|
|||
|
$rez[1]['sokr'] = stripslashes($rez[1]['sokr']);
|
|||
|
$rez[1]['fo'] = stripslashes($rez[1]['fo']);
|
|||
|
$out = $rez[1];
|
|||
|
}
|
|||
|
return $out;
|
|||
|
}
|
|||
|
function uo_get_student($id){
|
|||
|
GLOBAL $ST,$DB; $out = array();
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_students WHERE id='.$id.' LIMIT 1';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if($rez){
|
|||
|
$sql1 = 'SELECT * FROM '.$ST['dbpf'].'_users WHERE id='.$rez[1]['id_user'].' LIMIT 1';
|
|||
|
$rez1 = $DB->QUR_SEL($sql1);
|
|||
|
if($rez1){
|
|||
|
$rez[1]['fio'] = stripslashes($rez1[1]['fio']);
|
|||
|
}
|
|||
|
$rez[1]['num_zach'] = stripslashes($rez[1]['num_zach']);
|
|||
|
$rez[1]['num_stud'] = stripslashes($rez[1]['num_stud']);
|
|||
|
$rez[1]['num_grupp'] = stripslashes($rez[1]['num_grupp']);
|
|||
|
$rez[1]['kod_podgotovki'] = stripslashes($rez[1]['kod_podgotovki']);
|
|||
|
$out = $rez[1];
|
|||
|
}
|
|||
|
return $out;
|
|||
|
}
|
|||
|
function uo_get_prepod($id){
|
|||
|
GLOBAL $ST,$DB; $out = array();
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_teachers WHERE id='.$id.' LIMIT 1';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if($rez){
|
|||
|
$sql1 = 'SELECT * FROM '.$ST['dbpf'].'_users WHERE id='.$rez[1]['id_user'].' LIMIT 1';
|
|||
|
$rez1 = $DB->QUR_SEL($sql1);
|
|||
|
if($rez1){
|
|||
|
$rez[1]['fio'] = stripslashes($rez1[1]['fio']);
|
|||
|
}
|
|||
|
$rez[1]['zvanie'] = stripslashes($rez[1]['zvanie']);
|
|||
|
$rez[1]['dolgnost'] = stripslashes($rez[1]['dolgnost']);
|
|||
|
$out = $rez[1];
|
|||
|
}
|
|||
|
return $out;
|
|||
|
}
|
|||
|
/*
|
|||
|
if(isset($_POST['add_block'])){//ДОБАВЛЕНИЕ БЛОКА В АНКЕТУ
|
|||
|
$name=get_data_fu($_POST['name']);
|
|||
|
$pos=get_data_fu($_POST['pos']);
|
|||
|
$par=get_data_fu($_POST['par']);
|
|||
|
$type=get_data_fu($_POST['type']);
|
|||
|
|
|||
|
$sql = 'INSERT INTO '.$ST['dbpf'].'_trudo_blocks VALUES (0,"'.$name.'",'.$pos.','.$par.','.$type.');';
|
|||
|
$rez = $DB->QUR($sql);
|
|||
|
if(!$rez['err']) $info['msg'] = 'Объект сохранен';
|
|||
|
else {
|
|||
|
$info['err'][] = 'Объект не сохранен. Ошибка БД.';
|
|||
|
$info['err'][] = mysql_error();
|
|||
|
}
|
|||
|
}
|
|||
|
if(isset($_POST['edit_block'])){//РЕДАКТИРВОАНИЕ БЛОКА В АНКЕТЕ
|
|||
|
$id=get_data_fu($_POST['id']);
|
|||
|
$name=get_data_fu($_POST['name']);
|
|||
|
$pos=get_data_fu($_POST['pos']);
|
|||
|
$par=get_data_fu($_POST['par']);
|
|||
|
$type=get_data_fu($_POST['type']);
|
|||
|
|
|||
|
$sql = 'UPDATE '.$ST['dbpf'].'_trudo_blocks SET name="'.$name.'",pos='.$pos.',par='.$par.',type='.$type.' WHERE id='.$id.'';
|
|||
|
$rez = $DB->QUR($sql);
|
|||
|
if(!$rez['err']) $info['msg'] = 'Объект изменен';
|
|||
|
else {
|
|||
|
$info['err'][] = 'Объект не изменен. Ошибка БД.';
|
|||
|
$info['err'][] = mysql_error();
|
|||
|
}
|
|||
|
}
|
|||
|
if(isset($_POST['delete_block'])){//Удаление БЛОКА В АНКЕТЕ
|
|||
|
$id=get_data_fu($_POST['id']);
|
|||
|
|
|||
|
$sql = 'DELETE FROM '.$ST['dbpf'].'_trudo_blocks WHERE id='.$id.' LIMIT 1';
|
|||
|
$rez = $DB->QUR($sql);
|
|||
|
if(!$rez['err']) {
|
|||
|
$info['msg'] = 'Объект удален';
|
|||
|
$_GET['des']='';
|
|||
|
}else {
|
|||
|
$info['err'][] = 'Объект не удален. Ошибка БД.';
|
|||
|
$info['err'][] = mysql_error();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
if(isset($_POST['add_item'])){//ДОБАВЛЕНИЕ ПУНКТА В БЛОК
|
|||
|
$name=get_data_fu($_POST['name']);
|
|||
|
$descrip=get_data_fu($_POST['descrip']);
|
|||
|
$pos=get_data_fu($_POST['pos']);
|
|||
|
$par=0;
|
|||
|
$id_block=get_data_fu($_POST['id_block']);
|
|||
|
$type=get_data_fu($_POST['type']);
|
|||
|
|
|||
|
$sql = 'INSERT INTO '.$ST['dbpf'].'_trudo_items VALUES (0,"'.$name.'","'.$descrip.'",'.$pos.','.$par.','.$id_block.','.$type.');';
|
|||
|
$rez = $DB->QUR($sql);
|
|||
|
if(!$rez['err']) $info['msg'] = 'Объект сохранен';
|
|||
|
else {
|
|||
|
$info['err'][] = 'Объект не сохранен. Ошибка БД.';
|
|||
|
$info['err'][] = mysql_error();
|
|||
|
}
|
|||
|
}
|
|||
|
if(isset($_POST['edit_item'])){//РЕДАКТИРВОАНИЕ ПУНКТА В БЛОКЕ
|
|||
|
$id=get_data_fu($_POST['id']);
|
|||
|
$name=get_data_fu($_POST['name']);
|
|||
|
$pos=get_data_fu($_POST['pos']);
|
|||
|
$par=0;
|
|||
|
$id_block=get_data_fu($_POST['id_block']);
|
|||
|
$type=get_data_fu($_POST['type']);
|
|||
|
|
|||
|
$sql = 'UPDATE '.$ST['dbpf'].'_trudo_items SET name="'.$name.'",descrip="'.$descrip.'",pos='.$pos.',id_block='.$id_block.',type='.$type.' WHERE id='.$id.'';
|
|||
|
$rez = $DB->QUR($sql);
|
|||
|
if(!$rez['err']) $info['msg'] = 'Объект изменен';
|
|||
|
else {
|
|||
|
$info['err'][] = 'Объект не изменен. Ошибка БД.';
|
|||
|
$info['err'][] = $sql.mysql_error();
|
|||
|
}
|
|||
|
}
|
|||
|
if(isset($_POST['delete_item'])){//Удаление ПУНКТА В БЛОКЕ
|
|||
|
$id=get_data_fu($_POST['id']);
|
|||
|
|
|||
|
$sql = 'DELETE FROM '.$ST['dbpf'].'_trudo_items WHERE id='.$id.' LIMIT 1';
|
|||
|
$rez = $DB->QUR($sql);
|
|||
|
if(!$rez['err']) $info['msg'] = 'Объект удален';
|
|||
|
else {
|
|||
|
$info['err'][] = 'Объект не удален. Ошибка БД.';
|
|||
|
$info['err'][] = mysql_error();
|
|||
|
}
|
|||
|
}
|
|||
|
|
|||
|
|
|||
|
function recursiv($par=0,$old=0,$id=0){//отображение в древовидной структуре данных блоков для ВЫБОРА
|
|||
|
global $ST,$DB; $out = '';
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_trudo_blocks WHERE par='.$par.' ORDER BY pos, name ASC';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if($rez)foreach($rez as $key => $val)if($key){
|
|||
|
if ($val['par'] == $old) $old--;
|
|||
|
$out .= '<option value="'.$val['id'].'"'; if ($val['id'] == $id) $out .= ' SELECTED'; $out .= '>';
|
|||
|
for($i=0;$i<=$old;$i++) $out .= '--'; $out .= $val['name'].'</option>';
|
|||
|
$out .= recursiv($val['id'],$val['par'],$id);
|
|||
|
}
|
|||
|
return $out;
|
|||
|
}
|
|||
|
function recursiv_show($par=0,$old=0){//отображение в древовидной структуре данных блоков ОТОБРАЖЕНИЕ
|
|||
|
global $ST,$DB; $out = array();
|
|||
|
$sql = 'SELECT * FROM '.$ST['dbpf'].'_trudo_blocks WHERE par='.$par.' ORDER BY pos, name ASC';
|
|||
|
$rez = $DB->QUR_SEL($sql);
|
|||
|
if($rez)foreach($rez as $key => $val)if($key){
|
|||
|
$out[$key]['id']=$val['id'];
|
|||
|
$out[$key]['name']=$val['name'];
|
|||
|
$out[$key]['sub'] = recursiv_show($val['id'],$val['par']);
|
|||
|
$out[$key]['items'] = array();
|
|||
|
$sql1 = 'SELECT * FROM '.$ST['dbpf'].'_trudo_items WHERE id_block='.$val['id'].' ORDER BY pos, name ASC';
|
|||
|
$rez1 = $DB->QUR_SEL($sql1);
|
|||
|
if($rez1)foreach($rez1 as $key1 => $val1)if($key1){
|
|||
|
$out[$key]['items'][] = $val1;
|
|||
|
}
|
|||
|
}
|
|||
|
return $out;
|
|||
|
}
|
|||
|
|
|||
|
function get_type($id=0){
|
|||
|
$out=array();
|
|||
|
$type=array(0=>'Одиночный',1=>'Добавляемый');
|
|||
|
foreach($type as $key => $val){
|
|||
|
$out[$key]['id']=$key;
|
|||
|
$out[$key]['name']=$val;
|
|||
|
if ($id==$key) $out[$key]['sele']=1; else $out[$key]['sele']=0;
|
|||
|
}
|
|||
|
return $out;
|
|||
|
}
|
|||
|
*/
|
|||
|
?>
|