header('Content-Type: text/html; charset=tis-620');
include('../db_config.php');
$sql="select * from sk1_kday62 ";
$result=mysql_query($sql);
echo "
ที่ |
กลุ่มโรงเรียน |
รับรายงานตัว |
ปฏิคม |
รวม |
";
$rw=1; $trg=$tpk=0;
while ($db=mysql_fetch_array($result)) {
$sql2="select * from sk1_kday62 where id='$db[id]' ";
$result2=mysql_query($sql2);
$db2=mysql_fetch_array($result2);
if (!empty($db2[rg1])) { $trg++; }
if (!empty($db2[rg2])) { $trg++; }
if (!empty($db2[rg3])) { $trg++; }
if (!empty($db2[rg4])) { $trg++; }
if ($trg>0) { $crg=$trg; } else { $crg='-'; }
if (!empty($db2[pk1])) { $tpk++; }
if (!empty($db2[pk2])) { $tpk++; }
if (!empty($db2[pk3])) { $tpk++; }
if (!empty($db2[pk4])) { $tpk++; }
if (!empty($db2[pk5])) { $tpk++; }
if ($tpk>0) { $cpk=$tpk; } else { $cpk='-'; }
$tgk=$trg+$tpk;
echo "
$rw |
$db[ceo] |
$crg |
$cpk |
$tgk |
";
$rw++;
$ttrg+=$trg; $ttpk+=$tpk;
$trg=$tpk=0; $ttgk+=$tgk;
}
echo "
รวม |
$ttrg |
$ttpk |
$ttgk |
![](images/back.png)
";
?>