";
include('db_config.php');
mysql_query("TRUNCATE TABLE tmpkap5");
mysql_query("insert into tmpkap5 (SELECT * FROM $_data group by kd_sch,kd_code,g,s,b,a)");
$sql="select *,sum(kd_remark) as nrep,sum(g) as go,sum(s) as sv,sum(b) as bn,sum(a) as ad, count(kd_code) as sendall
from tmpkap5,$_sch where kd_sch=scode group by kd_sch order by nrep desc,go desc,sv desc,bn desc,ad desc ";
$result=mysql_query($sql);
$rk=1;
echo <<��ػ $_title �¡�ç���¹ ���§����ӹǹ���᷹
TH;
$tg=0; $ts=0; $tb=0; $total=0; $rk=1; $tsend=0;
while ($db=mysql_fetch_array($result)) {
$tot=$db[go]+$db[sv]+$db[bn]+$db[ad];
$scn=substr($db[sname],0,50);
$sgr=$db[abb_sch];
$sper=number_format($tot*100/$db[sendall],2,'.',',');
if($db[go]>0) { $go=$db[go]; } else { $go='-'; }
if($db[sv]>0) { $sv=$db[sv]; } else { $sv='-'; }
if($db[bn]>0) { $bn=$db[bn]; } else { $bn='-'; }
if($db[ad]>0) { $ad=$db[ad]; } else { $ad='-'; }
if($db[nrep]>0) { $rp=$db[nrep]; } else { $rp='-'; }
echo <<
TB;
$rk++; $tg+=$db[go]; $ts+=$db[sv]; $tb+=$db[bn]; $ta+=$db[ad]; $total+=$tot;
$tsend+=$db[sendall]; $trep+=$db[nrep];
}
$tsper=number_format($total*100/$tsend,2,'.',',');
echo <<
��� |
�ç���¹ |
��Ѥ���� |
�ͧ |
�Թ |
�ͧᴧ |
���� |
��� |
������ |
���᷹ |
$rk |
$scn |
$db[sendall] |
$go |
$sv |
$bn |
$ad |
$tot |
$sper |
$rp |
��� CEO $sgr |
$tsend |
$tg |
$ts |
$tb |
$ta |
$total |
$tsper |
$trep |
TF;
?>