"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 "
moneyPara = $moneyPara";
if($add_area){
echo " ";
exit();
}
//编辑后保持对应tariff_id的页面
if ($keep_id != 1){
$tariff_id=isset($tariff_id)?$tariff_id:'00';
}
else {$tariff_id=$return_tariff_id;}
if($DEBUG) {echo "
keep_id=$keep_id
tariff_id=$return_tariff_id
";}
//
$where=" WHERE tariff_id=$tariff_id ";
//echo "
where=$where";
$str_sql ="SELECT count(*) FROM $table_name ".$where;
//echo "
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 "
sel_sql=$sel_sql";
$result = @mysqli_query($objDbConn,$sel_sql);
$rows = @mysqli_fetch_array($result);
echo mysqli_error($objDbConn);
?>
keep_id=$keep_id
tariff_id=$return_tariff_id
";
$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 "";
echo "";
echo "| ";
echo "Rent";
echo " | ";
echo "
";
echo "
";
echo "";
?>
$strTariffRentID";
echo "| $strDescription | ";
echo "$strTariffRentChargeType | ";
echo "$strTariffRentChargeDate | ";
echo "$strTariffRentChargeAmount | ";
?>
";
echo "$showi | ";
echo "-- | ";
echo "-- | ";
echo "-- | ";
echo "-- | ";
echo "";
}
else{
echo "";
echo "| $showi | ";
echo "$rows[description] | ";
echo "";
if($rows[rent_type]=='00'){
echo "$strTariffRentAccordingToDate";
}else{
echo "$strTariffRentAccordingToPeriod";
}
echo " | ";
echo "";
if($rows[rent_type]=='01'){
echo "$rows[charge_date]";
}else{
echo "--";
}
echo " | ";
echo "$rows[rent_amount] | ";
/*
$rows[rent_amount] = $rows[rent_amount]/$moneyPara;
if($moneyPara < 10){
printf("%5.0f | ", $rows[rent_amount]);
}
elseif($moneyPara < 100){
printf("%5.1f | ", $rows[rent_amount]);
}
else{
printf("%5.2f | ", $rows[rent_amount]);
}*/
echo "
";
}
}while($rows=mysqli_fetch_array($result));
}
?>
keep_id=$keep_id
tariff_id=$return_tariff_id
";}
$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);
?>
";
echo "";
echo "| ";
echo "SMS";
echo " | ";
echo "
"; echo "";
echo "";
?>
$strTariffRentID";
echo "| $strChargingPrefix | ";
echo "Call type | ";
echo "$strCountryDistrict | ";
echo "$strDiscountID | ";
echo "$strTariffRentChargeAmount | ";
echo "$strTariffRentCapFlag | ";
?>
";
echo "$i | ";
if("" == $rows[prefix]){
$rows[prefix]="--";
}
echo " $rows[prefix] | ";
if($rows[call_type]==0)
echo "Local call out | ";
elseif($rows[call_type]==1)
echo "NDD | ";
elseif($rows[call_type]==2)
echo "IDD | ";
else
echo "--- | ";
if ($rows[area] == ''){
$rows[area]='--';
}
echo " $rows[area] | ";
echo "$rows[discount_id] | ";
echo "";
echo "$rows[charge_amount] | ";
$cap_flag_value=$sm_cap_flag_label[$rows[cap_flag]+0];
echo "$cap_flag_value | ";
/*
$rows[charge_amount ] = $rows[charge_amount ]/$moneyPara;
if($moneyPara < 10){
printf("%5.0f | ", $rows[charge_amount]);
}
elseif($moneyPara < 100){
printf("%5.1f | ", $rows[charge_amount]);
}
else{
printf("%5.2f | ", $rows[charge_amount]);
}*/
echo "";
}while($rows=mysqli_fetch_array($result));
}
?>
keep_id=$keep_id
tariff_id=$return_tariff_id
";}
$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);
?>
";
echo "";
echo "| ";
echo "GPRS";
echo " | ";
echo "
"; echo "";
echo "";
?>
ID";
echo "| Dest IP | ";
echo "Charge unit(KB) | ";
echo "Basic fee | ";
echo "Minimum charge unit | ";
echo "Initial adjustment | ";
echo "Cap flag | ";
echo "Discount ID | ";
?>
"Disable",1=>"Enable");
if($rows && $result){
do{
$i++;
echo "";
echo "| {$rows[record_id]} | ";
echo " $rows[dest_ip] | ";
echo " $rows[charge_unit] | ";
echo " $rows[basic_fee] | ";
echo " $rows[min_charge_unit] | ";
echo " $rows[initial_adjustment] | ";
$cap_flag_value=$gprs_cap_flag_label[$rows[cap_flag]+0];
echo " $cap_flag_value | ";
echo " $rows[discount_id] | ";
echo "
";
}while($rows=mysqli_fetch_array($result));
}
?>
keep_id=$keep_id
tariff_id=$return_tariff_id
";}
$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);
?>
";
echo "";
echo "| ";
echo "MMS Send";
echo " | ";
echo "
"; echo "";
echo "";
?>
ID";
echo "| MMS type | ";
echo "Prefix | ";
echo "Call type | ";
echo "Dest name | ";
echo "Discount ID | ";
echo "Charge fee | ";
echo "Cap flag | ";
?>
"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 "";
echo "| {$rows[mms_send_id]} | ";
echo " {$mms_type_label[$rows[mms_type]]} | ";
if(trim($rows[prefix])=="")
echo "-- | ";
else
echo " $rows[prefix] | ";
echo " {$call_type_label[$rows[call_type]]} | ";
if(trim($rows[dest_name])=="")
echo "-- | ";
else
echo " $rows[dest_name] | ";
echo " $rows[discount_id] | ";
echo " $rows[charge_fee] | ";
$cap_flag_value=$gprs_cap_flag_label[$rows[cap_flag]+0];
echo " $cap_flag_value | ";
echo "
";
}while($rows=mysqli_fetch_array($result));
}
echo "
";
?>
keep_id=$keep_id
tariff_id=$return_tariff_id
";}
//
$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);
?>
setSql=$setSql";
mysqli_query($objDbConn,$setSql);
}
echo "";
echo "";
echo "";
echo " Supplementary tariff";
echo " | ";
echo "
";
echo "
";
echo "";
?>
";
echo "| $strDescription | ";
echo "$strTariffRentChargeAmount | ";
echo "$strUnitChargingTimeSecond | ";
echo "";
/*
$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 "";
echo "| $arr_description[$i] | ";
echo "$arr_amount[$i] | ";
/*if($moneyPara < 10){
printf("%5.0f | ", $arr_amount[$i]/$moneyPara);
}
elseif($moneyPara < 100){
printf("%5.1f | ", $arr_amount[$i]/$moneyPara);
}
else{
printf("%5.2f | ", $arr_amount[$i]/$moneyPara);
}*/
echo " $arr_unit[$i] | ";
echo "
";
echo $tariffID;
}
?>