header('Content-Type: text/html; charset=tis-620');
include('../db_config.php');
$sql="select *,count(*) as nsc from sk1_dlchk where level != 'x' group by scgrp order by sampur";
$result=mysql_query($sql);
echo <<
ที่ |
กลุ่มโรงเรียน |
ทั้ง หมด |
ตอบ แล้ว |
ร้อยละ ที่ตอบ |
TH;
$rw=1; $gsc=0;
while ($db=mysql_fetch_array($result)) {
$sql2="select * from sk1_dlchk where scgrp='$db[scgrp]' ";
$result2=mysql_query($sql2);
$gts=$gtk=0;
while ($db2=mysql_fetch_array($result2)) {
if ($db2[sprom] != '') { $gsc++; }
}
if ($gsc > 0) { $gg=$gsc; } else { $gg='-'; }
$perc=number_format($gsc*100/$db[nsc],2,'.','');
$tpc=number_format($gtk*100/$gts,2,'.','');
echo <<
$rw |
$db[sgrp] |
$db[nsc] |
$gg |
$perc |
TB;
$rw++; $tgsc+=$gsc; $gsc=0; $tnsc+=$db[nsc];
$ats+=$gts;
$atk+=$gtk;
}
$tperc=number_format($tgsc*100/$tnsc,2,'.','');
$apc=number_format($atk*100/$ats,2,'.','');
echo <<
รวม |
$tnsc |
$tgsc |
$tperc |
TF;
?>
|