// echo "
" ; header('Content-Type: text/html; charset=tis-620'); echo "
"; require_once("header.php"); include_once('db_config.php'); $sql0="select * from $_sch where scode='$scid' "; $result0=mysql_query($sql0); $db0=mysql_fetch_array($result0); $sql="select * from $_act order by kp_code"; $result=mysql_query($sql); echo <<
กิจกรรมแข่งขัน $_title
$_title2
โรงเรียน$db0[sname] สพท.$db0[scgrp]
ที่
กลุ่มสาระการเรียนรู้
กิจกรรม
สมัครได้
สมัครแล้ว
TH; $rw=1; $total=0; $max; while ($db=mysql_fetch_array($result)) { $act=$db[kp_code]; $sql1="select count(*) as nstd from $_data where kd_sch='$scid' and kd_code='$act' " ; $result1=mysql_query($sql1); $db1=mysql_fetch_array($result1); if ( $db1[nstd]==0) { $nst='-'; } else { $nst=$db1[nstd]; } echo <<
$rw
$db[kp_grp]
$db[kp_act] ($db[kp_level])
$db[kp_st]
$nst
TB; $rw++; $total+=$nst; $max+=$db[kp_st]; } echo <<
รวม
$max
$total
TF; ?>