header('Content-Type: text/html; charset=tis-620');
include('../db_config.php');
$sql="select * from sk1_prath a,sk1_sch b where a.smis=b.smis order by a.smis";
$result=mysql_query($sql);
echo "
ที่ |
โรงเรียนประชารัฐ |
ห้องเรียน ICT |
เอกชนสนับสนุน |
";
$rw=1; $fns=$spp=0;
while ($db=mysql_fetch_array($result)) {
$sql2="select * from sk1_prath where smis='$db[smis]' and
(a1c<>'' or a2c<>'' or p1c<>'' or p2c<>'' or p3c<>'' or p4c<>'' or p5c<>'' or p6c<>'' or m1c<>'' or m2c<>'' or m3c<>'' or airc<>'') ";
$result2=mysql_query($sql2);
$fill=mysql_num_rows($result2);
if ($fill>0) { $gg='กรอกแล้ว'; $fns++; } else { $gg='-'; }
$sql3="select * from sk1_prath60 where prt_sch='$db[smis]' ";
$result3=mysql_query($sql3);
$spt=mysql_num_rows($result3);
if ($spt>0) { $sp='กรอกแล้ว'; $spp++; } else { $sp='-'; }
echo "
$rw |
$db[sname] |
$gg |
$sp |
";
$rw++;
}
$p1=number_format($fns*100/25,0,'.','');
$p2=number_format($spp*100/25,0,'.','');
echo "
รวม |
$fns ($p1%) |
$spp ($p2%) |
";
?>