ussd perform
This commit is contained in:
@@ -158,10 +158,16 @@ if(!$array){
|
|||||||
<td width="50%" align="center">
|
<td width="50%" align="center">
|
||||||
|
|
||||||
</td>
|
</td>
|
||||||
<td width="20%" align="right">
|
|
||||||
<div onClick="window.print();" style="cursor:hand">
|
<td width="5%" align="right">
|
||||||
|
<a href="./downCSTA.php?sysTypeNo=360&selectedDate=<?php echo "$selectedDate";?> ">
|
||||||
|
<img align=absBottom border=0 src="../../images/list.gif" width="16" height="16"><?php echo " Export";?>
|
||||||
|
</a>
|
||||||
|
</td>
|
||||||
|
<td width="5%" align="right">
|
||||||
|
<a href="window.print();">
|
||||||
<img align=absBottom border=0 src="../../images/printer.gif" width="16" height="16"><?php echo " $strDailyBtnPrint";?>
|
<img align=absBottom border=0 src="../../images/printer.gif" width="16" height="16"><?php echo " $strDailyBtnPrint";?>
|
||||||
</div>
|
</a>
|
||||||
</td>
|
</td>
|
||||||
</TR>
|
</TR>
|
||||||
</TABLE>
|
</TABLE>
|
||||||
@@ -461,27 +467,33 @@ echo "</center>";
|
|||||||
<TABLE border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF">
|
<TABLE border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF">
|
||||||
<TR bgcolor=#E6E6E6>
|
<TR bgcolor=#E6E6E6>
|
||||||
<?php
|
<?php
|
||||||
echo "<td width=\"11%\"> </td>";
|
echo "<td width=\"10%\"> </td>";
|
||||||
echo "<td width=\"11%\">Index</td>";
|
echo "<td width=\"10%\">Index</td>";
|
||||||
echo "<td width=\"13%\">USSD Code</td> ";
|
echo "<td width=\"10%\">USSD Code</td> ";
|
||||||
echo "<td width=\"13%\" align=\"right\">Session Num</td> ";
|
echo "<td width=\"10%\" align=\"right\">Session Num</td> ";
|
||||||
echo "<td width=\"13%\" align=\"right\">Session Duration</td> ";
|
echo "<td width=\"10%\" align=\"right\">Session Duration</td> ";
|
||||||
echo "<td width=\"13%\" align=\"right\">Error Timeout</td> ";
|
echo "<td width=\"10%\" align=\"right\">Error Timeout</td> ";
|
||||||
echo "<td width=\"13%\" align=\"right\">Error System</td> ";
|
echo "<td width=\"10%\" align=\"right\">Error System</td> ";
|
||||||
echo "<td width=\"13%\" align=\"right\">Error Message</td> ";
|
echo "<td width=\"10%\" align=\"right\">Error Message</td> ";
|
||||||
|
echo "<td width=\"10%\" align=\"right\">Average Duration</td> ";
|
||||||
|
echo "<td width=\"10%\" align=\"right\">TPS</td> ";
|
||||||
|
|
||||||
?>
|
?>
|
||||||
</TR>
|
</TR>
|
||||||
<TR >
|
<TR >
|
||||||
<td rowspan="11"><?php echo "USSD Code Report"; ?></td>
|
<td rowspan="11"><?php echo "USSD Code Report"; ?></td>
|
||||||
<?php
|
<?php
|
||||||
echo "<td>1</td>";
|
echo "<td>1</td>";
|
||||||
|
$average1=$array['session_num_1']?$array['session_duration_1']/($array['session_num_1']):0;
|
||||||
|
$tps1=$array['session_num_1']/(3600*24);
|
||||||
echo "<td align=\"right\">$array[ussd_code_1]</td>";
|
echo "<td align=\"right\">$array[ussd_code_1]</td>";
|
||||||
echo "<td align=\"right\">$array[session_num_1]</td>";
|
echo "<td align=\"right\">$array[session_num_1]</td>";
|
||||||
echo "<td align=\"right\">$array[session_duration_1]</td>";
|
echo "<td align=\"right\">$array[session_duration_1]</td>";
|
||||||
echo "<td align=\"right\">$array[error_timeout_1]</td>";
|
echo "<td align=\"right\">$array[error_timeout_1]</td>";
|
||||||
echo "<td align=\"right\">$array[error_system_1]</td>";
|
echo "<td align=\"right\">$array[error_system_1]</td>";
|
||||||
echo "<td align=\"right\">$array[error_message_1]</td>";
|
echo "<td align=\"right\">$array[error_message_1]</td>";
|
||||||
|
echo "<td align=\"right\">$average1</td>";
|
||||||
|
echo "<td align=\"right\">$tps1</td>";
|
||||||
|
|
||||||
|
|
||||||
// echo "<td align=\"right\">$incoming_call_nums</td>";
|
// echo "<td align=\"right\">$incoming_call_nums</td>";
|
||||||
@@ -491,6 +503,8 @@ echo "</center>";
|
|||||||
</TR>
|
</TR>
|
||||||
<?php
|
<?php
|
||||||
for ($i = 2; $i <= 8; $i++) {
|
for ($i = 2; $i <= 8; $i++) {
|
||||||
|
$average=$array['session_num_' . $i]?$array['session_duration_' . $i]/$array['session_num_' . $i]:0;
|
||||||
|
$tps=$array['session_num_' . $i]/(3600*24);
|
||||||
echo "<tr>";
|
echo "<tr>";
|
||||||
echo "<td>$i</td>";
|
echo "<td>$i</td>";
|
||||||
echo "<td align=\"right\">{$array['ussd_code_' . $i]}</td>";
|
echo "<td align=\"right\">{$array['ussd_code_' . $i]}</td>";
|
||||||
@@ -499,6 +513,8 @@ echo "</center>";
|
|||||||
echo "<td align=\"right\">{$array['error_timeout_' . $i]}</td>";
|
echo "<td align=\"right\">{$array['error_timeout_' . $i]}</td>";
|
||||||
echo "<td align=\"right\">{$array['error_system_' . $i]}</td>";
|
echo "<td align=\"right\">{$array['error_system_' . $i]}</td>";
|
||||||
echo "<td align=\"right\">{$array['error_message_' . $i]}</td>";
|
echo "<td align=\"right\">{$array['error_message_' . $i]}</td>";
|
||||||
|
echo "<td align=\"right\">{$average}</td>";
|
||||||
|
echo "<td align=\"right\">{$tps}</td>";
|
||||||
echo "</tr>";
|
echo "</tr>";
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|||||||
124
wxc2_omc/performance/ppsDailyReport/downCSTA.php
Normal file
124
wxc2_omc/performance/ppsDailyReport/downCSTA.php
Normal file
@@ -0,0 +1,124 @@
|
|||||||
|
<?php
|
||||||
|
require("../../inc/lib.inc");
|
||||||
|
|
||||||
|
global $OMC_server;
|
||||||
|
$sysTypeNo=$_GET['sysTypeNo'];
|
||||||
|
$pssDbConn=mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], 'PPS_DB');
|
||||||
|
$objDbConn=mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], 'OBJ_'.$sysTypeNo);
|
||||||
|
// $page_id=$_GET['page_id'];
|
||||||
|
// $sel_date_from=$_GET['sel_date_from'];
|
||||||
|
// $sel_date_to=$_GET['sel_date_to'];
|
||||||
|
// $show_type=$_GET['show_type'];
|
||||||
|
|
||||||
|
$query_year=$_REQUEST['query_year'];
|
||||||
|
$query_month=$_REQUEST['query_month'];
|
||||||
|
$query_day=$_REQUEST['query_day'];
|
||||||
|
|
||||||
|
|
||||||
|
if(!$query_year){
|
||||||
|
$query_year=date("Y",mktime(0,0,0,date("m"),date("d")-1,date("Y")));
|
||||||
|
$query_month=date("m",mktime(0,0,0,date("m"),date("d")-1,date("Y")));
|
||||||
|
$query_day=date("d",mktime(0,0,0,date("m"),date("d")-1,date("Y")));
|
||||||
|
}
|
||||||
|
$defaultDate="$query_year-$query_month-$query_day";
|
||||||
|
$selectedDate=$_REQUEST['selectedDate']?$_REQUEST['selectedDate']:$defaultDate;
|
||||||
|
|
||||||
|
switch($sysTypeNo){
|
||||||
|
case '360':
|
||||||
|
|
||||||
|
$sumSql="SELECT
|
||||||
|
ussd_code_1,
|
||||||
|
session_num_1,
|
||||||
|
session_duration_1,
|
||||||
|
error_timeout_1,
|
||||||
|
error_system_1,
|
||||||
|
error_message_1,
|
||||||
|
ussd_code_2,
|
||||||
|
session_num_2,
|
||||||
|
session_duration_2,
|
||||||
|
error_timeout_2,
|
||||||
|
error_system_2,
|
||||||
|
error_message_2,
|
||||||
|
ussd_code_3,
|
||||||
|
session_num_3,
|
||||||
|
session_duration_3,
|
||||||
|
error_timeout_3,
|
||||||
|
error_system_3,
|
||||||
|
error_message_3,
|
||||||
|
ussd_code_4,
|
||||||
|
session_num_4,
|
||||||
|
session_duration_4,
|
||||||
|
error_timeout_4,
|
||||||
|
error_system_4,
|
||||||
|
error_message_4,
|
||||||
|
ussd_code_5,
|
||||||
|
session_num_5,
|
||||||
|
session_duration_5,
|
||||||
|
error_timeout_5,
|
||||||
|
error_system_5,
|
||||||
|
error_message_5,
|
||||||
|
ussd_code_6,
|
||||||
|
session_num_6,
|
||||||
|
session_duration_6,
|
||||||
|
error_timeout_6,
|
||||||
|
error_system_6,
|
||||||
|
error_message_6,
|
||||||
|
ussd_code_7,
|
||||||
|
session_num_7,
|
||||||
|
session_duration_7,
|
||||||
|
error_timeout_7,
|
||||||
|
error_system_7,
|
||||||
|
error_message_7,
|
||||||
|
ussd_code_8,
|
||||||
|
session_num_8,
|
||||||
|
session_duration_8,
|
||||||
|
error_timeout_8,
|
||||||
|
error_system_8,
|
||||||
|
error_message_8
|
||||||
|
FROM
|
||||||
|
PPS_DB.daily_report
|
||||||
|
WHERE date = '$selectedDate' ";
|
||||||
|
//echo "sumSql=$sumSql";
|
||||||
|
$res=mysqli_query($pssDbConn,$sumSql);
|
||||||
|
echo mysqli_error($pssDbConn);
|
||||||
|
$num=mysqli_num_rows($res);
|
||||||
|
|
||||||
|
// 检查是否有记录
|
||||||
|
if ($num > 0) {
|
||||||
|
// 读取第一条记录
|
||||||
|
$row = mysqli_fetch_array($res, MYSQLI_ASSOC);
|
||||||
|
|
||||||
|
// 处理标题
|
||||||
|
$title = ['Index','USSD Code','Session Num','Session Duration','Error Timeout','Error System','Error Message','Average Duration','TPS']; // 获取字段名
|
||||||
|
$file_name = 'PPS-USSD.csv';
|
||||||
|
$file = fopen($file_name, 'w');
|
||||||
|
fputcsv($file, $title); // 写入标题行
|
||||||
|
|
||||||
|
for ($i = 1; $i <= 8; $i++) {
|
||||||
|
$average=$row['session_num_' . $i]?$row['session_duration_' . $i]/$row['session_num_' . $i]:0;
|
||||||
|
$tps=$row['session_num_' . $i]/(3600*24);
|
||||||
|
fputcsv($file, [$i,$row['ussd_code_' . $i],$row['session_num_' . $i],$row['session_duration_' . $i],$row['error_timeout_' . $i],$row['error_system_' . $i],$row['error_message_' . $i],$average,$tps]);
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose($file);
|
||||||
|
// 检查文件是否存在
|
||||||
|
if (file_exists($file_name)) {
|
||||||
|
header("Content-type: application/csv");
|
||||||
|
//use for download csv in https
|
||||||
|
header('Expires: 0');
|
||||||
|
header('Pragma: public');
|
||||||
|
header('Cache-Control: must-revalidate, post-check=0, pre-check=0');
|
||||||
|
header('Cache-Control: public');
|
||||||
|
header("Content-Disposition: attachment; filename=$file_name");
|
||||||
|
readfile($file_name);
|
||||||
|
} else {
|
||||||
|
// 文件不存在时的处理
|
||||||
|
echo "Error: File does not exist.";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
?>
|
||||||
Reference in New Issue
Block a user