<?php
/*********************************************************      
 程序说明：         
    功能说明：进行话务分析
    调用关系：调用:header.inc     
              被调用:      
    变量说明：
    返回值：无
	作者：    
      
修改注释：      
NO.1      
姓名：Lilong
时间：2004-7-26
修改说明：24:00(tomorrow 0:00)
*********************************************************/  
// 发送头信息
//Header( "Content-type: image/PNG");
require("../../inc/header.inc");
?>
<body leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('down');" onresize="javascript:adjust_frame('down');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">

<?
adjust_head_frame("down");
adjust_title_head_frame("down");
adjust_title_tail_frame("down");

adjust_content_head_frame("down");	
echo "<br>";

$DEBUG	= 0;

$db=$csta_db;
$time_column = "csta_datetime";

//<!--		0:00 ~ 23:00		-->
$showDate = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y")));
$showDate = omc_keep_length($showDate,0,2);
$table_name='smscDetail'."_".$showDate;
$title_time=date("Y-m-d", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y")));//表头显示时间
if($DEBUG)	echo "table_name=$table_name, db=$db<br>";
$sel_field_list= @mysql_list_fields($db,$table_name);
if($DEBUG)	echo "sel_field_list = $sel_field_list<br>";

//<!--		23:00 ~ 24:00		-->
$showDate1 = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y")));
$showDate1 = omc_keep_length($showDate1,0,2);
$table_name1 = "smscDetail_".$showDate1;
if($DEBUG)	echo "table_name1 = $table_name1<br>";
$sel_field_list1= @mysql_list_fields($db,$table_name1);
if($DEBUG)	echo "sel_field_list1 = $sel_field_list1<br>";

if ( (!$sel_field_list)&&(!$sel_field_list1) )
{
	echo "<br>$strNotFindRecord.";
	exit();
}

if($language == 'eng'){
	$strSmscStatistic = "SMSC statistics";
}else{
	$strSmscStatistic = "SMSC 话务统计";
}

//<!--				0:00 ~ 23:00				-->
//-------确定日期范围-----
if($sel_date<0){
	$bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-6,date("Y")));
	$end_date=date("Y-m-d H:i:s", mktime());
}
elseif($sel_date>0){
	$bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y")));
	$end_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d")-$sel_date+1,date("Y")));
}else{
	$bgn_date=date("Y-m-d H:i:s", mktime(0,0,0,date("m"),date("d"),date("Y")));
	$end_date=date("Y-m-d H:i:s", mktime());
}

/* where语句的时间限制组成部分为$w1,系统id限制为$w2 */
$w1=" $time_column >'$bgn_date' AND $time_column <= '$end_date'";
	
//合成where语句
$where=" WHERE ".$w1;   
$str_sql_all=" SELECT count(*) as number_of_records FROM $table_name ".$where;
if($DEBUG)	echo "str_sql_all=$str_sql_all<br>";
$csta_result= mysqli_query($pubConn,$str_sql_all);
$record = @mysql_fetch_object($csta_result);
$number_of_records = $record->number_of_records;
//echo "number_of_records = $number_of_records<br>";
if(!$number_of_records)
{      
	echo "$strNotFindRecord";
	exit();
}

if($sel_field_list){
	$sum_sql=" SELECT 
	SUM(MS_to_SMSC_attempt) AS MS_to_SMSC_attempt,
	SUM(MS_to_SMSC_success) AS MS_to_SMSC_success,
	SUM(MS_to_SMSC_sysfail) AS MS_to_SMSC_sysfail,
	SUM(MS_to_SMSC_userfail) AS MS_to_SMSC_userfail,
	SUM(MS_to_SMSC_smfail) AS MS_to_SMSC_smfail,
	SUM(MS_to_SMSC_byte) AS MS_to_SMSC_byte,

	SUM(SMSC_to_MS_attempt) AS SMSC_to_MS_attempt,
	SUM(SMSC_to_MS_success) AS SMSC_to_MS_success,
	SUM(SMSC_to_MS_sysfail) AS SMSC_to_MS_sysfail,
	SUM(SMSC_to_MS_userfail) AS SMSC_to_MS_userfail,
	SUM(SMSC_to_MS_smfail) AS SMSC_to_MS_smfail,
	SUM(SMSC_to_MS_byte) AS SMSC_to_MS_byte,

	SUM(VMS_to_SMSC_attempt) AS VMS_to_SMSC_attempt,
	SUM(VMS_to_SMSC_success) AS VMS_to_SMSC_success,
	SUM(VMS_to_SMSC_sysfail) AS VMS_to_SMSC_sysfail,
	SUM(VMS_to_SMSC_userfail) AS VMS_to_SMSC_userfail,
	SUM(VMS_to_SMSC_smfail) AS VMS_to_SMSC_smfail,
	SUM(VMS_to_SMSC_byte) AS VMS_to_SMSC_byte,

	SUM(SMSC_to_VMS_attempt) AS SMSC_to_VMS_attempt,
	SUM(SMSC_to_VMS_success) AS SMSC_to_VMS_success,
	SUM(SMSC_to_VMS_sysfail) AS SMSC_to_VMS_sysfail,
	SUM(SMSC_to_VMS_userfail) AS SMSC_to_VMS_userfail,
	SUM(SMSC_to_VMS_smfail) AS SMSC_to_VMS_smfail,
	SUM(SMSC_to_VMS_byte) AS SMSC_to_VMS_byte,

	SUM(PPS_to_SMSC_attempt) AS PPS_to_SMSC_attempt,
	SUM(PPS_to_SMSC_success) AS PPS_to_SMSC_success,
	SUM(PPS_to_SMSC_sysfail) AS PPS_to_SMSC_sysfail,
	SUM(PPS_to_SMSC_userfail) AS PPS_to_SMSC_userfail,
	SUM(PPS_to_SMSC_smfail) AS PPS_to_SMSC_smfail,
	SUM(PPS_to_SMSC_byte) AS PPS_to_SMSC_byte,

	SUM(SMSC_to_PPS_attempt) AS SMSC_to_PPS_attempt,
	SUM(SMSC_to_PPS_success) AS SMSC_to_PPS_success,
	SUM(SMSC_to_PPS_sysfail) AS SMSC_to_PPS_sysfail,
	SUM(SMSC_to_PPS_userfail) AS SMSC_to_PPS_userfail,
	SUM(SMSC_to_PPS_smfail) AS SMSC_to_PPS_smfail,
	SUM(SMSC_to_PPS_byte) AS SMSC_to_PPS_byte,

	SUM(SMPP_to_SMSC_attempt) AS SMPP_to_SMSC_attempt,
	SUM(SMPP_to_SMSC_success) AS SMPP_to_SMSC_success,
	SUM(SMPP_to_SMSC_sysfail) AS SMPP_to_SMSC_sysfail,
	SUM(SMPP_to_SMSC_userfail) AS SMPP_to_SMSC_userfail,
	SUM(SMPP_to_SMSC_smfail) AS SMPP_to_SMSC_smfail,
	SUM(SMPP_to_SMSC_byte) AS SMPP_to_SMSC_byte,

	SUM(SMSC_to_SMPP_attempt) AS SMSC_to_SMPP_attempt,
	SUM(SMSC_to_SMPP_success) AS SMSC_to_SMPP_success,
	SUM(SMSC_to_SMPP_sysfail) AS SMSC_to_SMPP_sysfail,
	SUM(SMSC_to_SMPP_userfail) AS SMSC_to_SMPP_userfail,
	SUM(SMSC_to_SMPP_smfail) AS SMSC_to_SMPP_smfail,
	SUM(SMSC_to_SMPP_byte) AS SMSC_to_SMPP_byte,

	SUM(SM_bgn) AS SM_bgn,
	SUM(SM_end) AS SM_end

	FROM $table_name ".$where;
	//echo "<br>sum_sql=$sum_sql";
	$sum_res = mysqli_query($pubConn,$sum_sql);
	$sum_row = @mysqli_fetch_array($sum_res);
	echo mysqli_error($pubConn);
}

//<!--				23:00 ~ 24:00				->
if($sel_field_list1){
	$where1 = " WHERE $time_column = '$end_date'";
	//echo "where1 = $where1<br>";
	$sum_sql1=" SELECT 
	SUM(MS_to_SMSC_attempt) AS MS_to_SMSC_attempt,
	SUM(MS_to_SMSC_success) AS MS_to_SMSC_success,
	SUM(MS_to_SMSC_sysfail) AS MS_to_SMSC_sysfail,
	SUM(MS_to_SMSC_userfail) AS MS_to_SMSC_userfail,
	SUM(MS_to_SMSC_smfail) AS MS_to_SMSC_smfail,
	SUM(MS_to_SMSC_byte) AS MS_to_SMSC_byte,

	SUM(SMSC_to_MS_attempt) AS SMSC_to_MS_attempt,
	SUM(SMSC_to_MS_success) AS SMSC_to_MS_success,
	SUM(SMSC_to_MS_sysfail) AS SMSC_to_MS_sysfail,
	SUM(SMSC_to_MS_userfail) AS SMSC_to_MS_userfail,
	SUM(SMSC_to_MS_smfail) AS SMSC_to_MS_smfail,
	SUM(SMSC_to_MS_byte) AS SMSC_to_MS_byte,

	SUM(VMS_to_SMSC_attempt) AS VMS_to_SMSC_attempt,
	SUM(VMS_to_SMSC_success) AS VMS_to_SMSC_success,
	SUM(VMS_to_SMSC_sysfail) AS VMS_to_SMSC_sysfail,
	SUM(VMS_to_SMSC_userfail) AS VMS_to_SMSC_userfail,
	SUM(VMS_to_SMSC_smfail) AS VMS_to_SMSC_smfail,
	SUM(VMS_to_SMSC_byte) AS VMS_to_SMSC_byte,

	SUM(SMSC_to_VMS_attempt) AS SMSC_to_VMS_attempt,
	SUM(SMSC_to_VMS_success) AS SMSC_to_VMS_success,
	SUM(SMSC_to_VMS_sysfail) AS SMSC_to_VMS_sysfail,
	SUM(SMSC_to_VMS_userfail) AS SMSC_to_VMS_userfail,
	SUM(SMSC_to_VMS_smfail) AS SMSC_to_VMS_smfail,
	SUM(SMSC_to_VMS_byte) AS SMSC_to_VMS_byte,

	SUM(PPS_to_SMSC_attempt) AS PPS_to_SMSC_attempt,
	SUM(PPS_to_SMSC_success) AS PPS_to_SMSC_success,
	SUM(PPS_to_SMSC_sysfail) AS PPS_to_SMSC_sysfail,
	SUM(PPS_to_SMSC_userfail) AS PPS_to_SMSC_userfail,
	SUM(PPS_to_SMSC_smfail) AS PPS_to_SMSC_smfail,
	SUM(PPS_to_SMSC_byte) AS PPS_to_SMSC_byte,

	SUM(SMSC_to_PPS_attempt) AS SMSC_to_PPS_attempt,
	SUM(SMSC_to_PPS_success) AS SMSC_to_PPS_success,
	SUM(SMSC_to_PPS_sysfail) AS SMSC_to_PPS_sysfail,
	SUM(SMSC_to_PPS_userfail) AS SMSC_to_PPS_userfail,
	SUM(SMSC_to_PPS_smfail) AS SMSC_to_PPS_smfail,
	SUM(SMSC_to_PPS_byte) AS SMSC_to_PPS_byte,

	SUM(SMPP_to_SMSC_attempt) AS SMPP_to_SMSC_attempt,
	SUM(SMPP_to_SMSC_success) AS SMPP_to_SMSC_success,
	SUM(SMPP_to_SMSC_sysfail) AS SMPP_to_SMSC_sysfail,
	SUM(SMPP_to_SMSC_userfail) AS SMPP_to_SMSC_userfail,
	SUM(SMPP_to_SMSC_smfail) AS SMPP_to_SMSC_smfail,
	SUM(SMPP_to_SMSC_byte) AS SMPP_to_SMSC_byte,

	SUM(SMSC_to_SMPP_attempt) AS SMSC_to_SMPP_attempt,
	SUM(SMSC_to_SMPP_success) AS SMSC_to_SMPP_success,
	SUM(SMSC_to_SMPP_sysfail) AS SMSC_to_SMPP_sysfail,
	SUM(SMSC_to_SMPP_userfail) AS SMSC_to_SMPP_userfail,
	SUM(SMSC_to_SMPP_smfail) AS SMSC_to_SMPP_smfail,
	SUM(SMSC_to_SMPP_byte) AS SMSC_to_SMPP_byte,

	SUM(SM_bgn) AS SM_bgn,
	SUM(SM_end) AS SM_end

	FROM $table_name1 ".$where1;
	//echo "<br>sum_sql1=$sum_sql1";
	$sum_res1 = mysqli_query($pubConn,$sum_sql1);
	$sum_row1 = @mysqli_fetch_array($sum_res1);
	echo mysqli_error($pubConn);
}

//service array
$arrSMSCSevice[0][0] = "Attempt"; 
$arrSMSCSevice[0][1] = "Success"; 
$arrSMSCSevice[0][2] = "Failure"; 
$arrSMSCSevice[0][3] = "MT failure"; 
$arrSMSCSevice[0][4] = "MO failure"; 
$arrSMSCSevice[0][5] = "Total bytes"; 
$arrSMSCSevice[0][6] = "Success percentage"; 

$arrSMSCSevice[1][0] = $sum_row[MS_to_SMSC_attempt] + $sum_row1[MS_to_SMSC_attempt]; 
$arrSMSCSevice[1][1] = $sum_row[MS_to_SMSC_success] + $sum_row1[MS_to_SMSC_success];  
$arrSMSCSevice[1][2] = $sum_row[MS_to_SMSC_sysfail] + $sum_row1[MS_to_SMSC_sysfail];  
$arrSMSCSevice[1][3] = $sum_row[MS_to_SMSC_userfail] + $sum_row1[MS_to_SMSC_userfail];  
$arrSMSCSevice[1][4] = $sum_row[MS_to_SMSC_smfail] + $sum_row1[MS_to_SMSC_smfail];  
$arrSMSCSevice[1][5] = $sum_row[MS_to_SMSC_byte] + $sum_row1[MS_to_SMSC_byte];  

if($arrSMSCSevice[1][0]){
	$arrSMSCSevice[1][6] = change_percent($arrSMSCSevice[1][1]/$arrSMSCSevice[1][0]);
}else{
	$arrSMSCSevice[1][6] = "0%";
}

$arrSMSCSevice[6][0] = $sum_row[SMSC_to_MS_attempt] + $sum_row1[SMSC_to_MS_attempt];  
$arrSMSCSevice[6][1] = $sum_row[SMSC_to_MS_success] + $sum_row1[SMSC_to_MS_success];  
$arrSMSCSevice[6][2] = $sum_row[SMSC_to_MS_sysfail] + $sum_row1[SMSC_to_MS_sysfail];  
$arrSMSCSevice[6][3] = $sum_row[SMSC_to_MS_userfail] + $sum_row1[SMSC_to_MS_userfail];  
$arrSMSCSevice[6][4] = $sum_row[SMSC_to_MS_smfail] + $sum_row1[SMSC_to_MS_smfail];
$arrSMSCSevice[6][5] = $sum_row[SMSC_to_MS_byte] + $sum_row1[SMSC_to_MS_byte];
if($arrSMSCSevice[6][0]){
	$arrSMSCSevice[6][6] = change_percent($arrSMSCSevice[6][1]/$arrSMSCSevice[6][0]);
}else{
	$arrSMSCSevice[6][6] = "0%";
}

$arrSMSCSevice[2][0] = $sum_row[VMS_to_SMSC_attempt] + $sum_row1[VMS_to_SMSC_attempt];  
$arrSMSCSevice[2][1] = $sum_row[VMS_to_SMSC_success] + $sum_row1[VMS_to_SMSC_success];  
$arrSMSCSevice[2][2] = $sum_row[VMS_to_SMSC_sysfail] + $sum_row1[VMS_to_SMSC_sysfail];  
$arrSMSCSevice[2][3] = $sum_row[VMS_to_SMSC_userfail] + $sum_row1[VMS_to_SMSC_userfail];  
$arrSMSCSevice[2][4] = $sum_row[VMS_to_SMSC_smfail] + $sum_row1[VMS_to_SMSC_smfail];  
$arrSMSCSevice[2][5] = $sum_row[VMS_to_SMSC_byte] + $sum_row1[VMS_to_SMSC_byte];  
if($arrSMSCSevice[2][0]){
	$arrSMSCSevice[2][6] = change_percent($arrSMSCSevice[2][1]/$arrSMSCSevice[2][0]);
}else{
	$arrSMSCSevice[2][6] = "0%";
}

$arrSMSCSevice[7][0] = $sum_row[SMSC_to_VMS_attempt] + $sum_row[SMSC_to_VMS_attempt];  
$arrSMSCSevice[7][1] = $sum_row[SMSC_to_VMS_success] + $sum_row[SMSC_to_VMS_success];  
$arrSMSCSevice[7][2] = $sum_row[SMSC_to_VMS_sysfail] + $sum_row[SMSC_to_VMS_sysfail];  
$arrSMSCSevice[7][3] = $sum_row[SMSC_to_VMS_userfail] + $sum_row[SMSC_to_VMS_userfail];  
$arrSMSCSevice[7][4] = $sum_row[SMSC_to_VMS_smfail] + $sum_row[SMSC_to_VMS_smfail];  
$arrSMSCSevice[7][5] = $sum_row[SMSC_to_VMS_byte] + $sum_row[SMSC_to_VMS_byte];  

if($arrSMSCSevice[7][0]){
	$arrSMSCSevice[7][6] = change_percent($arrSMSCSevice[7][1]/$arrSMSCSevice[7][0]);
}else{
	$arrSMSCSevice[7][6] = "0%";
}

$arrSMSCSevice[3][0] = $sum_row[PPS_to_SMSC_attempt] + $sum_row1[PPS_to_SMSC_attempt];  
$arrSMSCSevice[3][1] = $sum_row[PPS_to_SMSC_success] + $sum_row1[PPS_to_SMSC_success];  
$arrSMSCSevice[3][2] = $sum_row[PPS_to_SMSC_sysfail] + $sum_row1[PPS_to_SMSC_sysfail];  
$arrSMSCSevice[3][3] = $sum_row[PPS_to_SMSC_userfail] + $sum_row1[PPS_to_SMSC_userfail];  
$arrSMSCSevice[3][4] = $sum_row[PPS_to_SMSC_smfail] + $sum_row1[PPS_to_SMSC_smfail];  
$arrSMSCSevice[3][5] = $sum_row[PPS_to_SMSC_byte] + $sum_row1[PPS_to_SMSC_byte];  
if($arrSMSCSevice[3][0]){
	$arrSMSCSevice[3][6] = change_percent($arrSMSCSevice[3][1]/$arrSMSCSevice[3][0]);
}else{
	$arrSMSCSevice[3][6] = "0%";
}

$arrSMSCSevice[8][0] = $sum_row[SMSC_to_PPS_attempt] + $sum_row1[SMSC_to_PPS_attempt];  
$arrSMSCSevice[8][1] = $sum_row[SMSC_to_PPS_success] + $sum_row1[SMSC_to_PPS_success];  
$arrSMSCSevice[8][2] = $sum_row[SMSC_to_PPS_sysfail] + $sum_row1[SMSC_to_PPS_sysfail];  
$arrSMSCSevice[8][3] = $sum_row[SMSC_to_PPS_userfail] + $sum_row1[SMSC_to_PPS_userfail];  
$arrSMSCSevice[8][4] = $sum_row[SMSC_to_PPS_smfail] + $sum_row1[SMSC_to_PPS_smfail];  
$arrSMSCSevice[8][5] = $sum_row[SMSC_to_PPS_byte] + $sum_row1[SMSC_to_PPS_byte];  

if($arrSMSCSevice[8][0]){
	$arrSMSCSevice[8][6] = change_percent($arrSMSCSevice[8][1]/$arrSMSCSevice[8][0]);
}else{
	$arrSMSCSevice[8][6] = "0%";
}

$arrSMSCSevice[4][0] = $sum_row[SMPP_to_SMSC_attempt] + $sum_row1[SMPP_to_SMSC_attempt];  
$arrSMSCSevice[4][1] = $sum_row[SMPP_to_SMSC_success] + $sum_row1[SMPP_to_SMSC_success];  
$arrSMSCSevice[4][2] = $sum_row[SMPP_to_SMSC_sysfail] + $sum_row1[SMPP_to_SMSC_sysfail];  
$arrSMSCSevice[4][3] = $sum_row[SMPP_to_SMSC_userfail] + $sum_row1[SMPP_to_SMSC_userfail];  
$arrSMSCSevice[4][4] = $sum_row[SMPP_to_SMSC_smfail] + $sum_row1[SMPP_to_SMSC_smfail];  
$arrSMSCSevice[4][5] = $sum_row[SMPP_to_SMSC_byte] + $sum_row1[SMPP_to_SMSC_byte];  
if($arrSMSCSevice[4][0]){
	$arrSMSCSevice[4][6] = change_percent($arrSMSCSevice[4][1]/$arrSMSCSevice[4][0]);
}else{
	$arrSMSCSevice[4][6] = "0%";
}

$arrSMSCSevice[9][0] = $sum_row[SMSC_to_SMPP_attempt] + $sum_row1[SMSC_to_SMPP_attempt];  
$arrSMSCSevice[9][1] = $sum_row[SMSC_to_SMPP_success] + $sum_row1[SMSC_to_SMPP_success];  
$arrSMSCSevice[9][2] = $sum_row[SMSC_to_SMPP_sysfail] + $sum_row1[SMSC_to_SMPP_sysfail];  
$arrSMSCSevice[9][3] = $sum_row[SMSC_to_SMPP_userfail] + $sum_row1[SMSC_to_SMPP_userfail];  
$arrSMSCSevice[9][4] = $sum_row[SMSC_to_SMPP_smfail] + $sum_row1[SMSC_to_SMPP_smfail]; 
$arrSMSCSevice[9][5] = $sum_row[SMSC_to_SMPP_byte] + $sum_row1[SMSC_to_SMPP_byte];
if($arrSMSCSevice[9][0]){
	$arrSMSCSevice[9][6] = change_percent($arrSMSCSevice[9][1]/$arrSMSCSevice[9][0]);
}else{
	$arrSMSCSevice[9][6] = "0%";
}

for($i=0;$i<6;$i++){
	for($j=1;$j<5;$j++){
		$arrSMSCSevice[5][$i] += $arrSMSCSevice[$j][$i];
	}
	//echo "<br>arrSMSCSevice[5][$i]={$arrSMSCSevice[5][$i]}";
}
if($arrSMSCSevice[5][0]){
	$arrSMSCSevice[5][6] = change_percent($arrSMSCSevice[5][1]/$arrSMSCSevice[5][0]);
}else{
	$arrSMSCSevice[5][6] = "0%";
}

for($i=0;$i<6;$i++){
	for($j=6;$j<10;$j++){
		$arrSMSCSevice[10][$i] += $arrSMSCSevice[$j][$i];
	}
	//echo "<br>arrSMSCSevice[10][$i]={$arrSMSCSevice[10][$i]}";
}
if($arrSMSCSevice[10][0]){
	$arrSMSCSevice[10][6] = change_percent($arrSMSCSevice[10][1]/$arrSMSCSevice[10][0]);
}else{
	$arrSMSCSevice[10][6] = "0%";
}

$clrSql = " SELECT SUM(SM_bgn) AS SM_bgn, SUM(SM_end) AS SM_end, csta_datetime FROM $table_name GROUP BY csta_datetime ";
$clrRes = @mysqli_query($pubConn,$clrSql);
$clrRow = @mysqli_fetch_array($clrRes);
echo mysqli_error($pubConn);
$i = 0;
do{
	if(!$i)
		$SM_bgn = $clrRow[SM_bgn];
		

	$SM_end = $clrRow[SM_end];
	$i++;
}while($clrRow = @mysqli_fetch_array($clrRes));
$SM_clr = $SM_end - $SM_bgn;
?>


<table border="0" width="100%">
<tr>
<td width="25%">
</td>
<td width="50%">
<p align="center"><b><?php echo "$strSmscStatistic"; ?></b><b>&nbsp;   
Date:<?php echo $title_time; ?></b>
</td>

<td width="20%" align="right">      
<div onClick="window.print();" style="cursor:hand">
<img align=absBottom border=0 src="../../images/printer.gif" width="16" height="16">
</div>
</td>
<!--
<td width="5%" align="center">
<div onClick="javascript:document.selectform.submit();" style="cursor:hand">
<img align=absBottom border=0 src="../../images/save.gif" width="16" height="16">	
</div>
</td>
-->
</tr>      
</table> 
<?php
echo "<table border=\"1\" width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";  
echo "<tr bgcolor=\"#E6E6E6\" align=\"center\">";
echo "<td rowspan=\"2\">&nbsp;</td>";
echo "<td colspan=\"5\">To SMSC</td>";
echo "<td colspan=\"5\">SMSC to</td>";
echo "</tr>";
echo "<tr bgcolor=\"#E6E6E6\" align=\"center\">";
echo "<td>MS</td>";
echo "<td>VMS</td>";
echo "<td>PPS</td>";
echo "<td>SMPP</td>";
echo "<td>Total</td>";
echo "<td>MS</td>";
echo "<td>VMS</td>";
echo "<td>PPS</td>";
echo "<td>SMPP</td>";
echo "<td>Total</td>";
echo "</tr>";

for($i=0;$i<7;$i++)
{
	if ((3==$i)||(4==$i))	continue;
	echo "<tr>";
	for($j=0;$j<11;$j++)
	{
		echo "<td>{$arrSMSCSevice[$j][$i]}</td>";
	}
	echo "</tr>";
}
echo "</table>";
echo "<P></P>";

echo "<table border=\"0\">";
echo "<tr>";
echo "<td width=\"10\"><nobr>Pending SM statistic at beginning:</nobr></td>";
echo "<td><b>$SM_bgn</b></td>";
echo "</tr>";
echo "<tr>";
echo "<td width=\"10\"><nobr>Pending SM statistic at ending:</nobr></td>";
echo "<td><b>$SM_end</b></td>";
echo "</tr>";
/*
echo "<tr>";
echo "<td width=\"10\"><nobr>SM cleared during statistic perio:</nobr></td>";
echo "<td><b>$SM_clr</b></td>";
echo "</tr>";
*/
echo "</table>";
echo "<BR>";
?>
</body>
<?PHP

require("./drawGraphic.php");
adjust_content_tail("down");
?>
</html>
