header('Content-Type: text/html; charset=tis-620');
include('db_config.php');
echo <<
แจ้งชื่อเข้าประชุมจัดตั้งงบประมาณ 6-7 ธค.66
รอบวันที่ / ณ ห้องประชุมเพชร |
จำนวน |
TH;
for ($i=1; $i<=2; $i++) {
$result0=mysql_query("select * from $_db where smday='$i' ");
$nsch=mysql_num_rows($result0);
if ($nsch==0) { $cn='-'; } else { $cn=$nsch; }
echo <<
$day[$i] |
$cn |
TF;
$tot+=$nsch;
}
echo <<
รวม |
$tot |
TE;
$sql="select *,count(*) as nsc from $_sch where scgrp != 'prv'
group by scgrp order by ampcode,scode";
$result=mysql_query($sql);
echo << |
ที่ |
กลุ่มโรงเรียน |
ทั้งหมด |
แจ้งแล้ว |
ร้อยละ |
TH;
$rw=1; $gsc=0;
while ($db=mysql_fetch_array($result)) {
$sql2="select * from $_db a,$_sch b where a.smsch=b.scode and b.scgrp='$db[scgrp]' ";
$result2=mysql_query($sql2);
while ($db2=mysql_fetch_array($result2)) {
if ($db2[smsch] !='' ) { $gsc++; }
}
if ($gsc > 0 ) { $gg=$gsc; } else { $gg='-';}
$perc=number_format($gsc*100/$db[nsc],2,'.','');
echo <<
$rw |
$db[sgrp] |
$db[nsc] |
$gg |
$perc |
TB;
$rw++; $tgsc+=$gsc; $gsc=0; $tnsc+=$db[nsc];
}
$tperc=number_format($tgsc*100/$tnsc,2,'.','');
echo <<
รวม |
$tnsc |
$tgsc |
$tperc |
TF;
?>
|