init web ems all
This commit is contained in:
1935
wxc2_omc/performance/mscCsta/bhca.php
Executable file
1935
wxc2_omc/performance/mscCsta/bhca.php
Executable file
File diff suppressed because it is too large
Load Diff
354
wxc2_omc/performance/mscCsta/dataDown.php
Executable file
354
wxc2_omc/performance/mscCsta/dataDown.php
Executable file
@@ -0,0 +1,354 @@
|
||||
<?php
|
||||
/*********************************************************
|
||||
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
|
||||
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD>Ļ<EFBFBD><C4BB><EFBFBD>
|
||||
|
||||
<20><><EFBFBD>ù<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: header.inc
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||
|
||||
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
|
||||
|
||||
<20><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>
|
||||
|
||||
<20><><EFBFBD>ߣ<EFBFBD><DFA3><EFBFBD><EFBFBD><EFBFBD>ɭ 2002-05-29
|
||||
|
||||
<EFBFBD><EFBFBD>ע<EFBFBD>ͣ<EFBFBD>
|
||||
NO.1
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ʱ<EFBFBD>䣺
|
||||
<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*********************************************************/
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
<base target="_self">
|
||||
<body leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('down');" onresize="javascript:adjust_frame('down');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
|
||||
|
||||
<?php
|
||||
adjust_head_frame("down");
|
||||
adjust_title_head_frame("down");
|
||||
adjust_title_tail_frame("down");
|
||||
|
||||
adjust_content_head_frame("down");
|
||||
echo "<br>";
|
||||
|
||||
$DEBUG=0;
|
||||
|
||||
$showDate = date("d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y")));
|
||||
$timeItem = date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date,date("Y")));
|
||||
$showDate = omc_keep_length($showDate,0,2);
|
||||
$db = $csta_db;
|
||||
$sort_field = 'csta_datetime'; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD>
|
||||
$sort_direction = 'DESC'; //<2F><><EFBFBD><EFBFBD>˳<EFBFBD><CBB3>
|
||||
$number_records_to_display = 200; //ÿҳ<C3BF><D2B3>¼<EFBFBD><C2BC>
|
||||
$time_column = "csta_datetime"; //ʱ<><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
$sysType = isset($sysType)?$sysType:$DEFAULT_SYS; //<2F>豸<EFBFBD><E8B1B8>
|
||||
$csta_type = isset($csta_type)?$csta_type:'csta-h';
|
||||
$table_name = omc_table_name($sysType,$csta_type); //ȡ<><C8A1><EFBFBD><EFBFBD><EFBFBD>ݿ<EFBFBD><DDBF><EFBFBD>
|
||||
if($sysType == 'CNF' || $sysType == 'VPS'){
|
||||
$table_name="vpsDetail";
|
||||
}
|
||||
$table_name = $table_name."_".$showDate;
|
||||
$query_type = isset($query_type)?$query_type:'0'; //ȡ<>ò<EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>
|
||||
$where = isset($where) ? urldecode($where) : ''; //<2F><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>url<72><6C>
|
||||
$where = isset($where) ? stripslashes($where) : ''; //<2F><><EFBFBD><EFBFBD>һЩ'/'
|
||||
|
||||
$sysIdFiled="key_sys_id";
|
||||
$subsysIdFiled="key_subsys_id";
|
||||
//echo "$table_name<br>";
|
||||
$sel_field_list= @mysql_list_fields($db,$table_name);
|
||||
if(!$sel_field_list)
|
||||
{
|
||||
echo "<br>$strNotFindRecord.";
|
||||
exit();
|
||||
}
|
||||
|
||||
//ɾ<><C9BE><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if($delete)
|
||||
{
|
||||
$sql_query="DELETE FROM $table_name ".$where;
|
||||
$sql_query=urlencode($sql_query); //<2F><><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룬<EFBFBD>ʺϴ<CABA><CFB4><EFBFBD>
|
||||
echo " <meta http-equiv=\"refresh\" content=\"0; url=./csta_del.php?del_sql=$sql_query\"> ";
|
||||
}//endif($delete)
|
||||
|
||||
//<2F><>ת<EFBFBD><D7AA>ָ<EFBFBD><D6B8>ҳ<EFBFBD><D2B3>
|
||||
if($go)
|
||||
{
|
||||
$initial_record = $number_records_to_display * ( $gotopage - 1 );
|
||||
if($initial_record >= $number_of_records || $initial_record < 0)
|
||||
{
|
||||
echo "<script language=\"javascript\"> ";
|
||||
echo "alert('";
|
||||
echo $strInputPageNumberHasAMistake;
|
||||
echo "'); ";
|
||||
echo "</script>";
|
||||
$initial_record = 0;
|
||||
}
|
||||
}//endif($go)
|
||||
|
||||
// <20><>ʼ<EFBFBD><CABC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
if (!$number_of_records)
|
||||
{
|
||||
//<2F><>תҳ<D7AA>治<EFBFBD><E6B2BB><EFBFBD>г<EFBFBD>ʼ<EFBFBD><CABC>
|
||||
//-------ȷ<><C8B7><EFBFBD><EFBFBD><EFBFBD>ڷ<EFBFBD>Χ-----
|
||||
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){
|
||||
if($sel_time){
|
||||
$bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y")));
|
||||
$end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,date("Y")));
|
||||
}else{
|
||||
$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{
|
||||
if($sel_time){
|
||||
$bgn_date=date("Y-m-d H:i:s", mktime($hou_1,$mid_1,$sec_1,date("m"),date("d")-$sel_date,date("Y")));
|
||||
$end_date=date("Y-m-d H:i:s", mktime($hou_2,$mid_2,$sec_2,date("m"),date("d")-$sel_date,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<72><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲ<EFBFBD><C9B2><EFBFBD>$w0
|
||||
$w0=" key_type<17 ";
|
||||
|
||||
//where<72><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲ<EFBFBD><C9B2><EFBFBD>$w1
|
||||
$w1=" AND $time_column > '$bgn_date' AND $time_column <= '$end_date'";
|
||||
|
||||
//where<72><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳid<69><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲ<EFBFBD><C9B2><EFBFBD>$w2
|
||||
if($sys_num!='-1' && $sys_num!=''){
|
||||
$w2=" AND $sysIdFiled=$sys_num";
|
||||
}
|
||||
|
||||
//where<72><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ϵͳid<69><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲ<EFBFBD><C9B2><EFBFBD>$w3
|
||||
if($subsys_num!='-1' && $subsys_num!=''){
|
||||
$w3=" AND $subsysIdFiled=$subsys_num";
|
||||
}
|
||||
|
||||
//where<72><65><EFBFBD><EFBFBD><EFBFBD><EFBFBD>E1id<69><64><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲ<EFBFBD><C9B2><EFBFBD>$w4
|
||||
if($e1_num!='-1' && $e1_num!='' && $query_type<5 && $query_type>0){
|
||||
$w4=" AND key_e1_tg=$e1_num";
|
||||
}
|
||||
|
||||
//where<72><65><EFBFBD><EFBFBD><EFBFBD>ĺ<EFBFBD><C4BA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ɲ<EFBFBD><C9B2><EFBFBD>$w5
|
||||
if($query_type>0)
|
||||
{
|
||||
$w5=" AND key_type=$query_type ";
|
||||
}
|
||||
|
||||
if($sysType == 'VPS'){
|
||||
$w6=" AND key_type=1 ";
|
||||
}elseif($sysType == 'CNF'){
|
||||
$w6=" AND key_type=2 ";
|
||||
|
||||
}
|
||||
//<2F>ϳɲ<CFB3>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>$where
|
||||
$where=" WHERE ".$w0.$w1.$w2.$w3.$w4.$w5.$w6;
|
||||
//echo "$where<br>";
|
||||
|
||||
$initial_record = 0;//<2F><>ʼ<EFBFBD><CABC>¼<EFBFBD><C2BC>
|
||||
|
||||
$str_sql_all="SELECT count(*) as number_of_records FROM $table_name ".$where;
|
||||
if ($DEBUG) echo "<br>str_sql_all=$str_sql_all";
|
||||
$csta_result= mysqli_query($pubConn,$str_sql_all);
|
||||
$record = mysql_fetch_object($csta_result);
|
||||
$number_of_records = $record->number_of_records;
|
||||
if(!$number_of_records)
|
||||
{
|
||||
echo $strNotFindRecord;
|
||||
exit();
|
||||
} //endif(!$number_of_records)
|
||||
}//endif(!$number_of_records)
|
||||
|
||||
$page_num= ($initial_record / $number_records_to_display) +1; //<2F><>ҳҳ<D2B3><D2B3>
|
||||
$all_page_num= ceil($number_of_records / $number_records_to_display); //<2F><>ҳ<EFBFBD><D2B3>
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>־
|
||||
if($page_num <=1)
|
||||
{
|
||||
insertLog("CSTA data query",2,1);
|
||||
}
|
||||
//<2F><><EFBFBD><EFBFBD><EFBFBD>ǿ<EFBFBD><C7BF>Ʒ<EFBFBD>ҳ<EFBFBD><D2B3>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>ݱ<EFBFBD><DDB1><EFBFBD>
|
||||
if ($number_of_records >= 1)
|
||||
{
|
||||
$next_index = $initial_record + $number_records_to_display; //<2F><>ҳ<EFBFBD>Ľ<EFBFBD><C4BD><EFBFBD><EFBFBD><EFBFBD>Ŀ
|
||||
if ($next_index > $number_of_records)
|
||||
{
|
||||
$next_index = $number_of_records;
|
||||
}
|
||||
$t1 = $initial_record + 1;
|
||||
$prev_index = $initial_record - $number_records_to_display;
|
||||
if($prev_index < 0)
|
||||
{
|
||||
$prev_index = 0;
|
||||
}
|
||||
}
|
||||
$show_initial_record=$initial_record+1;
|
||||
?>
|
||||
|
||||
<script LANGUAGE="JavaScript">
|
||||
function goto(){
|
||||
var url_1,url_2,url_3,url_4,url_5,initial_record,gotopage,number_records_to_display,where,number_of_records,sort_field,sel_date;
|
||||
gotopage=document.selectform.gotopage.value;
|
||||
number_records_to_display=<?php echo $number_records_to_display; ?>;
|
||||
where=document.selectform.where.value;
|
||||
initial_record=number_records_to_display*(gotopage-1);
|
||||
number_of_records=document.selectform.number_of_records.value;
|
||||
sort_field=document.selectform.sort_field.value;
|
||||
sel_date=document.selectform.sel_date.value;
|
||||
url_1='<?php echo $PHP_SELF;?>?initial_record='+initial_record;
|
||||
url_2="&where="+where;
|
||||
url_3="&number_of_records="+number_of_records;
|
||||
url_4="&sort_field="+sort_field;
|
||||
url_5="&sel_date="+sel_date;
|
||||
window.location.href=url_1+url_2+url_3+url_4+url_5;
|
||||
}
|
||||
</script>
|
||||
|
||||
<table border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF">
|
||||
<tr>
|
||||
<td width="50%">
|
||||
<?php
|
||||
echo "$strDisplayRecords:<FONT color=#0000ff> $show_initial_record - $next_index</FONT>, ($strTotalRecords:$number_of_records ) ";
|
||||
?>
|
||||
</td>
|
||||
<td width="10%" align="center">
|
||||
<?php
|
||||
// NEW: Display a link for the previous set of records.
|
||||
if ($initial_record != 0)
|
||||
{
|
||||
$t1 = "initial_record=$prev_index&number_of_records=$number_of_records&sys_id=$sys_id&sysType=$sysType&csta_type=$csta_type&query_type=$query_type";
|
||||
$where=urlencode($where); //<2F><><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룬<EFBFBD>ʺϴ<CABA><CFB4><EFBFBD>
|
||||
echo "<a href=\"$PHP_SELF?$t1&where=$where&end_date=$end_date&bgn_date=$bgn_date&sel_date=$sel_date\">";
|
||||
echo "<IMG alt=\"$strPreviousPage\" src=\"../../images/pre_page.gif\" border=\"0\"></a> ";
|
||||
}
|
||||
|
||||
|
||||
// NEW: Display a link for the next set of records.
|
||||
if ($next_index != $number_of_records && $number_of_records >0 && $number_of_records > $number_records_to_display )
|
||||
{
|
||||
$t1 = "initial_record=$next_index&number_of_records=$number_of_records&sys_id=$sys_id&sysType=$sysType&csta_type=$csta_type&query_type=$query_type";
|
||||
$where=urlencode($where); //<2F><><EFBFBD><EFBFBD><EFBFBD>ַ<EFBFBD><D6B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD>룬<EFBFBD>ʺϴ<CABA><CFB4><EFBFBD>
|
||||
echo "<a href=\"$PHP_SELF?$t1&where=$where&end_date=$end_date&bgn_date=$bgn_date&sel_date=$sel_date\">";
|
||||
echo "<IMG alt=\"$strNextPage\" src=\"../../images/next_page.gif\" border=\"0\"></a>";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
||||
<form name="selectform" method="post" action="<?php echo "$PHP_SELF?initial_record=$prev_index&number_of_records=$number_of_records&where=$where&sys_id=$sys_id&sysType=$sysType&csta_type=$csta_type&query_type=$query_type";?>" >
|
||||
<td width="20%" align="center"><?php echo $strTopage;?>
|
||||
<select size="1" name="gotopage" onChange="javascript:goto()">
|
||||
<?php
|
||||
for($i=1;$i<=$all_page_num;$i++)
|
||||
{
|
||||
if($i== $page_num ){
|
||||
echo "<option selected value=\"$i\" >$i</option>";
|
||||
}else{
|
||||
echo "<option value=\"$i\">$i</option>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<!--
|
||||
<td width="10%" align="center"><input type="submit" value="<?php echo $strDeleteQueryResult;?>" name="delete" ></td>
|
||||
-->
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<?php
|
||||
$where = isset($where) ? urldecode($where) : ''; //<2F><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>url<72><6C>
|
||||
$where = isset($where) ? urldecode($where) : ''; //<2F><><EFBFBD>ر<EFBFBD><D8B1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>url<72><6C>
|
||||
$where = isset($where) ? stripslashes($where) : ''; //<2F><><EFBFBD><EFBFBD>һЩ'/'
|
||||
|
||||
//<2F><>ѯ<EFBFBD><D1AF><EFBFBD>ݲ<EFBFBD><DDB2><EFBFBD><EFBFBD><EFBFBD>myrows<77><73><EFBFBD><EFBFBD><EFBFBD>С<EFBFBD>
|
||||
|
||||
//<2F>ϳ<EFBFBD>sql<71><6C><EFBFBD><EFBFBD>
|
||||
$order=" ORDER BY $sort_field $sort_direction";
|
||||
$limit=" LIMIT $initial_record, $number_records_to_display";
|
||||
|
||||
$csta_sql="SELECT * FROM $table_name"."\n".$where.$order.$limit;
|
||||
//echo "$csta_sql<br>";
|
||||
$csta_result = mysqli_query($pubConn,$csta_sql);
|
||||
$csta_rows = mysqli_fetch_array($csta_result);
|
||||
|
||||
?>
|
||||
<table border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
|
||||
<tr bgcolor="#E6E6E6">
|
||||
<td colspan="3" align="center" ><?php echo $strEquipment; ?>
|
||||
</td>
|
||||
<td colspan="9" align="center" >
|
||||
<?php
|
||||
echo "{$defineQueryType[$query_type][name]}";
|
||||
?>
|
||||
</td>
|
||||
<td align="center" > </td>
|
||||
</tr>
|
||||
<tr bgcolor="#E6E6E6">
|
||||
<td align="center"><?php echo $strSystem; ?></td>
|
||||
<td align="center"><?php echo $strType; ?></td>
|
||||
<td align="center">TG</td>
|
||||
<td align="center"><?php echo "Attempt"; ?></td>
|
||||
<td align="center"><?php echo "Success"; ?></td>
|
||||
<td align="center"><?php echo "Call Deny"; ?></td>
|
||||
<td align="center"><?php echo "Net Busy"; ?></td>
|
||||
<td align="center"><?php echo "Caller clear"; ?></td>
|
||||
<td align="center"><?php echo "Sub Busy"; ?></td>
|
||||
<td align="center"><?php echo "No Answer"; ?></td>
|
||||
<td align="center"><?php echo "Signal Error"; ?></td>
|
||||
<td align="center"><?php echo "Total Call Duration"; ?></td>
|
||||
<td align="center"><?php echo "$strTime($timeItem)"; ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
do{
|
||||
?>
|
||||
<tr>
|
||||
<td align="center"><?php
|
||||
$csta_rows[0]=$csta_rows[$sysIdFiled];
|
||||
$csta_rows[1]=$csta_rows[$subsysIdFiled];
|
||||
echo "$sysType"."_"."$csta_rows[0]_$csta_rows[1]";?></td>
|
||||
<td align="center">
|
||||
<?php
|
||||
echo $csta_rows[2];
|
||||
?>
|
||||
</td>
|
||||
<td align="center">
|
||||
<?php
|
||||
if($sysType==$DEFAULT_SYS){
|
||||
echo $csta_rows[3];
|
||||
}else{
|
||||
echo "--";
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
<td align="center"><?php echo "$csta_rows[Attempt]";?></td>
|
||||
<td align="center"><?php echo "$csta_rows[Success]";?></td>
|
||||
<td align="center"><?php echo "$csta_rows[CallDeny]";?></td>
|
||||
<td align="center"><?php echo "$csta_rows[NetBusy]";?></td>
|
||||
<td align="center"><?php echo "$csta_rows[CallerClear]";?></td>
|
||||
<td align="center"><?php echo "$csta_rows[SubBusy]";?></td>
|
||||
<td align="center"><?php echo "$csta_rows[NoAnswer]";?></td>
|
||||
<td align="center"><?php echo "$csta_rows[SignalErr]";?></td>
|
||||
<td align="center"><?php echo "$csta_rows[Duration]";?></td>
|
||||
<td align="center">
|
||||
<?php
|
||||
$tmpArray = explode(" ",$csta_rows[csta_datetime]);
|
||||
echo "$tmpArray[1] ";
|
||||
?>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}while($csta_rows= mysqli_fetch_array($csta_result));
|
||||
?>
|
||||
<input type="hidden" name="where" value="<?php echo $where; ?>">
|
||||
<input type="hidden" name="number_of_records" value="<?php echo $number_of_records; ?>">
|
||||
<input type="hidden" name="sort_field" value="<?php echo $sort_field; ?>">
|
||||
<input type="hidden" name="sel_date" value="<?php echo $sel_date; ?>">
|
||||
</form>
|
||||
</table>
|
||||
<?php
|
||||
adjust_content_tail("down");
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
17
wxc2_omc/performance/mscCsta/dataIndex.php
Executable file
17
wxc2_omc/performance/mscCsta/dataIndex.php
Executable file
@@ -0,0 +1,17 @@
|
||||
<?php
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
|
||||
<frameset framespacing="0" border="0" rows="75,*" frameborder="0">
|
||||
<frame name="header" scrolling="no" noresize target="main" src="dataUp.php?sysType=<?php echo $sysType; ?>">
|
||||
<frame name="main" src="dataDown.php?sysType=<?php echo $sysType; ?>" scrolling="auto" target="_self">
|
||||
<noframes>
|
||||
<body>
|
||||
|
||||
<p><3E><><EFBFBD><EFBFBD>ҳʹ<D2B3><CAB9><EFBFBD>˿<EFBFBD><CBBF>ܣ<EFBFBD><DCA3><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>֧<EFBFBD>ֿ<EFBFBD><D6BF>ܡ<EFBFBD></p>
|
||||
|
||||
</body>
|
||||
</noframes>
|
||||
</frameset>
|
||||
|
||||
</html>
|
||||
147
wxc2_omc/performance/mscCsta/dataUp.php
Executable file
147
wxc2_omc/performance/mscCsta/dataUp.php
Executable file
@@ -0,0 +1,147 @@
|
||||
<?php
|
||||
/*********************************************************
|
||||
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
|
||||
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ѯ<EFBFBD><D1AF><EFBFBD><EFBFBD>ѡ<EFBFBD><D1A1>
|
||||
|
||||
<20><><EFBFBD>ù<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: header.inc
|
||||
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
|
||||
|
||||
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
|
||||
|
||||
<20><><EFBFBD><EFBFBD>ֵ<EFBFBD><D6B5><EFBFBD><EFBFBD>
|
||||
|
||||
<20><><EFBFBD>ߣ<EFBFBD><DFA3><EFBFBD><EFBFBD><EFBFBD>ɭ 2002-05-29
|
||||
|
||||
<EFBFBD><EFBFBD>ע<EFBFBD>ͣ<EFBFBD>
|
||||
NO.1
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ʱ<EFBFBD>䣺
|
||||
<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
|
||||
NO.2
|
||||
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
ʱ<EFBFBD>䣺
|
||||
<EFBFBD><EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
*********************************************************/
|
||||
require("../../inc/header.inc");
|
||||
$helpId = "3.2.1";
|
||||
|
||||
$device_name=isset($device_name)?$device_name:$DEFAULT_SYS;
|
||||
$db=$omc_db;
|
||||
?>
|
||||
|
||||
<base target="main">
|
||||
|
||||
<script language="javascript">
|
||||
<!--
|
||||
function display(){
|
||||
if(document.selectform.sel_time.checked){
|
||||
document.all["set_time"].style.visibility="visible";
|
||||
}else{
|
||||
document.all["set_time"].style.visibility="hidden";
|
||||
}
|
||||
}
|
||||
|
||||
function select_device(){
|
||||
var base_url,url_add,url;
|
||||
base_url='<?php echo"$PHP_SELF";?>?device_name=';
|
||||
url_add=document.selectform.device_list.value;
|
||||
url=base_url+url_add;
|
||||
window.location=url;
|
||||
}
|
||||
//-->
|
||||
</script>
|
||||
|
||||
|
||||
<body leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('up');" onresize="javascript:adjust_frame('up');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
|
||||
<form method="post" name="selectform" id="selectform" action="dataDown.php" >
|
||||
<?php
|
||||
adjust_head_frame("up");
|
||||
adjust_title_head_frame("up");
|
||||
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
|
||||
echo "<tr>";
|
||||
echo "<td width=\"40%\" align=\"left\">";
|
||||
echo "$strAdvanced > $strTitlePerformance > $sysType > $strData";
|
||||
echo "</td>";
|
||||
echo "<td width=\"60%\" align=\"right\" title=\"Help\">";
|
||||
//showHelp($helpId);
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td align=\"left\">";
|
||||
|
||||
$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")));
|
||||
$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y")));
|
||||
$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y")));
|
||||
$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y")));
|
||||
$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y")));
|
||||
$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y")));
|
||||
$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y")));
|
||||
|
||||
$sys_num= get_sys_total($device_name);
|
||||
$subsys_num= get_subsys_total($device_name);
|
||||
$e1_num= get_e1_total($device_name);
|
||||
if($sysType == $DEFAULT_SYS){
|
||||
echo "<select style=\"font-family: Verdana; font-size: 8pt\" name=\"query_type\" size=\"1\">";
|
||||
echo "<option value=\"0\">All</option>";
|
||||
echo "<option value=\"5\">Sub to sub</option>";
|
||||
echo "<option value=\"6\">Sub to trunk</option>";
|
||||
echo "<option value=\"7\">Trunk to sub</option>";
|
||||
echo "<option value=\"8\">Trunk to trunk</option>";
|
||||
echo "<option value=\"9\">Interconnection</option>";
|
||||
echo "<option value=\"10\">Sub to ip</option>";
|
||||
echo "<option value=\"11\">Trunk to ip</option>";
|
||||
echo "<option value=\"12\">Mobile originated</option>";
|
||||
echo "<option value=\"13\">Mobile terminated</option>";
|
||||
echo "<option value=\"14\">In trunk</option>";
|
||||
echo "<option value=\"15\">Out trunk</option>";
|
||||
echo "<option value=\"16\">Ip terminated</option>";
|
||||
echo "</select>";
|
||||
echo " ";
|
||||
}
|
||||
echo "<select style=\"font-family: Verdana; font-size: 8pt\" name=\"sel_date\" size=\"1\">";
|
||||
echo "<OPTION selected value=\"0\">$day0</OPTION>";
|
||||
echo "<OPTION value=\"1\">$day1</OPTION>";
|
||||
echo "<OPTION value=\"2\">$day2</OPTION>";
|
||||
echo "<OPTION value=\"3\">$day3</OPTION>";
|
||||
echo "<OPTION value=\"4\">$day4</OPTION>";
|
||||
echo "<OPTION value=\"5\">$day5</OPTION>";
|
||||
echo "<OPTION value=\"6\">$day6</OPTION>";
|
||||
echo "</SELECT>";
|
||||
?>
|
||||
<span onClick="javascript:document.selectform.submit();" style="cursor:hand">
|
||||
<IMG align=absBottom border=0 src="../../images/search.gif" ><?php echo "$strSearch"; ?>
|
||||
</span>
|
||||
|
||||
<?php
|
||||
echo "</td>";
|
||||
echo "<td align=\"right\">";
|
||||
?>
|
||||
<?php echo "$strSpecifyTime" ?><input style="font-family: Verdana; font-size: 8pt" name=sel_time onClick=display() value="true" type="checkbox" >
|
||||
<span align=left id=set_time style="VISIBILITY: hidden;">
|
||||
<?php echo "$strFrom"; ?>
|
||||
<input style="font-family: Verdana; font-size: 8pt" name="hou_1" size="2" value="00" maxLength="2"> <?php echo "$strHour"; ?>
|
||||
<input style="font-family: Verdana; font-size: 8pt" name="mid_1" size="2" value="00" maxLength="2"> <?php echo "$strMinute"; ?>
|
||||
<input style="font-family: Verdana; font-size: 8pt" name="sec_1" size="2" value="00" maxLength="2"> <?php echo "$strSencond"; ?>
|
||||
<?php echo "$strTo"; ?>
|
||||
<input style="font-family: Verdana; font-size: 8pt" maxLength="2" name="hou_2" size="2" value="23"> <?php echo "$strHour"; ?>
|
||||
<input style="font-family: Verdana; font-size: 8pt" name="mid_2" size="2" value="59" maxLength="2"> <?php echo "$strMinute"; ?>
|
||||
<input style="font-family: Verdana; font-size: 8pt" name="sec_2" size="2" value="59" maxLength="2"> <?php echo "$strSencond"; ?>
|
||||
</span>
|
||||
<?php
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
|
||||
?>
|
||||
|
||||
|
||||
<input type="hidden" name="sysType" value="<?php echo $sysType;?>">
|
||||
</form>
|
||||
<?php
|
||||
adjust_title_tail_frame("up");
|
||||
adjust_content_head_frame("up");
|
||||
adjust_content_tail_frame("up");
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
1042
wxc2_omc/performance/mscCsta/e1_detail_down.php
Executable file
1042
wxc2_omc/performance/mscCsta/e1_detail_down.php
Executable file
File diff suppressed because it is too large
Load Diff
31
wxc2_omc/performance/mscCsta/e1_detail_index.php
Executable file
31
wxc2_omc/performance/mscCsta/e1_detail_index.php
Executable file
@@ -0,0 +1,31 @@
|
||||
<?php
|
||||
//==============initial the data=======================
|
||||
if(!isset($sel_date_from))
|
||||
$sel_date_from=0;
|
||||
if(!isset($sel_date_to))
|
||||
$sel_date_to=0;
|
||||
if(!isset($sel_in_out))
|
||||
$sel_in_out=0;
|
||||
if(!isset($e1_no))
|
||||
$e1_no=0;
|
||||
if(!isset($from_hour))
|
||||
$from_hour="00";
|
||||
if(!isset($from_minute))
|
||||
$from_minute="00";
|
||||
if(!isset($from_second))
|
||||
$from_second="00";
|
||||
if(!isset($to_hour))
|
||||
$to_hour="23";
|
||||
if(!isset($to_minute))
|
||||
$to_minute="59";
|
||||
if(!isset($to_second))
|
||||
$to_second="59";
|
||||
|
||||
?>
|
||||
<frameset rows="20%,*" frameborder=0>
|
||||
<?php
|
||||
echo "<frame scrolling=\"no\" name=\"e1_detail_up\" src=\"e1_detail_up.php?sel_date_from=$sel_date_from&sel_date_to=$sel_date_to&sel_in_out=$sel_in_out&e1_no=$e1_no\">";
|
||||
echo "<frame name=\"e1_detail_down\" src=\"e1_detail_down.php?sel_date_from=$sel_date_from&sel_date_to=$sel_date_to&e1_no=$e1_no&sel_in_out=$sel_in_out&on_top_index=0\">";
|
||||
?>
|
||||
</frameset>
|
||||
|
||||
141
wxc2_omc/performance/mscCsta/e1_detail_up.php
Executable file
141
wxc2_omc/performance/mscCsta/e1_detail_up.php
Executable file
@@ -0,0 +1,141 @@
|
||||
<?php
|
||||
//Include the head file
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
function page_refresh()
|
||||
{
|
||||
//sel_date_from,sel_date_to,scroll_y,on_top_index
|
||||
|
||||
var down_date_from=document.myform.sel_date_from.value;
|
||||
var down_date_to=document.myform.sel_date_to.value;
|
||||
var e1no=document.myform.e1_no.value;
|
||||
var in_out=document.myform.sel_in_out.value;
|
||||
var on_top=parent.e1_detail_down.document.myform.on_top_index.value;
|
||||
|
||||
var scrolly=document.body.scrollTop;
|
||||
if(down_date_from<=down_date_to)
|
||||
down_date_to=down_date_from;
|
||||
|
||||
//alert(ser_type);
|
||||
var urll='<?php echo"$PHP_SELF";?>?sel_date_from='+down_date_from+'&sel_date_to='+down_date_to+'&e1_no='+e1no+"&on_top_index="+on_top+"&scroll_y="+scrolly+"&sel_in_out="+in_out;
|
||||
window.location.href=urll;
|
||||
|
||||
}
|
||||
</script>
|
||||
<base target="e1_detail_down">
|
||||
<?php
|
||||
echo "<div style=\"position:absolute;top:0;left:840;\">";
|
||||
$helpId="3.2.3";
|
||||
showHelp($helpId);
|
||||
echo "</div>";
|
||||
//=================================test=======================================
|
||||
//echo "e1_no:$e1_no<br>";
|
||||
//echo "sel_date_from:$sel_date_from<br>";
|
||||
//echo "sel_date_to:$sel_date_to<br>";
|
||||
//echo "in_out:$sel_in_out<br>";
|
||||
//==================get the parameter the previous transfer====================
|
||||
$old_sel_date_from=$sel_date_from;
|
||||
$old_sel_date_to=$sel_date_to;
|
||||
$old_sel_in_out=$sel_in_out;
|
||||
//===========================page title========================================
|
||||
echo "<table><tr><td><nobr>";
|
||||
echo "$strTitlePerformance > MSC > E1";
|
||||
echo "</td>";
|
||||
echo "</tr></table>";
|
||||
//=======================data initial==========================================
|
||||
if(!isset($sel_date_from))
|
||||
$sel_date_from=0;
|
||||
if(!isset($sel_date_to))
|
||||
$sel_date_to=0;
|
||||
if(!isset($e1_no))
|
||||
$e1_no=0;
|
||||
if(!isset($sel_in_out))
|
||||
$sel_in_out=0;
|
||||
if(!isset($on_top_index))
|
||||
$on_top_index=0;
|
||||
//selection date define
|
||||
$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")));
|
||||
$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y")));
|
||||
$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y")));
|
||||
$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y")));
|
||||
$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y")));
|
||||
$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y")));
|
||||
$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y")));
|
||||
|
||||
//===================the back link button======================================
|
||||
echo "<div style=\"position:absolute;top=90;left:790;\">";
|
||||
echo "<a target=\"_parent\" href=\"../../performance/mscCsta/e1_general_index.php?sel_date_from=$old_sel_date_from&sel_date_to=$old_sel_date_to&scroll_y=0&sel_in_out=$old_sel_in_out\"><img src=\"../../images/left.gif\" border=0 align=\"left\">back</img></a>";
|
||||
echo "</div>";
|
||||
?>
|
||||
<form name="myform" action="e1_detail_down.php" method="post">
|
||||
<table><tr>
|
||||
<!--==================the trunk no hidden==============================-->
|
||||
<td>
|
||||
<?php
|
||||
echo "<input type=\"hidden\" name=\"e1_no\" value=$e1_no>";
|
||||
?>
|
||||
</td>
|
||||
<!--=========================in&out selection=============================-->
|
||||
<td>
|
||||
<select name="sel_in_out" onChange="javascript:page_refresh()">
|
||||
<?php
|
||||
$in_out_string=array("In","Out","In&Out");
|
||||
for($i=0;$i<3;$i++)
|
||||
{
|
||||
if($i==$sel_in_out)
|
||||
echo "<option selected value=$i>$in_out_string[$i]</option>";
|
||||
else
|
||||
echo "<option value=$i>$in_out_string[$i]</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
|
||||
<!--=========================date from selection=================================-->
|
||||
<select name="sel_date_from" onChange="javascript:page_refresh()">
|
||||
<?php
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
if($i==$sel_date_from)
|
||||
echo "<option selected value=$i>${day.$i}</option>";
|
||||
else
|
||||
echo "<option value=$i>${day.$i}</option>";
|
||||
}
|
||||
?>
|
||||
</select>to
|
||||
</td>
|
||||
<td>
|
||||
<!--=========================date to selection=================================-->
|
||||
<select name="sel_date_to">
|
||||
<?php
|
||||
for($i=0;$i<=$sel_date_from;$i++)
|
||||
{
|
||||
if($i==$sel_date_to)
|
||||
echo "<option selected value=$i>${day.$i}</option>";
|
||||
else
|
||||
echo "<option value=$i>${day.$i}</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<td>
|
||||
<!--=========================the search button============================-->
|
||||
<div onClick="javascript:myform.submit()" style="cursor:hand">
|
||||
<IMG align=absBottom border=0 src="../../images/search.gif" ><?php echo "$strSearch"; ?>
|
||||
<div>
|
||||
</td>
|
||||
<?php
|
||||
//add the blank-space
|
||||
for($i=0;$i<60;$i++)
|
||||
{
|
||||
echo "<td> </td>";
|
||||
}
|
||||
?>
|
||||
</tr></table>
|
||||
<!--==========================the print button=============================-->
|
||||
<div onClick="window.print();" style="position:absolute;top:90;left:840;cursor:hand">
|
||||
<img align=absBottom border=0 src="../../images/printer.gif" width="16" height="16">
|
||||
</div>
|
||||
817
wxc2_omc/performance/mscCsta/e1_general_down.php
Executable file
817
wxc2_omc/performance/mscCsta/e1_general_down.php
Executable file
@@ -0,0 +1,817 @@
|
||||
<?php
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
|
||||
<?php
|
||||
//====scroll the page====
|
||||
if($scroll_y > 0){
|
||||
echo "<body style=\"overflow-x:hidden\" topmargin=\"5\" leftmargin=\"12\" onLoad='self.scrollBy(0,$scroll_y)'>";
|
||||
}else{
|
||||
echo "<body style=\"overflow-x:hidden\" topmargin=\"5\" leftmargin=\"12\">";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
//========================================================================================|
|
||||
//===========================Initial The Data From Index Page=============================|
|
||||
//========================================================================================|
|
||||
if(!isset($scroll_y))
|
||||
$scroll_y=0;
|
||||
if(!isset($sel_date_from))
|
||||
$sel_date_from=0;
|
||||
if(!isset($sel_date_to))
|
||||
$sel_date_to=0;
|
||||
if(!isset($sel_in_out))
|
||||
$sel_in_out=0;
|
||||
if(!isset($from_hour))
|
||||
$from_hour="00";
|
||||
if(!isset($from_minute))
|
||||
$from_minute="00";
|
||||
if(!isset($from_second))
|
||||
$from_second="00";
|
||||
if(!isset($to_hour))
|
||||
$to_hour="23";
|
||||
if(!isset($to_minute))
|
||||
$to_minute="59";
|
||||
if(!isset($to_second))
|
||||
$to_second="59";
|
||||
$slot=$sel_date_from-$sel_date_to+1;
|
||||
$DEBUG=1;
|
||||
//========================================================================================|
|
||||
//============================Define The Data=============================================|
|
||||
//========================================================================================|
|
||||
for($i=0;$i<256;$i++)
|
||||
{
|
||||
for($j=0;$j<9;$j++)
|
||||
{
|
||||
/*
|
||||
0 e1-no 0 attempt
|
||||
1 e1 no 1 success
|
||||
... 2 call deny
|
||||
3 net busy
|
||||
4 caller clear
|
||||
5 sub busy
|
||||
6 no answer
|
||||
7 signal error
|
||||
8 total call duration
|
||||
*/
|
||||
$e1_csta[$i][$j]=0;
|
||||
}
|
||||
}
|
||||
//====title======
|
||||
for($i=0;$i<256;$i++)
|
||||
{
|
||||
$trunk_element_title[$i]="";
|
||||
$e1_element_title[$i]="";
|
||||
$e1_status[$i]=0;
|
||||
}
|
||||
|
||||
//===in out in&out data=====
|
||||
for($i=0;$i<9;$i++)
|
||||
{
|
||||
$in_e1[$i]=0;
|
||||
$out_e1[$i]=0;
|
||||
$total_e1[$i]=0;
|
||||
}
|
||||
|
||||
//========================================================================================|
|
||||
//================================Get the title from DB===================================|
|
||||
//========================================================================================|
|
||||
//===get the default value of XAPP element info===
|
||||
$database="OBJ_225";
|
||||
$sql="select initValue from paramConf where level_1=2 and level_2=11 ";
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
$default_initValue=$rows[initValue];
|
||||
//============
|
||||
$database="OBJ_225";
|
||||
$sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=11 ";
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
if(!$DEBUG)
|
||||
{
|
||||
if(!$rows)
|
||||
exit("No record");
|
||||
do{
|
||||
//echo "level_1:{$rows[level_1]} level_2:{$rows[level_2]} level_3:{$rows[level_3]} level_4:{$rows[level_4]} level_5:{$rows[level_5]} level_6:{$rows[level_6]} level_7:{$rows[level_7]} level_8:{$rows[level_8]} level_9:{$rows[level_9]} level_10:{$rows[level_10]}<br>";
|
||||
if($default_initValue==$rows[initValue])
|
||||
continue;
|
||||
|
||||
$trunk_no=hexdec(getBitValue($rows[initValue],'3.0-3.7'))+0;
|
||||
//echo "$trunk_no<br>";
|
||||
$value=$rows['initValue'];
|
||||
$value=substr($value,28,20);
|
||||
//echo "trunk_no:$trunk_no $value<br>";
|
||||
//=====change the hex to ansi char======
|
||||
$temp="";
|
||||
for($num=0;$num<10;$num++)
|
||||
{
|
||||
$str=substr($value,$num*2,2);
|
||||
$str=hexdec($str);
|
||||
$str=chr($str);
|
||||
$temp.=$str;
|
||||
}
|
||||
//echo "$temp<br>";
|
||||
$trunk_element_title[$trunk_no]=$temp;
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
}
|
||||
|
||||
//====Fix the title====
|
||||
for($i=0;$i<256;$i++)
|
||||
{
|
||||
$trunk_element_title[$i]=trim($trunk_element_title[$i]);
|
||||
if($trunk_element_title[$i]=="")
|
||||
$trunk_element_title[$i]="--";
|
||||
if($i==253||$i==254)
|
||||
{
|
||||
$trunk_element_title[$i]="LoopBack$i";
|
||||
}
|
||||
}
|
||||
|
||||
if(!$DEBUG)
|
||||
{
|
||||
//=======get the e1 belong trunk no======
|
||||
$database="OBJ_322";
|
||||
$sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 and level_3=2 ";
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
if(!$rows)
|
||||
exit("No record");
|
||||
do{
|
||||
$e1_no=$rows['instanceNo'];
|
||||
//echo "$e1_no<br>";
|
||||
$value=$rows['initValue'];
|
||||
$value=trim($value);
|
||||
//echo "$value<br>";
|
||||
$t_g=hexdec($value);
|
||||
$e1_element_title[$e1_no]=$trunk_element_title[$t_g];
|
||||
//echo "e1_no:$e1_no {$e1_element_title[$e1_no]}<br>";
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
//======get the e1 status======
|
||||
$database="OBJ_322";
|
||||
$sql="select instanceNo,initValue from param_99 where level_1=2 and level_2=4 and level_3=4 ";
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
if(!$rows)
|
||||
exit("No record");
|
||||
do{
|
||||
$e1_no=$rows['instanceNo'];
|
||||
//echo "$e1_no<br>";
|
||||
$value=$rows['initValue'];
|
||||
$value=trim($value);
|
||||
$value=substr($value,1,1);
|
||||
//echo "$value<br>";
|
||||
switch($value)
|
||||
{
|
||||
//lock
|
||||
case '0':
|
||||
case '1':
|
||||
case '4':
|
||||
case '5':
|
||||
case '8':
|
||||
case '9':
|
||||
case 'C':
|
||||
case 'D': $e1_status[$e1_no]=0;break;
|
||||
//unlock
|
||||
case '2':
|
||||
case '3':
|
||||
case '6':
|
||||
case '7':
|
||||
case 'A':
|
||||
case 'B':
|
||||
case 'E':
|
||||
case 'F': $e1_status[$e1_no]=1;break;
|
||||
}
|
||||
|
||||
//echo "e1_no:$e1_no {$e1_element_title[$e1_no]} e1_status:{$e1_status[$e1_no]}<br>";
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
}
|
||||
//========Fake data================
|
||||
if(1)
|
||||
{
|
||||
//====title======
|
||||
for($i=0;$i<256;$i++)
|
||||
{
|
||||
$trunk_element_title[$i]="TG ".$i;
|
||||
$e1_element_title[$i]="TG ".$i;
|
||||
$e1_status[$i]=1;//rand(0,2);
|
||||
}
|
||||
}
|
||||
//========================================================================================|
|
||||
//===========================Get Data from DB=============================================|
|
||||
//========================================================================================|
|
||||
$db=$csta_db;
|
||||
$slot=$sel_date_from-$sel_date_to+1;
|
||||
$time_column="csta_datetime";
|
||||
|
||||
for($day=0;$day<$slot;$day++)
|
||||
{
|
||||
$table_name="mscSum";
|
||||
$temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
$table_name=$table_name."_".$temp;
|
||||
$from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
$to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day+1,date("Y")));
|
||||
|
||||
//echo "table_name:$table_name<br>";
|
||||
//echo "from_time:$from_time<br>";
|
||||
//echo "to_time:$to_time<br>";
|
||||
//echo "in_out:$sel_in_out<br>";
|
||||
if($sel_in_out==0)
|
||||
$e1_where="and key_type=1 ";
|
||||
else if($sel_in_out==1)
|
||||
$e1_where="and key_type=2 ";
|
||||
else
|
||||
$e1_where="and key_type>0 and key_type<3 ";
|
||||
|
||||
$select="select key_e1_tg,sum(Attempt) as attempt,sum(Normal) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration,key_sys_id,key_subsys_id ";
|
||||
$from="from $table_name ";
|
||||
$where="where $time_column >'$from_time' and $time_column <='$to_time' ".$e1_where;
|
||||
$group="group by key_e1_tg ";
|
||||
$order="order by key_e1_tg ";
|
||||
$sql=$select.$from.$where.$group.$order;
|
||||
//echo "sql:$sql<br>";
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
if(1)
|
||||
{
|
||||
if($rows)
|
||||
{
|
||||
do{
|
||||
$msc_no=$rows[key_sys_id]+0;
|
||||
$e1_no=$rows[0]+0;
|
||||
|
||||
for($tt=0;$tt<9;$tt++)
|
||||
{
|
||||
$e1_csta[$msc_no*128+$e1_no][$tt]+=$rows[$tt+1];
|
||||
//echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}<br>";
|
||||
}
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//====get the in_e1,out_e1,total_e1====
|
||||
for($day=0;$day<$slot;$day++)
|
||||
{
|
||||
$table_name="mscSum";
|
||||
$temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
$table_name=$table_name."_".$temp;
|
||||
$from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
$to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day+1,date("Y")));
|
||||
|
||||
//====in-e1 data======
|
||||
$select="select key_e1_tg,sum(Attempt) as attempt,sum(Normal) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration,key_sys_id,key_subsys_id ";
|
||||
$from="from $table_name ";
|
||||
$e1_where="and key_type=1 ";
|
||||
$where="where $time_column >'$from_time' and $time_column <='$to_time' ".$e1_where;
|
||||
$group="group by key_e1_tg,key_sys_id ";
|
||||
$order="order by key_e1_tg ";
|
||||
$sql=$select.$from.$where.$group.$order;
|
||||
//echo "sql=$sql<br>";
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
if(1)
|
||||
{
|
||||
if($rows)
|
||||
{
|
||||
do{
|
||||
$e1_no=$rows[0]+0;
|
||||
$msc_no=$rows['key_sys_id']+0;
|
||||
if($e1_status[$e1_no+$msc_no*128]==0)
|
||||
continue;
|
||||
for($tt=0;$tt<9;$tt++)
|
||||
{
|
||||
$in_e1[$tt]+=$rows[$tt+1];
|
||||
}
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
}
|
||||
}
|
||||
//====out_e1 data======
|
||||
$select="select key_e1_tg,sum(Attempt) as attempt,sum(Normal) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration,key_sys_id,key_subsys_id ";
|
||||
$from="from $table_name ";
|
||||
$e1_where="and key_type=2 ";
|
||||
$where="where $time_column >'$from_time' and $time_column <='$to_time' ".$e1_where;
|
||||
$group="group by key_e1_tg,key_sys_id ";
|
||||
$order="order by key_e1_tg ";
|
||||
$sql=$select.$from.$where.$group.$order;
|
||||
//echo "sql=$sql<br>";
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
if(1)
|
||||
{
|
||||
if($rows)
|
||||
{
|
||||
do{
|
||||
$e1_no=$rows[0]+0;
|
||||
$msc_no=$rows['key_sys_id']+0;
|
||||
//echo "msc-$msc_no<br>";
|
||||
if($e1_status[$e1_no+$msc_no*128]==0)
|
||||
continue;
|
||||
for($tt=0;$tt<9;$tt++)
|
||||
{
|
||||
$out_e1[$tt]+=$rows[$tt+1];
|
||||
}
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
}
|
||||
}
|
||||
//====total_e1 data=====
|
||||
$select="select key_e1_tg,sum(Attempt) as attempt,sum(Normal) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration,key_sys_id,key_subsys_id ";
|
||||
$from="from $table_name ";
|
||||
$e1_where="and key_type>0 and key_type<3 ";
|
||||
$where="where $time_column >'$from_time' and $time_column <='$to_time' ".$e1_where;
|
||||
$group="group by key_e1_tg,key_sys_id ";
|
||||
$order="order by key_e1_tg ";
|
||||
$sql=$select.$from.$where.$group.$order;
|
||||
|
||||
//echo "sql=$sql<br>";
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
if(1)
|
||||
{
|
||||
if($rows)
|
||||
{
|
||||
do{
|
||||
$e1_no=$rows[0]+0;
|
||||
$msc_no=$rows['key_sys_id']+0;
|
||||
//echo "msc-$msc_no<br>";
|
||||
if($e1_status[$e1_no+$msc_no*128]==0)
|
||||
{
|
||||
//$e1_no=$e1_no+$msc_no*128;
|
||||
//echo "$e1_no<br>";
|
||||
continue;
|
||||
}
|
||||
for($tt=0;$tt<9;$tt++)
|
||||
{
|
||||
$total_e1[$tt]+=$rows[$tt+1];
|
||||
}
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
//========================================================================================|
|
||||
//============================Fake Data===================================================|
|
||||
//========================================================================================|
|
||||
if(0)
|
||||
{
|
||||
for($i=0;$i<256;$i++)
|
||||
{
|
||||
for($j=0;$j<9;$j++)
|
||||
{
|
||||
if($i==0)
|
||||
$e1_csta[$i][$j]=rand(200,300);
|
||||
else
|
||||
$e1_csta[$i][$j]=rand(10,100);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(0)
|
||||
{
|
||||
for($i=0;$i<9;$i++)
|
||||
{
|
||||
$in_e1[$i]=rand(10,100);
|
||||
$out_e1[$i]=rand(10,100);
|
||||
$total_e1[$i]=$in_e1[$i]+$out_e1[$i];
|
||||
}
|
||||
}
|
||||
|
||||
//========================================================================================|
|
||||
//===========================Test the data================================================|
|
||||
//========================================================================================|
|
||||
if(0)
|
||||
{
|
||||
for($i=0;$i<9;$i++)
|
||||
{
|
||||
echo "in-type-$i:<br>{$in_e1[$i]}<br>";
|
||||
echo "out-type-$i:<br>{$out_e1[$i]}<br>";
|
||||
echo "total-type-$i:<br>{$total_e1[$i]}<br>";
|
||||
}
|
||||
}
|
||||
//========================================================================================|
|
||||
//========================Draw the table-1================================================|
|
||||
//========================================================================================|
|
||||
$title_time=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")));
|
||||
if($slot==1)
|
||||
$table_title="E1 statistic Date:".$title_time;
|
||||
else
|
||||
$table_title="E1 statistic Date:".$title_time." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y")));
|
||||
echo "<center><b>$table_title</b></center>";
|
||||
echo "<table width=\"100%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
|
||||
if($sel_in_out==0)
|
||||
$temp="In";
|
||||
else if($sel_in_out==1)
|
||||
$temp="Out";
|
||||
else if($sel_in_out==2)
|
||||
$temp="In&Out";
|
||||
|
||||
echo "<tr bgcolor=\"#E6E6E6\">";
|
||||
echo "<td> </td><td colspan=11 align=\"center\">$temp</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr bgcolor=\"#E6E6E6\">";
|
||||
echo "<td align=\"center\" width=\"6%\"><nobr>E1 No.</td>";
|
||||
echo "<td align=\"center\" width=\"12%\"><nobr>Element Title</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Attempt</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Success</td>";
|
||||
echo "<td align=\"center\" width=\"8%\"><nobr>Call deny</td>";
|
||||
echo "<td align=\"center\" width=\"8%\"><nobr>Net busy</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Caller clear</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Sub busy</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">No answer</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Signal error</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Total call duration</td>";
|
||||
echo "<td align=\"center\" width=\"10%\">Average call<br>duration(s)</td>";
|
||||
echo "</tr>";
|
||||
for($i=0;$i<256;$i++)
|
||||
{
|
||||
if($e1_status[$i]==0)
|
||||
continue;
|
||||
echo "<tr>";
|
||||
echo "<td align=\"center\"><a target=\"_parent\" href=\"../../performance/mscCsta/e1_detail_index.php?e1_no=$i&sel_date_from=$sel_date_from&sel_date_to=$sel_date_to&sel_in_out=$sel_in_out\">$i</a></td>";
|
||||
echo "<td align=\"left\">{$e1_element_title[$i]}</td>";
|
||||
for($j=0;$j<9;$j++)
|
||||
{
|
||||
echo "<td align=\"center\">";
|
||||
if($j==0)
|
||||
echo "{$e1_csta[$i][$j]}";
|
||||
if($j>0&&$j<8)
|
||||
{
|
||||
echo "{$e1_csta[$i][$j]}";
|
||||
echo "<br>";
|
||||
if($e1_csta[$i][0]==0)
|
||||
$rate=0;
|
||||
else
|
||||
{
|
||||
$rate=$e1_csta[$i][$j]/$e1_csta[$i][0];
|
||||
$rate=$rate*100;
|
||||
$rate=number_format($rate,2,"."," ");
|
||||
}
|
||||
if($rate==0)
|
||||
$rate=0;
|
||||
echo "$rate%";
|
||||
}
|
||||
if($j==8)
|
||||
{
|
||||
echo "{$e1_csta[$i][$j]}(s)";
|
||||
$hour=floor($e1_csta[$i][$j]/3600);
|
||||
$minute=floor($e1_csta[$i][$j]%3600/60);
|
||||
$second=$e1_csta[$i][$j]%60;
|
||||
if($hour==0&&$minute==0&&$second==0)
|
||||
echo "<br>";
|
||||
else
|
||||
echo "<br>$hour:$minute:$second";
|
||||
}
|
||||
echo "</td>";
|
||||
}
|
||||
//=====average call duration=========
|
||||
echo "<td align=\"center\">";
|
||||
if($e1_csta[$i][1]!=0)
|
||||
$ave=round($e1_csta[$i][8]/$e1_csta[$i][1]);
|
||||
else
|
||||
$ave=0;
|
||||
echo "$ave";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
//========================================================================================|
|
||||
//===========================Draw the table-2=============================================|
|
||||
//========================================================================================|
|
||||
echo "<br><center><b>$table_title</b></center>";
|
||||
echo "<center>";
|
||||
echo "<table width=\"100%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
|
||||
echo "<tr bgcolor=\"#E6E6E6\">";
|
||||
echo "<td colspan=8 align=\"center\">2.Success/failure</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr bgcolor=\"#E6E6E6\">";
|
||||
echo "<td align=\"center\">Type</td>";
|
||||
echo "<td align=\"center\">Success</td>";
|
||||
echo "<td align=\"center\">Call deny</td>";
|
||||
echo "<td align=\"center\">Net busy</td>";
|
||||
echo "<td align=\"center\">Caller clear</td>";
|
||||
echo "<td align=\"center\">Sub busy</td>";
|
||||
echo "<td align=\"center\">No answer</td>";
|
||||
echo "<td align=\"center\">Signal error</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//=====in e1 data======
|
||||
echo "<tr>";
|
||||
echo "<td align=\"center\">In</td>";
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
echo "<td align=\"center\">";
|
||||
if($in_e1[0]!=0)
|
||||
{
|
||||
$rate=$in_e1[$i+1]/$in_e1[0];
|
||||
$rate=$rate*100;
|
||||
$rate=number_format($rate,2,"."," ");
|
||||
}
|
||||
else
|
||||
$rate=0;
|
||||
if($rate==0)
|
||||
$rate=0;
|
||||
echo "$rate%";
|
||||
echo "</td>";
|
||||
}
|
||||
echo "</tr>";
|
||||
|
||||
//=====out e1 data=======
|
||||
echo "<tr>";
|
||||
echo "<td align=\"center\">Out</td>";
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
echo "<td align=\"center\">";
|
||||
if($out_e1[0]!=0)
|
||||
{
|
||||
$rate=$out_e1[$i+1]/$out_e1[0];
|
||||
$rate=$rate*100;
|
||||
$rate=number_format($rate,2,"."," ");
|
||||
}
|
||||
else
|
||||
$rate=0;
|
||||
if($rate==0)
|
||||
$rate=0;
|
||||
echo "$rate%";
|
||||
echo "</td>";
|
||||
}
|
||||
echo "</tr>";
|
||||
|
||||
//====total e1 data=======
|
||||
echo "<tr>";
|
||||
echo "<td align=\"center\">In&Out</td>";
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
echo "<td align=\"center\">";
|
||||
if($total_e1[0]!=0)
|
||||
{
|
||||
$rate=$total_e1[$i+1]/$total_e1[0];
|
||||
$rate=$rate*100;
|
||||
$rate=number_format($rate,2,"."," ");
|
||||
}
|
||||
else
|
||||
$rate=0;
|
||||
if($rate==0)
|
||||
$rate=0;
|
||||
echo "$rate%";
|
||||
echo "</td>";
|
||||
}
|
||||
echo "</table></center>";
|
||||
|
||||
//========================================================================================|
|
||||
//============================Draw the graphics-1=========================================|
|
||||
//========================================================================================|
|
||||
echo "<p><b>3.In/Out(Attempt Call)</b><br>";
|
||||
$sizex=510;
|
||||
$sizey=240;
|
||||
$im = ImageCreate ($sizex, $sizey);
|
||||
$background_color=ImageColorAllocate($im,255,255,255);
|
||||
imageLine($im,0,0,0,200,$black_color);
|
||||
imageLine($im,0,200,600,200,$black_color);
|
||||
|
||||
$bgcolor=F8F8F8;
|
||||
$fgcolor=000000;
|
||||
|
||||
$background_color = ImageColorAllocate ($im,
|
||||
hexdec(substr($bgcolor, 0, 2)),
|
||||
hexdec(substr($bgcolor, 2, 2)),
|
||||
hexdec(substr($bgcolor, 4, 2)));
|
||||
|
||||
$text_color = ImageColorAllocate ($im,
|
||||
hexdec(substr($fgcolor, 0, 2)),
|
||||
hexdec(substr($fgcolor, 2, 2)),
|
||||
hexdec(substr($fgcolor, 4, 2)));
|
||||
$white_color=ImageColorAllocate($im,255,255,255);
|
||||
$black_color=ImageColorAllocate($im,0,0,0);
|
||||
$color[0]=ImageColorAllocate($im,0x33,0x33,0xff);
|
||||
$color[1]=ImageColorAllocate($im,0x66,0xaa,0);
|
||||
|
||||
//====background====
|
||||
ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198));
|
||||
ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130));
|
||||
$pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1);
|
||||
Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130));
|
||||
$pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4);
|
||||
Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130));
|
||||
ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color);
|
||||
|
||||
imageLine($im,40,20,40,200,$black_color);
|
||||
imageLine($im,40,20,490,20,$black_color);
|
||||
imageLine($im,490,200,490,20,$black_color);
|
||||
imageLine($im,40,200,490,200,$black_color);
|
||||
|
||||
//====draw the horizonal line=======
|
||||
$style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color);
|
||||
imagesetstyle($im, $style);
|
||||
for($i=10;$i>0;$i--)
|
||||
{
|
||||
$x1=40;
|
||||
$y1=20+(10-$i)*18;
|
||||
$x2=490;
|
||||
$y2=$y1;
|
||||
if($i!=10)
|
||||
imageline($im,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED);
|
||||
|
||||
imagestring($im,2,$x1-22,$y2-5,($i*10)."%",$black_color);
|
||||
}
|
||||
|
||||
//======draw the vitical line====
|
||||
$u=floor(450/9);
|
||||
for($i=0;$i<10;$i++)
|
||||
{
|
||||
$x1=40+$i*$u;
|
||||
$y1=20;
|
||||
$x2=$x1;
|
||||
$y2=200;
|
||||
ImageDashedLine($im,$x1,$y1,$x2,$y2,$black_color);
|
||||
}
|
||||
|
||||
//=====get the two block height====
|
||||
if($total_e1[0]==0)
|
||||
{
|
||||
$in_e1_percent="0%";
|
||||
$out_e1_percent="0%";
|
||||
$height[0]=0;
|
||||
$heighr[1]=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$in_e1_percent=change_percent($in_e1[0]/$total_e1[0]);
|
||||
$out_e1_percent=change_percent($out_e1[0]/$total_e1[0]);
|
||||
$height[0]=floor(180*$in_e1[0]/$total_e1[0]);
|
||||
$height[1]=floor(180*$out_e1[0]/$total_e1[0]);
|
||||
}
|
||||
|
||||
//======draw the data block=====
|
||||
for($i=0;$i<2;$i++)
|
||||
{
|
||||
$x1=90+(4*$i+1)*50;
|
||||
if($height[$i]==0)
|
||||
$height[$i]=1;
|
||||
$y1=200-$height[$i];
|
||||
$x2=90+(4*$i+2)*50;
|
||||
$y2=199;
|
||||
imagefilledrectangle($im,$x1,$y1,$x2,$y2,$color[$i]);
|
||||
}
|
||||
|
||||
//=====draw the legend string=====
|
||||
imagestring($im,2,160,205,"In",$black_color);
|
||||
imagestring($im,2,138,220,"(".$in_e1_percent.")",$black_color);
|
||||
imagestring($im,2,355,205,"Out",$black_color);
|
||||
imagestring($im,2,335,220,"(".$out_e1_percent.")",$black_color);
|
||||
|
||||
//====show the service attempt graphics=====
|
||||
//-----<2D><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//delete *.png
|
||||
$handle=opendir('.');
|
||||
while($file=readdir($handle)){
|
||||
$retval="";
|
||||
$pt=strrpos($file,".");
|
||||
if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt);
|
||||
if($retval=='png') unlink($file);
|
||||
}
|
||||
$tt=time()+34;
|
||||
$filename="e11_".$tt.".png";
|
||||
if(1)
|
||||
{
|
||||
ImagePng ($im,"$filename");
|
||||
ImageDestroy($im);
|
||||
}
|
||||
//-----<2D><>ʾͼƬ
|
||||
echo "<img src=\"$filename\"></img>";
|
||||
|
||||
//========================================================================================|
|
||||
//===========================Draw the Graphics-2==========================================|
|
||||
//========================================================================================|
|
||||
echo "<p><b>4.Success/Failure<br>";
|
||||
$sizex=600;
|
||||
$sizey=250;
|
||||
$image=imagecreate($sizex,$sizey);
|
||||
$bgcolor=imagecolorallocate($image,255,255,255);
|
||||
$black_color=ImageColorAllocate($image,0,0,0);
|
||||
$white_color=imagecolorallocate($image,255,255,255);
|
||||
$bgcolor=F8F8F8;
|
||||
$fgcolor=000000;
|
||||
$color[0]=ImageColorAllocate($image,0x33,0x33,0xff);
|
||||
$color[1]=ImageColorAllocate($image,0x66,0xaa,0);
|
||||
$background_color = ImageColorAllocate ($image,
|
||||
hexdec(substr($bgcolor, 0, 2)),
|
||||
hexdec(substr($bgcolor, 2, 2)),
|
||||
hexdec(substr($bgcolor, 4, 2)));
|
||||
|
||||
$text_color = ImageColorAllocate ($image,
|
||||
hexdec(substr($fgcolor, 0, 2)),
|
||||
hexdec(substr($fgcolor, 2, 2)),
|
||||
hexdec(substr($fgcolor, 4, 2)));
|
||||
|
||||
//===background====
|
||||
ImageFilledRectangle($image,0,0,$sizex,$sizey,ImageColorAllocate ($image, 198, 198, 198));
|
||||
ImageFilledRectangle($image,2,2,$sizex,$sizey,ImageColorAllocate ($image, 130, 130, 130));
|
||||
$pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1);
|
||||
Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130));
|
||||
$pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4);
|
||||
Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130));
|
||||
ImageFilledRectangle($image,2,2,$sizex-3,$sizey-3,$background_color);
|
||||
|
||||
imageLine($image,40,20,40,200,$black_color);
|
||||
imageLine($image,40,20,580,20,$black_color);
|
||||
imageLine($image,580,200,580,20,$black_color);
|
||||
imageLine($image,40,200,580,200,$black_color);
|
||||
|
||||
//======draw the horizonal line=====
|
||||
$style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color);
|
||||
imagesetstyle($image, $style);
|
||||
for($i=10;$i>0;$i--)
|
||||
{
|
||||
$x1=40;
|
||||
$y1=20+(10-$i)*18;
|
||||
$x2=580;
|
||||
$y2=$y1;
|
||||
if($i!=10)
|
||||
imageline($image,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED);
|
||||
|
||||
imagestring($image,2,$x1-22,$y2-5,($i*10)."%",$black_color);
|
||||
}
|
||||
|
||||
//=====draw the vitical line======
|
||||
$u=floor(540/15);
|
||||
for($i=0;$i<16;$i++)
|
||||
{
|
||||
$x1=40+$i*$u;
|
||||
$y1=20;
|
||||
$x2=$x1;
|
||||
$y2=200;
|
||||
ImageDashedLine($image,$x1,$y1,$x2,$y2,$black_color);
|
||||
}
|
||||
|
||||
//======get the block height======
|
||||
for($j=0;$j<7;$j++)
|
||||
{
|
||||
if($total_e1[0]==0)
|
||||
$total_height[$j][0]=1;
|
||||
else
|
||||
{
|
||||
$total_height[$j][0]=floor(180*$in_e1[$j+1]/$total_e1[0]);
|
||||
}
|
||||
}
|
||||
for($j=0;$j<7;$j++)
|
||||
{
|
||||
if($total_e1[0]==0)
|
||||
$total_height[$j][1]=1;
|
||||
else
|
||||
{
|
||||
$total_height[$j][1]=floor(180*$out_e1[$j+1]/$total_e1[0]);
|
||||
}
|
||||
}
|
||||
|
||||
//=======draw the data block=====
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
for($j=0;$j<2;$j++)
|
||||
{
|
||||
if($total_height[$i][$j]<1)
|
||||
$total_height[$i][$j]=1;
|
||||
//echo "lie-$i-hang-$j-{$total_height[$i][$j]}<br>";
|
||||
$x1=40+(2*$i+1)*36;
|
||||
$y1=199;
|
||||
for($z=0;$z<$j+1;$z++)
|
||||
{
|
||||
$y1=$y1-$total_height[$i][$z];
|
||||
}
|
||||
$x2=40+(2*$i+2)*36;
|
||||
$y2=199;
|
||||
for($z=0;$z<$j;$z++)
|
||||
{
|
||||
$y2=$y2-$total_height[$i][$z];
|
||||
}
|
||||
|
||||
imagefilledrectangle($image,$x1,$y1,$x2,$y2,$color[$j]);
|
||||
}
|
||||
}
|
||||
|
||||
//======draw the legend string======
|
||||
imagefilledrectangle($image,170,230,185,245,$color[0]);
|
||||
imagestring($image,2,190,230,"In",$black_color);
|
||||
imagefilledrectangle($image,360,230,375,245,$color[1]);
|
||||
imagestring($image,2,380,230,"Out",$black_color);
|
||||
|
||||
imagestring($image,2,75,205,"Success",$black_color);
|
||||
imagestring($image,2,138,205,"Call deny",$black_color);
|
||||
imagestring($image,2,215,205,"Net busy",$black_color);
|
||||
imagestring($image,2,294,200,"Caller",$black_color);
|
||||
imagestring($image,2,297,212,"clear",$black_color);
|
||||
imagestring($image,2,363,205,"SubBusy",$black_color);
|
||||
imagestring($image,2,433,205,"No answer",$black_color);
|
||||
imagestring($image,2,508,200,"Signal",$black_color);
|
||||
imagestring($image,2,510,212,"error",$black_color);
|
||||
//=====show the answer failure graphics=======
|
||||
$tt=time()-525;
|
||||
$file_name="e12_".$tt.".png";
|
||||
imagepng($image,$file_name);
|
||||
imagedestroy($image);
|
||||
echo "<img src=$file_name></img>";
|
||||
?>
|
||||
</body>
|
||||
|
||||
28
wxc2_omc/performance/mscCsta/e1_general_index.php
Executable file
28
wxc2_omc/performance/mscCsta/e1_general_index.php
Executable file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
//==============initial the data=======================
|
||||
if(!isset($sel_date_from))
|
||||
$sel_date_from=0;
|
||||
if(!isset($sel_date_to))
|
||||
$sel_date_to=0;
|
||||
if(!isset($sel_in_out))
|
||||
$sel_in_out=2;
|
||||
if(!isset($from_hour))
|
||||
$from_hour="00";
|
||||
if(!isset($from_minute))
|
||||
$from_minute="00";
|
||||
if(!isset($from_second))
|
||||
$from_second="00";
|
||||
if(!isset($to_hour))
|
||||
$to_hour="23";
|
||||
if(!isset($to_minute))
|
||||
$to_minute="59";
|
||||
if(!isset($to_second))
|
||||
$to_second="59";
|
||||
|
||||
?>
|
||||
<frameset rows="21%,*" frameborder=0>
|
||||
<?php
|
||||
echo "<frame scrolling=\"no\" name=\"e1_general_up\" src=\"e1_general_up.php?sel_date_from=$sel_date_from&sel_date_to=$sel_date_to&sel_in_out=$sel_in_out&from_hour=$from_hour&from_minute=$from_minute&from_second=$from_second&to_hour=$to_hour&to_minute=$to_minute&to_second=$to_second\">";
|
||||
echo "<frame name=\"e1_general_down\" src=\"e1_general_down.php?sel_date_from=$sel_date_from&sel_date_to=$sel_date_to&sel_in_out=$sel_in_out&from_hour=$from_hour&from_minute=$from_minute&from_second=$from_second&to_hour=$to_hour&to_minute=$to_minute&to_second=$to_second\">";
|
||||
?>
|
||||
</frameset>
|
||||
188
wxc2_omc/performance/mscCsta/e1_general_up.php
Executable file
188
wxc2_omc/performance/mscCsta/e1_general_up.php
Executable file
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
//Include the head file
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
//the function is called when the page is refresh
|
||||
function page_refresh()
|
||||
{
|
||||
//in&out,fromdate,todate,fromhour,fromminute,fromsecond,tohour,tominute,tosecond
|
||||
|
||||
var down_date_from=document.myform.sel_date_from.value;
|
||||
var down_date_to=document.myform.sel_date_to.value;
|
||||
var in_out=document.myform.sel_in_out.value;
|
||||
var scrollY=document.body.scrollTop;
|
||||
var from_h=document.myform.from_hour.value;
|
||||
var from_m=document.myform.from_minute.value;
|
||||
var from_s=document.myform.from_second.value;
|
||||
var to_h=document.myform.to_hour.value;
|
||||
var to_m=document.myform.to_minute.value;
|
||||
var to_s=document.myform.to_second.value;
|
||||
var secondsFrom=from_h*3600+from_m*60+from_s;
|
||||
var secondsTo=to_h*3600+to_m*60+to_s;
|
||||
if(secondsFrom>secondsTo)
|
||||
alert("Time error");
|
||||
else
|
||||
{
|
||||
if(down_date_from<=down_date_to)
|
||||
down_date_to=down_date_from;
|
||||
var ur="&from_hour="+from_h+"&from_minute="+from_m+"&from_second="+from_s;
|
||||
ur=ur+"&to_hour="+to_h+"&to_minute="+to_m+"&to_second="+to_s+"&sel_in_out="+in_out;
|
||||
var urll='<?php echo"$PHP_SELF";?>?sel_date_from='+down_date_from+'&sel_date_to='+down_date_to+'&scroll_y='+scrollY+ur;
|
||||
window.location.href=urll;
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
<base target="e1_general_down">
|
||||
<?php
|
||||
//File index
|
||||
echo "<table><tr><td><nobr>";
|
||||
echo "$strTitlePerformance > MSC > E1";
|
||||
echo "</td></tr></table>";
|
||||
echo "<div style=\"position:absolute;top:0;left:840;\">";
|
||||
$helpId="3.2.3";
|
||||
showHelp($helpId);
|
||||
echo "</div>";
|
||||
?>
|
||||
|
||||
<!--================Initial the variables=====================-->
|
||||
<?php
|
||||
if(!isset($scroll_y))
|
||||
$scroll_y=0;
|
||||
if(!isset($sel_date_from))
|
||||
$sel_date_from=0;
|
||||
if(!isset($sel_date_to))
|
||||
$sel_date_to=0;
|
||||
if(!isset($sel_in_out))
|
||||
$sel_in_out=2;
|
||||
if(!isset($from_hour))
|
||||
$from_hour="00";
|
||||
if(!isset($from_minute))
|
||||
$from_minute="00";
|
||||
if(!isset($from_second))
|
||||
$from_second="00";
|
||||
if(!isset($to_hour))
|
||||
$to_hour="23";
|
||||
if(!isset($to_minute))
|
||||
$to_minute="59";
|
||||
if(!isset($to_second))
|
||||
$to_second="59";
|
||||
//selection date define
|
||||
$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")));
|
||||
$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y")));
|
||||
$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y")));
|
||||
$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y")));
|
||||
$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y")));
|
||||
$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y")));
|
||||
$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y")));
|
||||
?>
|
||||
|
||||
<form action="e1_general_down.php" method="post" name="myform">
|
||||
<table>
|
||||
<tr>
|
||||
<!--=========================in&out selection=============================-->
|
||||
<td>
|
||||
<select name="sel_in_out" onChange="javascript:page_refresh()">
|
||||
<?php
|
||||
$in_out_string=array("In","Out","In&Out");
|
||||
for($i=0;$i<3;$i++)
|
||||
{
|
||||
if($i==$sel_in_out)
|
||||
echo "<option selected value=$i>$in_out_string[$i]</option>";
|
||||
else
|
||||
echo "<option value=$i>$in_out_string[$i]</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<!--============================date from selection=============================-->
|
||||
<td>
|
||||
<select name="sel_date_from" onChange="javascript:page_refresh()">
|
||||
<?php
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
if($i==$sel_date_from)
|
||||
echo "<option selected value=$i>${day.$i}</option>";
|
||||
else
|
||||
echo "<option value=$i>${day.$i}</option>";
|
||||
}
|
||||
?>
|
||||
</select>to
|
||||
</td>
|
||||
<td>
|
||||
<!--=========================date to selection=================================-->
|
||||
<select name="sel_date_to" onChange="javascript:page_refresh()">
|
||||
<?php
|
||||
for($i=0;$i<=$sel_date_from;$i++)
|
||||
{
|
||||
if($i==$sel_date_to)
|
||||
echo "<option selected value=$i>${day.$i}</option>";
|
||||
else
|
||||
echo "<option value=$i>${day.$i}</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
</td>
|
||||
<!--============================the search button=================================-->
|
||||
<td>
|
||||
<div onClick="javascript:myform.submit();" style="cursor:hand">
|
||||
<img align=absBottom border=0 src="../../images/search.gif">
|
||||
Search
|
||||
</div>
|
||||
</td>
|
||||
<?php
|
||||
//=====================add some blank unit to justify the table====================
|
||||
for($i=0;$i<22;$i++)
|
||||
{
|
||||
echo "<td> </td>";
|
||||
}
|
||||
//========================wether the select time slot is one day==================
|
||||
$slot=$sel_date_from-$sel_date_to+1;
|
||||
//echo "slot:$slot<br>";
|
||||
if($slot==1)
|
||||
{
|
||||
//===============================from_hour text=================================
|
||||
echo "<td><input type=\"hidden\" name=\"from_hour\" value=$from_hour size=\"2\" maxLength=\"2\"></td>";
|
||||
//===============================from_minute text================================
|
||||
echo "<td><input type=\"hidden\" name=\"from_minute\" value=$from_minute size=\"2\" maxLength=\"2\"></td>";
|
||||
//===============================from_second text================================
|
||||
echo "<td><input type=\"hidden\" name=\"from_second\" value=$from_second size=\"2\" maxLength=\"2\"></td>";
|
||||
//===============================to_hour text=====================================
|
||||
echo "<td><input type=\"hidden\" name=\"to_hour\" value=$to_hour size=\"2\" maxLength=\"2\"></td>";
|
||||
//===============================to_minute text===================================
|
||||
echo "<td><input type=\"hidden\" name=\"to_minute\" value=$to_minute size=\"2\" maxLength=\"2\"></td>";
|
||||
//==============================to_second text====================================
|
||||
echo "<td><input type=\"hidden\" name=\"to_second\" value=$to_second size=\"2\" maxLength=\"2\"></td>";
|
||||
}
|
||||
else
|
||||
{
|
||||
//===============================from_hour hidden=================================
|
||||
echo "<td><input type=\"hidden\" name=\"from_hour\" value=$from_hour></td>";
|
||||
//===============================from_minute hidden================================
|
||||
echo "<td><input type=\"hidden\" name=\"from_minute\" value=$from_minute></td>";
|
||||
//===============================from_second hidden================================
|
||||
echo "<td><input type=\"hidden\" name=\"from_second\" value=$from_second></td>";
|
||||
//===============================to_hour hidden=====================================
|
||||
echo "<td><input type=\"hidden\" name=\"to_hour\" value=$to_hour></td>";
|
||||
//===============================to_minute hidden===================================
|
||||
echo "<td><input type=\"hidden\" name=\"to_minute\" value=$to_minute></td>";
|
||||
//==============================to_second hidden====================================
|
||||
echo "<td><input type=\"hidden\" name=\"to_second\" value=$to_second></td>";
|
||||
}
|
||||
?>
|
||||
</tr>
|
||||
</table>
|
||||
<table>
|
||||
<tr>
|
||||
|
||||
<td align="right">
|
||||
<!--==========================the print button=============================-->
|
||||
<div onClick="window.print();" style="position:absolute;top:90;left:840;cursor:hand">
|
||||
<img align=absBottom border=0 src="../../images/printer.gif" width="16" height="16">
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
1959
wxc2_omc/performance/mscCsta/erlang.php
Executable file
1959
wxc2_omc/performance/mscCsta/erlang.php
Executable file
File diff suppressed because it is too large
Load Diff
BIN
wxc2_omc/performance/mscCsta/ser3_1253897512.png
Executable file
BIN
wxc2_omc/performance/mscCsta/ser3_1253897512.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 3.1 KiB |
BIN
wxc2_omc/performance/mscCsta/ser4_1253895012.png
Executable file
BIN
wxc2_omc/performance/mscCsta/ser4_1253895012.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 3.9 KiB |
1152
wxc2_omc/performance/mscCsta/service_detail_down.php
Executable file
1152
wxc2_omc/performance/mscCsta/service_detail_down.php
Executable file
File diff suppressed because it is too large
Load Diff
27
wxc2_omc/performance/mscCsta/service_detail_index.php
Executable file
27
wxc2_omc/performance/mscCsta/service_detail_index.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
/*
|
||||
File Name: service_detail_index.php
|
||||
Description: show the detail service page main frame
|
||||
Author: JianHui Zheng
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
//==============initial the data=======================
|
||||
if(!isset($sel_date_from))
|
||||
$sel_date_from=0;
|
||||
if(!isset($sel_date_to))
|
||||
$sel_date_to=0;
|
||||
if(!isset($service_type))
|
||||
$service_type=0;
|
||||
if(!isset($on_top_index))
|
||||
$on_top_index=0;
|
||||
|
||||
?>
|
||||
<frameset rows="75,*" frameborder=0 border=0>
|
||||
<?php
|
||||
echo "<frame scrolling=\"no\" name=\"service_detail_up\" src=\"service_detail_up.php?sel_date_from=$sel_date_from&sel_date_to=$sel_date_to&service_type=$service_type\">";
|
||||
echo "<frame name=\"service_detail_down\" src=\"service_detail_down.php?on_top_index=$on_top_index&service_type=$service_type&sel_date_from=$sel_date_from&sel_date_to=$sel_date_to\">";
|
||||
?>
|
||||
</frameset>
|
||||
|
||||
117
wxc2_omc/performance/mscCsta/service_detail_up.php
Executable file
117
wxc2_omc/performance/mscCsta/service_detail_up.php
Executable file
@@ -0,0 +1,117 @@
|
||||
<?php
|
||||
//Include the head file
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
<base target="service_detail_down">
|
||||
<script language="JavaScript">
|
||||
function sel_date_from_change()
|
||||
{
|
||||
//sel_date_from,sel_date_to,scroll_y,on_top_index1,on_top_index2
|
||||
var down_date_from=document.myform.sel_date_from.value;
|
||||
var down_date_to=document.myform.sel_date_to.value;
|
||||
var ser_type=document.myform.service_type.value;
|
||||
var on_top=parent.service_detail_down.document.myform.on_top_index.value;
|
||||
//var scrolly=document.body.scrollTop;
|
||||
if(down_date_from<=down_date_to)
|
||||
down_date_to=down_date_from;
|
||||
|
||||
//alert(ser_type);
|
||||
//var urll='<?php echo"$PHP_SELF";?>?sel_date_from='+down_date_from+'&sel_date_to='+down_date_to+'&service_type='+ser_type+"&on_top_index="+on_top+"&scroll_y="+scrolly;
|
||||
var urll='<?php echo"$PHP_SELF";?>?sel_date_from='+down_date_from+'&sel_date_to='+down_date_to+'&service_type='+ser_type+"&on_top_index="+on_top;
|
||||
window.location.href=urll;
|
||||
}
|
||||
</script>
|
||||
<body leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('up');" onresize="javascript:adjust_frame('up');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
|
||||
<form name="myform" action="service_detail_down.php" method="post">
|
||||
<?php
|
||||
|
||||
adjust_head_frame("up");
|
||||
adjust_title_head_frame("up");
|
||||
//==================get the parameter the previous transfer====================
|
||||
$old_sel_date_from=$sel_date_from;
|
||||
$old_sel_date_to=$sel_date_to;
|
||||
//===========================page title========================================
|
||||
echo "<table id=\"table_up\" border=0 width=\"100%\">";
|
||||
echo "<tr>";
|
||||
echo "<td width=50% align=\"left\"><nobr>";
|
||||
echo "$strTitlePerformance > MSC > $strService";
|
||||
echo "</td>";
|
||||
echo "<td width=50% align=\"right\"><nobr>";
|
||||
$helpId="3.2.1";
|
||||
showHelp($helpId);
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td width=50% align=\"left\">";
|
||||
|
||||
//=======================data initial==========================================
|
||||
if(!isset($sel_date_from))
|
||||
$sel_date_from=0;
|
||||
if(!isset($sel_date_to))
|
||||
$sel_date_to=0;
|
||||
if(!isset($service_type))
|
||||
$service_type=0;
|
||||
if(!isset($on_top_index))
|
||||
$on_top_index=0;
|
||||
|
||||
//selection date define
|
||||
$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")));
|
||||
$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y")));
|
||||
$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y")));
|
||||
$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y")));
|
||||
$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y")));
|
||||
$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y")));
|
||||
$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y")));
|
||||
|
||||
echo "<input type=\"hidden\" name=\"service_type\" value=$service_type>";
|
||||
?>
|
||||
<select name="sel_date_from" onChange="javascript:sel_date_from_change()">
|
||||
<?php
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
if($i==$sel_date_from)
|
||||
echo "<option selected value=$i>${day.$i}</option>";
|
||||
else
|
||||
echo "<option value=$i>${day.$i}</option>";
|
||||
}
|
||||
?>
|
||||
</select> to
|
||||
<select name="sel_date_to">
|
||||
<?php
|
||||
for($i=0;$i<=$sel_date_from;$i++)
|
||||
{
|
||||
if($i==$sel_date_to)
|
||||
echo "<option selected value=$i>${day.$i}</option>";
|
||||
else
|
||||
echo "<option value=$i>${day.$i}</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span onClick="javascript:myform.submit()" style="cursor:hand">
|
||||
<IMG align=absBottom border=0 src="../../images/search.gif" ><?php echo "$strSearch"; ?>
|
||||
</span>
|
||||
<?php
|
||||
echo "</td>";
|
||||
echo "<td width=50% align=\"right\">";
|
||||
|
||||
//===================the back link button======================================
|
||||
echo "<a target=\"_parent\" href=\"../../performance/mscCsta/service_general_index.php?sel_date_from=$old_sel_date_from&sel_date_to=$old_sel_date_to&scroll_y=0\"><img src=\"../../images/left.gif\" border=0></img>back</a>";
|
||||
?>
|
||||
|
||||
<a href=# onClick="window.print();" style="cursor:hand">
|
||||
<img align=absBottom border=0 src="../../images/printer.gif" width="16" height="16">
|
||||
</a>
|
||||
<?php
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
|
||||
adjust_title_tail_frame("up");
|
||||
adjust_content_head_frame("up");
|
||||
adjust_content_tail_frame("up");
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
898
wxc2_omc/performance/mscCsta/service_general_down.php
Executable file
898
wxc2_omc/performance/mscCsta/service_general_down.php
Executable file
@@ -0,0 +1,898 @@
|
||||
<?php
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
function hide_and_show_table1()
|
||||
{
|
||||
if(document.all.t1.style.display=="none")
|
||||
{
|
||||
document.all.t0.style.display="";
|
||||
document.all.t1.style.display="";
|
||||
document.all.t2.style.display="";
|
||||
document.all.t3.style.display="";
|
||||
document.all.t4.style.display="";
|
||||
document.all.flag1.value="Hide";
|
||||
}
|
||||
else
|
||||
{
|
||||
document.all.t0.style.display="none";
|
||||
document.all.t1.style.display="none";
|
||||
document.all.t2.style.display="none";
|
||||
document.all.t3.style.display="none";
|
||||
document.all.t4.style.display="none";
|
||||
document.all.flag1.value="Show";
|
||||
}
|
||||
}
|
||||
function hide_and_show_table2()
|
||||
{
|
||||
if(document.all.t5.style.display=="none")
|
||||
{
|
||||
document.all.t5.style.display="";
|
||||
document.all.t6.style.display="";
|
||||
document.all.t7.style.display="";
|
||||
document.all.flag2.value="Hide";
|
||||
}
|
||||
else
|
||||
{
|
||||
document.all.t5.style.display="none";
|
||||
document.all.t6.style.display="none";
|
||||
document.all.t7.style.display="none";
|
||||
document.all.flag2.value="Show";
|
||||
}
|
||||
}
|
||||
function hide_and_show_table3()
|
||||
{
|
||||
if(document.all.t8.style.display=="none")
|
||||
{
|
||||
document.all.t8.style.display="";
|
||||
document.all.t9.style.display="";
|
||||
document.all.t10.style.display="";
|
||||
document.all.t11.style.display="";
|
||||
document.all.t12.style.display="";
|
||||
document.all.flag3.value="Hide";
|
||||
}
|
||||
else
|
||||
{
|
||||
document.all.t8.style.display="none";
|
||||
document.all.t9.style.display="none";
|
||||
document.all.t10.style.display="none";
|
||||
document.all.t11.style.display="none";
|
||||
document.all.t12.style.display="none";
|
||||
document.all.flag3.value="Show";
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<?php
|
||||
?>
|
||||
<?php
|
||||
//============scroll the page====================
|
||||
if($scroll_y > 0){
|
||||
//echo "<body style=\"overflow-x:hidden\" topmargin=\"5\" leftmargin=\"12\" onLoad='self.scrollBy(0,$scroll_y)'>";
|
||||
echo "<body leftmargin=\"15\" rightmargin=\"10\" onload=\"javascript:scroll_div('$scroll_y');javascript:adjust_frame('down');\" onresize=\"javascript:adjust_frame('down');\" style=\"overflow:hidden;overflow-x:hidden;overflow-y:hidden;\">";
|
||||
}else{
|
||||
echo "<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>";
|
||||
//=====================================================================================|
|
||||
//============================Function Flag============================================|
|
||||
//=====================================================================================|
|
||||
$Hide_Show_Function_On=0;
|
||||
$DEBUG=0;
|
||||
//=====================================================================================|
|
||||
//============================Data From Index Page=====================================|
|
||||
//=====================================================================================|
|
||||
if(0)
|
||||
{
|
||||
|
||||
$url_temp=$_SERVER["REQUEST_URI"];
|
||||
echo "This page URL:$url_temp<br>";
|
||||
|
||||
echo "sel_date_from:$sel_date_from<br>";
|
||||
echo "sel_date_to:$sel_date_to<br>";
|
||||
}
|
||||
//=====================================================================================|
|
||||
//============================Define The Data==========================================|
|
||||
//=====================================================================================|
|
||||
//data define
|
||||
for($i=0;$i<12;$i++)
|
||||
{
|
||||
for($j=0;$j<9;$j++)
|
||||
{
|
||||
/*
|
||||
0 sub to sub 0 attempt
|
||||
1 sub to trunk 1 success
|
||||
2 trunk to sub 2 call deny
|
||||
3 trunk to trunk 3 network busy
|
||||
4 interconnection 4 caller clear
|
||||
5 sub to IP 5 subscriber busy
|
||||
6 trunk to IP 6 no answer
|
||||
7 mobile originated 7 signal error
|
||||
8 mobile terminated 8 duration
|
||||
9 in trunk
|
||||
10 out trunk
|
||||
11 IP terminated
|
||||
*/
|
||||
$service_csta[$i][$j]=0;
|
||||
}
|
||||
}
|
||||
|
||||
//===================================================================================|
|
||||
//========================Get The Data From DB=======================================|
|
||||
//===================================================================================|
|
||||
$db=$csta_db;
|
||||
$bgn_time=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")));
|
||||
$end_time=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y")));
|
||||
//get the numbers of days that selected
|
||||
$slot=$sel_date_from-$sel_date_to+1;
|
||||
if(0)
|
||||
{
|
||||
echo "bgn_time:$bgn_time<br>";
|
||||
echo "end_time:$end_time<br>";
|
||||
echo "slot:$slot<br>";
|
||||
echo "db:$csta_db<br>";
|
||||
}
|
||||
|
||||
$key_type_relation=array(5=>0,6=>1,7=>2,8=>3,9=>4,10=>5,11=>6,12=>7,13=>8,14=>9,15=>10,16=>11);
|
||||
for($day=0;$day<$slot;$day++)
|
||||
{
|
||||
$table_name="mscSum";
|
||||
$temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
$table_name=$table_name."_".$temp;
|
||||
|
||||
//echo "table_name:$table_name<br>";
|
||||
$from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
$to_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
//echo "from:$from_time--to:$to_time<br>";
|
||||
|
||||
$select="select key_type,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as subscriber_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration ";
|
||||
$from="from $table_name ";
|
||||
$service_where="and key_type>4 and key_type<17 ";
|
||||
$where="where csta_datetime >='$from_time' and csta_datetime <'$to_time' ".$service_where;
|
||||
$group="group by key_type ";
|
||||
$order="order by key_type ";
|
||||
$sql=$select.$from.$where.$group.$order;
|
||||
//echo "$sql<br>";
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
|
||||
if(!$rows)
|
||||
continue;
|
||||
|
||||
do{
|
||||
$key_type=$rows[key_type];
|
||||
$index=$key_type_relation[$key_type]+0;
|
||||
|
||||
for($tt=0;$tt<9;$tt++)
|
||||
{
|
||||
$service_csta[$index][$tt]+=$rows[$tt+1];
|
||||
//echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}<br>";
|
||||
}
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
}
|
||||
|
||||
//get the 0-hour of the day
|
||||
for($day=0;$day<$slot;$day++)
|
||||
{
|
||||
$table_name="mscSum";
|
||||
$temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y")));
|
||||
$table_name=$table_name."_".$temp;
|
||||
|
||||
//echo "table_name:$table_name<br>";
|
||||
$from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y")));
|
||||
$to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
//echo "from:$from_time--to:$to_time<br>";
|
||||
|
||||
$select="select key_type,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as subscriber_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration ";
|
||||
$from="from $table_name ";
|
||||
$service_where="and key_type>4 and key_type<17 ";
|
||||
$where="where csta_datetime >='$from_time' and csta_datetime <'$to_time' ".$service_where;
|
||||
$group="group by key_type ";
|
||||
$order="order by key_type ";
|
||||
$sql=$select.$from.$where.$group.$order;
|
||||
//echo "$sql<br>";
|
||||
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
|
||||
if(!$rows)
|
||||
continue;
|
||||
|
||||
do{
|
||||
$key_type=$rows[key_type];
|
||||
$index=$key_type_relation[$key_type]+0;
|
||||
|
||||
for($tt=0;$tt<9;$tt++)
|
||||
{
|
||||
$service_csta[$index][$tt]+=$rows[$tt+1];
|
||||
//echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}<br>";
|
||||
}
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
}
|
||||
|
||||
|
||||
//===================================================================================|
|
||||
//==========================Fake Data for Test=======================================|
|
||||
//===================================================================================|
|
||||
if($DEBUG)
|
||||
{
|
||||
for($i=0;$i<12;$i++)
|
||||
{
|
||||
for($j=0;$j<9;$j++)
|
||||
{
|
||||
if($j==0)
|
||||
$service_csta[$i][$j]=rand(200,400);
|
||||
else if($j==1)
|
||||
$service_csta[$i][$j]=rand(100,200);
|
||||
else
|
||||
$service_csta[$i][$j]=rand(0,100);
|
||||
}
|
||||
}
|
||||
}
|
||||
//===================================================================================|
|
||||
//=========================Test The Data=============================================|
|
||||
//===================================================================================|
|
||||
if(0)
|
||||
{
|
||||
for($i=0;$i<12;$i++)
|
||||
{
|
||||
for($j=0;$j<9;$j++)
|
||||
{
|
||||
echo "type-$i-$j:{$service_csta[$i][$j]}<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//===================================================================================|
|
||||
//=======================Show The Table-1============================================|
|
||||
//===================================================================================|
|
||||
//===table title
|
||||
if($slot==1)
|
||||
$table_title="Service statistic Date:".$bgn_time;
|
||||
else
|
||||
$table_title="Service statistic Date:".$bgn_time." to ".$end_time;
|
||||
echo "<center><b>$table_title</b></center>";
|
||||
echo "<table border=\"1\" width=\"100%\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
|
||||
echo "<tr bgcolor=\"#E6E6E6\">";
|
||||
echo "<td align=\"center\" width=\"13%\">Type</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Attempt</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Success</td>";
|
||||
echo "<td align=\"center\" width=\"8%\"><nobr>Call Deny</td>";
|
||||
echo "<td align=\"center\" width=\"8%\"><nobr>Net Busy</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Caller clear</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Sub Busy</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">No Answer</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Signal Error</td>";
|
||||
echo "<td align=\"center\" width=\"10%\">Total call duration</td>";
|
||||
echo "<td align=\"center\" width=\"13%\">Average call duration(s)</td>";
|
||||
echo "</tr>";
|
||||
$service_type_label=array("Subs to subs","Subs to trunk","Trunk to subs","Trunk to trunk","Intraconnection","Subs to IP","Trunk to IP","Mobile originated","Mobile terminated","In trunk","Out trunk","IP terminated");
|
||||
|
||||
//========show subs to subs,subs to local,subs to toll,trunk to subs,trunk to trunk==========
|
||||
for($i=0;$i<12;$i++)
|
||||
{
|
||||
if($i==5||$i==7)
|
||||
{
|
||||
echo "<tr id=\"t$i\">";
|
||||
echo "<td colspan=11> </td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
|
||||
echo "<tr id=\"t$i\">";
|
||||
|
||||
echo "<td align=\"center\"><a target=\"_parent\" href=\"../../performance/mscCsta/service_detail_index.php?on_top_index=0&service_type=$i&sel_date_from=$sel_date_from&sel_date_to=$sel_date_to\">$service_type_label[$i]</a></td>";
|
||||
for($j=0;$j<9;$j++)
|
||||
{
|
||||
echo "<td align=\"center\">";
|
||||
if($j==8)
|
||||
{
|
||||
echo "{$service_csta[$i][$j]}(s)";
|
||||
$hour=floor($service_csta[$i][$j]/3600);
|
||||
$minute=floor($service_csta[$i][$j]%3600/60);
|
||||
$second=$service_csta[$i][$j]%60;
|
||||
if($hour==0&&$minute==0&&$second==0)
|
||||
echo "<br>";
|
||||
else
|
||||
echo "<br>$hour:$minute:$second";
|
||||
}
|
||||
else
|
||||
echo "{$service_csta[$i][$j]}";
|
||||
if($j>0&&$j<8)
|
||||
{
|
||||
if($service_csta[$i][0]==0)
|
||||
$rate=0;
|
||||
else
|
||||
{
|
||||
$rate=$service_csta[$i][$j]/$service_csta[$i][0];
|
||||
$rate=$rate*100;
|
||||
if($rate!=0&&$rate!=100)
|
||||
$rate=number_format($rate, 2, '.', '');
|
||||
}
|
||||
echo "<br>$rate%";
|
||||
}
|
||||
echo "</td>";
|
||||
}
|
||||
echo "<td align=\"center\">";
|
||||
if($service_csta[$i][1]!=0)
|
||||
$ave=round($service_csta[$i][8]/$service_csta[$i][1]);
|
||||
else
|
||||
$ave=0;
|
||||
echo "$ave";
|
||||
echo "</td>";
|
||||
|
||||
echo "</tr>";
|
||||
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
if($Hide_Show_Function_On==1)
|
||||
echo "<input type=button id=flag1 value=Hide onClick=\"javascript:hide_and_show_table1()\">";
|
||||
|
||||
|
||||
if($Hide_Show_Function_On==1)
|
||||
echo "<input type=button id=flag2 value=Hide onClick=\"javascript:hide_and_show_table2()\">";
|
||||
|
||||
if($Hide_Show_Function_On==1)
|
||||
echo "<input type=button id=flag3 value=Hide onClick=\"javascript:hide_and_show_table3()\">";
|
||||
|
||||
//=====================================================================================|
|
||||
//=======================Draw The Graphics-1===========================================|
|
||||
//=====================================================================================|
|
||||
echo "<p><b>2.Service(Attempt)</b><br>";
|
||||
//=====graphics size=======
|
||||
$sizex=830;
|
||||
$sizey=250;
|
||||
|
||||
$im = ImageCreate ($sizex, $sizey);
|
||||
$background_color=ImageColorAllocate($im,255,255,255);
|
||||
$black_color=ImageColorAllocate($im,0,0,0);
|
||||
$white_color= imagecolorallocate($im, 255, 255, 255);
|
||||
|
||||
|
||||
$bgcolor=F8F8F8;
|
||||
$fgcolor=000000;
|
||||
|
||||
$background_color = ImageColorAllocate ($im,
|
||||
hexdec(substr($bgcolor, 0, 2)),
|
||||
hexdec(substr($bgcolor, 2, 2)),
|
||||
hexdec(substr($bgcolor, 4, 2)));
|
||||
|
||||
$text_color = ImageColorAllocate ($im,
|
||||
hexdec(substr($fgcolor, 0, 2)),
|
||||
hexdec(substr($fgcolor, 2, 2)),
|
||||
hexdec(substr($fgcolor, 4, 2)));
|
||||
|
||||
|
||||
//====graphics background=======
|
||||
ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198));
|
||||
ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130));
|
||||
$pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1);
|
||||
Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130));
|
||||
$pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4);
|
||||
Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130));
|
||||
ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color);
|
||||
|
||||
|
||||
|
||||
imagedashedline($im,30,30,100,100,$black_color);
|
||||
|
||||
//======draw the horizonal line========
|
||||
$style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color);
|
||||
imagesetstyle($im, $style);
|
||||
for($i=10;$i>0;$i--)
|
||||
{
|
||||
$x1=40;
|
||||
$y1=20+(10-$i)*18;
|
||||
$x2=790;
|
||||
$y2=$y1;
|
||||
|
||||
if($i!=10)
|
||||
{
|
||||
imageline($im, $x1,$y1,460,$y2, IMG_COLOR_STYLED);
|
||||
imageline($im, 490,$y1,$x2,$y2, IMG_COLOR_STYLED);
|
||||
}
|
||||
|
||||
imagestring($im,2,$x1-22,$y2-5,($i*10)."%",$black_color);
|
||||
imagestring($im,2,$x2+5,$y2-5,($i*10)."%",$black_color);
|
||||
|
||||
}
|
||||
|
||||
//=======draw the vitical line=======
|
||||
$u=floor(750/25);
|
||||
for($i=0;$i<25;$i++)
|
||||
{
|
||||
$x1=40+$i*$u;
|
||||
$y1=20;
|
||||
$x2=$x1;
|
||||
$y2=200;
|
||||
ImageDashedLine($im,$x1,$y1,$x2,$y2,$black_color);
|
||||
}
|
||||
|
||||
//=======get colors============
|
||||
$color[0]=ImageColorAllocate($im,0x99,0x00,0x33);
|
||||
$color[1]=ImageColorAllocate($im,0x99,0x00,0xcc);
|
||||
$color[2]=ImageColorAllocate($im,0x99,0x99,0x00);
|
||||
$color[3]=ImageColorAllocate($im,0x99,0xcc,0x99);
|
||||
$color[4]=ImageColorAllocate($im,0x99,0xff,0x33);
|
||||
$color[5]=ImageColorAllocate($im,0xff,0x99,0x66);
|
||||
$color[6]=ImageColorAllocate($im,0xff,0x99,0xff);
|
||||
$color[7]=ImageColorAllocate($im,0xff,0xff,0x00);
|
||||
$color[8]=ImageColorAllocate($im,0x33,0x3,0x33);
|
||||
$color[9]=ImageColorAllocate($im,0x00,0xcc,0xff);
|
||||
$color[10]=ImageColorAllocate($im,0x00,0x66,0xcc);
|
||||
$color[11]=ImageColorAllocate($im,0x33,0xff,0x99);
|
||||
|
||||
|
||||
//=====get the precent and block height(Part-1)======
|
||||
$attempt_sum_one=0;
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
$attempt_sum_one+=$service_csta[$i][0];
|
||||
}
|
||||
if($attempt_sum_one==0)
|
||||
{
|
||||
//sub to sub precent
|
||||
$subs_to_subs_attempt_precent="0%";
|
||||
//sub to trunk precent
|
||||
$subs_to_trunk_attempt_precent="0%";
|
||||
//trunk to sub precent
|
||||
$trunk_to_subs_attempt_precent="0%";
|
||||
//trunk to trunk precent
|
||||
$trunk_to_trunk_attempt_precent="0%";
|
||||
//interconnection precent
|
||||
$interconnection_attempt_precent="0%";
|
||||
|
||||
//subs to IP precent
|
||||
$subs_to_ip_attempt_precent="0%";
|
||||
//trunk to IP precent
|
||||
$trunk_to_ip_attempt_precent="0%";
|
||||
|
||||
|
||||
for($t=0;$t<7;$t++)
|
||||
$height[$t]=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
//sub to sub precent
|
||||
$subs_to_subs_attempt_precent=number_format($service_csta[0][0]*100/$attempt_sum_one,2,'.','')."%";
|
||||
//sub to trunk precent
|
||||
$subs_to_trunk_attempt_precent=number_format($service_csta[1][0]*100/$attempt_sum_one,2,'.','')."%";
|
||||
//trunk to sub precent
|
||||
$trunk_to_subs_attempt_precent=number_format($service_csta[2][0]*100/$attempt_sum_one,2,'.','')."%";
|
||||
//trunk to trunk precent
|
||||
$trunk_to_trunk_attempt_precent=number_format($service_csta[3][0]*100/$attempt_sum_one,2,'.','')."%";
|
||||
//interconnection precent
|
||||
$interconnection_attempt_precent=number_format($service_csta[4][0]*100/$attempt_sum_one,2,'.','')."%";
|
||||
|
||||
//subs to IP precent
|
||||
$subs_to_ip_attempt_precent=number_format($service_csta[5][0]*100/$attempt_sum_one,2,'.','')."%";
|
||||
//trunk to IP precent
|
||||
$trunk_to_ip_attempt_precent=number_format($service_csta[6][0]*100/$attempt_sum_one,2,'.','')."%";
|
||||
|
||||
|
||||
for($t=0;$t<7;$t++)
|
||||
$height[$t]=floor(180*$service_csta[$t][0]/$attempt_sum_one);
|
||||
|
||||
}
|
||||
//=====get the precent and block height(Part-2)======
|
||||
$attempt_sum_tow=0;
|
||||
for($i=7;$i<12;$i++)
|
||||
{
|
||||
$attempt_sum_tow+=$service_csta[$i][0];
|
||||
}
|
||||
if($attempt_sum_tow==0)
|
||||
{
|
||||
//mobile originated precent
|
||||
$mobile_originated_attempt_precent="0%";
|
||||
//mobile terminated precent
|
||||
$mobile_terminated_attempt_precent="0%";
|
||||
//in trunk precent
|
||||
$in_trunk_attempt_precent="0%";
|
||||
//out_trunk precent
|
||||
$out_trunk_attempt_precent="0%";
|
||||
//IP terminated precent
|
||||
$ip_terminated_attempt_precent="0%";
|
||||
|
||||
|
||||
for($t=7;$t<12;$t++)
|
||||
$height[$t]=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
//mobile originated precent
|
||||
$mobile_originated_attempt_precent=number_format($service_csta[7][0]*100/$attempt_sum_tow,2,'.','')."%";
|
||||
//mobile terminated precent
|
||||
$mobile_terminated_attempt_precent=number_format($service_csta[8][0]*100/$attempt_sum_tow,2,'.','')."%";
|
||||
//in trunk precent
|
||||
$in_trunk_attempt_precent=number_format($service_csta[9][0]*100/$attempt_sum_tow,2,'.','')."%";
|
||||
//out_trunk precent
|
||||
$out_trunk_attempt_precent=number_format($service_csta[10][0]*100/$attempt_sum_tow,2,'.','')."%";
|
||||
//IP terminated precent
|
||||
$ip_terminated_attempt_precent=number_format($service_csta[11][0]*100/$attempt_sum_tow,2,'.','')."%";
|
||||
|
||||
|
||||
for($t=7;$t<12;$t++)
|
||||
$height[$t]=floor(180*$service_csta[$t][0]/$attempt_sum_tow);
|
||||
|
||||
}
|
||||
|
||||
//======draw the data block======
|
||||
for($i=0;$i<12;$i++)
|
||||
{
|
||||
$x1=40+(2*$i+1)*$u;
|
||||
if($height[$i]==0)
|
||||
$height[$i]=1;
|
||||
$y1=200-$height[$i];
|
||||
$x2=40+(2*$i+2)*$u;
|
||||
$y2=199;
|
||||
imagefilledrectangle($im,$x1,$y1,$x2,$y2,$color[$i]);
|
||||
}
|
||||
|
||||
//======draw the legend string=======
|
||||
imagestring($im,2,65,205,"SUB SUB",$black_color);
|
||||
imagestring($im,2,60,220,"(".$subs_to_subs_attempt_precent.")",$black_color);
|
||||
imagestring($im,2,125,205,"SUB TRK",$black_color);
|
||||
imagestring($im,2,123,220,"(".$subs_to_trunk_attempt_precent.")",$black_color);
|
||||
imagestring($im,2,185,205,"TRK SUB",$black_color);
|
||||
imagestring($im,2,185,220,"(".$trunk_to_subs_attempt_precent.")",$black_color);
|
||||
imagestring($im,2,245,205,"TRK TRK",$black_color);
|
||||
imagestring($im,2,243,221,"(".$trunk_to_trunk_attempt_precent.")",$black_color);
|
||||
imagestring($im,2,310,205,"INTRA",$black_color);
|
||||
imagestring($im,2,308,221,"(".$interconnection_attempt_precent.")",$black_color);
|
||||
imagestring($im,2,368,205,"SUB IP",$black_color);
|
||||
imagestring($im,2,366,221,"(".$subs_to_ip_attempt_precent.")",$black_color);
|
||||
imagestring($im,2,428,205,"TRK IP",$black_color);
|
||||
imagestring($im,2,425,221,"(".$trunk_to_ip_attempt_precent.")",$black_color);
|
||||
imagestring($im,2,500,205,"MO",$black_color);
|
||||
imagestring($im,2,487,221,"(".$mobile_originated_attempt_precent.")",$black_color);
|
||||
imagestring($im,2,560,205,"MT",$black_color);
|
||||
imagestring($im,2,547,221,"(".$mobile_terminated_attempt_precent.")",$black_color);
|
||||
imagestring($im,2,608,205,"IN TRK",$black_color);
|
||||
imagestring($im,2,605,221,"(".$in_trunk_attempt_precent.")",$black_color);
|
||||
imagestring($im,2,668,205,"OUT TRK",$black_color);
|
||||
imagestring($im,2,667,221,"(".$out_trunk_attempt_precent.")",$black_color);
|
||||
imagestring($im,2,742,205,"IP",$black_color);
|
||||
imagestring($im,2,727,221,"(".$ip_terminated_attempt_precent.")",$black_color);
|
||||
|
||||
//draw the outline
|
||||
imageLine($im,40,20,40,200,$black_color);
|
||||
imageLine($im,40,20,460,20,$black_color);
|
||||
imageLine($im,460,200,460,20,$black_color);
|
||||
imageLine($im,40,200,460,200,$black_color);
|
||||
|
||||
imageLine($im,490,200,490,20,$black_color);
|
||||
imageLine($im,490,20,790,20,$black_color);
|
||||
imageLine($im,790,200,790,20,$black_color);
|
||||
imageLine($im,490,200,790,200,$black_color);
|
||||
|
||||
|
||||
//======show the service attempt graphics==========
|
||||
//-----<2D><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//delete *.png
|
||||
$handle=opendir('.');
|
||||
while($file=readdir($handle)){
|
||||
$retval="";
|
||||
$pt=strrpos($file,".");
|
||||
if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt);
|
||||
if($retval=='png') unlink($file);
|
||||
}
|
||||
$filename="ser3_".time().".png";
|
||||
if(1){
|
||||
ImagePng ($im,"$filename");
|
||||
|
||||
ImageDestroy($im);
|
||||
}
|
||||
//-----<2D><>ʾͼƬ
|
||||
echo "<img src=\"$filename\"></img>";
|
||||
|
||||
//=======show the remark label========
|
||||
echo "<table width=\"100%\" border=0>";
|
||||
|
||||
echo "<tr>";
|
||||
echo "<td width=\"34%\"><font color=blue>SUB SUB</font>-> Subscriber to subscriber</td>";
|
||||
echo "<td width=\"34%\"><font color=blue>TRK TRK</font>-> Trunk to trunk</td>";
|
||||
echo "<td width=\"33%\"><font color=blue>MO</font>-> Mobile originated</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td width=\"33%\"><font color=blue>SUB TRK</font>-> Subscriber to trunk</td>";
|
||||
echo "<td width=\"33%\"><font color=blue>INTRA</font>-> Intraconnection</td>";
|
||||
echo "<td width=\"33%\"><font color=blue>MT</font>-> Mobile terminated</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td width=\"33%\"><font color=blue>TRK SUB</font>-> Trunk to subscriber</td>";
|
||||
echo "<td width=\"33%\"><font color=blue>SUB IP</font>-> Subscriber to IP</td>";
|
||||
echo "<td width=\"34%\"><font color=blue>IN TRK</font>-> In trunk</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td width=\"33%\"><font color=blue>TRK IP</font>-> Trunk to IP</td>";
|
||||
echo "<td width=\"33%\"></td>";
|
||||
echo "<td width=\"34%\"><font color=blue>OUT TRK</font>-> Out trunk</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td width=\"33%\"></td>";
|
||||
echo "<td width=\"33%\"></td>";
|
||||
echo "<td width=\"33%\"><font color=blue>IP</font>-> IP terminated</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
|
||||
//=====================================================================================|
|
||||
//========================Draw The Graphics-2==========================================|
|
||||
//=====================================================================================|
|
||||
//=======draw the Success failure graphics==========
|
||||
echo "<p><b>3.Success/Failure<br>";
|
||||
$sizex=830;
|
||||
$sizey=310;
|
||||
$image=imagecreate($sizex,$sizey);
|
||||
$bgcolor=imagecolorallocate($image,255,255,255);
|
||||
$black_color=ImageColorAllocate($image,0,0,0);
|
||||
|
||||
$bgcolor=F8F8F8;
|
||||
$fgcolor=000000;
|
||||
|
||||
$background_color = ImageColorAllocate ($image,
|
||||
hexdec(substr($bgcolor, 0, 2)),
|
||||
hexdec(substr($bgcolor, 2, 2)),
|
||||
hexdec(substr($bgcolor, 4, 2)));
|
||||
|
||||
$text_color = ImageColorAllocate ($image,
|
||||
hexdec(substr($fgcolor, 0, 2)),
|
||||
hexdec(substr($fgcolor, 2, 2)),
|
||||
hexdec(substr($fgcolor, 4, 2)));
|
||||
|
||||
//=====background========
|
||||
ImageFilledRectangle($image,0,0,$sizex,$sizey,ImageColorAllocate ($image, 198, 198, 198));
|
||||
ImageFilledRectangle($image,2,2,$sizex,$sizey,ImageColorAllocate ($image, 130, 130, 130));
|
||||
$pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1);
|
||||
Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130));
|
||||
$pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4);
|
||||
Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130));
|
||||
ImageFilledRectangle($image,2,2,$sizex-3,$sizey-3,$background_color);
|
||||
|
||||
//first
|
||||
imageLine($image,40,20,40,200,$black_color);
|
||||
imageLine($image,40,20,400,20,$black_color);
|
||||
imageLine($image,400,200,400,20,$black_color);
|
||||
imageLine($image,40,200,400,200,$black_color);
|
||||
|
||||
//second
|
||||
imageLine($image,430,20,430,200,$black_color);
|
||||
imageLine($image,430,20,790,20,$black_color);
|
||||
imageLine($image,790,200,790,20,$black_color);
|
||||
imageLine($image,430,200,790,200,$black_color);
|
||||
|
||||
//========draw the horizonal line(part-1)=======
|
||||
$style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color);
|
||||
imagesetstyle($image, $style);
|
||||
for($i=10;$i>0;$i--)
|
||||
{
|
||||
$x1=40;
|
||||
$y1=20+(10-$i)*18;
|
||||
$x2=400;
|
||||
$y2=$y1;
|
||||
|
||||
if($i!=10)
|
||||
imageline($image, $x1,$y1,$x2,$y2, IMG_COLOR_STYLED);
|
||||
|
||||
imagestring($image,2,$x1-22,$y2-5,($i*10)."%",$black_color);
|
||||
}
|
||||
//========draw the horizonal line(part-2)=======
|
||||
$style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color);
|
||||
imagesetstyle($image, $style);
|
||||
for($i=10;$i>0;$i--)
|
||||
{
|
||||
$x1=430;
|
||||
$y1=20+(10-$i)*18;
|
||||
$x2=790;
|
||||
$y2=$y1;
|
||||
|
||||
if($i!=10)
|
||||
imageline($image, $x1,$y1,$x2,$y2, IMG_COLOR_STYLED);
|
||||
|
||||
imagestring($image,2,$x1-22,$y2-5,($i*10)."%",$black_color);
|
||||
}
|
||||
|
||||
//========draw the vitical line(part-1)=========
|
||||
$u=floor(360/15);
|
||||
for($i=0;$i<16;$i++)
|
||||
{
|
||||
$x1=40+$i*$u;
|
||||
$y1=20;
|
||||
$x2=$x1;
|
||||
$y2=200;
|
||||
ImageDashedLine($image,$x1,$y1,$x2,$y2,$black_color);
|
||||
}
|
||||
//========draw the vitical line(part-2)=========
|
||||
for($i=0;$i<16;$i++)
|
||||
{
|
||||
$x1=430+$i*$u;
|
||||
$y1=20;
|
||||
$x2=$x1;
|
||||
$y2=200;
|
||||
ImageDashedLine($image,$x1,$y1,$x2,$y2,$black_color);
|
||||
}
|
||||
|
||||
//=======get colors============
|
||||
$color[0]=ImageColorAllocate($image,0x99,0x00,0x33);
|
||||
$color[1]=ImageColorAllocate($image,0x99,0x00,0xcc);
|
||||
$color[2]=ImageColorAllocate($image,0x99,0x99,0x00);
|
||||
$color[3]=ImageColorAllocate($image,0x99,0xcc,0x99);
|
||||
$color[4]=ImageColorAllocate($image,0x99,0xff,0x33);
|
||||
$color[5]=ImageColorAllocate($image,0xff,0x99,0x66);
|
||||
$color[6]=ImageColorAllocate($image,0xff,0x99,0xff);
|
||||
$color[7]=ImageColorAllocate($image,0xff,0xff,0x00);
|
||||
$color[8]=ImageColorAllocate($image,0x33,0x3,0x33);
|
||||
$color[9]=ImageColorAllocate($image,0x00,0xcc,0xff);
|
||||
$color[10]=ImageColorAllocate($image,0x00,0x66,0xcc);
|
||||
$color[11]=ImageColorAllocate($image,0x33,0xff,0x99);
|
||||
|
||||
|
||||
//======get the block height(part-1)===========
|
||||
$sum_one=0;
|
||||
for($i=0;$i<7;$i++)
|
||||
$sum_one+=$service_csta[$i][0];
|
||||
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
|
||||
for($j=0;$j<7;$j++)
|
||||
{
|
||||
if($sum_one==0)
|
||||
$total_height[$j][$i]=0;
|
||||
else
|
||||
$total_height[$j][$i]=floor(180*$service_csta[$i][$j+1]/$sum_one);
|
||||
}
|
||||
}
|
||||
//======get the block height(part-2)===========
|
||||
$sum_two=0;
|
||||
for($i=7;$i<12;$i++)
|
||||
$sum_two+=$service_csta[$i][0];
|
||||
for($i=7;$i<12;$i++)
|
||||
{
|
||||
|
||||
for($j=0;$j<7;$j++)
|
||||
{
|
||||
if($sum_two==0)
|
||||
$total_height[$j][$i]=0;
|
||||
else
|
||||
$total_height[$j][$i]=floor(180*$service_csta[$i][$j+1]/$sum_two);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//========draw the data block(part-1)==========
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
for($j=0;$j<7;$j++)
|
||||
{
|
||||
if($total_height[$i][$j]<1)
|
||||
$total_height[$i][$j]=0;
|
||||
//echo "lie-$i-hang-$j-{$total_height[$i][$j]}<br>";
|
||||
$x1=40+(2*$i+1)*24;
|
||||
$y1=199;
|
||||
for($z=0;$z<$j+1;$z++)
|
||||
{
|
||||
$y1=$y1-$total_height[$i][$z];
|
||||
}
|
||||
$x2=40+(2*$i+2)*24;
|
||||
$y2=199;
|
||||
for($z=0;$z<$j;$z++)
|
||||
{
|
||||
$y2=$y2-$total_height[$i][$z];
|
||||
}
|
||||
|
||||
imagefilledrectangle($image,$x1,$y1,$x2,$y2,$color[$j]);
|
||||
}
|
||||
}
|
||||
|
||||
//========draw the data block(part-2)==========
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
for($j=7;$j<12;$j++)
|
||||
{
|
||||
if($total_height[$i][$j]<1)
|
||||
$total_height[$i][$j]=0;
|
||||
//echo "lie-$i-hang-$j-{$total_height[$i][$j]}<br>";
|
||||
$x1=430+(2*$i+1)*24;
|
||||
$y1=199;
|
||||
for($z=7;$z<$j+1;$z++)
|
||||
{
|
||||
$y1=$y1-$total_height[$i][$z];
|
||||
}
|
||||
$x2=430+(2*$i+2)*24;
|
||||
$y2=199;
|
||||
for($z=7;$z<$j;$z++)
|
||||
{
|
||||
$y2=$y2-$total_height[$i][$z];
|
||||
}
|
||||
|
||||
imagefilledrectangle($image,$x1,$y1,$x2,$y2,$color[$j]);
|
||||
}
|
||||
}
|
||||
|
||||
//=====draw the legend string(part-1)============
|
||||
imagefilledrectangle($image,30,230,40,240,$color[0]);
|
||||
imagestring($image,2,50,230,"SUB SUB",$black_color);
|
||||
|
||||
imagefilledrectangle($image,170,230,180,240,$color[1]);
|
||||
imagestring($image,2,190,230,"SUB TRK",$black_color);
|
||||
|
||||
imagefilledrectangle($image,320,230,330,240,$color[2]);
|
||||
imagestring($image,2,340,230,"TRK SUB",$black_color);
|
||||
|
||||
imagefilledrectangle($image,470,230,480,240,$color[7]);
|
||||
imagestring($image,2,490,230,"MO",$black_color);
|
||||
|
||||
imagefilledrectangle($image,620,230,630,240,$color[8]);
|
||||
imagestring($image,2,640,230,"MT",$black_color);
|
||||
|
||||
imagefilledrectangle($image,760,230,770,240,$color[9]);
|
||||
imagestring($image,2,780,230,"IN TRK",$black_color);
|
||||
|
||||
imagefilledrectangle($image,30,250,40,260,$color[6]);
|
||||
imagestring($image,2,50,250,"TRK IP",$black_color);
|
||||
|
||||
imagefilledrectangle($image,170,250,180,260,$color[3]);
|
||||
imagestring($image,2,190,250,"TRK TRK",$black_color);
|
||||
|
||||
imagefilledrectangle($image,320,250,330,260,$color[4]);
|
||||
imagestring($image,2,340,250,"INTRA",$black_color);
|
||||
|
||||
imagefilledrectangle($image,470,250,480,260,$color[10]);
|
||||
imagestring($image,2,490,250,"OUT TRK",$black_color);
|
||||
|
||||
imagefilledrectangle($image,620,250,630,260,$color[11]);
|
||||
imagestring($image,2,640,250,"IP",$black_color);
|
||||
|
||||
imagefilledrectangle($image,30,270,40,280,$color[5]);
|
||||
imagestring($image,2,50,270,"SUB IP",$black_color);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
imagestring($image,2,55,205,"Success",$black_color);
|
||||
imagestring($image,2,113,200,"Call",$black_color);
|
||||
imagestring($image,2,113,212,"Deny",$black_color);
|
||||
imagestring($image,2,165,200,"Net",$black_color);
|
||||
imagestring($image,2,163,212,"Busy",$black_color);
|
||||
imagestring($image,2,202,200,"Caller",$black_color);
|
||||
imagestring($image,2,204,212,"Clear",$black_color);
|
||||
imagestring($image,2,260,200,"Sub",$black_color);
|
||||
imagestring($image,2,258,212,"Busy",$black_color);
|
||||
imagestring($image,2,310,200,"No",$black_color);
|
||||
imagestring($image,2,303,212,"Answer",$black_color);
|
||||
imagestring($image,2,348,200,"Signal",$black_color);
|
||||
imagestring($image,2,349,212,"Error",$black_color);
|
||||
|
||||
imagestring($image,2,445,205,"Success",$black_color);
|
||||
imagestring($image,2,113+390,200,"Call",$black_color);
|
||||
imagestring($image,2,113+390,212,"Deny",$black_color);
|
||||
imagestring($image,2,165+390,200,"Net",$black_color);
|
||||
imagestring($image,2,163+390,212,"Busy",$black_color);
|
||||
imagestring($image,2,202+390,200,"Caller",$black_color);
|
||||
imagestring($image,2,204+390,212,"Clear",$black_color);
|
||||
imagestring($image,2,260+390,200,"Sub",$black_color);
|
||||
imagestring($image,2,258+390,212,"Busy",$black_color);
|
||||
imagestring($image,2,310+390,200,"No",$black_color);
|
||||
imagestring($image,2,303+390,212,"Answer",$black_color);
|
||||
imagestring($image,2,348+390,200,"Signal",$black_color);
|
||||
imagestring($image,2,349+390,212,"Error",$black_color);
|
||||
|
||||
//======show the answer failure graphics=====
|
||||
$tt=time()-2500;
|
||||
$file_name="ser4_".$tt.".png";
|
||||
imagepng($image,$file_name);
|
||||
imagedestroy($image);
|
||||
echo "<img src=$file_name></img>";
|
||||
adjust_content_tail("down");
|
||||
?>
|
||||
|
||||
|
||||
</body>
|
||||
23
wxc2_omc/performance/mscCsta/service_general_index.php
Executable file
23
wxc2_omc/performance/mscCsta/service_general_index.php
Executable file
@@ -0,0 +1,23 @@
|
||||
<?php
|
||||
/*
|
||||
File Name: service_general_index.php
|
||||
Description: show the general service page main frame
|
||||
Author: JianHui Zheng
|
||||
*/
|
||||
?>
|
||||
|
||||
<?php
|
||||
//==============initial the data=======================
|
||||
if(!isset($sel_date_from))
|
||||
$sel_date_from=0;
|
||||
if(!isset($sel_date_to))
|
||||
$sel_date_to=0;
|
||||
|
||||
?>
|
||||
<frameset rows="75,*" frameborder=0 border=0>
|
||||
<?php
|
||||
echo "<frame scrolling=\"no\" name=\"service_general_up\" src=\"service_general_up.php?sel_date_from=$sel_date_from&sel_date_to=$sel_date_to\">";
|
||||
echo "<frame name=\"service_general_down\" src=\"service_general_down.php?sel_date_from=$sel_date_from&sel_date_to=$sel_date_to\">";
|
||||
?>
|
||||
</frameset>
|
||||
|
||||
98
wxc2_omc/performance/mscCsta/service_general_up.php
Executable file
98
wxc2_omc/performance/mscCsta/service_general_up.php
Executable file
@@ -0,0 +1,98 @@
|
||||
<?php
|
||||
//Include the head file
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
|
||||
<script language="JavaScript">
|
||||
//the function is called when the sel_date_from value changed
|
||||
function sel_date_from_change()
|
||||
{
|
||||
var down_date_from=document.myform.sel_date_from.value;
|
||||
var down_date_to=document.myform.sel_date_to.value;
|
||||
//var scrollY=document.body.scrollTop;
|
||||
if(down_date_from<=down_date_to)
|
||||
down_date_to=down_date_from;
|
||||
//var urll='<?php echo"$PHP_SELF";?>?sel_date_from='+down_date_from+'&sel_date_to='+down_date_to+'&scroll_y='+scrollY;
|
||||
var urll='<?php echo"$PHP_SELF";?>?sel_date_from='+down_date_from+'&sel_date_to='+down_date_to;
|
||||
window.location.href=urll;
|
||||
}
|
||||
</script>
|
||||
<base target="service_general_down">
|
||||
<body leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('up');" onresize="javascript:adjust_frame('up');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
|
||||
<form action="service_general_down.php" method="post" name="myform">
|
||||
<?php
|
||||
adjust_head_frame("up");
|
||||
adjust_title_head_frame("up");
|
||||
echo "<table id=\"table_up\" border=0 width=\"100%\">";
|
||||
echo "<tr>";
|
||||
echo "<td width=50% align=\"left\">";
|
||||
echo "$strTitlePerformance > MSC > $strService";
|
||||
echo "</td>";
|
||||
echo "<td align=\"right\">";
|
||||
$helpId="3.2.1";
|
||||
showHelp($helpId);
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td align=\"left\">";
|
||||
|
||||
//<!--================Initial the variables=====================-->
|
||||
if(!isset($sel_date_from))
|
||||
$sel_date_from=0;
|
||||
if(!isset($sel_date_to))
|
||||
$sel_date_to=0;
|
||||
//selection date define
|
||||
$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")));
|
||||
$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y")));
|
||||
$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y")));
|
||||
$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y")));
|
||||
$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y")));
|
||||
$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y")));
|
||||
$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y")));
|
||||
|
||||
?>
|
||||
<select name="sel_date_from" onChange="javascript:sel_date_from_change()">
|
||||
<?php
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
if($i==$sel_date_from)
|
||||
echo "<option selected value=$i>${day.$i}</option>";
|
||||
else
|
||||
echo "<option value=$i>${day.$i}</option>";
|
||||
}
|
||||
?>
|
||||
</select> to
|
||||
<select name="sel_date_to">
|
||||
<?php
|
||||
for($i=0;$i<=$sel_date_from;$i++)
|
||||
{
|
||||
if($i==$sel_date_to)
|
||||
echo "<option selected value=$i>${day.$i}</option>";
|
||||
else
|
||||
echo "<option value=$i>${day.$i}</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span onClick="javascript:myform.submit()" style="cursor:hand">
|
||||
<IMG align=absBottom border=0 src="../../images/search.gif" ><?php echo "$strSearch"; ?>
|
||||
</span>
|
||||
<?php
|
||||
echo "</td>";
|
||||
echo "<td align=\"right\">";
|
||||
|
||||
?>
|
||||
<span onClick="window.print();" style="cursor:hand">
|
||||
<img border=0 src="../../images/printer.gif" width="16" height="16">
|
||||
</span>
|
||||
<?php
|
||||
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
adjust_title_tail_frame("up");
|
||||
adjust_content_head_frame("up");
|
||||
adjust_content_tail_frame("up");
|
||||
?>
|
||||
|
||||
|
||||
BIN
wxc2_omc/performance/mscCsta/test/aa
Executable file
BIN
wxc2_omc/performance/mscCsta/test/aa
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 530 B |
11
wxc2_omc/performance/mscCsta/test/test.php
Executable file
11
wxc2_omc/performance/mscCsta/test/test.php
Executable file
@@ -0,0 +1,11 @@
|
||||
<script language="JavaScript">
|
||||
</script>
|
||||
|
||||
<form name=myform>
|
||||
name:<input type=name size=10><br>
|
||||
<input type="image" src="../../images/search.gif" name="sub">
|
||||
</form>
|
||||
<?php
|
||||
$a=array("a",2=>"b");
|
||||
print_r($a);
|
||||
?>
|
||||
27
wxc2_omc/performance/mscCsta/test/test1.php
Executable file
27
wxc2_omc/performance/mscCsta/test/test1.php
Executable file
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
//Include the head file
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
|
||||
<?php
|
||||
|
||||
$value="87";
|
||||
//1000 0111
|
||||
$v=getBitValue($value,"0.0");
|
||||
echo "$v ";
|
||||
$v=getBitValue($value,"0.1");
|
||||
echo "$v ";
|
||||
$v=getBitValue($value,"0.2");
|
||||
echo "$v ";
|
||||
$v=getBitValue($value,"0.3");
|
||||
echo "$v ";
|
||||
$v=getBitValue($value,"1.0");
|
||||
echo "$v ";
|
||||
$v=getBitValue($value,"1.1");
|
||||
echo "$v ";
|
||||
$v=getBitValue($value,"1.2");
|
||||
echo "$v ";
|
||||
$v=getBitValue($value,"1.3");
|
||||
echo "$v ";
|
||||
|
||||
?>
|
||||
10
wxc2_omc/performance/mscCsta/test/test2.php
Executable file
10
wxc2_omc/performance/mscCsta/test/test2.php
Executable file
@@ -0,0 +1,10 @@
|
||||
<html>
|
||||
<head><title>Solution</title></head>
|
||||
<body>
|
||||
|
||||
<?
|
||||
$name=date("d");
|
||||
echo "Your name is $name,and your age is $age";
|
||||
?>
|
||||
</body>
|
||||
</html>
|
||||
1117
wxc2_omc/performance/mscCsta/trunk_detail_down.php
Executable file
1117
wxc2_omc/performance/mscCsta/trunk_detail_down.php
Executable file
File diff suppressed because it is too large
Load Diff
32
wxc2_omc/performance/mscCsta/trunk_detail_index.php
Executable file
32
wxc2_omc/performance/mscCsta/trunk_detail_index.php
Executable file
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
//==============initial the data=======================
|
||||
if(!isset($sel_date_from))
|
||||
$sel_date_from=0;
|
||||
if(!isset($sel_date_to))
|
||||
$sel_date_to=0;
|
||||
if(!isset($sel_in_out))
|
||||
$sel_in_out=0;
|
||||
if(!isset($trunk_no))
|
||||
$trunk_no=0;
|
||||
if(!isset($from_hour))
|
||||
$from_hour="00";
|
||||
if(!isset($from_minute))
|
||||
$from_minute="00";
|
||||
if(!isset($from_second))
|
||||
$from_second="00";
|
||||
if(!isset($to_hour))
|
||||
$to_hour="23";
|
||||
if(!isset($to_minute))
|
||||
$to_minute="59";
|
||||
if(!isset($to_second))
|
||||
$to_second="59";
|
||||
if(!isset($element_title))
|
||||
$element_title="<EFBFBD><EFBFBD><EFBFBD><EFBFBD>";
|
||||
?>
|
||||
<frameset rows="75,*" frameborder=0 border=0>
|
||||
<?php
|
||||
echo "<frame scrolling=\"no\" name=\"trunk_detail_up\" src=\"trunk_detail_up.php?sel_date_from=$sel_date_from&sel_date_to=$sel_date_to&sel_in_out=$sel_in_out&trunk_no=$trunk_no&element_title=$element_title\">";
|
||||
echo "<frame name=\"trunk_detail_down\" src=\"trunk_detail_down.php?sel_date_from=$sel_date_from&sel_date_to=$sel_date_to&trunk_no=$trunk_no&sel_in_out=$sel_in_out&on_top_index=0&element_title=$element_title\">";
|
||||
?>
|
||||
</frameset>
|
||||
|
||||
142
wxc2_omc/performance/mscCsta/trunk_detail_up.php
Executable file
142
wxc2_omc/performance/mscCsta/trunk_detail_up.php
Executable file
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
//Include the head file
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
<base target="trunk_detail_down">
|
||||
<script language="JavaScript">
|
||||
function page_refresh()
|
||||
{
|
||||
//sel_date_from,sel_date_to,scroll_y,on_top_index
|
||||
|
||||
var down_date_from=document.myform.sel_date_from.value;
|
||||
var down_date_to=document.myform.sel_date_to.value;
|
||||
var trunkno=document.myform.trunk_no.value;
|
||||
var in_out=document.myform.sel_in_out.value;
|
||||
var on_top=parent.trunk_detail_down.document.myform.on_top_index.value;
|
||||
|
||||
|
||||
var scrolly=document.getElementById('content_down').scrollTop;
|
||||
if(down_date_from<=down_date_to)
|
||||
down_date_to=down_date_from;
|
||||
|
||||
|
||||
var urll='<?php echo"$PHP_SELF";?>?sel_date_from='+down_date_from+'&sel_date_to='+down_date_to+'&trunk_no='+trunkno+"&on_top_index="+on_top+"&scroll_y="+scrolly+"&sel_in_out="+in_out;
|
||||
window.location.href=urll;
|
||||
|
||||
}
|
||||
</script>
|
||||
<body leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('up');" onresize="javascript:adjust_frame('up');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
|
||||
<form name="myform" action="trunk_detail_down.php" method="post">
|
||||
<?php
|
||||
adjust_head_frame("up");
|
||||
adjust_title_head_frame("up");
|
||||
//=================================test=======================================
|
||||
//echo "trunk_no:$trunk_no<br>";
|
||||
//echo "sel_date_from:$sel_date_from<br>";
|
||||
//echo "sel_date_to:$sel_date_to<br>";
|
||||
//echo "in_out:$sel_in_out<br>";
|
||||
//==================get the parameter the previous transfer====================
|
||||
$old_sel_date_from=$sel_date_from;
|
||||
$old_sel_date_to=$sel_date_to;
|
||||
$old_sel_in_out=$sel_in_out;
|
||||
//===========================page title========================================
|
||||
echo "<table id=\"table_up\" width=\"100%\" border=0>";
|
||||
echo "<tr>";
|
||||
echo "<td width=50% align=\"left\"><nobr>";
|
||||
echo "$strTitlePerformance > MSC > Trunk group";
|
||||
echo "</td>";
|
||||
echo "<td width=50% align=\"right\">";
|
||||
$helpId="3.2.2";
|
||||
showHelp($helpId);
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td align=\"left\">";
|
||||
|
||||
//=======================data initial==========================================
|
||||
if(!isset($sel_date_from))
|
||||
$sel_date_from=0;
|
||||
if(!isset($sel_date_to))
|
||||
$sel_date_to=0;
|
||||
if(!isset($trunk_no))
|
||||
$trunk_no=0;
|
||||
if(!isset($sel_in_out))
|
||||
$sel_in_out=0;
|
||||
if(!isset($on_top_index))
|
||||
$on_top_index=0;
|
||||
//selection date define
|
||||
$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")));
|
||||
$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y")));
|
||||
$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y")));
|
||||
$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y")));
|
||||
$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y")));
|
||||
$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y")));
|
||||
$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y")));
|
||||
|
||||
echo "<input type=\"hidden\" name=\"trunk_no\" value=$trunk_no>";
|
||||
?>
|
||||
<select name="sel_in_out" onChange="javascript:page_refresh()">
|
||||
<?php
|
||||
$in_out_string=array("In","Out","In&Out");
|
||||
for($i=0;$i<3;$i++)
|
||||
{
|
||||
if($i==$sel_in_out)
|
||||
echo "<option selected value=$i>$in_out_string[$i]</option>";
|
||||
else
|
||||
echo "<option value=$i>$in_out_string[$i]</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<!--=========================date from selection=================================-->
|
||||
<select name="sel_date_from" onChange="javascript:page_refresh()">
|
||||
<?php
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
if($i==$sel_date_from)
|
||||
echo "<option selected value=$i>${day.$i}</option>";
|
||||
else
|
||||
echo "<option value=$i>${day.$i}</option>";
|
||||
}
|
||||
?>
|
||||
</select> to
|
||||
<!--=========================date to selection=================================-->
|
||||
<select name="sel_date_to">
|
||||
<?php
|
||||
for($i=0;$i<=$sel_date_from;$i++)
|
||||
{
|
||||
if($i==$sel_date_to)
|
||||
echo "<option selected value=$i>${day.$i}</option>";
|
||||
else
|
||||
echo "<option value=$i>${day.$i}</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<a href=# onClick="javascript:myform.submit()" style="cursor:hand">
|
||||
<IMG border=0 src="../../images/search.gif" ><?php echo "$strSearch"; ?>
|
||||
</a>
|
||||
<?php
|
||||
|
||||
|
||||
echo "</td>";
|
||||
echo "<td align=\"right\">";
|
||||
//===================the back link button======================================
|
||||
echo "<a target=\"_parent\" href=\"../../performance/mscCsta/trunk_general_index.php?sel_date_from=$old_sel_date_from&sel_date_to=$old_sel_date_to&sel_in_out=$old_sel_in_out\"><img src=\"../../images/left.gif\" border=0></img>back</a>";
|
||||
?>
|
||||
|
||||
<a href=# onClick="window.print();" style="cursor:hand">
|
||||
<img align=absBottom border=0 src="../../images/printer.gif" width="16" height="16">
|
||||
</a>
|
||||
<?php
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
|
||||
adjust_title_tail_frame("up");
|
||||
adjust_content_head_frame("up");
|
||||
adjust_content_tail_frame("up");
|
||||
|
||||
|
||||
?>
|
||||
|
||||
|
||||
|
||||
861
wxc2_omc/performance/mscCsta/trunk_general_down.php
Executable file
861
wxc2_omc/performance/mscCsta/trunk_general_down.php
Executable file
@@ -0,0 +1,861 @@
|
||||
<?php
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
|
||||
<?php
|
||||
//=====scroll the page=====
|
||||
if($scroll_y > 0){
|
||||
//echo "<body style=\"overflow-x:hidden\" topmargin=\"5\" leftmargin=\"12\" onLoad='self.scrollBy(0,$scroll_y)'>";
|
||||
echo "<body leftmargin=\"15\" rightmargin=\"10\" onload=\"javascript:scroll_div('$scroll_y');javascript:adjust_frame('down');\" onresize=\"javascript:adjust_frame('down');\" style=\"overflow:hidden;overflow-x:hidden;overflow-y:hidden;\">";
|
||||
}else{
|
||||
echo "<body leftmargin=\"15\" rightmargin=\"10\" onload=\"javascript:adjust_frame('down');\" onresize=\"javascript:adjust_frame('down');\" style=\"overflow:hidden;overflow-x:hidden;overflow-y:hidden;\">";
|
||||
}
|
||||
?>
|
||||
|
||||
<?php
|
||||
adjust_head_frame("down");
|
||||
adjust_title_head_frame("down");
|
||||
adjust_title_tail_frame("down");
|
||||
|
||||
adjust_content_head_frame("down");
|
||||
echo "<br>";
|
||||
//========================================================================================|
|
||||
//========================Initial The Data From Index Page================================|
|
||||
//========================================================================================|
|
||||
if(!isset($sel_date_from))
|
||||
$sel_date_from=0;
|
||||
if(!isset($sel_date_to))
|
||||
$sel_date_to=0;
|
||||
if(!isset($sel_in_out))
|
||||
$sel_in_out=0;
|
||||
if(!isset($from_hour))
|
||||
$from_hour="00";
|
||||
if(!isset($from_minute))
|
||||
$from_minute="00";
|
||||
if(!isset($from_second))
|
||||
$from_second="00";
|
||||
if(!isset($to_hour))
|
||||
$to_hour="23";
|
||||
if(!isset($to_minute))
|
||||
$to_minute="59";
|
||||
if(!isset($to_second))
|
||||
$to_second="59";
|
||||
$DEBUG=1;
|
||||
//========================================================================================|
|
||||
//============================Define The Data=============================================|
|
||||
//========================================================================================|
|
||||
for($i=0;$i<=256;$i++)
|
||||
{
|
||||
for($j=0;$j<9;$j++)
|
||||
{
|
||||
/*
|
||||
0 trunk-no 0 attempt
|
||||
1 trunk no 1 success
|
||||
... 2 call deny
|
||||
3 network busy
|
||||
4 caller clear
|
||||
5 sub busy
|
||||
6 no answer
|
||||
7 signal error
|
||||
8 total call duration
|
||||
*/
|
||||
$trunk_csta[$i][$j]=0;
|
||||
}
|
||||
}
|
||||
|
||||
//===in going,out going,in-out-going data from DB===
|
||||
for($i=0;$i<9;$i++)
|
||||
{
|
||||
$in_trunk[$i]=0;
|
||||
$out_trunk[$i]=0;
|
||||
$total_trunk[$i]=0;
|
||||
}
|
||||
//========================================================================================|
|
||||
//============================Get The Trunk Group Element Title===========================|
|
||||
//========================================================================================|
|
||||
//====initial=====
|
||||
for($i=0;$i<=256;$i++)
|
||||
{
|
||||
$trunk_element_title[$i]="";
|
||||
}
|
||||
$dualTableLevelWhere="T1.level_1=T2.level_1 AND
|
||||
T1.level_2=T2.level_2 AND
|
||||
T1.level_3=T2.level_3 AND
|
||||
T1.level_4=T2.level_4 AND
|
||||
T1.level_5=T2.level_5 AND
|
||||
T1.level_6=T2.level_6 AND
|
||||
T1.level_7=T2.level_7 AND
|
||||
T1.level_8=T2.level_8 AND
|
||||
T1.level_9=T2.level_9 AND
|
||||
T1.level_10=T2.level_10";
|
||||
|
||||
|
||||
//===get the title of tg=====
|
||||
$database="OBJ_320";
|
||||
$sql="SELECT T1.* FROM param_99 AS T1,paramConf AS T2 WHERE $dualTableLevelWhere AND T2.name_2='tgTitle'";
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$TrunkGroupCount=mysqli_num_rows($result);
|
||||
|
||||
if($TrunkGroupCount>0)
|
||||
{
|
||||
while($rows = @mysqli_fetch_array($result))
|
||||
{
|
||||
//get the instanceNo of the tg
|
||||
$trunk_no=$rows[instanceNo]+0;
|
||||
$trunk_status[$trunk_no]=1;
|
||||
$trunk_element_title[$trunk_no]=$rows[initValue];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//========================================================================================|
|
||||
//=============================Get The Data From DB=======================================|
|
||||
//========================================================================================|
|
||||
//=====data for per trunk=======
|
||||
$db=$csta_db;
|
||||
$slot=$sel_date_from-$sel_date_to+1;
|
||||
$time_column="csta_datetime";
|
||||
|
||||
for($day=0;$day<$slot;$day++)
|
||||
{
|
||||
|
||||
$table_name ="mscSum";
|
||||
$temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
$table_name=$table_name."_".$temp;
|
||||
$from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
$to_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
//echo "table_name:$table_name<br>";
|
||||
//echo "from_time:$from_time<br>";
|
||||
//echo "to_time:$to_time<br>";
|
||||
//echo "in_out:$sel_in_out<br>";
|
||||
|
||||
if($sel_in_out==0)
|
||||
$trunk_where="and key_type=3 ";
|
||||
else if($sel_in_out==1)
|
||||
$trunk_where="and key_type=4 ";
|
||||
else
|
||||
$trunk_where="and key_type>2 and key_type<5 ";
|
||||
|
||||
$select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration ";
|
||||
$from="from $table_name ";
|
||||
$where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where;
|
||||
$group="group by key_e1_tg ";
|
||||
$order="order by key_e1_tg ";
|
||||
$sql=$select.$from.$where.$group.$order;
|
||||
//echo "sql:$sql<br>";
|
||||
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
if(!$rows)
|
||||
continue;
|
||||
|
||||
do
|
||||
{
|
||||
$gro=$rows[0];
|
||||
for($tt=0;$tt<9;$tt++)
|
||||
{
|
||||
$trunk_csta[$gro][$tt]+=$rows[$tt+1];
|
||||
//echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}<br>";
|
||||
}
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
}
|
||||
|
||||
//get the 0-hour of this day
|
||||
for($day=0;$day<$slot;$day++)
|
||||
{
|
||||
|
||||
$table_name ="mscSum";
|
||||
$temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y")));
|
||||
$table_name=$table_name."_".$temp;
|
||||
$from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y")));
|
||||
$to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
//echo "table_name:$table_name<br>";
|
||||
//echo "from_time:$from_time<br>";
|
||||
//echo "to_time:$to_time<br>";
|
||||
//echo "in_out:$sel_in_out<br>";
|
||||
|
||||
if($sel_in_out==0)
|
||||
$trunk_where="and key_type=3 ";
|
||||
else if($sel_in_out==1)
|
||||
$trunk_where="and key_type=4 ";
|
||||
else
|
||||
$trunk_where="and key_type>2 and key_type<5 ";
|
||||
|
||||
$select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration ";
|
||||
$from="from $table_name ";
|
||||
$where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where;
|
||||
$group="group by key_e1_tg ";
|
||||
$order="order by key_e1_tg ";
|
||||
$sql=$select.$from.$where.$group.$order;
|
||||
//echo "sql:$sql<br>";
|
||||
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
if(!$rows)
|
||||
continue;
|
||||
|
||||
do
|
||||
{
|
||||
$gro=$rows[0];
|
||||
for($tt=0;$tt<9;$tt++)
|
||||
{
|
||||
$trunk_csta[$gro][$tt]+=$rows[$tt+1];
|
||||
//echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}<br>";
|
||||
}
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
|
||||
}
|
||||
|
||||
//=====data for in_trunk,out_trunk,total_trunk===
|
||||
for($day=0;$day<$slot;$day++)
|
||||
{
|
||||
$table_name ="mscSum";
|
||||
$temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
$table_name=$table_name."_".$temp;
|
||||
$from_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
$to_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
|
||||
//===in-trunk data=====
|
||||
$select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as call_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration ";
|
||||
$from="from $table_name ";
|
||||
$trunk_where="and key_type=3 ";
|
||||
$where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where;
|
||||
$group="group by key_e1_tg ";
|
||||
$order="order by key_e1_tg ";
|
||||
$sql=$select.$from.$where.$group.$order;
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
if(!$rows)
|
||||
continue;
|
||||
do{
|
||||
//if the trunk group is disable
|
||||
$trunk_no=$rows[0];
|
||||
if($trunk_status[$trunk_no]==0)
|
||||
continue;
|
||||
|
||||
for($tt=0;$tt<9;$tt++)
|
||||
{
|
||||
$in_trunk[$tt]+=$rows[$tt+1];
|
||||
//echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}<br>";
|
||||
}
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
|
||||
//===out-trunk=======
|
||||
$select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration ";
|
||||
$from="from $table_name ";
|
||||
$trunk_where="and key_type=4 ";
|
||||
$where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where;
|
||||
$group="group by key_e1_tg ";
|
||||
$order="order by key_e1_tg ";
|
||||
$sql=$select.$from.$where.$group.$order;
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
if(!$rows)
|
||||
continue;
|
||||
do{
|
||||
$trunk_no=$rows[0];
|
||||
if($trunk_status[$trunk_no]==0)
|
||||
continue;
|
||||
for($tt=0;$tt<9;$tt++)
|
||||
{
|
||||
$out_trunk[$tt]+=$rows[$tt+1];
|
||||
//echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}<br>";
|
||||
}
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
|
||||
//=====total_trunk data=======
|
||||
$select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration ";
|
||||
$from="from $table_name ";
|
||||
$trunk_where="and key_type>2 and key_type<5 ";
|
||||
$where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where;
|
||||
$group="group by key_e1_tg ";
|
||||
$order="order by key_e1_tg ";
|
||||
$sql=$select.$from.$where.$group.$order;
|
||||
//echo "$sql<br>";
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
if(!$rows)
|
||||
continue;
|
||||
do{
|
||||
$trunk_no=$rows[0];
|
||||
if($trunk_status[$trunk_no]==0)
|
||||
continue;
|
||||
for($tt=0;$tt<9;$tt++)
|
||||
{
|
||||
$total_trunk[$tt]+=$rows[$tt+1];
|
||||
//echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}<br>";
|
||||
}
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
}
|
||||
|
||||
//get the 0-hour of the day
|
||||
for($day=0;$day<$slot;$day++)
|
||||
{
|
||||
$table_name ="mscSum";
|
||||
$temp=date("d",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y")));
|
||||
$table_name=$table_name."_".$temp;
|
||||
$from_time=date("Y-m-d H:i:s",mktime(23,0,0,date("m"),date("d")-$sel_date_from+$day-1,date("Y")));
|
||||
$to_time=date("Y-m-d H:i:s",mktime(0,0,0,date("m"),date("d")-$sel_date_from+$day,date("Y")));
|
||||
|
||||
//===in-trunk data=====
|
||||
$select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as call_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration ";
|
||||
$from="from $table_name ";
|
||||
$trunk_where="and key_type=3 ";
|
||||
$where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where;
|
||||
$group="group by key_e1_tg ";
|
||||
$order="order by key_e1_tg ";
|
||||
$sql=$select.$from.$where.$group.$order;
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
if(!$rows)
|
||||
continue;
|
||||
do{
|
||||
//if the trunk group is disable
|
||||
$trunk_no=$rows[0];
|
||||
if($trunk_status[$trunk_no]==0)
|
||||
continue;
|
||||
|
||||
for($tt=0;$tt<9;$tt++)
|
||||
{
|
||||
$in_trunk[$tt]+=$rows[$tt+1];
|
||||
//echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}<br>";
|
||||
}
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
|
||||
//===out-trunk=======
|
||||
$select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration ";
|
||||
$from="from $table_name ";
|
||||
$trunk_where="and key_type=4 ";
|
||||
$where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where;
|
||||
$group="group by key_e1_tg ";
|
||||
$order="order by key_e1_tg ";
|
||||
$sql=$select.$from.$where.$group.$order;
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
if(!$rows)
|
||||
continue;
|
||||
do{
|
||||
$trunk_no=$rows[0];
|
||||
if($trunk_status[$trunk_no]==0)
|
||||
continue;
|
||||
for($tt=0;$tt<9;$tt++)
|
||||
{
|
||||
$out_trunk[$tt]+=$rows[$tt+1];
|
||||
//echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}<br>";
|
||||
}
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
|
||||
//=====total_trunk data=======
|
||||
$select="select key_e1_tg,sum(Attempt) as attempt,sum(Success) as success,sum(CallDeny) as call_deny,sum(NetBusy) as network_busy,sum(CallerClear) as caller_clear,sum(SubBusy) as sub_busy,sum(NoAnswer) as no_answer,sum(SignalErr) as signal_error,sum(Duration) as duration ";
|
||||
$from="from $table_name ";
|
||||
$trunk_where="and key_type>2 and key_type<5 ";
|
||||
$where="where $time_column >='$from_time' and $time_column <'$to_time' ".$trunk_where;
|
||||
$group="group by key_e1_tg ";
|
||||
$order="order by key_e1_tg ";
|
||||
$sql=$select.$from.$where.$group.$order;
|
||||
//echo "$sql<br>";
|
||||
$result=@mysqli_query($pubConn,$sql);
|
||||
$rows=@mysqli_fetch_array($result);
|
||||
if(!$rows)
|
||||
continue;
|
||||
do{
|
||||
$trunk_no=$rows[0];
|
||||
if($trunk_status[$trunk_no]==0)
|
||||
continue;
|
||||
for($tt=0;$tt<9;$tt++)
|
||||
{
|
||||
$total_trunk[$tt]+=$rows[$tt+1];
|
||||
//echo "type-$service_type-$tt:{$service_csta[$service_type][$tt]}<br>";
|
||||
}
|
||||
}while($rows=mysqli_fetch_array($result));
|
||||
}
|
||||
|
||||
|
||||
if(0)
|
||||
{
|
||||
for($i=0;$i<9;$i++)
|
||||
{
|
||||
$in_trunk[$i]=rand(100,300);
|
||||
$out_trunk[$i]=rand(100,300);
|
||||
$total_trunk[$i]=$in_trunk[$i]+$out_trunk[$i];
|
||||
}
|
||||
}
|
||||
|
||||
//========================================================================================|
|
||||
//==============================Test The Data=============================================|
|
||||
//========================================================================================|
|
||||
//====test the csta data====
|
||||
if(0)
|
||||
{
|
||||
$test_type_label=array("attempt","success","call clear","no answer","subs busy","network busy","call barred","signalling timeout","total call duration");
|
||||
for($i=0;$i<=256;$i++)
|
||||
{
|
||||
for($j=0;$j<9;$j++)
|
||||
{
|
||||
echo "group-$i-{$test_type_label[$j]}-$j:{$trunk_csta[$i][$j]}<br>";
|
||||
}
|
||||
}
|
||||
}
|
||||
//====test the title of trunk group===
|
||||
if(0)
|
||||
{
|
||||
for($i=0;$i<=256;$i++)
|
||||
{
|
||||
echo "group:$i {$trunk_element_title[$i]}<br>";
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
//====test the status of trunk group===
|
||||
if(0)
|
||||
{
|
||||
for($i=0;$i<=256;$i++)
|
||||
{
|
||||
echo "group:$i {$trunk_status[$i]}<br>";
|
||||
}
|
||||
}
|
||||
|
||||
//=====test the in_trunk,out_trunk,total_trunk==
|
||||
if(0)
|
||||
{
|
||||
for($i=0;$i<9;$i++)
|
||||
{
|
||||
echo "in-type-$i:{$in_trunk[$i]}<br>";
|
||||
echo "out-type-$i:{$out_trunk[$i]}<br>";
|
||||
echo "total-type-$i:{$total_trunk[$i]}<br>";
|
||||
}
|
||||
}
|
||||
//========================================================================================|
|
||||
//===========================Show the table-1=============================================|
|
||||
//========================================================================================|
|
||||
|
||||
//===get the numbers of days that selected===
|
||||
$slot=$sel_date_from-$sel_date_to+1;
|
||||
|
||||
//====get the table title====
|
||||
$title_time=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_from,date("Y")));
|
||||
if($slot==1)
|
||||
$table_title="Trunk statistic Date:".$title_time;
|
||||
else
|
||||
$table_title="Trunk statistic Date:".$title_time." to ".date("Y-m-d",mktime(0,0,0,date("m"),date("d")-$sel_date_to,date("Y")));
|
||||
|
||||
echo "<center><b>$table_title</b></center>";
|
||||
echo "<table width=\"100%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
|
||||
if($sel_in_out==0)
|
||||
$temp="In";
|
||||
else if($sel_in_out==1)
|
||||
$temp="Out";
|
||||
else if($sel_in_out==2)
|
||||
$temp="In&Out";
|
||||
|
||||
echo "<tr bgcolor=\"#E6E6E6\">";
|
||||
echo "<td> </td><td colspan=11 align=\"center\">$temp</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr bgcolor=\"#E6E6E6\">";
|
||||
echo "<td align=\"center\" width=\"6%\"><nobr>TG No.</td>";
|
||||
echo "<td align=\"center\" width=\"12%\"><nobr>Element Title</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Attempt</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Success</td>";
|
||||
echo "<td align=\"center\" width=\"8%\"><nobr>Call deny</td>";
|
||||
echo "<td align=\"center\" width=\"8%\"><nobr>Net busy</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Caller clear</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Sub busy</td>";
|
||||
echo "<td align=\"center\" width=\"8%\"><nobr>No answer</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Signal error</td>";
|
||||
echo "<td align=\"center\" width=\"8%\">Total call duration</td>";
|
||||
echo "<td align=\"center\" width=\"10%\">Average call<br>duration(s)</td>";
|
||||
echo "</tr>";
|
||||
|
||||
for($i=0;$i<=256;$i++)
|
||||
{
|
||||
if($trunk_status[$i]!=1)
|
||||
continue;
|
||||
echo "<tr>";
|
||||
|
||||
$t=$i;
|
||||
echo "<td><a target=\"_parent\" href=\"../../performance/mscCsta/trunk_detail_index.php?trunk_no=$i&sel_date_from=$sel_date_from&sel_date_to=$sel_date_to&sel_in_out=$sel_in_out&element_title={$trunk_element_title[$i]}\">$t</a></td>";
|
||||
echo "<td align=\"left\">{$trunk_element_title[$i]}</td>";
|
||||
for($j=0;$j<9;$j++)
|
||||
{
|
||||
echo "<td align=\"center\">";
|
||||
if($j==0)
|
||||
echo "{$trunk_csta[$i][$j]}";
|
||||
if($j>0&&$j<8)
|
||||
{
|
||||
echo "{$trunk_csta[$i][$j]}";
|
||||
echo "<br>";
|
||||
if($trunk_csta[$i][0]==0)
|
||||
$rate=0;
|
||||
else
|
||||
{
|
||||
$rate=$trunk_csta[$i][$j]/$trunk_csta[$i][0];
|
||||
$rate=$rate*100;
|
||||
$rate=number_format($rate,2,"."," ");
|
||||
}
|
||||
if($rate==0)
|
||||
$rate=0;
|
||||
echo "$rate%";
|
||||
}
|
||||
if($j==8)
|
||||
{
|
||||
echo "{$trunk_csta[$i][$j]}(s)";
|
||||
$hour=floor($trunk_csta[$i][$j]/3600);
|
||||
$minute=floor($trunk_csta[$i][$j]%3600/60);
|
||||
$second=$trunk_csta[$i][$j]%60;
|
||||
if($hour==0&&$minute==0&&$second==0)
|
||||
echo "<br>";
|
||||
else
|
||||
echo "<br>$hour:$minute:$second";
|
||||
}
|
||||
echo "</td>";
|
||||
}
|
||||
//==average call duration=====
|
||||
echo "<td align=\"center\">";
|
||||
if($trunk_csta[$i][1]!=0)
|
||||
$ave=round($trunk_csta[$i][8]/$trunk_csta[$i][1]);
|
||||
else
|
||||
$ave=0;
|
||||
echo "$ave";
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
}
|
||||
echo "</table>";
|
||||
|
||||
|
||||
//========================================================================================|
|
||||
//=========================Show the table-2===============================================|
|
||||
//========================================================================================|
|
||||
|
||||
echo "<br><center><b>$table_title</b></center>";
|
||||
echo "<center>";
|
||||
echo "<table width=\"100%\" border=\"1\" cellpadding=\"2\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" bgcolor=\"#FFFFFF\">";
|
||||
echo "<tr bgcolor=\"#E6E6E6\">";
|
||||
echo "<td colspan=8 align=\"center\">2.Success/failure</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr bgcolor=\"#E6E6E6\">";
|
||||
echo "<td align=\"center\">Type</td>";
|
||||
echo "<td align=\"center\">Success</td>";
|
||||
echo "<td align=\"center\">Call deny</td>";
|
||||
echo "<td align=\"center\">Net busy</td>";
|
||||
echo "<td align=\"center\">Caller clear</td>";
|
||||
echo "<td align=\"center\">Sub busy</td>";
|
||||
echo "<td align=\"center\">No answer</td>";
|
||||
echo "<td align=\"center\">Signal error</td>";
|
||||
echo "</tr>";
|
||||
|
||||
//====in trunk data=====
|
||||
echo "<tr>";
|
||||
echo "<td align=\"center\">In</td>";
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
echo "<td align=\"center\">";
|
||||
if($in_trunk[0]!=0)
|
||||
{
|
||||
$rate=$in_trunk[$i+1]/$in_trunk[0];
|
||||
$rate=$rate*100;
|
||||
$rate=number_format($rate,2,"."," ");
|
||||
}
|
||||
else
|
||||
$rate=0;
|
||||
if($rate==0)
|
||||
$rate=0;
|
||||
echo "$rate%";
|
||||
echo "</td>";
|
||||
}
|
||||
echo "</tr>";
|
||||
|
||||
//===out trunk data=======
|
||||
echo "<tr>";
|
||||
echo "<td align=\"center\">Out</td>";
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
echo "<td align=\"center\">";
|
||||
if($out_trunk[0]!=0)
|
||||
{
|
||||
$rate=$out_trunk[$i+1]/$out_trunk[0];
|
||||
$rate=$rate*100;
|
||||
$rate=number_format($rate,2,"."," ");
|
||||
}
|
||||
else
|
||||
$rate=0;
|
||||
if($rate==0)
|
||||
$rate=0;
|
||||
echo "$rate%";
|
||||
echo "</td>";
|
||||
}
|
||||
echo "</tr>";
|
||||
|
||||
//====total trunk data====
|
||||
echo "<tr>";
|
||||
echo "<td align=\"center\">In&Out</td>";
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
echo "<td align=\"center\">";
|
||||
if($total_trunk[0]!=0)
|
||||
{
|
||||
$rate=$total_trunk[$i+1]/$total_trunk[0];
|
||||
$rate=$rate*100;
|
||||
$rate=number_format($rate,2,"."," ");
|
||||
}
|
||||
else
|
||||
$rate=0;
|
||||
if($rate==0)
|
||||
$rate=0;
|
||||
echo "$rate%";
|
||||
echo "</td>";
|
||||
}
|
||||
echo "</table></center>";
|
||||
|
||||
|
||||
//========================================================================================|
|
||||
//=======================Draw the Graphics-1==============================================|
|
||||
//========================================================================================|
|
||||
|
||||
echo "<p><b>3.In/Out(Attempt Call)</b><br>";
|
||||
$sizex=510;
|
||||
$sizey=240;
|
||||
$im = ImageCreate ($sizex, $sizey);
|
||||
$background_color=ImageColorAllocate($im,255,255,255);
|
||||
$black_color=ImageColorAllocate($im,0,0,0);
|
||||
$white_color=ImageColorAllocate($im,255,255,255);
|
||||
|
||||
$bgcolor=F8F8F8;
|
||||
$fgcolor=000000;
|
||||
|
||||
$background_color = ImageColorAllocate ($im,
|
||||
hexdec(substr($bgcolor, 0, 2)),
|
||||
hexdec(substr($bgcolor, 2, 2)),
|
||||
hexdec(substr($bgcolor, 4, 2)));
|
||||
|
||||
$text_color = ImageColorAllocate ($im,
|
||||
hexdec(substr($fgcolor, 0, 2)),
|
||||
hexdec(substr($fgcolor, 2, 2)),
|
||||
hexdec(substr($fgcolor, 4, 2)));
|
||||
$color[0]=ImageColorAllocate($im,0x33,0x33,0xff);
|
||||
$color[1]=ImageColorAllocate($im,0x66,0xaa,0);
|
||||
|
||||
//=====background====
|
||||
ImageFilledRectangle($im,0,0,$sizex,$sizey,ImageColorAllocate ($im, 198, 198, 198));
|
||||
ImageFilledRectangle($im,2,2,$sizex,$sizey,ImageColorAllocate ($im, 130, 130, 130));
|
||||
$pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1);
|
||||
Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130));
|
||||
$pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4);
|
||||
Imagefilledpolygon($im, $pointArr, 3, ImageColorAllocate ($im, 130, 130, 130));
|
||||
ImageFilledRectangle($im,2,2,$sizex-3,$sizey-3,$background_color);
|
||||
|
||||
imageLine($im,40,20,40,200,$black_color);
|
||||
imageLine($im,40,20,490,20,$black_color);
|
||||
imageLine($im,490,200,490,20,$black_color);
|
||||
imageLine($im,40,200,490,200,$black_color);
|
||||
|
||||
//=====draw the horizonal line======
|
||||
$style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color);
|
||||
imagesetstyle($im, $style);
|
||||
for($i=10;$i>0;$i--)
|
||||
{
|
||||
$x1=40;
|
||||
$y1=20+(10-$i)*18;
|
||||
$x2=490;
|
||||
$y2=$y1;
|
||||
if($i!=10)
|
||||
imageline($im,$x1,$y1,$x2,$y2,IMG_COLOR_STYLED);
|
||||
imagestring($im,2,$x1-22,$y2-5,($i*10)."%",$black_color);
|
||||
}
|
||||
|
||||
//====draw the vitical line======
|
||||
$u=floor(450/9);
|
||||
for($i=0;$i<10;$i++)
|
||||
{
|
||||
$x1=40+$i*$u;
|
||||
$y1=20;
|
||||
$x2=$x1;
|
||||
$y2=200;
|
||||
ImageDashedLine($im,$x1,$y1,$x2,$y2,$black_color);
|
||||
}
|
||||
|
||||
//=====get the two block height=======
|
||||
if($total_trunk[0]==0)
|
||||
{
|
||||
$in_trunk_percent="0%";
|
||||
$out_trunk_percent="0%";
|
||||
$height[0]=0;
|
||||
$heighr[1]=0;
|
||||
}
|
||||
else
|
||||
{
|
||||
$in_trunk_percent=change_percent($in_trunk[0]/$total_trunk[0]);
|
||||
$out_trunk_percent=change_percent($out_trunk[0]/$total_trunk[0]);
|
||||
$height[0]=floor(180*$in_trunk[0]/$total_trunk[0]);
|
||||
$height[1]=floor(180*$out_trunk[0]/$total_trunk[0]);
|
||||
}
|
||||
|
||||
//======draw the data block=======
|
||||
for($i=0;$i<2;$i++)
|
||||
{
|
||||
$x1=90+(4*$i+1)*50;
|
||||
if($height[$i]==0)
|
||||
$height[$i]=1;
|
||||
$y1=200-$height[$i];
|
||||
$x2=90+(4*$i+2)*50;
|
||||
$y2=199;
|
||||
imagefilledrectangle($im,$x1,$y1,$x2,$y2,$color[$i]);
|
||||
}
|
||||
|
||||
//=====draw the legend string=======
|
||||
imagestring($im,2,155,205,"In",$black_color);
|
||||
imagestring($im,2,138,220,"(".$in_trunk_percent.")",$black_color);
|
||||
imagestring($im,2,355,205,"Out",$black_color);
|
||||
imagestring($im,2,340,220,"(".$out_trunk_percent.")",$black_color);
|
||||
|
||||
//====show the graphics=====
|
||||
//-----<2D><><EFBFBD><EFBFBD>ͼ<EFBFBD><CDBC><EFBFBD>ļ<EFBFBD><C4BC><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
|
||||
//delete *.png
|
||||
$handle=opendir('.');
|
||||
while($file=readdir($handle)){
|
||||
$retval="";
|
||||
$pt=strrpos($file,".");
|
||||
if($pt) $retval=substr($file,$pt+1,strlen($file)-$pt);
|
||||
if($retval=='png') unlink($file);
|
||||
}
|
||||
$filename="tg1_".time().".png";
|
||||
if(1){
|
||||
ImagePng ($im,"$filename");
|
||||
|
||||
ImageDestroy($im);
|
||||
}
|
||||
//-----<2D><>ʾͼƬ
|
||||
echo "<img src=\"$filename\"></img>";
|
||||
|
||||
//========================================================================================|
|
||||
//==========================Draw the Graphics-2===========================================|
|
||||
//========================================================================================|
|
||||
|
||||
echo "<p><b>4.Success/Failure<br>";
|
||||
$sizex=600;
|
||||
$sizey=250;
|
||||
$image=imagecreate($sizex,$sizey);
|
||||
$bgcolor=imagecolorallocate($image,255,255,255);
|
||||
$black_color=ImageColorAllocate($image,0,0,0);
|
||||
$white_color=ImageColorAllocate($image,255,255,255);
|
||||
$bgcolor=F8F8F8;
|
||||
$fgcolor=000000;
|
||||
$color[0]=ImageColorAllocate($image,0x33,0x33,0xff);
|
||||
$color[1]=ImageColorAllocate($image,0x66,0xaa,0);
|
||||
$background_color = ImageColorAllocate ($image,
|
||||
hexdec(substr($bgcolor, 0, 2)),
|
||||
hexdec(substr($bgcolor, 2, 2)),
|
||||
hexdec(substr($bgcolor, 4, 2)));
|
||||
|
||||
$text_color = ImageColorAllocate ($image,
|
||||
hexdec(substr($fgcolor, 0, 2)),
|
||||
hexdec(substr($fgcolor, 2, 2)),
|
||||
hexdec(substr($fgcolor, 4, 2)));
|
||||
|
||||
//====background====
|
||||
ImageFilledRectangle($image,0,0,$sizex,$sizey,ImageColorAllocate ($image, 198, 198, 198));
|
||||
ImageFilledRectangle($image,2,2,$sizex,$sizey,ImageColorAllocate ($image, 130, 130, 130));
|
||||
$pointArr=array(0,$sizey-1,3,$sizey-4,4,$sizey-1);
|
||||
Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130));
|
||||
$pointArr=array($sizex-1,0,$sizex-4,3,$sizex,4);
|
||||
Imagefilledpolygon($image, $pointArr, 3, ImageColorAllocate ($image, 130, 130, 130));
|
||||
ImageFilledRectangle($image,2,2,$sizex-3,$sizey-3,$background_color);
|
||||
|
||||
imageLine($image,40,20,40,200,$black_color);
|
||||
imageLine($image,40,20,580,20,$black_color);
|
||||
imageLine($image,580,200,580,20,$black_color);
|
||||
imageLine($image,40,200,580,200,$black_color);
|
||||
|
||||
//====draw the horizonal line===
|
||||
$style = array($black_color,$black_color,$black_color,$black_color,$black_color,$white_color,$white_color,$white_color,$white_color,$white_color);
|
||||
imagesetstyle($image, $style);
|
||||
for($i=10;$i>0;$i--)
|
||||
{
|
||||
$x1=40;
|
||||
$y1=20+(10-$i)*18;
|
||||
$x2=580;
|
||||
$y2=$y1;
|
||||
if($i!=10)
|
||||
imageline($image, $x1,$y1,$x2,$y2, IMG_COLOR_STYLED);
|
||||
|
||||
imagestring($image,2,$x1-22,$y2-5,($i*10)."%",$black_color);
|
||||
}
|
||||
|
||||
//====draw the vitical line=====
|
||||
$u=floor(540/15);
|
||||
for($i=0;$i<16;$i++)
|
||||
{
|
||||
$x1=40+$i*$u;
|
||||
$y1=20;
|
||||
$x2=$x1;
|
||||
$y2=200;
|
||||
ImageDashedLine($image,$x1,$y1,$x2,$y2,$black_color);
|
||||
}
|
||||
|
||||
//=====get the block height======
|
||||
for($j=0;$j<7;$j++)
|
||||
{
|
||||
if($total_trunk[0]==0)
|
||||
$total_height[$j][0]=1;
|
||||
else
|
||||
$total_height[$j][0]=floor(180*$in_trunk[$j+1]/$total_trunk[0]);
|
||||
}
|
||||
for($j=0;$j<7;$j++)
|
||||
{
|
||||
if($total_trunk[0]==0)
|
||||
$total_height[$j][1]=1;
|
||||
else
|
||||
$total_height[$j][1]=floor(180*$out_trunk[$j+1]/$total_trunk[0]);
|
||||
}
|
||||
|
||||
//======draw the data block=====
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
for($j=0;$j<2;$j++)
|
||||
{
|
||||
if($total_height[$i][$j]<1)
|
||||
$total_height[$i][$j]=1;
|
||||
//echo "lie-$i-hang-$j-{$total_height[$i][$j]}<br>";
|
||||
$x1=40+(2*$i+1)*36;
|
||||
$y1=199;
|
||||
for($z=0;$z<$j+1;$z++)
|
||||
{
|
||||
$y1=$y1-$total_height[$i][$z];
|
||||
}
|
||||
$x2=40+(2*$i+2)*36;
|
||||
$y2=199;
|
||||
for($z=0;$z<$j;$z++)
|
||||
{
|
||||
$y2=$y2-$total_height[$i][$z];
|
||||
}
|
||||
|
||||
imagefilledrectangle($image,$x1,$y1,$x2,$y2,$color[$j]);
|
||||
}
|
||||
}
|
||||
|
||||
//=====draw the legend string=====
|
||||
imagefilledrectangle($image,150,230,165,245,$color[0]);
|
||||
imagestring($image,2,170,230,"In",$black_color);
|
||||
imagefilledrectangle($image,320,230,335,245,$color[1]);
|
||||
imagestring($image,2,340,230,"Out",$black_color);
|
||||
|
||||
imagestring($image,2,77,205,"Success",$black_color);
|
||||
imagestring($image,2,135,205,"Call deny",$black_color);
|
||||
imagestring($image,2,215,205,"Net busy",$black_color);
|
||||
imagestring($image,2,293,200,"Caller",$black_color);
|
||||
imagestring($image,2,298,212,"clear",$black_color);
|
||||
imagestring($image,2,360,205,"Sub busy",$black_color);
|
||||
imagestring($image,2,430,205,"No answer",$black_color);
|
||||
imagestring($image,2,508,200,"Signal",$black_color);
|
||||
imagestring($image,2,512,212,"error",$black_color);
|
||||
|
||||
//=====show the success failure graphics====
|
||||
$tt=time()-1505;
|
||||
$file_name="tg2_".$tt.".png";
|
||||
imagepng($image,$file_name);
|
||||
imagedestroy($image);
|
||||
echo "<img src=$file_name></img>";
|
||||
adjust_content_tail("down");
|
||||
?>
|
||||
|
||||
</body>
|
||||
|
||||
28
wxc2_omc/performance/mscCsta/trunk_general_index.php
Executable file
28
wxc2_omc/performance/mscCsta/trunk_general_index.php
Executable file
@@ -0,0 +1,28 @@
|
||||
<?php
|
||||
//==============initial the data=======================
|
||||
if(!isset($sel_date_from))
|
||||
$sel_date_from=0;
|
||||
if(!isset($sel_date_to))
|
||||
$sel_date_to=0;
|
||||
if(!isset($sel_in_out))
|
||||
$sel_in_out=2;
|
||||
if(!isset($from_hour))
|
||||
$from_hour="00";
|
||||
if(!isset($from_minute))
|
||||
$from_minute="00";
|
||||
if(!isset($from_second))
|
||||
$from_second="00";
|
||||
if(!isset($to_hour))
|
||||
$to_hour="23";
|
||||
if(!isset($to_minute))
|
||||
$to_minute="59";
|
||||
if(!isset($to_second))
|
||||
$to_second="59";
|
||||
|
||||
?>
|
||||
<frameset rows="75,*" frameborder=0 border=0>
|
||||
<?php
|
||||
echo "<frame scrolling=\"no\" name=\"trunk_general_up\" src=\"trunk_general_up.php?sel_date_from=$sel_date_from&sel_date_to=$sel_date_to&sel_in_out=$sel_in_out&from_hour=$from_hour&from_minute=$from_minute&from_second=$from_second&to_hour=$to_hour&to_minute=$to_minute&to_second=$to_second\">";
|
||||
echo "<frame name=\"trunk_general_down\" src=\"trunk_general_down.php?sel_date_from=$sel_date_from&sel_date_to=$sel_date_to&sel_in_out=$sel_in_out&from_hour=$from_hour&from_minute=$from_minute&from_second=$from_second&to_hour=$to_hour&to_minute=$to_minute&to_second=$to_second\">";
|
||||
?>
|
||||
</frameset>
|
||||
178
wxc2_omc/performance/mscCsta/trunk_general_up.php
Executable file
178
wxc2_omc/performance/mscCsta/trunk_general_up.php
Executable file
@@ -0,0 +1,178 @@
|
||||
<?php
|
||||
//Include the head file
|
||||
require("../../inc/header.inc");
|
||||
?>
|
||||
<base target="trunk_general_down">
|
||||
<script language="JavaScript">
|
||||
//the function is called when the page is refresh
|
||||
function page_refresh()
|
||||
{
|
||||
//in&out,fromdate,todate,fromhour,fromminute,fromsecond,tohour,tominute,tosecond
|
||||
|
||||
var down_date_from=document.myform.sel_date_from.value;
|
||||
var down_date_to=document.myform.sel_date_to.value;
|
||||
var in_out=document.myform.sel_in_out.value;
|
||||
var scrollY=document.getElementById('content_down').scrollTop;
|
||||
var from_h=document.myform.from_hour.value;
|
||||
var from_m=document.myform.from_minute.value;
|
||||
var from_s=document.myform.from_second.value;
|
||||
var to_h=document.myform.to_hour.value;
|
||||
var to_m=document.myform.to_minute.value;
|
||||
var to_s=document.myform.to_second.value;
|
||||
var secondsFrom=from_h*3600+from_m*60+from_s;
|
||||
var secondsTo=to_h*3600+to_m*60+to_s;
|
||||
if(secondsFrom>secondsTo)
|
||||
alert("Time error");
|
||||
else
|
||||
{
|
||||
if(down_date_from<=down_date_to)
|
||||
down_date_to=down_date_from;
|
||||
var ur="&from_hour="+from_h+"&from_minute="+from_m+"&from_second="+from_s;
|
||||
ur=ur+"&to_hour="+to_h+"&to_minute="+to_m+"&to_second="+to_s+"&sel_in_out="+in_out;
|
||||
var urll='<?php echo"$PHP_SELF";?>?sel_date_from='+down_date_from+'&sel_date_to='+down_date_to+'&scroll_y='+scrollY+ur;
|
||||
window.location.href=urll;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
<body leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('up');" onresize="javascript:adjust_frame('up');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
|
||||
<form action="trunk_general_down.php" method="post" name="myform">
|
||||
|
||||
<?php
|
||||
adjust_head_frame("up");
|
||||
adjust_title_head_frame("up");
|
||||
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
|
||||
echo "<tr>";
|
||||
echo "<td width=50% align=\"left\">";
|
||||
echo "$strTitlePerformance > MSC > Trunk group";
|
||||
echo "</td>";
|
||||
echo "<td align=\"right\">";
|
||||
$helpId = "3.2.2";
|
||||
showHelp($helpId);
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "<tr>";
|
||||
echo "<td align=\"left\">";
|
||||
|
||||
if(!isset($scroll_y))
|
||||
$scroll_y=0;
|
||||
if(!isset($sel_date_from))
|
||||
$sel_date_from=0;
|
||||
if(!isset($sel_date_to))
|
||||
$sel_date_to=0;
|
||||
if(!isset($sel_in_out))
|
||||
$sel_in_out=2;
|
||||
if(!isset($from_hour))
|
||||
$from_hour="00";
|
||||
if(!isset($from_minute))
|
||||
$from_minute="00";
|
||||
if(!isset($from_second))
|
||||
$from_second="00";
|
||||
if(!isset($to_hour))
|
||||
$to_hour="24";
|
||||
if(!isset($to_minute))
|
||||
$to_minute="00";
|
||||
if(!isset($to_second))
|
||||
$to_second="00";
|
||||
//selection date define
|
||||
$day0=date("Y-m-d",mktime(0,0,0,date("m"),date("d"),date("Y")));
|
||||
$day1=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-1,date("Y")));
|
||||
$day2=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-2,date("Y")));
|
||||
$day3=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-3,date("Y")));
|
||||
$day4=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-4,date("Y")));
|
||||
$day5=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-5,date("Y")));
|
||||
$day6=date("Y-m-d",mktime(0,0,0,date("m"),date("d")-6,date("Y")));
|
||||
?>
|
||||
|
||||
<select name="sel_in_out" onChange="javascript:page_refresh()">
|
||||
<?php
|
||||
$in_out_string=array("In","Out","In&Out");
|
||||
for($i=0;$i<3;$i++)
|
||||
{
|
||||
if($i==$sel_in_out)
|
||||
echo "<option selected value=$i>$in_out_string[$i]</option>";
|
||||
else
|
||||
echo "<option value=$i>$in_out_string[$i]</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<select name="sel_date_from" onChange="javascript:page_refresh()">
|
||||
<?php
|
||||
for($i=0;$i<7;$i++)
|
||||
{
|
||||
if($i==$sel_date_from)
|
||||
echo "<option selected value=$i>${day.$i}</option>";
|
||||
else
|
||||
echo "<option value=$i>${day.$i}</option>";
|
||||
}
|
||||
?>
|
||||
</select> to
|
||||
<select name="sel_date_to" onChange="javascript:page_refresh()">
|
||||
<?php
|
||||
for($i=0;$i<=$sel_date_from;$i++)
|
||||
{
|
||||
if($i==$sel_date_to)
|
||||
echo "<option selected value=$i>${day.$i}</option>";
|
||||
else
|
||||
echo "<option value=$i>${day.$i}</option>";
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<span onClick="javascript:myform.submit();" style="cursor:hand">
|
||||
<img border=0 src="../../images/search.gif">Search
|
||||
</span>
|
||||
<?php
|
||||
//========================wether the select time slot is one day==================
|
||||
$slot=$sel_date_from-$sel_date_to+1;
|
||||
//echo "slot:$slot<br>";
|
||||
if($slot==1)
|
||||
{
|
||||
|
||||
//===============================from_hour text=================================
|
||||
echo "<input type=\"hidden\" name=\"from_hour\" value=$from_hour size=\"2\" maxLength=\"2\">";
|
||||
//===============================from_minute text================================
|
||||
echo "<input type=\"hidden\" name=\"from_minute\" value=$from_minute size=\"2\" maxLength=\"2\">";
|
||||
//===============================from_second text================================
|
||||
echo "<input type=\"hidden\" name=\"from_second\" value=$from_second size=\"2\" maxLength=\"2\">";
|
||||
//===============================to_hour text=====================================
|
||||
echo "<input type=\"hidden\" name=\"to_hour\" value=$to_hour size=\"2\" maxLength=\"2\">";
|
||||
//===============================to_minute text===================================
|
||||
echo "<input type=\"hidden\" name=\"to_minute\" value=$to_minute size=\"2\" maxLength=\"2\">";
|
||||
//==============================to_second text====================================
|
||||
echo "<input type=\"hidden\" name=\"to_second\" value=$to_second size=\"2\" maxLength=\"2\">";
|
||||
}
|
||||
else
|
||||
{
|
||||
//===============================from_hour hidden=================================
|
||||
echo "<input type=\"hidden\" name=\"from_hour\" value=$from_hour>";
|
||||
//===============================from_minute hidden================================
|
||||
echo "<input type=\"hidden\" name=\"from_minute\" value=$from_minute>";
|
||||
//===============================from_second hidden================================
|
||||
echo "<input type=\"hidden\" name=\"from_second\" value=$from_second>";
|
||||
//===============================to_hour hidden=====================================
|
||||
echo "<input type=\"hidden\" name=\"to_hour\" value=$to_hour>";
|
||||
//===============================to_minute hidden===================================
|
||||
echo "<input type=\"hidden\" name=\"to_minute\" value=$to_minute>";
|
||||
//==============================to_second hidden====================================
|
||||
echo "<input type=\"hidden\" name=\"to_second\" value=$to_second>";
|
||||
}
|
||||
|
||||
|
||||
echo "</td>";
|
||||
echo "<td align=\"right\">";
|
||||
?>
|
||||
|
||||
<span onClick="window.print();" style="cursor:hand">
|
||||
<img align=absBottom border=0 src="../../images/printer.gif" width="16" height="16">
|
||||
</span>
|
||||
<?php
|
||||
echo "</td>";
|
||||
echo "</tr>";
|
||||
echo "</table>";
|
||||
echo "</form>";
|
||||
adjust_title_tail_frame("up");
|
||||
adjust_content_head_frame("up");
|
||||
adjust_content_tail_frame("up");
|
||||
|
||||
?>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user