Files
web.ems/wxc2_omc/account/tariffList/mtTariffList.php
agtuser 16a3fd1e1b init
2024-11-11 17:56:00 +08:00

390 lines
11 KiB
PHP
Executable File

<?php
/*********************************************************
程序说明:
功能说明:列表显示被叫计费号码信息
调用关系:调用: header.inc
被调用:
变量说明
作者:崔体存 2004-04-13
修改注释:
NO.1
姓名:
时间:
修改说明:
*********************************************************/
$DEBUG = 0;
require("../../inc/header.inc");
$helpId = "2.2.3.2";
$db='PPS_DB';
$table_name='mt_tariff';
$objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$db);
$strThisPage=$strTitleAccount.$strTitleSpace.$strCurrentTariff.$strTitleSpace.$strMtTariff;
$arr_mode=array("edit","add");
if(!$sort_field){
$sort_field = 'bill_id'; //排序所依赖的字段名
}
$sort_direction = 'ASC '; //排序顺序
$moneyPara = getMoneyPara(); //显示的货币单位是最小货币单位的倍数
//echo "<br>moneyPara = $moneyPara";
if($add_area){
echo " <meta http-equiv=\"refresh\" content=\"0; url=./rate_modify.php?add_area=1\"> ";
exit();
}
//编辑后保持对应tariff_id的页面
if ($keep_id != 1){
$tariff_id=isset($tariff_id)?$tariff_id:'00';
}
else {$tariff_id=$return_tariff_id;}
if($DEBUG) {echo "<br>keep_id=$keep_id<br>tariff_id=$return_tariff_id<br>";}
$where=" WHERE tariff_id=$tariff_id ";
//echo "<br>where=$where";
$str_sql ="SELECT count(*) FROM $table_name ".$where;
// echo "<br>str_sql=$str_sql";
$result=mysqli_query($objDbConn,$str_sql);
$record = mysqli_fetch_array($result);
$number_of_records = $record[0];
$order = " ORDER BY $sort_field $sort_direction ";
$sel_sql ="SELECT * FROM $table_name ".$where.$order;
//echo "<br>sel_sql=$sel_sql";
$result = @mysqli_query($objDbConn,$sel_sql);
$rows = @mysqli_fetch_array($result);
echo mysqli_error($objDbConn);
?>
<base>
<body leftmargin="15" rightmargin="10" onload="javascript:adjust();" onresize="javascript:adjust();" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<form method="POST" name="selectform" action="<?php echo "$PHP_SELF";?>">
<?php
adjust_head();
adjust_title_head();
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "$strThisPage";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "<tr>";
echo "<td align=\"left\">";
echo "$strTotal&nbsp;$strDisplayRecords:<FONT color=blue>&nbsp;$number_of_records</FONT>";
echo "</td>";
echo "<td align=\"right\">";
echo "$strResideZone:&nbsp;";
$maxCosSql = " SELECT pubVarValue FROM OMC_PUB.omcPubVarConf WHERE pubVarName = 'maxCOSNumber' ";
$maxCosRes = @mysqli_query($pubConn,$maxCosSql);
$maxCosRow = @mysqli_fetch_array($maxCosRes);
$maxCosNum = $maxCosRow[pubVarValue];
echo "<select size=\"1\" name=\"tariff_id\" onChange=\"javascript:selectTitle()\">";
for($i=0;$i<$maxCosNum;$i++){
$m=($i<10?"0":"").$i;
if($m != $tariff_id){
echo "<option value=\"$m\">$m</option>";
}else{
echo "<option value=\"$m\" selected>$m</option>";
}
}
echo "</select>";
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_title_tail();
adjust_content_head();
echo "<br>";
?>
<script LANGUAGE="JavaScript">
function selectTitle(){
var base_url,url_add,url;
base_url='<?php echo "$PHP_SELF?tariff_id=";?>';
url_add=document.selectform.tariff_id.options[document.selectform.tariff_id.selectedIndex].value;
url=base_url+url_add;
window.location=url;
}
</script>
<?php
//没有纪录时,显示无记录提示
if(!$rows)
{
echo "<br>&nbsp;";
echo "$strTariffNoRecords $tariff_id"."!";
exit();
}
?>
<table border="1" width="100%" cellpadding="1" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF">
<tr bgcolor="#E6E6E6" valign="top">
<?php
// echo "<td>$strResideZone</td>";
echo "<td><a href=\"$PHP_SELF?tariff_id=$tariff_id&where=$where&sort_field=bill_id\" target=\"_self\">$strChargingPrefix</a></td>";
echo "<td><a href=\"$PHP_SELF?tariff_id=$tariff_id&where=$where&sort_field=area\" target=\"_self\">Country<br>/District</a></td>";
echo "<td >Call<br>type</td>";
echo "<td >Discount<br>ID</td>";
echo "<td >$strUnitChargingTimeSecond</td>";
echo "<td >$strFreeChargeUnit</td>";
echo "<td >$strMinimumChargingUnit</td>";
echo "<td >$strBasicInitial</td>";
echo "<td >Tier Level</td>";
echo "<td >Tier0 Unit</td>";
echo "<td >$strBasicFee</td>";
echo "<td >$strBasicLongDistance</td>";
echo "<td >Tier1 Unit</td>";
echo "<td >$strBasicFee</td>";
echo "<td >$strBasicLongDistance</td>";
echo "<td >Tier2 Unit</td>";
echo "<td >$strBasicFee</td>";
echo "<td >$strBasicLongDistance</td>";
?>
</tr>
<?php
do{
echo "<tr>";
// echo "<td>$rows[tariff_id]</td>";
echo "<td>$rows[bill_id]&nbsp;</td>";
echo "<td>$rows[area]&nbsp</td>";
if($rows[call_type]==4)
echo "<td>Local call in</td>";
elseif($rows[call_type]==5)
echo "<td>Trunk call in</td>";
else
echo "<td align=\"right\">---</td>";
echo "<td align=\"right\">$rows[discount_id]</td>";
echo "<td align=\"right\">$rows[unit_time]</td>";
echo "<td align=\"right\">$rows[free_time]</td>";
echo "<td align=\"right\">$rows[mini_time]</td>";
//echo "<td align=\"right\">$rows[base_fee]</td>";
//echo "<td align=\"right\">$rows[long_distance_fee]</td>";
echo "<td align=\"right\">$rows[adjustment]</td>";
echo "<td align=\"right\">$rows[tier_level]</td>";
echo "<td align=\"right\">$rows[tier_unit_0]</td>";
echo "<td align=\"right\">$rows[base_fee_0]</td>";
echo "<td align=\"right\">$rows[long_distance_fee_0]</td>";
echo "<td align=\"right\">$rows[tier_unit_1]</td>";
echo "<td align=\"right\">$rows[base_fee_1]</td>";
echo "<td align=\"right\">$rows[long_distance_fee_1]</td>";
echo "<td align=\"right\">$rows[tier_unit_2]</td>";
echo "<td align=\"right\">$rows[base_fee_2]</td>";
echo "<td align=\"right\">$rows[long_distance_fee_2]</td>";
/* $base_fee=$rows[base_fee]/$moneyPara;
if($moneyPara < 10){
printf("<td align=\"right\">%5.0f</td>",$base_fee);
}
elseif($moneyPara < 100){
printf("<td align=\"right\">%5.1f</td>",$base_fee);
}
else{
printf("<td align=\"right\">%5.2f</td>",$base_fee);
}
$long_distance_fee=$rows[long_distance_fee]/$moneyPara;
if($moneyPara < 10){
printf("<td align=\"right\">%5.0f</td>", $long_distance_fee);
}
elseif($moneyPara < 100){
printf("<td align=\"right\">%5.1f</td>", $long_distance_fee);
}
else{
printf("<td align=\"right\">%5.2f</td>", $long_distance_fee);
}
$adjustment_fee=$rows[adjustment]/$moneyPara;
if($moneyPara < 10){
printf("<td align=\"right\">%5.0f</td>", $adjustment_fee);
}
elseif($moneyPara < 100){
printf("<td align=\"right\">%5.1f</td>", $adjustment_fee);
}
else{
printf("<td align=\"right\">%5.2f</td>", $adjustment_fee);
}*/
echo "</tr>";
}while($rows = mysqli_fetch_array($result));
?>
</table>
<?php
//--------MMS Retrieve--------------
echo "<br><b>MMS Retrieve</b><p>";
echo "<table border=\"1\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td align=\"center\">ID</td>";
echo "<td align=\"center\">Prefix</td>";
echo "<td align=\"center\">Call type</td>";
echo "<td align=\"center\">Dest name</td>";
echo "<td align=\"center\">Discount ID</td>";
echo "<td align=\"center\">Charge fee</td>";
echo "<td align=\"center\">Cap flag</td>";
echo "</tr>";
$tableName="PPS_DB.vas_mms_retrieve_tariff";
$sql="select * from $tableName where tariff_id=$tariff_id order by mms_retrieve_id asc ";
$res=@mysqli_query($objDbConn,$sql);
$num=@mysqli_num_rows($res);
$mms_retrieve_cap_flag_label=array(0=>"Disable",1=>"Enable");
$mms_retrieve_call_type_label=array(4=>"Local call in",5=>"Trunk call in");
for($i=0;$i<$num;$i++)
{
$row=@mysqli_fetch_array($res);
echo "<tr>";
//ID
$mms_retrieve_id=$row[mms_retrieve_id];
echo "<td align=\"center\">";
echo "$mms_retrieve_id";
echo "</td>";
//Prefix
echo "<td align=\"center\">";
if(trim($row[prefix]) == "")
echo "--";
else
echo "{$row[prefix]}";
echo "</td>";
//Call type
echo "<td align=\"center\">";
echo "{$mms_retrieve_call_type_label[$row[call_type]]}&nbsp;";
echo "</td>";
//Dest name
echo "<td align=\"center\">";
if(trim($row[dest_name]) == "")
echo "--";
else
echo "{$row[dest_name]}";
echo "</td>";
//Discount ID
echo "<td align=\"center\">";
echo "{$row[discount_id]}&nbsp;";
echo "</td>";
//Charge fee
echo "<td align=\"center\">";
echo "{$row[charge_fee]}&nbsp;";
echo "</td>";
//Cap flag
echo "<td align=\"center\">";
echo "{$mms_retrieve_cap_flag_label[$row[cap_flag]]}&nbsp;";
echo "</td>";
echo "</tr>";
}
//echo "tariff_id=$tariff_id<br>";
echo "</table>";
?>
<?php
//--------MMS Email--------------
echo "<br><b>MMS Email</b><p>";
echo "<table border=\"1\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td align=\"center\">ID</td>";
echo "<td align=\"center\">Prefix</td>";
echo "<td align=\"center\">Call type</td>";
echo "<td align=\"center\">Dest name</td>";
echo "<td align=\"center\">Discount ID</td>";
echo "<td align=\"center\">Charge fee</td>";
echo "<td align=\"center\">Cap flag</td>";
echo "</tr>";
$tableName="PPS_DB.vas_mms_email_tariff";
$sql="select * from $tableName where tariff_id=$tariff_id order by email_id asc ";
$res=@mysqli_query($objDbConn,$sql);
$num=@mysqli_num_rows($res);
$email_cap_flag_label=array(0=>"Disable",1=>"Enable");
$email_call_type_label=array(4=>"Local call in",5=>"Trunk call in");
for($i=0;$i<$num;$i++)
{
$row=@mysqli_fetch_array($res);
echo "<tr>";
//ID
$email_id=$row[email_id];
echo "<td align=\"center\">";
echo "$email_id";
echo "</td>";
//Prefix
echo "<td align=\"center\">";
if(trim($row[prefix]) == "")
echo "--";
else
echo "{$row[prefix]}";
echo "</td>";
//Call type
echo "<td align=\"center\">";
echo "{$email_call_type_label[$row[call_type]]}&nbsp;";
echo "</td>";
//Dest name
echo "<td align=\"center\">";
if(trim($row[dest_name]) == "")
echo "--";
else
echo "{$row[dest_name]}";
echo "</td>";
//Discount ID
echo "<td align=\"center\">";
echo "{$row[discount_id]}&nbsp;";
echo "</td>";
//Charge fee
echo "<td align=\"center\">";
echo "{$row[charge_fee]}&nbsp;";
echo "</td>";
//Cap flag
echo "<td align=\"center\">";
echo "{$email_cap_flag_label[$row[cap_flag]]}&nbsp;";
echo "</td>";
echo "</tr>";
}
//echo "tariff_id=$tariff_id<br>";
echo "</table>";
?>
</form>
<?php
adjust_content_tail();
?>
</body>
</html>