header('Content-Type: text/html; charset=tis-620');
include('../db_config.php');
$sql="select *,count(*) as nsc from sk1_sch where level<>'a' group by sgrp order by sampur";
$result=mysql_query($sql);
echo <<
ที่ |
กลุ่มโรงเรียน |
รร. ทั้งหมด |
ส่งแผนจัดห้องเรียน |
ครบ ร้อยละ |
ครบ |
ไม่ครบ |
TH;
$rw=1; $gsc1=$gsc2=0;
while ($db=mysql_fetch_array($result)) {
$sql2="select * from sk1_pclass,sk1_sch where psmis=smis and scgrp='$db[scgrp]' ";
$result2=mysql_query($sql2);
while ($db2=mysql_fetch_array($result2)) {
if (($db2[y62a1]+$db2[y62p1]+$db2[y62m1]+$db2[y62m4]+$db2[y63a1]+$db2[y63p1]+$db2[y63m1]+$db2[y63m4] == 0) or
($db2[y62a1s]+$db2[y62p1s]+$db2[y62m1s]+$db2[y62m4s]+$db2[y63a1s]+$db2[y63p1s]+$db2[y63m1s]+$db2[y63m4s] == 0)) {
$gsc1++; $tgsc1++;
} else {
$gsc2++; $tgsc2++;
}
}
if ($gsc1 > 0 ) { $gg1=$gsc1; } else { $gg1='-';}
if ($gsc2 > 0 ) { $gg2=$gsc2; } else { $gg2='-';}
$perc=number_format($gsc2*100/$db[nsc],2,'.','');
echo "
$rw |
$db[sgrp] |
$db[nsc] |
$gg2 |
$gg1 |
$perc |
";
$rw++;
$gsc1=$gsc2=0;
$tnsc+=$db[nsc];
}
$tperc=number_format($tgsc2*100/$tnsc,2,'.','');
echo <<
รวม |
$tnsc |
$tgsc2 |
$tgsc1 |
$tperc |
TF;
?>
|