header('Content-Type: text/html; charset=tis-620');
include('../db_config.php');
$sql="select * from sk1_dlchk where scgrp='$sg' ";
$result0=mysql_query($sql);
$db0=mysql_fetch_array($result0);
$result=mysql_query($sql);
echo <<
กลุ่มโรงเรียน : $db0[sgrp]
ที่ |
โรงเรียน |
ทั้ง หมด |
เรียน ได้ |
ร้อยละ |
TH;
$rw=1; $n=$tn=0;
while ($db=mysql_fetch_array($result)) {
$ts=$db[a1]+$db[a2]+$db[a3]+$db[p1]+$db[p2]+$db[p3]+$db[p4]+$db[p5]+$db[p6]+
$db[m1]+$db[m2]+$db[m3]+$db[m4]+$db[m5]+$db[m6];
$tsk=$db[a1k]+$db[a2k]+$db[a3k]+$db[p1k]+$db[p2k]+$db[p3k]+$db[p4k]+$db[p5k]+$db[p6k]+
$db[m1k]+$db[m2k]+$db[m3k]+$db[m4k]+$db[m5k]+$db[m6k];
if ($ts==0) { $cts='-'; $ps='-'; } else { $cts=$ts; $ps=number_format($tsk*100/$ts,2,'.',','); }
if ($tsk==0) { $ctsk='-'; $ps='-'; } else { $ctsk=$tsk; $ps=number_format($tsk*100/$ts,2,'.',','); }
echo "
$rw |
$db[sname] |
$cts |
$ctsk |
$ps |
";
$rw++;
$tts+=$ts;
$ttsk+=$tsk;
}
$tps=number_format($ttsk*100/$tts,2,'.',',');
echo "
รวม |
$tts |
$ttsk |
$tps |
";
?>
|