"; //include('header.php'); header('Content-Type: text/html; charset=tis-620'); include_once('db_config.php'); mysql_query("TRUNCATE TABLE tmpsp3"); mysql_query("insert into tmpsp3 (SELECT * FROM $_data group by kd_sch,kd_code,g,s,b)"); $sql="select *,left(kp_code,2) as gr,sum(g) as g,sum(s) as s,sum(b) as b from tmpsp3,$_act where kp_code=kd_code group by gr order by kp_grp"; $result=mysql_query($sql); echo "
ÊÃØ»àËÃÕ­ÃÒ§ÇÑÅ á¡ÃÒ»ÃÐàÀ·¡ÕÌÒ"; echo ""; echo ""; $tg=0; $ts=0; $tb=0; $ta=0; $total=0; $rw=1; $kgp=''; while ($db=mysql_fetch_array($result)) { $tt=$db[g]+$db[s]+$db[b]; $kgp=substr($db[kd_code],0,2); if ($db[g]>0) { $gg=$db[g]; } else { $gg='-'; } if ($db[s]>0) { $ss=$db[s]; } else { $ss='-'; } if ($db[b]>0) { $bb=$db[b]; } else { $bb='-'; } if ($rep>0) { $rr=$rep; } else { $rr='-'; } if ($tt>0) { $tot=$tt; } else { $tot='-'; } echo ""; $tg+=$db[g]; $ts+=$db[s]; $tb+=$db[b]; $ta+=$db[a]; $total+=$tt; $rw++; } echo "
·Õè »ÃÐàÀ·¡ÕÌÒ ·Í§ à§Ô¹ ·Í§á´§ ÃÇÁ
$rw $db[kp_grp] $gg $ss $bb $tot
ÃÇÁ $tg $ts $tb $total
"; ?>