EIOS/inc/iup_users1.php

25 lines
1.1 KiB
PHP

<?php
if($des == 'show'){
$users=array();
$sql = 'SELECT us.id,us.fio,ut.statuses,te.fakultet,te.kafedra FROM '.$ST['dbpf'].'_users as us,'.$ST['dbpf'].'_users_statuses as ut,'.$ST['dbpf'].'_teachers as te WHERE (ut.statuses LIKE "%20%" OR ut.statuses LIKE "%21%" OR ut.statuses LIKE "%22%" OR ut.statuses LIKE "%23%" OR ut.statuses LIKE "%24%" OR ut.statuses LIKE "%25%" OR ut.statuses LIKE "%30%") AND us.id=ut.id_user AND us.id=te.id_user ORDER BY te.fakultet,te.kafedra,us.fio';
$rez = $DB->QUR_SEL($sql);
//echo $sql.'<pre>'.print_r($rez,1).'</pre>';
if($rez){
foreach($rez as $key => $val)if($key){
$val['statuses'] = explode(',',$val['statuses']);
$users[] = $val;
}
}
$smarty->assign('users',$users);
$smarty->assign('statuses',$CF['user_statuses']);
}
$smarty->assign('page',$page);
$smarty->assign('des',$des);
$smarty->assign('debug',$debug);
$smarty->assign('msg',$msg);
$fakultets = iup_get_fakultets();
$smarty->assign('fakultets',$fakultets);
$kafedras = iup_get_kafedras();
$smarty->assign('kafedras',$kafedras);
$maincontent = $smarty->fetch('tpl_iup_users1.html');