header('Content-Type: text/html; charset=tis-620');
include('../db_config.php');
$sql="select * from sk1_sch where scgrp='$sg' ";
$result=mysql_query($sql);
echo "
ที่ |
บุคลากรในโรงเรียน |
ทั้ง หมด |
สมัคร แล้ว |
ร้อย ละ |
";
$rw=1;
while ($db=mysql_fetch_array($result)) {
$sql1="select smis,dd+tc+oth as allp,dd_line+tc_line+oth_line as aline
from sk1_obecline where smis='$db[smis]' ";
$result1=mysql_query($sql1);
$db1=mysql_fetch_array($result1);
$perc=number_format($db1[aline]*100/$db1[allp],0,'.',',');
if ($db1[aline] > 0 ) { $gg=$db1[aline]; } else { $gg='-';}
echo "
$rw |
$db[sname] |
$db1[allp] |
$gg |
$perc |
";
$rw++;
$allp+=$db1[allp];
$aline+=$db1[aline];
}
$aper=number_format($aline*100/$allp,0,'.',',');
echo "
รวม |
$allp |
$aline |
$aper |
";
?>