header('Content-Type: text/html; charset=utf8');
include('db_config.php');
$sql="select *,count(*) as noff from $_cmt where cm_act<>''
group by cm_office order by noff desc,cm_office";
$result=mysql_query($sql);
echo <<
สรุปยอดผู้สมัคร แยกตามหน่วยงาน
ที่ |
หน่วยงาน/สถาบัน |
ยอด สมัคร |
TH;
$rw=1;
while ($db=mysql_fetch_array($result)) {
echo <<
$rw |
$db[cm_office] |
$db[noff] |
TB;
$rw++;
$tc+=$db[noff];
}
$tc=number_format($tc);
echo <<
รวม |
$tc |
TF;
?>
|