header('Content-Type: text/html; charset=tis-620');
include('../db_config.php');
$sql="select *	from sk1_stand,sch where sta_smis=smis and sta_small='1' and scgrp='$sg' ";
$result=mysql_query($sql);
echo "
	
	| ที่ | 
	โรงเรียน | 
	ส่งข้อมูล | 
	
";
$rw=1;
while ($db=mysql_fetch_array($result)) {
	$sql1="select * from sk1_stand where sta_smis='$db[smis]' and sta_reason<>'' ";
	$result1=mysql_query($sql1);
	$nrec=mysql_num_rows($result1);
	if (! empty($nrec)) { $ast="$nrec"; } else { $ast='-'; }
	echo "
		| $rw | 
		$db[sname] | 
		$ast | 
		
";
	$rw++; $trec+=$nrec;
	$nrec=0;
}
$tstd=number_format($tstd,0,'.',',');
echo "
	| รวม | 
	$trec | 
	
	

";
?>