";
$sql="select *,count(*) as allstd from $_std where std_room<>''
group by std_room order by std_room";
$result=mysql_query($sql); $rw=1;
while ($db=mysql_fetch_array($result)) {
$sql1="select *,count(*) as ntime from $_log,$_std where log_std=std_id and std_room='$db[std_room]' group by log_std";
$result1=mysql_query($sql1);
$nlogin=mysql_num_rows($result1);
$sql3="select * from $_log,$_std where log_std=std_id and std_room='$db[std_room]' ";
$result3=mysql_query($sql3);
$logtime=mysql_num_rows($result3);
$sql2="select * from $_act,$_std
where act_std=std_id and std_room='$db[std_room]' and act_type='1'
group by act_std,act_type";
$result2=mysql_query($sql2);
$nstudy=mysql_num_rows($result2);
$sql4="select * from $_act,$_std where act_std=std_id and std_room='$db[std_room]' ";
$result4=mysql_query($sql4);
$nstime=mysql_num_rows($result4);
$sql5="select * from $_act,$_std where act_std=std_id and act_type=5 and
std_room='$db[std_room]' group by act_std";
$result5=mysql_query($sql5);
$nwk=mysql_num_rows($result5);
$sql5="select * from $_act,$_std where act_std=std_id and act_type=5 and
std_room='$db[std_room]' group by act_target";
$result5=mysql_query($sql5);
$nwkt=mysql_num_rows($result5);
$sql6="select * from $_act,$_std where act_std=std_id and act_type=5 and act_eval=3 and
std_room='$db[std_room]' group by act_std";
$result6=mysql_query($sql6);
$pass=mysql_num_rows($result6);
$sql6="select * from $_act,$_std where act_std=std_id and act_type=5 and act_eval=3 and
std_room='$db[std_room]' group by act_target";
$result6=mysql_query($sql6);
$passt=mysql_num_rows($result6);
if ($nlogin==0) { $nlogin='-'; }
if ($logtime==0) { $logtime='-'; }
if ($nstudy==0) { $nstudy='-'; }
if ($nstime==0) { $nstime='-'; }
if ($nwk==0) { $nwk='-'; }
if ($nwkt==0) { $nwkt='-'; }
if ($pass==0) { $pass='-'; }
if ($passt==0) { $passt='-'; }
$plog=number_format($nlogin*100/$db[allstd],2,'.',',');
if ($plog==0) { $plog='-'; }
$pact=number_format($nstudy*100/$db[allstd],2,'.',',');
if ($pact==0) { $pact='-'; }
$pwk=number_format($nwk*100/$db[allstd],2,'.',',');
if ($pwk==0) { $pwk='-'; }
$ppass=number_format($pass*100/$db[allstd],2,'.',',');
if ($ppass==0) { $ppass='-'; }
if ($rw%2==0) { $cl='#FFF1D5'; } else { $cl='#FFCD64'; }
echo "