. **/ try{ if(isset($_GET['list'])){ $filter="WHERE id<>1 and class<>''"; $filter_array=array(); if(isset($_POST['filter'])){ if(isset($_POST['f_search'])){ if($_POST['f_search']!=""){ $filter.=" and (class LIKE ? or username LIKE ? or fullname LIKE ?)"; array_push($filter_array, "%".$_POST['f_search']."%", "%".$_POST['f_search']."%", "%".$_POST['f_search']."%"); } } } $sql=$db->prepare("SELECT fullname, accesslevel, class FROM users ".$filter." ORDER BY class ASC, accesslevel DESC, fullname ASC"); $sql->execute($filter_array); //echo table(s) $first=true; $rid=0; $curClass=""; while($row=$sql->fetch(PDO::FETCH_ASSOC)){ if($curClass!=$row['class']){ $curClass=$row['class']; if(!$first){ echo "
"; } if($first){ $first=false; } $rid=1; echo "

".$curClass."


"; } echo " "; $rid++; } echo "
".$lang['rowid']." ".$lang['fullname']." ".$lang['role']."
".$rid." ".$row['fullname']." ".($row['accesslevel']>0?$lang['headteacher']:$lang['student'])."
"; } } catch(Exception $e){ functions::setError(500); error_log($e); }