QUR_SEL($sql); if($rez){ $otchgods = $rez[1]; $otchgods['konec'] = 0; if(time()>$otchgods['data_s2']) $otchgods['konec'] = 1; $_SESSION['otchgods'][$otchgods['tip']] = $otchgods;//для подсчета баллов if($_SESSION['user']['id']==4870||$_SESSION['user']['id']==19603){ $otchgods['konec']=0; } if($otchgods['konec']==0){ $rejtuser = rejt_get_useranketa(); $items = $rejtuser['items']; $BALLS = $rejtuser['balls']; } } //echo '
'.print_r($_SESSION,1).'
'; $users_kaf=array(); if(isset($_SESSION['user']['statuses'][59])) {//админ иупа if(isset($_SESSION['rejteu'])){//есть выбор пользователя для редактирования if(isset($_SESSION['user']['teacher'])){ $fakultet = $_SESSION['user']['teacher']['fakultet']; $kafedra = $_SESSION['user']['teacher']['kafedra']; $sql = 'SELECT u.*,t.zvanie,t.dolgnost,t.stepen FROM '.$ST['dbpf'].'_teachers as t,'.$ST['dbpf'].'_users as u WHERE u.id='.$_SESSION['rejteu'].' AND t.id_user=u.id'; $rez = $DB->QUR_SEL($sql); if($rez){//вроде наш сотрудник //меняем ИД пользователя и отображаем $_SESSION['user']['oid'] = $_SESSION['user']['id']; $_SESSION['user']['id'] = $_SESSION['rejteu']; $rejtuser = rejt_get_useranketa(); $items = $rejtuser['items']; $BALLS = $rejtuser['balls']; //echo '
'.print_r($rejtuser,1).'
';exit(); } } }else { $fakultet = $_SESSION['user']['teacher']['fakultet']; $kafedra = $_SESSION['user']['teacher']['kafedra']; //надо выбрать всех преподов на кафедре и отобразить список $sql = 'SELECT u.*,t.zvanie,t.dolgnost,t.stepen FROM ' . $ST['dbpf'] . '_teachers as t,' . $ST['dbpf'] . '_users as u WHERE t.id_user=u.id'; $rez = $DB->QUR_SEL($sql); if ($rez) { foreach ($rez as $key => $val) if ($key) { $users_kaf[] = $val; } } } }else if(isset($_SESSION['user']['statuses'][30])){//зав.кафедрой if(isset($_SESSION['rejteu'])){//есть выбор пользователя для редактирования if(isset($_SESSION['user']['teacher'])){ $fakultet = $_SESSION['user']['teacher']['fakultet']; $kafedra = $_SESSION['user']['teacher']['kafedra']; $sql = 'SELECT u.*,t.zvanie,t.dolgnost,t.stepen FROM '.$ST['dbpf'].'_teachers as t,'.$ST['dbpf'].'_users as u WHERE t.kafedra="'.$kafedra.'" AND u.id='.$_SESSION['rejteu'].' AND t.id_user=u.id'; $rez = $DB->QUR_SEL($sql); if($rez){//вроде наш сотрудник //меняем ИД пользователя и отображаем $_SESSION['user']['oid'] = $_SESSION['user']['id']; $_SESSION['user']['id'] = $_SESSION['rejteu']; $rejtuser = rejt_get_useranketa(); $items = $rejtuser['items']; $BALLS = $rejtuser['balls']; //echo '
'.print_r($rejtuser,1).'
';exit(); } } }else{ //смотрим какая кафедра if(isset($_SESSION['user']['teacher'])){ $fakultet = $_SESSION['user']['teacher']['fakultet']; $kafedra = $_SESSION['user']['teacher']['kafedra']; //надо выбрать всех преподов на кафедре и отобразить список $sql = 'SELECT u.*,t.zvanie,t.dolgnost,t.stepen FROM '.$ST['dbpf'].'_teachers as t,'.$ST['dbpf'].'_users as u WHERE t.kafedra="'.$kafedra.'" AND t.id_user=u.id'; $rez = $DB->QUR_SEL($sql); if($rez){ foreach($rez as $key => $val)if($key){ $users_kaf[] = $val; } } } } } //если редактируем пользователя if(isset($_SESSION['rejteu'])) $smarty->assign('rejteu',$_SESSION['rejteu']); else $smarty->assign('rejteu',0); $smarty->assign('users_kaf',$users_kaf); //echo '
'.print_r($_SESSION,1).'
'; //echo '
'.print_r($otchgods,1).'
'; $smarty->assign('otchgods',$otchgods); $smarty->assign('BALLS',$BALLS); $smarty->assign('items',$items); $smarty->assign('page',$page); $smarty->assign('des',$des); $zkedit = 0; if(isset($_SESSION['rejteu'])&&isset($_SESSION['user']['oid'])) $zkedit=1; $smarty->assign('zkedit',$zkedit); $maincontent = $smarty->fetch('tpl_rejt_anketa.html');