header('Content-Type: text/html; charset=tis-620');
include('../db_config.php');
$sql="select *,count(*) as nsc from sk1_sch group by scgrp order by sampur";
$result=mysql_query($sql);
echo "
ที่ |
กลุ่มโรงเรียน |
รร. |
จองแล้ว |
ร้อยละ |
";
$rw=1; $gsc=0;
while ($db=mysql_fetch_array($result)) {
$sql2="select * from sk1_sch where scgrp='$db[scgrp]' ";
$result2=mysql_query($sql2);
while ($db2=mysql_fetch_array($result2)) {
if (($db2[jss]+$db2[js]+$db2[jm]+$db2[jl]+$db2[jxl]+$db2[j2xl]+$db2[j3xl]+$db2[p1ss]+$db2[p1s]+$db2[p1m]+$db2[p1l]+$db2[p1xl]+$db2[p12xl]+$db2[p13xl]+$db2[p14xl]+$db2[p15xl]+$db2[p2ss]+$db2[p2s]+$db2[p2m]+$db2[p2l]+$db2[p2xl]+$db2[p22xl]+$db2[p23xl]+$db2[p24xl]+$db2[p25xl])>0) { $gsc++; }
}
if ($gsc > 0 ) { $gg=$gsc; } else { $gg='-';}
$perc=number_format($gsc*100/$db[nsc],2,'.','');
echo "
$rw |
$db[sgrp] |
$db[nsc] |
$gg |
$perc |
";
$rw++; $tgsc+=$gsc; $gsc=0; $tnsc+=$db[nsc];
}
$tperc=number_format($tgsc*100/$tnsc,2,'.','');
echo "
รวม |
$tnsc |
$tgsc |
$tperc |
[ ดูรูปแบบ / ขนาดของเสื้อ ]
";
?>