init web ems all

This commit is contained in:
agtuser
2024-09-27 17:13:36 +08:00
parent 81c97acbe9
commit 5cc56f8078
4263 changed files with 798779 additions and 0 deletions

View File

@@ -0,0 +1,692 @@
<?php
/*********************************************************
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD>Ʒ<EFBFBD><C6B7><EFBFBD>Ϣ
<20><><EFBFBD>ù<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: header.inc
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
<EFBFBD>޸<EFBFBD>ע<EFBFBD>ͣ<EFBFBD>
NO.1
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ʱ<EFBFBD><EFBFBD>: 2004-4-13
<EFBFBD>޸<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD> Support OMC 7.0 <20><>Mo tariff<66><66>Rent<6E><74>SMS<4D><53>Servives tariff<66><66>
<20><>һ<EFBFBD><D2BB>ҳ<EFBFBD><EFBFBD><E6A3AC><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ͨ<EFBFBD><CDA8>ѡ<EFBFBD><D1A1>tariff_id<69><64><EFBFBD><EFBFBD><E9BFB4>Ӧ<EFBFBD>ķ<EFBFBD><C4B7><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*********************************************************/
require("../../inc/header.inc");
$helpId = "2.2.3.1";
$db='PPS_DB';
$table_name='mo_tariff';
$objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$db);
$strThisPage=$strTitleAccount.$strTitleSpace.$strCurrentTariff.$strTitleSpace.$strBasicTariff;
$arr_mode=array("edit","add");
$DEBUG = 0;
if(!$sort_field){
$sort_field = 'bill_id'; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD>
}
$sort_direction = 'ASC '; //<2F><><EFBFBD><EFBFBD>˳<EFBFBD><CBB3>
$moneyPara = getMoneyPara(); //<2F><>ʾ<EFBFBD>Ļ<EFBFBD><C4BB>ҵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD>ҵ<EFBFBD>λ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
$call_cap_flag_label=array(0=>"Disable",1=>"Home PLMN Call",2=>"Other Network Call");
$sm_cap_flag_label=array(0=>"Disable",1=>"Home PLMN SM",2=>"Other Network SM");
//echo "<br>moneyPara = $moneyPara";
if($add_area){
echo " <meta http-equiv=\"refresh\" content=\"0; url=./rate_modify.php?add_area=1\"> ";
exit();
}
//<2F><EFBFBD>󱣳ֶ<F3B1A3B3>Ӧtariff_id<69><64>ҳ<EFBFBD><D2B3>
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 "<b>MO basic tariff</b> Total records:$number_of_records";
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
//û<>м<EFBFBD>¼ʱ<C2BC><CAB1><EFBFBD><EFBFBD>ʾ<EFBFBD>޼<EFBFBD>¼<EFBFBD><C2BC>ʾ
if(!$rows){
echo "$strTariffNoRecords $tariff_id"."!";
}
?>
<?php
if($rows){
echo "<table border=\"1\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
echo "<tr bgcolor=\"#E6E6E6\" valign=\"top\">";
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 >$strBasicFee</td>";
//echo "<td >$strBasicLongDistance</td>";
echo "<td >$strBasicInitial</td>";
echo "<td >$strTariffRentCapFlag</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>";
echo "</tr>";
do{
echo "<tr>";
echo "<td>$rows[bill_id]</td>";
echo "<td>$rows[area]&nbsp</td>";
if($rows[call_type]==0)
echo "<td>Local call out</td>";
elseif($rows[call_type]==1)
echo "<td>NDD</td>";
elseif($rows[call_type]==2)
echo "<td>IDD</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\">{$call_cap_flag_label[$rows[cap_flag]]}</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>
</form>
<!-- Rent -->
<?php
$moneyPara = getMoneyPara(); //<2F><>ʾ<EFBFBD>Ļ<EFBFBD><C4BB>ҵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD>ҵ<EFBFBD>λ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
$db='PPS_DB';
$table_name='rent';
$arr_mode=array("edit","add");
//<2F><EFBFBD>󱣳ֶ<F3B1A3B3>Ӧtariff_id<69><64>ҳ<EFBFBD><D2B3>
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>";
$sql="SELECT id,description,rent_type,charge_date,rent_amount
FROM $table_name
WHERE tariff_id=$tariff_id
ORDER by id";
//echo $sql,$bill_db;
$result=@mysqli_query($objDbConn,$sql);
$rows=@mysqli_fetch_array($result);
echo mysqli_error($objDbConn);
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td>";
echo "<b>Rent</b>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<p></p>";
?>
<table border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
<tr bgcolor="#E6E6E6">
<?php
echo "<td align=\"center\">$strTariffRentID</td>";
echo "<td align=\"center\">$strDescription</td>";
echo "<td align=\"center\">$strTariffRentChargeType</td>";
echo "<td align=\"center\">$strTariffRentChargeDate</td>";
echo "<td align=\"center\">$strTariffRentChargeAmount</td>";
?>
</tr>
<?php
$i=0;
if($rows && $result){
do{
$i++;
$showi=$i;
if ($rows[description] == ''){
echo "<tr>";
echo "<td align=\"center\">$showi</td>";
echo "<td align=\"center\">--</td>";
echo "<td align=\"center\">--</td>";
echo "<td align=\"center\">--</td>";
echo "<td align=\"right\">--</td>";
echo "</tr>";
}
else{
echo "<tr>";
echo "<td align=\"center\">$showi</td>";
echo "<td align=\"center\">$rows[description]</td>";
echo "<td align=\"center\">";
if($rows[rent_type]=='00'){
echo "$strTariffRentAccordingToDate";
}else{
echo "$strTariffRentAccordingToPeriod";
}
echo "</td>";
echo "<td align=\"center\">";
if($rows[rent_type]=='01'){
echo "$rows[charge_date]";
}else{
echo "--";
}
echo "</td>";
echo "<td align=\"right\">$rows[rent_amount]</td>";
/*
$rows[rent_amount] = $rows[rent_amount]/$moneyPara;
if($moneyPara < 10){
printf("<td align=\"right\">%5.0f</td>", $rows[rent_amount]);
}
elseif($moneyPara < 100){
printf("<td align=\"right\">%5.1f</td>", $rows[rent_amount]);
}
else{
printf("<td align=\"right\">%5.2f</td>", $rows[rent_amount]);
}*/
echo "</tr>";
}
}while($rows=mysqli_fetch_array($result));
}
?>
</table>
<!-- SMS -->
<?php
$moneyPara = getMoneyPara(); //<2F><>ʾ<EFBFBD>Ļ<EFBFBD><C4BB>ҵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD>ҵ<EFBFBD>λ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
$db='PPS_DB';
$table_name='bill_sms';
$arr_mode=array("edit","add");
//<2F><EFBFBD>󱣳ֶ<F3B1A3B3>Ӧtariff_id<69><64>ҳ<EFBFBD><D2B3>
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>";}
$sql="SELECT id,prefix,call_type,area,discount_id,charge_amount,cap_flag
FROM $table_name
WHERE tariff_id=$tariff_id
ORDER by id";
//echo $sql,$bill_db;
$result=@mysqli_query($objDbConn,$sql);
$rows=@mysqli_fetch_array($result);
echo mysqli_error($objDbConn);
?>
<p></p>
<?php
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td>";
echo "<b>SMS</b>";
echo "</td>";
echo "</tr>"; echo "</table>";
echo "<p></p>";
?>
<table border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
<tr bgcolor="#E6E6E6">
<?php
echo "<td align=\"center\">$strTariffRentID</td>";
echo "<td align=\"center\">$strChargingPrefix</td>";
echo "<td align=\"center\">Call type</td>";
echo "<td align=\"center\">$strCountryDistrict</td>";
echo "<td align=\"center\">$strDiscountID</td>";
echo "<td align=\"center\">$strTariffRentChargeAmount</td>";
echo "<td align=\"center\">$strTariffRentCapFlag</td>";
?>
</tr>
<?php
$i=0;
if($rows && $result){
do{
$i++;
echo "<tr>";
echo "<td align=\"center\">$i</td>";
if("" == $rows[prefix]){
$rows[prefix]="--";
}
echo "<td align=\"center\">&nbsp;$rows[prefix]</td>";
if($rows[call_type]==0)
echo "<td align=\"center\">Local call out</td>";
elseif($rows[call_type]==1)
echo "<td align=\"center\">NDD</td>";
elseif($rows[call_type]==2)
echo "<td align=\"center\">IDD</td>";
else
echo "<td align=\"right\">---</td>";
if ($rows[area] == ''){
$rows[area]='--';
}
echo "<td align=\"center\">&nbsp;$rows[area]</td>";
echo "<td align=\"center\">$rows[discount_id]</td>";
echo "</td>";
echo "<td align=\"center\">$rows[charge_amount]</td>";
$cap_flag_value=$sm_cap_flag_label[$rows[cap_flag]+0];
echo "<td align=\"center\">$cap_flag_value</td>";
/*
$rows[charge_amount ] = $rows[charge_amount ]/$moneyPara;
if($moneyPara < 10){
printf("<td align=\"right\">%5.0f</td>", $rows[charge_amount]);
}
elseif($moneyPara < 100){
printf("<td align=\"right\">%5.1f</td>", $rows[charge_amount]);
}
else{
printf("<td align=\"right\">%5.2f</td>", $rows[charge_amount]);
}*/
echo "</tr>";
}while($rows=mysqli_fetch_array($result));
}
?>
</table>
<!-- GPRS -->
<?php
$moneyPara = getMoneyPara(); //<2F><>ʾ<EFBFBD>Ļ<EFBFBD><C4BB>ҵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD>ҵ<EFBFBD>λ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
$db='PPS_DB';
$table_name='gprs_tariff';
$arr_mode=array("edit","add");
//<2F><EFBFBD>󱣳ֶ<F3B1A3B3>Ӧtariff_id<69><64>ҳ<EFBFBD><D2B3>
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>";}
$sql="SELECT record_id,dest_ip,charge_unit,basic_fee,min_charge_unit,initial_adjustment,cap_flag,discount_id
FROM $table_name
WHERE tariff_id=$tariff_id
ORDER by record_id";
//echo $sql,$bill_db;
$result=@mysqli_query($objDbConn,$sql);
$rows=@mysqli_fetch_array($result);
echo mysqli_error($objDbConn);
?>
<p></p>
<?php
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td>";
echo "<b>GPRS</b>";
echo "</td>";
echo "</tr>"; echo "</table>";
echo "<p></p>";
?>
<table border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
<tr bgcolor="#E6E6E6">
<?php
echo "<td align=\"center\">ID</td>";
echo "<td align=\"center\">Dest IP</td>";
echo "<td align=\"center\">Charge unit(KB)</td>";
echo "<td align=\"center\">Basic fee</td>";
echo "<td align=\"center\">Minimum charge unit</td>";
echo "<td align=\"center\">Initial adjustment</td>";
echo "<td align=\"center\">Cap flag</td>";
echo "<td align=\"center\">Discount ID</td>";
?>
</tr>
<?php
$i=0;
$gprs_cap_flag_label=array(0=>"Disable",1=>"Enable");
if($rows && $result){
do{
$i++;
echo "<tr>";
echo "<td align=\"center\">{$rows[record_id]}</td>";
echo "<td align=\"center\">&nbsp;$rows[dest_ip]</td>";
echo "<td align=\"center\">&nbsp;$rows[charge_unit]</td>";
echo "<td align=\"center\">&nbsp;$rows[basic_fee]</td>";
echo "<td align=\"center\">&nbsp;$rows[min_charge_unit]</td>";
echo "<td align=\"center\">&nbsp;$rows[initial_adjustment]</td>";
$cap_flag_value=$gprs_cap_flag_label[$rows[cap_flag]+0];
echo "<td align=\"center\">&nbsp;$cap_flag_value</td>";
echo "<td align=\"center\">&nbsp;$rows[discount_id]</td>";
echo "</tr>";
}while($rows=mysqli_fetch_array($result));
}
?>
</table>
<!-- MMS Send -->
<?php
$moneyPara = getMoneyPara(); //<2F><>ʾ<EFBFBD>Ļ<EFBFBD><C4BB>ҵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD>ҵ<EFBFBD>λ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
$db='PPS_DB';
$table_name='vas_mms_send_tariff';
$arr_mode=array("edit","add");
//<2F><EFBFBD>󱣳ֶ<F3B1A3B3>Ӧtariff_id<69><64>ҳ<EFBFBD><D2B3>
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>";}
$sql="SELECT mms_send_id,mms_type,prefix,call_type,dest_name,discount_id,charge_fee,cap_flag
FROM $table_name
WHERE tariff_id=$tariff_id
ORDER by mms_send_id";
//echo $sql,$bill_db;
$result=@mysqli_query($objDbConn,$sql);
$rows=@mysqli_fetch_array($result);
echo mysqli_error($objDbConn);
?>
<p></p>
<?php
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td>";
echo "<b>MMS Send</b>";
echo "</td>";
echo "</tr>"; echo "</table>";
echo "<p></p>";
?>
<table border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
<tr bgcolor="#E6E6E6">
<?php
echo "<td align=\"center\">ID</td>";
echo "<td align=\"center\">MMS type</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>";
?>
</tr>
<?php
$i=0;
$mms_send_cap_flag_label=array(0=>"Disable",1=>"Enable");
$mms_type_label=array(1=>"To mobile",2=>"To email");
$call_type_label=array(0=>"Local call out",1=>"NDD",2=>"IDD");
if($rows && $result){
do{
$i++;
echo "<tr>";
echo "<td align=\"center\">{$rows[mms_send_id]}</td>";
echo "<td align=\"center\">&nbsp;{$mms_type_label[$rows[mms_type]]}</td>";
if(trim($rows[prefix])=="")
echo "<td align=\"center\">--</td>";
else
echo "<td align=\"center\">&nbsp;$rows[prefix]</td>";
echo "<td align=\"center\">&nbsp;{$call_type_label[$rows[call_type]]}</td>";
if(trim($rows[dest_name])=="")
echo "<td align=\"center\">--</td>";
else
echo "<td align=\"center\">&nbsp;$rows[dest_name]</td>";
echo "<td align=\"center\">&nbsp;$rows[discount_id]</td>";
echo "<td align=\"center\">&nbsp;$rows[charge_fee]</td>";
$cap_flag_value=$gprs_cap_flag_label[$rows[cap_flag]+0];
echo "<td align=\"center\">&nbsp;$cap_flag_value</td>";
echo "</tr>";
}while($rows=mysqli_fetch_array($result));
}
echo "</table>";
?>
<!-- Service tariff -->
<?php
$moneyPara = getMoneyPara(); //<2F><>ʾ<EFBFBD>Ļ<EFBFBD><C4BB>ҵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD>ҵ<EFBFBD>λ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
$db='PPS_DB';
$tableName='comm_tariff';
//<2F><EFBFBD>󱣳ֶ<F3B1A3B3>Ӧtariff_id<69><64>ҳ<EFBFBD><D2B3>
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 ";
$sql="SELECT * FROM $tableName".$where;
//echo $sql,$bill_db;
$result=@mysqli_query($objDbConn,$sql);
$rows=@mysqli_fetch_array($result);
echo mysqli_error($objDbConn);
?>
<?php
//û<>м<EFBFBD>¼ʱ<C2BC><CAB1><EFBFBD><EFBFBD>ʾ<EFBFBD>޼<EFBFBD>¼<EFBFBD><C2BC>ʾ
if(!$rows){
$setSql="INSERT INTO $tableName
(tariff_id,mo_sm_charge,mt_sm_charge,cf_charge_unit,cf_charge_amount,roaming_charge_unit,roaming_charge_amount,cc_charge_unit,cc_charge_amount,cug_charge_unit,cug_charge_amount,fav_change_charge,fav_charge_unit,fav_charge_amount )
VALUES
('$tariff_id','','','','','','','','','','','','','')";
if($DEBUG) echo "<br>setSql=$setSql";
mysqli_query($objDbConn,$setSql);
}
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td>";
echo "<b><br>Supplementary tariff</b>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<p></p>";
?>
<table border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
<?php
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td width=\"40%\">$strDescription</td>";
echo "<td align =\"right\" width=\"30%\">$strTariffRentChargeAmount</td>";
echo "<td align =\"right\" width=\"30%\">$strUnitChargingTimeSecond</td>";
echo "</tr>";
/*
$arr_editfieldAmount = array("cf_charge_amount","roaming_charge_amount","cc_charge_amount","cug_charge_amount","fav_charge_amount","fav_change_charge","cf_cug_charge_amount","cf_fav_charge_amount","cug_fav_charge_amount","cf_cug_fav_charge_amount");
$arr_editfieldUnit = array("cf_charge_unit","roaming_charge_unit","cc_charge_unit","cug_charge_unit","fav_charge_unit","","cf_cug_charge_unit","cf_fav_charge_unit","cug_fav_charge_unit","cf_cug_fav_charge_unit");
$arr_description = array($strCallForwrd,$strRoaming,$strConferenceCall,$strCloseUserGroup,$strFav_call,$strFav_listedtion,$strCf_Cug_call,$strCf_Fav_call,$strCug_Fav_call,$strCf_Cug_Fav_call);
$arr_amount = array($rows[cf_charge_amount],$rows[roaming_charge_amount],$rows[cc_charge_amount],$rows[cug_charge_amount],$rows[fav_charge_amount],$rows[fav_change_charge],$rows[cf_cug_charge_amount],$rows[cf_fav_charge_amount],$rows[cug_fav_charge_amount],$rows[cf_cug_fav_charge_amount]);
$arr_unit = array($rows[cf_charge_unit],$rows[roaming_charge_unit],$rows[cc_charge_unit],$rows[cug_charge_unit],$rows[fav_charge_unit],"----",$rows[cf_cug_charge_unit],$rows[cf_fav_charge_unit],$rows[cug_fav_charge_unit],$rows[cf_cug_fav_charge_unit]);
*/
$arr_editfieldAmount = array("cf_charge_amount","roaming_charge_amount","cc_charge_amount","cug_charge_amount","fav_charge_amount","fav_change_charge","cf_cug_charge_amount","cf_fav_charge_amount","cug_fav_charge_amount","cf_cug_fav_charge_amount","pool_account_change_charge","pool_call_amount","act_free_sms_charge","deact_free_sms_charge");
$arr_editfieldUnit = array("cf_charge_unit","roaming_charge_unit","cc_charge_unit","cug_charge_unit","fav_charge_unit","","cf_cug_charge_unit","cf_fav_charge_unit","cug_fav_charge_unit","cf_cug_fav_charge_unit","","pool_call_unit","","");
$arr_description = array($strCallForwrd,$strRoaming,$strConferenceCall,$strCloseUserGroup,$strFav_call,"Friends and family number change fee",$strCf_Cug_call,$strCf_Fav_call,$strCug_Fav_call,$strCf_Cug_Fav_call,"Pool account change fee","Pool call","Active free SMS charge","Deactive free SMS charge");
$arr_amount = array($rows[cf_charge_amount],$rows[roaming_charge_amount],$rows[cc_charge_amount],$rows[cug_charge_amount],$rows[fav_charge_amount],$rows[fav_change_charge],$rows[cf_cug_charge_amount],$rows[cf_fav_charge_amount],$rows[cug_fav_charge_amount],$rows[cf_cug_fav_charge_amount],$rows[pool_account_change_charge],$rows[pool_call_amount],$rows[act_free_sms_charge],$rows[deact_free_sms_charge]);
$arr_unit = array($rows[cf_charge_unit],$rows[roaming_charge_unit],$rows[cc_charge_unit],$rows[cug_charge_unit],$rows[fav_charge_unit],"----",$rows[cf_cug_charge_unit],$rows[cf_fav_charge_unit],$rows[cug_fav_charge_unit],$rows[cf_cug_fav_charge_unit],"----",$rows[pool_call_unit],"----","----");
for ($i=0;$i<14;$i++){
echo "<tr>";
echo "<td>$arr_description[$i]</td>";
echo "<td align=\"right\">$arr_amount[$i]</td>";
/*if($moneyPara < 10){
printf("<td align=\"right\">%5.0f</td>", $arr_amount[$i]/$moneyPara);
}
elseif($moneyPara < 100){
printf("<td align=\"right\">%5.1f</td>", $arr_amount[$i]/$moneyPara);
}
else{
printf("<td align=\"right\">%5.2f</td>", $arr_amount[$i]/$moneyPara);
}*/
echo "<td align =\"right\">&nbsp;$arr_unit[$i]</td>";
echo "</tr>";
echo $tariffID;
}
?>
</table>
<?php
adjust_content_tail();
?>
</body>
</html>

View File

@@ -0,0 +1,160 @@
<?php
/*********************************************************
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>ʾ<EFBFBD>ۿ۱<DBBF><DBB1><EFBFBD>Ϣ
<20><><EFBFBD>ù<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: header.inc
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:Cui Ticun 2004-04-13
<EFBFBD>޸<EFBFBD>ע<EFBFBD>ͣ<EFBFBD>
NO.1
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ʱ<EFBFBD>
<EFBFBD>޸<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*********************************************************/
require("../../inc/header.inc");
$helpId = "2.2..3.3";
$ppsDb='PPS_DB';
$tableName='bill_discount';
$strThisPage=$strTitleAccount.$strTitleSpace.$strTariffPlan.$strTitleSpace.$strDiscount;
/*
$strCallInsideZone ="С<><D0A1>ͨ<EFBFBD><CDA8>";
$strCallOutsideZone ="<22><><EFBFBD><EFBFBD><EFBFBD>л<EFBFBD>";
$strDomesticLongCall ="<22><><EFBFBD>ڳ<EFBFBD>;";
$strInternationalLongCall ="<22><><EFBFBD>ʳ<EFBFBD>;";
$strLongCallToHKOMTW ="<22>۰<EFBFBD>̨<EFBFBD><CCA8>;";
*/
$order="hours"; //<2F><><EFBFBD><EFBFBD>
$sql = "SELECT * FROM $tableName ORDER BY $order";
$result=mysqli_query($pubConn,$sql);
$rows = mysqli_fetch_array($result);
?>
<body>
<?php
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "$strThisPage";
echo "</td>";
echo "<td width=\"50%\" align=\"right\">";
showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<p></p>";
//û<>м<EFBFBD>¼ʱ<C2BC><CAB1><EFBFBD><EFBFBD>ʾ<EFBFBD>޼<EFBFBD>¼<EFBFBD><C2BC>ʾ
if(!$rows){
echo "$strNotFindRecord";
exit();
}
?>
<table border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
<tbody>
<tr bgcolor="#E6E6E6">
<td align="center"><?php echo "$strTariffDiscountTimeSection"; ?></td>
<td align="center"><?php echo $strMonday; ?></td>
<td align="center"><?php echo $strTuesday; ?></td>
<td align="center"><?php echo $strWednesday; ?></td>
<td align="center"><?php echo $strThursday; ?></td>
<td align="center"><?php echo $strFriday; ?></td>
<td align="center"><?php echo $strSaturday; ?></td>
<td align="center"><?php echo $strSunday; ?></td>
<td align="center"><?php echo $strSpecialDay; ?></td>
</tr>
<?php
$record_length = 0;
do
{
echo "<tr>";
$hours=$rows[hours];
if(strlen($hours) < 2) $hours='0'.$hours;
if(strlen($hours+1) < 2)
{
$next_hours='0'.($hours+1);
}
else
{
$next_hours=$hours+1;
}
$mon=change2point($rows[mon]/100);
$tue=change2point($rows[tue]/100);
$wed=change2point($rows[wed]/100);
$thu=change2point($rows[thu]/100);
$fri=change2point($rows[fri]/100);
$sat=change2point($rows[sat]/100);
$sun=change2point($rows[sun]/100);
$holiday=change2point($rows[holiday]/100);
echo "<td align=center>$hours:00:00 - $next_hours:00:00</td>";
echo "<td align=center>$mon</td>";
echo "<td align=center>$tue</td>";
echo "<td align=center>$wed</td>";
echo "<td align=center>$thu</td>";
echo "<td align=center>$fri</td>";
echo "<td align=center>$sat</td>";
echo "<td align=center>$sun</td>";
echo "<td align=center>$holiday</td>";
echo "</tr>";
$record_length++;
}
while($rows = @mysqli_fetch_array($result));
//<2F><>ʼ<EFBFBD><CABC><EFBFBD>ۿ۱<DBBF><DBB1><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Աû<D4B1><C3BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ۿ<EFBFBD>ʱ<EFBFBD><CAB1>ϵͳ<CFB5>Զ<EFBFBD><D4B6><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD>ε<EFBFBD><CEB5>ۿ<EFBFBD><DBBF><EFBFBD>Ϊ100%
for($i=$record_length;$i<24;$i++){
$hours=$i;
$defaultDiscount=100;
$setSql="INSERT INTO $tableName
(hours,mon,tue,wed,thu,fri,sat,sun,holiday)
VALUES ('$i','$defaultDiscount','$defaultDiscount','$defaultDiscount','$defaultDiscount','$defaultDiscount','$defaultDiscount','$defaultDiscount','$defaultDiscount')";
if($DEBUG) echo "<br>setSql=$setSql";
$result= @mysqli_query($pubConn,$setSql);
//echo mysqli_error($pubConn);
//echo "<br>sql=$sql";
if(strlen($hours) < 2) $hours='0'.$hours;
if(strlen($hours+1) < 2)
{
$next_hours='0'.($hours+1);
}
else
{
$next_hours=$hours+1;
}
$mon=change2point($rows[mon]/100);
$tue=change2point($rows[tue]/100);
$wed=change2point($rows[wed]/100);
$thu=change2point($rows[thu]/100);
$fri=change2point($rows[fri]/100);
$sat=change2point($rows[sat]/100);
$sun=change2point($rows[sun]/100);
$holiday=change2point($rows[holiday]/100);
echo "<tr>";
echo "<td align=center>$hours:00:00 - $next_hours:00:00</td>";
echo "<td align=center>$mon</td>";
echo "<td align=center>$tue</td>";
echo "<td align=center>$wed</td>";
echo "<td align=center>$thu</td>";
echo "<td align=center>$fri</td>";
echo "<td align=center>$sat</td>";
echo "<td align=center>$sun</td>";
echo "<td align=center>$holiday</td>";
echo "</tr>";
}
//
?>
</tbody>
</table>
</body>
</html>

View File

@@ -0,0 +1,154 @@
<?php
/*********************************************************
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>ʾ<EFBFBD>ۿ۱<DBBF><DBB1><EFBFBD>Ϣ
<20><><EFBFBD>ù<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: header.inc
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
<EFBFBD>޸<EFBFBD>ע<EFBFBD>ͣ<EFBFBD>
NO.1
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>: Lilong
ʱ<EFBFBD>䣺2004-4-13
<EFBFBD>޸<EFBFBD>˵<EFBFBD><EFBFBD>: support 16 discount ID.
*********************************************************/
require("../../inc/header.inc");
$helpId = "2.2.3.3";
$DEBUG = 0;
$ppsDb='PPS_DB';
$objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$ppsDb);
$tbName='bill_discount';
$strThisPage=$strTitleAccount.$strTitleSpace.$strCurrentTariff.$strTitleSpace.$strDiscount;
$order="hours"; //<2F><><EFBFBD><EFBFBD>
if($DEBUG) echo "discount_id=$discount_id<br>";
if( FALSE == isset($discount_id) ){
$discount_id = 00;
}
/*
//insert discount to table while the time segment is NULL
$countSql = "SELECT count(*) as total FROM $tbName WHERE discount_id=$discount_id";
if($DEBUG) echo "countSql=$countSql<br>";
$countRes = mysqli_query($pubConn,$countSql);
$countRows = mysqli_fetch_array($countRes);
echo "countRows[total]=$countRows[total]<br>";
if($countRows[total]<24){
}
exit();
*/
//select current discount id details from TABLE "pre_bill_discount"
$selSql = "SELECT * FROM $tbName WHERE discount_id=$discount_id ORDER BY $order";
if($DEBUG) echo "selSql=$selSql<br>";
$selRes = mysqli_query($objDbConn,$selSql);
$selRows = mysqli_fetch_array($selRes);
?>
<base>
<body leftmargin="15" rightmargin="10" onload="javascript:adjust();" onresize="javascript:adjust();" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<form method="POST" action="$PHP_SELF" name="selectform">
<?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 "&nbsp;";
echo "</td>";
echo "<td align=\"right\">";
echo "Discount ID:&nbsp;";
echo "<select size=\"1\" name=\"discount_id\" onChange=\"javascript:selectTitle()\">";
for($i=0;$i<32;$i++){
$m=($i<10?"0":"").$i;
if($m != $discount_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?discount_id=";?>';
url_add=document.selectform.discount_id.value;
url=base_url+url_add;
window.location=url;
}
</script>
</form>
<table border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
<tr bgcolor="#E6E6E6">
<td align="center"><?php echo "$strTariffDiscountTimeSection"; ?></td>
<td align="center"><?php echo $strMonday; ?></td>
<td align="center"><?php echo $strTuesday; ?></td>
<td align="center"><?php echo $strWednesday; ?></td>
<td align="center"><?php echo $strThursday; ?></td>
<td align="center"><?php echo $strFriday; ?></td>
<td align="center"><?php echo $strSaturday; ?></td>
<td align="center"><?php echo $strSunday; ?></td>
<td align="center"><?php echo $strSpecialDay; ?></td>
</tr>
<?php
do{
echo "<tr>";
$hours=$selRows[hours];
if(strlen($hours) < 2) $hours='0'.$hours;
if(strlen($hours+1) < 2){
$next_hours='0'.($hours+1);
}else{
$next_hours=$hours+1;
}
$mon=change2point($selRows[mon]/100);
$tue=change2point($selRows[tue]/100);
$wed=change2point($selRows[wed]/100);
$thu=change2point($selRows[thu]/100);
$fri=change2point($selRows[fri]/100);
$sat=change2point($selRows[sat]/100);
$sun=change2point($selRows[sun]/100);
$holiday=change2point($selRows[holiday]/100);
echo "<td align=center>$hours:00:00 - $next_hours:00:00</td>";
echo "<td align=center>$mon</td>";
echo "<td align=center>$tue</td>";
echo "<td align=center>$wed</td>";
echo "<td align=center>$thu</td>";
echo "<td align=center>$fri</td>";
echo "<td align=center>$sat</td>";
echo "<td align=center>$sun</td>";
echo "<td align=center>$holiday</td>";
echo "</tr>";
}while($selRows = @mysqli_fetch_array($selRes));
?>
</table>
<?php
adjust_content_tail();
?>
</body>
</html>

View File

@@ -0,0 +1,84 @@
<?php
/*********************************************************
<20>ļ<EFBFBD>˵<EFBFBD><CBB5>:
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:<3A>ڼ<EFBFBD><DABC><EFBFBD><EFBFBD>б<EFBFBD>
<20><><EFBFBD>ù<EFBFBD>ϵ:<3A><><EFBFBD><EFBFBD>:header.inc
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3>
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
NO.1
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Cui Ticun
ʱ<EFBFBD>䣺2004-04-13
<EFBFBD>޸<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>Support OMC7.0
*********************************************************/
require("../../inc/header.inc");
$helpId = "2.2.3.4";
$ppsDb='PPS_DB';
$objDbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'],$ppsDb);
$tableName='bill_holiday';
$arr_mode=array("edit","add");
$strThisPage=$strTitleAccount.$strTitleSpace.$strCurrentTariff.$strTitleSpace.$strHoliday;
$sql="SELECT *
FROM $tableName
ORDER BY 'month','day'";
$result=mysqli_query($objDbConn,$sql);
$rows=mysqli_fetch_array($result);
?>
<body leftmargin="15" rightmargin="10" onload="javascript:adjust();" onresize="javascript:adjust();" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?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 "</table>";
adjust_title_tail();
adjust_content_head();
echo "<br>";
/*
//û<>м<EFBFBD>¼ʱ<C2BC><CAB1><EFBFBD><EFBFBD>ʾ<EFBFBD>޼<EFBFBD>¼<EFBFBD><C2BC>ʾ
if(!$rows){
echo "$strNotFindRecord";
exit();
}
*/
?>
<table border="1" width="400" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
<tr bgcolor="#E6E6E6">
<td align="center" width="40%"><?php echo $strDate; ?>(mm-dd)</td>
<td align="center" width="60%"><?php echo $strDescription; ?></td>
</tr>
<?php
$i=0;
do
{
echo "<tr>";
$id=$rows[id];
$month=omc_keep_length($rows[month],0,2);
$day=omc_keep_length($rows[day],0,2);
$showDate=$month."-".$day;
$rows[name]=$rows[name]?$rows[name]:'--';
echo "<td align=\"center\">$showDate</td>";
echo "<td align=\"center\">$rows[name]</td>";
echo "</tr>";
$i++;
}while($rows=mysqli_fetch_array($result));
?>
</table>
<?php
adjust_content_tail();
?>
</body>
</html>

View File

@@ -0,0 +1,390 @@
<?php
/*********************************************************
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD>мƷѺ<C6B7><D1BA><EFBFBD><EFBFBD><EFBFBD>Ϣ
<20><><EFBFBD>ù<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: header.inc
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2004-04-13
<EFBFBD>޸<EFBFBD>ע<EFBFBD>ͣ<EFBFBD>
NO.1
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ʱ<EFBFBD><EFBFBD>:
<EFBFBD>޸<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*********************************************************/
$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'; //<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ֶ<EFBFBD><D6B6><EFBFBD>
}
$sort_direction = 'ASC '; //<2F><><EFBFBD><EFBFBD>˳<EFBFBD><CBB3>
$moneyPara = getMoneyPara(); //<2F><>ʾ<EFBFBD>Ļ<EFBFBD><C4BB>ҵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD>ҵ<EFBFBD>λ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
//echo "<br>moneyPara = $moneyPara";
if($add_area){
echo " <meta http-equiv=\"refresh\" content=\"0; url=./rate_modify.php?add_area=1\"> ";
exit();
}
//<2F><EFBFBD>󱣳ֶ<F3B1A3B3>Ӧtariff_id<69><64>ҳ<EFBFBD><D2B3>
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
//û<>м<EFBFBD>¼ʱ<C2BC><CAB1><EFBFBD><EFBFBD>ʾ<EFBFBD>޼<EFBFBD>¼<EFBFBD><C2BC>ʾ
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>

View File

@@ -0,0 +1,274 @@
<?php
/*********************************************************
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>download current tariff or tariff plan form PPS
<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>޸<EFBFBD>ע<EFBFBD>ͣ<EFBFBD>
NO.1
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ʱ<EFBFBD>
<EFBFBD>޸<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*********************************************************/
require("../../inc/header.inc");
?>
<body leftmargin="15" rightmargin="10" onload="javascript:adjust();" onresize="javascript:adjust();" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php
adjust_head();
adjust_title_head();
$helpId = "2.49";
$DEBUG=0;
global $pubConn,$OMC_server;
//==========================================================
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//==========================================================
$db='PPS_DB';
$dbConn = mysqli_connect($OMC_server[0]['host'],$OMC_server[0]['user'],$OMC_server[0]['password'], "PPS_DB");
$sysTypeNo = 360;
$pagePath=$strTitleAdvanced.$strTitleSpace.$strRateAdmin.$strTitleSpace.$strRefresh;
//==========================================================
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
//==========================================================
$downloadCurrent = $_REQUEST['downloadCurrent'];
$downloadPlan = $_REQUEST['downloadPlan'];
if($DEBUG) echo "<br>downloadCurrent = ".$_REQUEST['downloadCurrent'];
if($DEBUG) echo "<br>downloadPlan = ".$_REQUEST['downloadPlan'];
//==========================================================
//<2F><><EFBFBD>ݴ<EFBFBD><DDB4><EFBFBD>
//==========================================================
$ftpInfo=getMSSFtpAccount();
if($DEBUG) print_r($ftpInfo);
if($downloadCurrent||$downloadPlan){
echo "<br><br><br><br><br>";
adjust_title_tail();
adjust_content_head();
//<2F>ҵ<EFBFBD><D2B5>ʺϵ<CABA><CFB5><EFBFBD>ϵͳ
$getSysIdSql = "SELECT sysNo,subSysNo,ip
FROM sysInfo
WHERE sysTypeNo='$sysTypeNo' AND baseStat > '0'
ORDER BY sysNo ASC,subSysNo ASC
";
if($DEBUG) echo "<br>getSysIdSql=$getSysIdSql";
$getSysIdResult= mysqli_query($pubConn,$getSysIdSql);
echo mysqli_error($pubConn);
if(mysqli_num_rows($getSysIdResult) <= 0) {
echo "<br>Sorry, All the PPS's status are abnormal!";
exit();
}
$getSysIdRow=mysqli_fetch_array($getSysIdResult);
$sysId=$sysTypeNo.'_'.$getSysIdRow[sysNo].'_'.$getSysIdRow[subSysNo];
$sysName='PPS_'.$getSysIdRow[sysNo].'_'.$getSysIdRow[subSysNo];
if($DEBUG) echo "<br>sysId = $sysId";
$dstSeverIp = $getSysIdRow[ip];
if($DEBUG) echo "<br>dstSeverIp = $dstSeverIp";
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
/* close ftp
$con=@ftp_connect($dstSeverIp);
*/
$connection=sftp_connect($dstSeverIp);
if($DEBUG)echo "<br>con=$con";
//login pps server
$loginName = $ftpInfo[UserName];
$password = $ftpInfo[Password];
/* close ftp
$log=@ftp_login($con,$loginName,$password);
if($DEBUG)echo "<br>log=$log";
if(!$log){
echo "<br><font>Fail to connect $dstSeverIp.</font>";
echo "<br><br><a href=\"./refresh.php\">$strBack</a>";
exit();
}
*/
$key=sftp_login($connection,$loginName,$password);
if(!$key)
{
echo "<br><font>Fail to connect $dstSeverIp.</font>";
echo "<br><br><a href=\"./refresh.php\">$strBack</a>";
exit();
}
$mode=FTP_ASCII;
$remoteFile[0] ='/usr/local/subsManage/rent.csv';
$remoteFile[1] ='/usr/local/subsManage/bill_sms.csv';
$remoteFile[2] ='/usr/local/subsManage/bill_discount.csv';
$remoteFile[3] ='/usr/local/subsManage/bill_holiday.csv';
$remoteFile[4] ='/usr/local/subsManage/comm_tariff.csv';
$remoteFile[5] ='/usr/local/subsManage/mo_tariff.csv';
$remoteFile[6] ='/usr/local/subsManage/mt_tariff.csv';
$remoteFile[7] ='/usr/local/subsManage/gprs_tariff.csv';
$remoteFile[8] ='/usr/local/subsManage/vas_mms_email_tariff.csv';
$remoteFile[9] ='/usr/local/subsManage/vas_mms_retrieve_tariff.csv';
$remoteFile[10] ='/usr/local/subsManage/vas_mms_send_tariff.csv';
$localFile[0] ='/usr/local/apache/htdocs/ftpFile/rent.csv';
$localFile[1] ='/usr/local/apache/htdocs/ftpFile/bill_sms.csv';
$localFile[2] ='/usr/local/apache/htdocs/ftpFile/bill_discount.csv';
$localFile[3] ='/usr/local/apache/htdocs/ftpFile/bill_holiday.csv';
$localFile[4] ='/usr/local/apache/htdocs/ftpFile/comm_tariff.csv';
$localFile[5] ='/usr/local/apache/htdocs/ftpFile/mo_tariff.csv';
$localFile[6] ='/usr/local/apache/htdocs/ftpFile/mt_tariff.csv';
$localFile[7] ='/usr/local/apache/htdocs/ftpFile/gprs_tariff.csv';
$localFile[8] ='/usr/local/apache/htdocs/ftpFile/vas_mms_email_tariff.csv';
$localFile[9] ='/usr/local/apache/htdocs/ftpFile/vas_mms_retrieve_tariff.csv';
$localFile[10] ='/usr/local/apache/htdocs/ftpFile/vas_mms_send_tariff.csv';
if($downloadCurrent){
$dstTable[0]="rent";
$dstTable[1]="bill_sms";
$dstTable[2]="bill_discount";
$dstTable[3]="bill_holiday";
$dstTable[4]="comm_tariff";
$dstTable[5]="mo_tariff";
$dstTable[6]="mt_tariff";
$dstTable[7]="gprs_tariff";
$dstTable[8]="vas_mms_email_tariff";
$dstTable[9]="vas_mms_retrieve_tariff";
$dstTable[10]="vas_mms_send_tariff";
}else{
$dstTable[0]="pre_rent";
$dstTable[1]="pre_bill_sms";
$dstTable[2]="pre_bill_discount";
$dstTable[3]="pre_bill_holiday";
$dstTable[4]="pre_comm_tariff";
$dstTable[5]="pre_mo_tariff";
$dstTable[6]="pre_mt_tariff";
$dstTable[7]="pre_gprs_tariff";
$dstTable[8]="pre_vas_mms_email_tariff";
$dstTable[9]="pre_vas_mms_retrieve_tariff";
$dstTable[10]="pre_vas_mms_send_tariff";
}
$fileNum = count($remoteFile);
for($i=0;$i<$fileNum;$i++){
/* close ftp
$getRes[$i]=ftp_get($con,$localFile[$i],$remoteFile[$i],$mode);
*/
//$getRes[$i]=sftp_get($key,$localFile[$i],$remoteFile[$i],SFTP_ASCII);
$getRes[$i]=sftp_get($connection,$localFile[$i],$remoteFile[$i],SFTP_ASCII);
if($DEBUG)echo "<br>getRes[$i]=$getRes[$i]";
if($getRes[$i]){
echo "<br>Download $remoteFile[$i] from $sysName($dstSeverIp) ..... <font color=\"#0000FF\" >ok</font>";
$delSql = " DELETE FROM $dstTable[$i] ";
$delRes = mysqli_query($dbConn,$delSql);
$loadSql = "LOAD DATA INFILE '$localFile[$i]' REPLACE
INTO TABLE $dstTable[$i]
FIELDS
TERMINATED BY ','
LINES
TERMINATED BY '\n'
";
//echo "<br>loadSql=$loadSql";
$loadRes = mysqli_query($dbConn,$loadSql);
if($loadRes){
echo "<br>Load $localFile[$i] into OMC $dstTable[$i]..... <font color=\"#0000FF\" >ok</font>";
}else{
$noSuccess=1;
echo "<br>Load $localFile[$i] into OMC $dstTable[$i]..... <font color=\"#FF0000\" >Failed</font>";
}
}else{
$noSuccess=1;
echo "<br>Download $remoteFile[$i] from $sysName($dstSeverIp) ..... <font color=\"#FF0000\" >Failed</font>";
}
echo "<br>";
}
if($noSuccess){
if($downloadCurrent)
insertLog("Download CURRENT TARIFF FAILURE");
else
insertLog("Download TARIFF PLAN FAILURE");
}else{
if($downloadCurrent)
insertLog("Download CURRENT TARIFF SUCCESS");
else
insertLog("Download TARIFF PLAN SUCCESS");
}
echo "<br><br><br><br><a href=\"$PHP_SELF\"> &nbsp;&nbsp;<< Return </a>";
adjust_content_tail();
exit();
}
//==========================================================
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
//==========================================================
?>
<?php
echo "<table id=\"table_up\" border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "$pagePath";
echo "</td>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "</table>";
adjust_title_tail();
adjust_content_head();
echo "<br>";
?>
<form method="POST" action="<?php echo "$PHP_SELF";?>" name="updateTariff">
<?php
echo "<table border=\"1\" width=\"50%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\">";
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td>";
if ($selectedLanguage == 'eng')
echo "<font>Please download current tariff from PPS.</font>";
elseif ($selectedLanguage == 'chn')
echo "<font><3E><><EFBFBD><EFBFBD>PPS<50><53><EFBFBD>ص<EFBFBD>ǰ<EFBFBD><C7B0><EFBFBD><EFBFBD>.</font>";
echo "</td>";
echo "</tr>";
?>
<tr>
<td>
<input type="submit" name="downloadCurrent" value="<?php echo "$strDownload";?>" class="button">
</td>
</tr>
<tr bgcolor="#E6E6E6">
<td>
<?php
if ($selectedLanguage == 'eng')
echo "<font>Please download tariff plan from PPS.</font>";
elseif ($selectedLanguage == 'chn')
echo "<font><3E><><EFBFBD><EFBFBD>PPS<50><53><EFBFBD>ط<EFBFBD><D8B7>ʼƻ<CABC>.</font>";
?>
</td>
</tr>
<tr>
<td>
<input type="submit" name="downloadPlan" value="<?php echo "$strDownload";?>" class="button">
</td>
</tr>
</form>
<?php
adjust_content_tail();
?>
</body>
</html>

View File

@@ -0,0 +1,79 @@
<?php
/*********************************************************
<20>ļ<EFBFBD>˵<EFBFBD><CBB5>:
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:<3A>޸Ļ<DEB8><C4BB><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
<20><><EFBFBD>ù<EFBFBD>ϵ:<3A><><EFBFBD><EFBFBD>:header.inc
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3>
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
NO.1
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ʱ<EFBFBD>
<EFBFBD>޸<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*********************************************************/
require("../../inc/header.inc");
$helpId = "2.2.3.3.5";
$moneyPara = getMoneyPara(); //<2F><>ʾ<EFBFBD>Ļ<EFBFBD><C4BB>ҵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD>ҵ<EFBFBD>λ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
$ppsDb='PPS_DB';
$tableName='comm_tariff';
$strPageTitle=$strTitleConfiguration.$strTitleSpace."PPS".$strTitleSpace.$strCurrentTariff.$strTitleSpace."Multiple services";
$sql="SELECT * FROM $tableName";
//echo $sql,$bill_db;
$result=mysqli_query($pubConn,$sql);
$rows=mysqli_fetch_array($result);
echo mysqli_error($pubConn);
?>
<body>
<?php
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "$strPageTitle";
echo "</td>";
echo "<td width=\"50%\" align=\"right\">";
showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<p></p>";
//û<>м<EFBFBD>¼ʱ<C2BC><CAB1><EFBFBD><EFBFBD>ʾ<EFBFBD>޼<EFBFBD>¼<EFBFBD><C2BC>ʾ
if(!$rows){
echo "$strNotFindRecord";
exit();
}
?>
<table border="1" width="400" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
<?php
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td width=\"40%\">$strDescription</td>";
echo "<td align =\"right\" width=\"30%\">$strTariffRentChargeAmount</td>";
echo "<td align =\"right\" width=\"30%\">$strUnitChargingTimeSecond</td>";
echo "</tr>";
$arr_description = array($strSMS,$strCallForwrd,$strRoaming,$strConferenceCall,$strCloseUserGroup);
$arr_amount = array($rows[sm_charge_amount],$rows[cf_charge_amount],$rows[roaming_charge_amount],$rows[cc_charge_amount],$rows[cug_charge_amount]);
$arr_unit = array("--",$rows[cf_charge_unit],$rows[roaming_charge_unit],$rows[cc_charge_unit],$rows[cug_charge_unit]);
for ($i=0;$i<5;$i++){
echo "<tr>";
echo "<td>$arr_description[$i]</td>";
if($moneyPara < 10){
printf("<td align=\"right\">%5.0f</td>", $arr_amount[$i]/$moneyPara);
}
elseif($moneyPara < 100){
printf("<td align=\"right\">%5.1f</td>", $arr_amount[$i]/$moneyPara);
}
else{
printf("<td align=\"right\">%5.2f</td>", $arr_amount[$i]/$moneyPara);
}
//echo "<td>$arr_amount[$i]</td>";
echo "<td align =\"right\">$arr_unit[$i]</td>";
echo "</tr>";
}
?>
</table>
</body>
</html>

View File

@@ -0,0 +1,69 @@
<?php
/*********************************************************
<20>ļ<EFBFBD>˵<EFBFBD><CBB5>:
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:<3A>ڼ<EFBFBD><DABC><EFBFBD><EFBFBD>б<EFBFBD>
<20><><EFBFBD>ù<EFBFBD>ϵ:<3A><><EFBFBD><EFBFBD>:header.inc
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><>ָ<EFBFBD><D6B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ģ<EFBFBD><C4A3><EFBFBD><EFBFBD>ҳ<EFBFBD><D2B3>
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>:
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
NO.1
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ʱ<EFBFBD>
<EFBFBD>޸<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*********************************************************/
require("../../inc/header.inc");
$db='PPS_DB';
$helpId = "2.2.3.3.4";
$table_name='bill_holiday';
$strThisPage=$strTitleConfiguration.$strTitleSpace."PPS".$strTitleSpace.$strCurrentTariff.$strTitleSpace.$strSpecialDay;
$sql="SELECT *
FROM $table_name
ORDER BY 'month','day'";
$result=mysqli_query($pubConn,$sql);
$rows=mysqli_fetch_array($result);
?>
<body>
<?php
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "$strThisPage";
echo "</td>";
echo "<td width=\"50%\" align=\"right\">";
showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<p></p>";
//û<>м<EFBFBD>¼ʱ<C2BC><CAB1><EFBFBD><EFBFBD>ʾ<EFBFBD>޼<EFBFBD>¼<EFBFBD><C2BC>ʾ
if(!$rows){
echo "$strNotFindRecord";
exit();
}
?>
<table border="1" width="400" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
<tr bgcolor="#E6E6E6">
<td align="center" width="40%"><?php echo $strDate; ?>(mm-dd)</td>
<td align="center" width="60%"><?php echo $strDescription; ?></td>
</tr>
<?php
do
{
echo "<tr>";
$month=omc_keep_length($rows[month],0,2);
$day=omc_keep_length($rows[day],0,2);
$showDate=$month."-".$day;
$rows[name]=$rows[name]?$rows[name]:'--';
echo "<td align=\"center\">$showDate</td>";
echo "<td align=\"center\">$rows[name]</td>";
echo "</tr>";
}while($rows=mysqli_fetch_array($result));
?>
</table>
</body>
</html>

View File

@@ -0,0 +1,87 @@
<?php
/*********************************************************
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>ͳ<EFBFBD>ƺ<EFBFBD><C6BA><EFBFBD><EFBFBD>Ϻ<EFBFBD><CFBA><EFBFBD><EFBFBD>ƷѺ<C6B7><D1BA><EFBFBD><EFBFBD><EFBFBD>Ϣ
<20><><EFBFBD>ù<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:header.inc
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:<3A><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> 2004-04-15
<EFBFBD>޸<EFBFBD>ע<EFBFBD>ͣ<EFBFBD>
NO.1
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ʱ<EFBFBD>
<EFBFBD>޸<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*********************************************************/
require("../../inc/header.inc");
$DEBUG = 0;
$db='PPS_DB';
$strThisPage=$strTitleConfiguration.$strTitleSpace."PPS".$strTitleSpace.$strCurrentTariff.$strTitleSpace.$strBasicTariff;
$tableName='mo_tariff';
for($i=0;$i<16;$i++){
$selSql = "SELECT count(*)
FROM $tableName
WHERE tariff_id='$i'";
if($DEBUG) echo "<br>selSql=$selSql";
$result=@mysqli_query($pubConn,$selSql);
echo mysqli_error($pubConn);
$record = @mysqli_fetch_array($result);
$nMoAmount[$i] = $record[0];
if($DEBUG) echo "<br>$nMoAmount=$nMoAmount";
}
$tableName='mt_tariff';
for($i=0;$i<8;$i++){
$selSql = "SELECT count(*)
FROM $tableName
WHERE tariff_id='$i'";
if($DEBUG) echo "<br>selSql=$selSql";
$result=@mysqli_query($pubConn,$selSql);
echo mysqli_error($pubConn);
$record = @mysqli_fetch_array($result);
$nMtAmount[$i] = $record[0];
if($DEBUG) echo "<br>$nMtAmount=$nMtAmount";
}
//display
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
echo "$strThisPage";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<b><font size=3><p align=center>Basic tariff statistics</p></font></b>";
echo "<TABLE border=1 width=100% cellpadding=2 cellspacing=0 bordercolor=#666666 bordercolordark=#FFFFFF bgcolor=#FFFFFF>";
echo "<TR>";
echo "<TD width=25% bgcolor=#E6E6E6>MO tariff ID</TD>";
echo "<TD width=25% bgcolor=#E6E6E6>Total record</TD>";
echo "<TD width=25% bgcolor=#E6E6E6>Mt tariff ID</TD>";
echo "<TD width=25% bgcolor=#E6E6E6>Total record</TD>";
echo "</TR>";
for($i=0;$i<8;$i++){
echo "<TR>";
echo "<TD width=25% bgcolor=#E6E6E6>$i</TD>";
echo "<TD align=center>$nMoAmount[$i]</TD>";
echo "<TD width=25% bgcolor=#E6E6E6>$i</TD>";
echo "<TD align=center>$nMtAmount[$i]</TD>";
echo "</TR>";
}
for($i=8;$i<16;$i++){
echo "<TR>";
echo "<TD width=25% bgcolor=#E6E6E6>$i</TD>";
echo "<TD align=center>$nMoAmount[$i]</TD>";
echo "<TD width=25% bgcolor=#E6E6E6>--</TD>";
echo "<TD align=center>--</TD>";
echo "</TR>";
}
?>
<table width="400">
<tr>
<td>
<input type="button" name="return" value="Return" onclick=jacascript:location.href="./baseTariffList.php" class="button">&nbsp;
</td>
</tr>
</table>

View File

@@ -0,0 +1,386 @@
<?php
/*********************************************************
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD>
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD><D0B1><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ϣ
<20><><EFBFBD>ù<EFBFBD>ϵ<EFBFBD><CFB5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: header.inc
<20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
<20><><EFBFBD><EFBFBD>˵<EFBFBD><CBB5>
<EFBFBD><EFBFBD><EFBFBD><EFBFBD>:
<EFBFBD>޸<EFBFBD>ע<EFBFBD>ͣ<EFBFBD>
NO.1
<EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
ʱ<EFBFBD><EFBFBD>: 2004-04-14
<EFBFBD>޸<EFBFBD>˵<EFBFBD><EFBFBD><EFBFBD><EFBFBD> OMC V7.0
*********************************************************/
$DEBUG = 0;
require("../../inc/header.inc");
$helpId = "2.2.3.3.2";
$db='PPS_DB';
$moneyPara = getMoneyPara(); //<2F><>ʾ<EFBFBD>Ļ<EFBFBD><C4BB>ҵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD>ҵ<EFBFBD>λ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
$table_name='rent';
$strThisPage=$strTitleConfiguration.$strTitleSpace."PPS".$strTitleSpace.$strCurrentTariff.$strTitleSpace.$strSupplementary;
//<2F><EFBFBD>󱣳ֶ<F3B1A3B3>Ӧtariff_id<69><64>ҳ<EFBFBD><D2B3>
$tariff_id=isset($tariff_id)?$tariff_id:'00';
$sql="SELECT id,description,rent_type,charge_date,rent_amount
FROM $table_name
WHERE tariff_id=$tariff_id
ORDER by id";
//echo $sql,$bill_db;
$result=@mysqli_query($pubConn,$sql);
$rows=@mysqli_fetch_array($result);
echo mysqli_error($pubConn);
?>
<base>
<body>
<?php
echo "<table 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 "</table>";
?>
<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>
<form method="POST" name="selectform" action="<?php echo "$PHP_SELF";?>">
<table border="0" width="100%" cellpadding="1" cellspacing="2" bordercolor="#666666" bordercolordark="#FFFFFF">
<tr>
<td>
<?php
echo "<b>Rent</b>";
?>
</td>
<td align="right">
<?php
echo "$strResideZone:&nbsp;";
echo "<select size=\"1\" name=\"tariff_id\" onChange=\"javascript:selectTitle()\">";
for($i=0;$i<16;$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>";
?>
</td>
</tr>
</table>
</form>
<table border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
<tr bgcolor="#E6E6E6">
<?php
echo "<td align=\"center\">$strTariffRentID</td>";
echo "<td align=\"center\">$strDescription</td>";
echo "<td align=\"center\">$strTariffRentChargeType</td>";
echo "<td align=\"center\">$strTariffRentChargeDate</td>";
echo "<td align=\"center\">$strTariffRentChargeAmount</td>";
?>
</tr>
<?php
$i=0;
if($rows && $result){
do{
$i++;
if ($rows[description] == ''){
echo "<tr>";
echo "<td align=\"center\"><a>$i</a></td>";
echo "<td align=\"center\">--</td>";
echo "<td align=\"center\">--</td>";
echo "<td align=\"center\">--</td>";
echo "<td align=\"right\">--</td>";
echo "</tr>";
}
else{
echo "<tr>";
echo "<td align=\"center\"><a>$i</a></td>";
echo "<td align=\"center\">$rows[description]</td>";
echo "<td align=\"center\">";
if($rows[rent_type]=='00'){
echo "$strTariffRentAccordingToDate";
}else{
echo "$strTariffRentAccordingToPeriod";
}
echo "</td>";
echo "<td align=\"center\">";
if($rows[rent_type]=='01'){
echo "$rows[charge_date]";
}else{
echo "--";
}
echo "</td>";
$rows[rent_amount] = $rows[rent_amount]/$moneyPara;
if($moneyPara < 10){
printf("<td align=\"right\">%5.0f</td>", $rows[rent_amount]);
}
elseif($moneyPara < 100){
printf("<td align=\"right\">%5.1f</td>", $rows[rent_amount]);
}
else{
printf("<td align=\"right\">%5.2f</td>", $rows[rent_amount]);
}
}
}while($rows=mysqli_fetch_array($result));
}
?>
</table>
<!--- Service tariff -->
<?php
$moneyPara = getMoneyPara(); //<2F><>ʾ<EFBFBD>Ļ<EFBFBD><C4BB>ҵ<EFBFBD>λ<EFBFBD><CEBB><EFBFBD><EFBFBD>С<EFBFBD><D0A1><EFBFBD>ҵ<EFBFBD>λ<EFBFBD>ı<EFBFBD><C4B1><EFBFBD>
$tableName='comm_tariff';
//<2F><EFBFBD>󱣳ֶ<F3B1A3B3>Ӧtariff_id<69><64>ҳ<EFBFBD><D2B3>
$tariff_id2=isset($tariff_id2)?$tariff_id2:'00';
$where=" WHERE tariff_id=$tariff_id2 ";
$sql="SELECT * FROM $tableName".$where;
//echo $sql,$bill_db;
$result=@mysqli_query($pubConn,$sql);
$rows=@mysqli_fetch_array($result);
echo mysqli_error($pubConn);
?>
<script LANGUAGE="JavaScript">
function selectTitle2(){
var base_url2,url_add2,url2;
base_url2='<?php echo "$PHP_SELF?tariff_id2=";?>';
url_add2=document.selectform2.tariff_id2.options[document.selectform2.tariff_id2.selectedIndex].value;
url2=base_url2+url_add2;
window.location=url2;
}
</script>
<form method="POST" name="selectform2" action="<?php echo "$PHP_SELF";?>">
<table border="0" width="100%" cellpadding="1" cellspacing="2" bordercolor="#666666" bordercolordark="#FFFFFF">
<tr>
<td>
<?php
echo "<b>Service tariff</b>";
?>
</td>
<td align="right">
<?php
echo "$strResideZone:&nbsp;";
echo "<select size=\"1\" name=\"tariff_id2\" onChange=\"javascript:selectTitle2()\">";
for($i=0;$i<16;$i++){
$m=($i<10?"0":"").$i;
if($m != $tariff_id2){
echo "<option value=\"$m\">$m</option>";
}else{
echo "<option value=\"$m\" selected>$m</option>";
}
}
echo "</select>";
?>
</td>
</tr>
</table>
</form>
<table border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
<?php
echo "<tr bgcolor=\"#E6E6E6\">";
echo "<td width=\"40%\">$strDescription</td>";
echo "<td align =\"right\" width=\"30%\">$strTariffRentChargeAmount</td>";
echo "<td align =\"right\" width=\"30%\">$strUnitChargingTimeSecond</td>";
echo "</tr>";
$arr_editfieldAmount = array("cf_charge_amount","roaming_charge_amount","cc_charge_amount","cug_charge_amount","fav_charge_amount","fav_change_charge");
$arr_editfieldUnit = array("cf_charge_unit","roaming_charge_unit","cc_charge_unit","cug_charge_unit","fav_charge_unit","");
$arr_description = array($strCallForwrd,$strRoaming,$strConferenceCall,$strCloseUserGroup,$strFav_call,$strFav_listedtion);
$arr_amount = array($rows[cf_charge_amount],$rows[roaming_charge_amount],$rows[cc_charge_amount],$rows[cug_charge_amount],$rows[fav_charge_amount],$rows[fav_change_charge]);
$arr_unit = array($rows[cf_charge_unit],$rows[roaming_charge_unit],$rows[cc_charge_unit],$rows[cug_charge_unit],$rows[fav_charge_unit],"----");
for ($i=0;$i<6;$i++){
echo "<tr>";
echo "<td><a>$arr_description[$i]</a></td>";
if($moneyPara < 10){
printf("<td align=\"right\">%5.0f</td>", $arr_amount[$i]/$moneyPara);
}
elseif($moneyPara < 100){
printf("<td align=\"right\">%5.1f</td>", $arr_amount[$i]/$moneyPara);
}
else{
printf("<td align=\"right\">%5.2f</td>", $arr_amount[$i]/$moneyPara);
}
echo "<td align =\"right\">&nbsp;$arr_unit[$i]</td>";
echo "</tr>";
echo $tariffID;
}
?>
</table>
</body>
<!-- Discount -->
<?php
$tableName='bill_discount';
$order="hours"; //<2F><><EFBFBD><EFBFBD>
if($DEBUG) echo "discount_id=$discount_id<br>";
if( FALSE == isset($discount_id) ){
$discount_id = 00;
}
//select current discount id details from TABLE "pre_bill_discount"
$selSql = "SELECT * FROM $tableName WHERE discount_id=$discount_id ORDER BY $order";
if($DEBUG) echo "selSql=$selSql<br>";
$selRes = mysqli_query($pubConn,$selSql);
$selRows = mysqli_fetch_array($selRes);
?>
<base>
<body>
<script LANGUAGE="JavaScript">
function selectTitle1(){
var base_url1,url_add1,url1;
base_url1='<?php echo "$PHP_SELF?discount_id=";?>';
url_add1=document.selectform1.discount_id.value;
url1=base_url1+url_add1;
window.location=url1;
}
</script>
<form method="POST" action="$PHP_SELF" name="selectform1">
<table border="0" width="100%" cellpadding="1" cellspacing="2" bordercolor="#666666" bordercolordark="#FFFFFF">
<tr>
<td>
<?php
echo "<b>Discount</b>";
?>
</td>
<td align="right">
<?php
echo "Discount ID:&nbsp;";
echo "<select size=\"1\" name=\"discount_id\" onChange=\"javascript:selectTitle1()\">";
for($i=0;$i<16;$i++){
$m=($i<10?"0":"").$i;
if($m != $discount_id){
echo "<option value=\"$m\">$m</option>";
}else{
echo "<option value=\"$m\" selected>$m</option>";
}
}
echo "</select>";
?>
</td>
</tr>
</table>
</form>
<table border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
<tr bgcolor="#E6E6E6">
<td align="center"><?php echo "$strTariffDiscountTimeSection"; ?></td>
<td align="center"><?php echo $strMonday; ?></td>
<td align="center"><?php echo $strTuesday; ?></td>
<td align="center"><?php echo $strWednesday; ?></td>
<td align="center"><?php echo $strThursday; ?></td>
<td align="center"><?php echo $strFriday; ?></td>
<td align="center"><?php echo $strSaturday; ?></td>
<td align="center"><?php echo $strSunday; ?></td>
<td align="center"><?php echo $strSpecialDay; ?></td>
</tr>
<?php
do{
echo "<tr>";
$hours=$selRows[hours];
if(strlen($hours) < 2) $hours='0'.$hours;
if(strlen($hours+1) < 2){
$next_hours='0'.($hours+1);
}else{
$next_hours=$hours+1;
}
$mon=change2point($selRows[mon]/100);
$tue=change2point($selRows[tue]/100);
$wed=change2point($selRows[wed]/100);
$thu=change2point($selRows[thu]/100);
$fri=change2point($selRows[fri]/100);
$sat=change2point($selRows[sat]/100);
$sun=change2point($selRows[sun]/100);
$holiday=change2point($selRows[holiday]/100);
echo "<td align=center><a>$hours:00:00 - $next_hours:00:00</a></td>";
echo "<td align=center>$mon</td>";
echo "<td align=center>$tue</td>";
echo "<td align=center>$wed</td>";
echo "<td align=center>$thu</td>";
echo "<td align=center>$fri</td>";
echo "<td align=center>$sat</td>";
echo "<td align=center>$sun</td>";
echo "<td align=center>$holiday</td>";
echo "</tr>";
}while($selRows = @mysqli_fetch_array($selRes));
?>
</table>
</body>
<!-- Holiday -->
<?php
$tableName='bill_holiday';
$sql="SELECT *
FROM $tableName
ORDER BY 'month','day'";
$result=mysqli_query($pubConn,$sql);
$rows=mysqli_fetch_array($result);
?>
<body>
<?php
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td>";
echo "<br>";
echo "<b>Holiday</b>";
echo "<br>";
echo "</td>";
echo "</tr>";
echo "</table>";
?>
<table border="1" width="100%" cellpadding="2" cellspacing="0" bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF" >
<tr bgcolor="#E6E6E6">
<td align="center" width="40%"><?php echo $strDate; ?>(mm-dd)</td>
<td align="center" width="60%"><?php echo $strDescription; ?></td>
</tr>
<?php
$i=0;
if($rows){
do{
echo "<tr>";
$id=$rows[id];
$month=omc_keep_length($rows[month],0,2);
$day=omc_keep_length($rows[day],0,2);
$showDate=$month."-".$day;
$rows[name]=$rows[name]?$rows[name]:'--';
echo "<td align=\"center\"><a>$showDate</a></td>";
echo "<td align=\"center\">$rows[name]</td>";
echo "</tr>";
$i++;
}while($rows=mysqli_fetch_array($result));
}
?>
</table>
</body>