"; include('db_config.php'); $sql1="select * from $_sch where scgrp='$ceo' "; $result1=mysql_query($sql1); $db1=mysql_fetch_array($result1); $sql2="select * from $_act where kp_id='$code' "; $result2=mysql_query($sql2); $db2=mysql_fetch_array($result2); $gr=$db2[kp_cd]; $sql="select *,date_format(kd_edit,'%Y%m%d') as fdate from $_data,$_sch where kd_sch=scode and kd_code='$code' and scgrp='$ceo' order by kd_edit"; $result=mysql_query($sql); echo "

การแข่งขันทักษะวิชาการนักเรียน $_title
การแข่งขันกิจกรรม $db2[kp_act]
กลุ่ม $db1[sgrp] กลุ่มสาระ $db2[kp_grp] ชั้น $db2[kp_level] สมัครได้ $db2[eef_st] คน [ กลับรายการเดิม ]
"; $rw=0; $total=0; $sc=''; $ord=1; while ($db=mysql_fetch_array($result)) { $tdate=tsdate($db[fdate]); $sql0="select * from $_sch where scode='$db[kd_sch]' "; $result0=mysql_query($sql0); $db0=mysql_fetch_array($result0); if ($db[g]>0) { $medal='ทอง'; $col='#FFFF99'; // $type=$db[g]; } elseif ($db[s]>0) { $medal='เงิน'; $col='#DDDDFF'; // $type=$db[s]; } elseif ($db[b]>0) { $medal='ทองแดง'; $col='#FFD9E9'; // $type=$db[b]; } else { $medal=''; } if ($db[kd_sch]==$sc) { $sch=''; $sgrp=''; $row=''; $ord++; } else { $sch=$db0[sname]; $sgrp=$db0[abb_sch]; $rw++; $ord=1; $row=$rw; } echo ""; $sc=$db[kd_sch]; $total+=$db0[nstd]; } echo "
ที่ โรงเรียน กลุ่ม รร. นักเรียน ผู้ฝึกสอน วันสมัคร
$row $sch $sgrp $ord.$db[kd_std] $db[kd_tutor] $tdate

[ กลับรายการเดิม ]

"; //include("../footer.php"); function tsdate($day) { $Tmnt=array("ม.ค.","ก.พ.","มี.ค.","เม.ย.","พ.ค.","มิ.ย.","ก.ค.", "ส.ค.","ก.ย.","ต.ค.","พ.ย.","ธ.ค.") ; return intval(substr($day,6,2))." ".$Tmnt[intval(substr($day,4,2)-1)].intval(substr($day,2,2)+43) ; } ?>