header('Content-Type: text/html; charset=tis-620');
include('db_config.php');
if ($act==1) {
$sql="select *,date_format(aget,'%Y%m%d') as dget,date_format(aback,'%Y%m%d') as dback
from aw9_nation where atype='1' and arep='1' order by atype,acode";
} elseif ($act==2) {
$sql="select * from aw9_nation where aget='1' and arep='1' order by acode";
} elseif ($act==5) {
$sql="select * from aw9_nation where aget='1' and agrp='' and arep='1' order by acode";
} elseif ($act==3) {
$sql="select * from aw9_nation where aline <> '' and arep='1' order by acode";
} elseif ($act==4) {
$sql="select *,date_format(aget,'%Y%m%d') as dget,date_format(aback,'%Y%m%d') as dback
from aw9_nation where aback<>'0000-00-00' and arep='1' order by arcode,acode";
}
$result=mysql_query($sql);
echo <<
รายการตัวแทนระดับชาติ : กลุ่ม สพป.
รหัส |
กิจกรรม/ชื่อตัวแทน |
หมาย เหตุ |
TH;
$rw=1; $nsend=0;
while ($db=mysql_fetch_array($result)) {
if ($db[acode]>=248 and $db[acode]<=251) {
$code="4-$db[acode]";
} elseif ($db[acode]<=52) {
$code="1-$db[acode]";
} elseif ($db[acode]>=87 and $db[acode]<=134) {
$code="2-$db[acode]";
} else {
$code="3-$db[acode]";
}
if ($act==1) {
$tday="แจ้งส่ง ";
$nsend++;
} elseif ($act==2) {
$tday="เชิญเข้า ";
$nget++;
} elseif ($act==5) {
$tday="ยังไม่ เข้ากลุ่ม";
$nget++;
} elseif ($act==3) {
$tday="แจ้งส่ง ";
$nsend++;
} elseif ($act==4) {
$tday='ได้รับ '.tsdate($db[dback]);
$nsend++;
}
$aoff=str_replace("สำนักงานเขตพื้นที่การศึกษาประถมศึกษา","สพป.",$db[aoff]);
echo <<
$rw |
$code
$db[adesc] $db[aname]
$aoff |
$tday |
TB;
$rw++;
}
$tstd=number_format($tstd,0,'.',',');
echo "
";
function tsdate($day) {
$Tmnt=array("ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.",
"ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค.") ;
if ($day != '00000000') {
return intval(substr($day,6,2))." ".$Tmnt[intval(substr($day,4,2)-1)].intval(substr($day,2,2)+43) ;
} else {
return ' ';
}
}
?>
|