"; include('db_config.php'); mysql_query("TRUNCATE TABLE mt2"); mysql_query("insert into mt2 (SELECT * FROM $_data group by kd_sch,kd_code,g,s,b,a,kd_remark)"); $sql="SELECT *,sum(g) AS go,sum(s) AS sv,sum(b) AS bn,sum(a) AS an, sum(g*3)+sum(s*2)+sum(b*1)+sum(a) as score FROM mt2,$_reg WHERE kd_sch=scode GROUP BY scode ORDER BY score DESC,go desc,sv desc,bn desc"; $result=mysql_query($sql); echo "ػ­ $_title"; echo ""; echo ""; $row=1; $tg=0; $ts=0; $tb=0; $ta=0; $tts=0; while ($db=mysql_fetch_array($result)) { $total=$db[go]+$db[sv]+$db[bn]+$db[an]; /* if ($row<$db[eef2009]) { $adv=""; $col="#669900"; $dif=abs($row-$db[eef2009]); } elseif ($row>$db[eef2009]) { $col="#FF0000"; $dif=abs($row-$db[eef2009]); $adv=""; } elseif ($row=$db[eef2009]) { $dif='-'; $adv=""; } if ($row<$db[eef2008]) { $adv0=""; $col0="#669900"; $dif0=abs($row-$db[eef2008]); } elseif ($row>$db[eef2008]) { $col0="#FF0000"; $dif0=abs($row-$db[eef2008]); $adv0=""; } elseif ($row=$db[eef2008]) { $dif0='-'; $adv0=""; } */ echo ""; $row++ ; $tg+=$db[go]; $ts+=$db[sv]; $tb+=$db[bn]; $ta+=$db[an]; $tts+=$db[score]; } // $tt=$tg+$ts+$tb+$ta ; echo ""; echo "
ʾ./ ͧԹͧᴧ
$row $db[sname] $db[go]$db[sv] $db[bn] $db[an] $total $db[score]
$tg $ts$tb$ta 

ṹԴҡ ­ͧ x 3, Թ x 2 зͧᴧ x 1"; ?>