<?php
/*********************************************************      
 程序说明：         
    功能说明：统计呼出合乎入计费号码信息
    调用关系：调用:header.inc   
              被调用:        
    变量说明
作者:崔体存    2004-04-15 
修改注释：      

NO.1      
姓名：         
时间： 
修改说明：     
*********************************************************/
require("../../inc/header.inc");
$DEBUG = 0;
$db='PPS_DB';
$strThisPage=$strTitleConfiguration.$strTitleSpace."PPS".$strTitleSpace.$strCurrentTariff.$strTitleSpace.$strBasicTariff;

$tableName='mo_tariff';
for($i=0;$i<16;$i++){
	$selSql = "SELECT count(*) 
	                   FROM $tableName 
					   WHERE tariff_id='$i'";
	if($DEBUG) echo "<br>selSql=$selSql";
	$result=@mysqli_query($pubConn,$selSql);
	echo mysqli_error($pubConn);
	$record = @mysqli_fetch_array($result);
	$nMoAmount[$i] = $record[0];
	if($DEBUG) echo "<br>$nMoAmount=$nMoAmount";
}

$tableName='mt_tariff';
for($i=0;$i<8;$i++){
	$selSql = "SELECT count(*) 
	                   FROM $tableName	 
					   WHERE tariff_id='$i'";
	if($DEBUG) echo "<br>selSql=$selSql";
	$result=@mysqli_query($pubConn,$selSql);
	echo mysqli_error($pubConn);
	$record = @mysqli_fetch_array($result);
	$nMtAmount[$i] = $record[0];
	if($DEBUG) echo "<br>$nMtAmount=$nMtAmount";
}

//display
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "$strThisPage";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<b><font size=3><p align=center>Basic tariff statistics</p></font></b>";
echo "<TABLE  border=1 width=100% cellpadding=2 cellspacing=0 bordercolor=#666666 bordercolordark=#FFFFFF bgcolor=#FFFFFF>";
echo "<TR>";
echo "<TD width=25% bgcolor=#E6E6E6>MO tariff ID</TD>";
echo "<TD width=25% bgcolor=#E6E6E6>Total record</TD>";
echo "<TD width=25% bgcolor=#E6E6E6>Mt tariff ID</TD>";
echo "<TD width=25% bgcolor=#E6E6E6>Total record</TD>";
echo "</TR>";

for($i=0;$i<8;$i++){
	echo "<TR>";
	echo "<TD width=25% bgcolor=#E6E6E6>$i</TD>";
	echo "<TD align=center>$nMoAmount[$i]</TD>";
	echo "<TD width=25% bgcolor=#E6E6E6>$i</TD>";
	echo "<TD align=center>$nMtAmount[$i]</TD>";
	echo "</TR>";
}
for($i=8;$i<16;$i++){
	echo "<TR>";
	echo "<TD width=25% bgcolor=#E6E6E6>$i</TD>";
	echo "<TD align=center>$nMoAmount[$i]</TD>";
	echo "<TD width=25% bgcolor=#E6E6E6>--</TD>";
	echo "<TD align=center>--</TD>";
	echo "</TR>";
}
?>
<table  width="400">     
    <tr>     
     <td> 
	   <input type="button" name="return" value="Return" onclick=jacascript:location.href="./baseTariffList.php" class="button">&nbsp;
     </td>         
   </tr>           
</table>
