header('Content-Type: text/html; charset=tis-620');
echo '';
include('db_config.php');
$sql="select *,count(*) as nsch from $_sch group by scgrp order by scgrp";
$result=mysql_query($sql);
echo <<
ยอดสมัคร $_title3
ที่
สพป.
รร.ทั้งหมด
รร.สมัครแล้ว
ร้อยละ
TH;
$rw=1; $tt1=0; $tt2=0;
while ($db=mysql_fetch_array($result)) {
$reg='ศรีสะเกษ เขต '.substr($db[scgrp],3,1);
$sql1="select * from $_data,$_sch where kd_sch=scode and scgrp='$db[scgrp]' group by kd_sch";
$result1=mysql_query($sql1);
$res=mysql_num_rows($result1);
$pc=number_format($res*100/$db[nsch],2,".",",");
if ($res==0) { $res='-'; }
echo <<