header('Content-Type: text/html; charset=tis-620');
include('db_config.php');
$sql="select *,count(*) as nsc from $_sch where level != 'x' and level != 'z' group by scgrp order by sampur";
$result=mysqli_query($con,$sql);
echo <<
á¨é§¡ÒÃãªé´Ô¨Ô·ÑÅá¿Åµ¿ÍÃìÁ ¤Ãº·Ñé§ 4 ´éÒ¹
·Õè |
¡ÅØèÁâçàÃÕ¹ |
·Ñé§ ËÁ´ |
Êè§ áÅéÇ |
ÃéÍÂÅÐ ·ÕèÊè§ |
TH;
$rw=1; $gsc=0;
while ($db=mysqli_fetch_array($result)) {
$sql2="select * from $_data a,$_sch b where a.scode=b.scode and b.scgrp='$db[scgrp]' ";
$result2=mysqli_query($con,$sql2);
$gts=$gtk=0;
while ($db2=mysqli_fetch_array($result2)) {
if (!empty($db2[v1]) and !empty($db2[b1]) and !empty($db2[p1]) and !empty($db2[g1])) { $gsc++; }
}
if ($gsc > 0) { $gg=$gsc; } else { $gg='-'; }
$perc=number_format($gsc*100/$db[nsc],2,'.','');
$tpc=number_format($gtk*100/$gts,2,'.','');
echo <<
$rw |
$db[sgrp] |
$db[nsc] |
$gg |
$perc |
TB;
$rw++; $tgsc+=$gsc; $gsc=0; $tnsc+=$db[nsc];
$ats+=$gts;
$atk+=$gtk;
}
$tperc=number_format($tgsc*100/$tnsc,2,'.','');
$apc=number_format($atk*100/$ats,2,'.','');
echo <<
ÃÇÁ |
$tnsc |
$tgsc |
$tperc |
Êè§ÍÍ¡
TF;
mysqli_close($con,$sql);
?>
|