161 lines
4.5 KiB
PHP
Executable File
161 lines
4.5 KiB
PHP
Executable File
<?php
|
||
/*********************************************************
|
||
程序说明:
|
||
功能说明:列表显示折扣表信息
|
||
|
||
调用关系:调用: header.inc
|
||
被调用:
|
||
|
||
变量说明:
|
||
|
||
作者:Cui Ticun 2004-04-13
|
||
|
||
修改注释:
|
||
NO.1
|
||
姓名:
|
||
时间:
|
||
修改说明:
|
||
*********************************************************/
|
||
require("../../inc/header.inc");
|
||
$helpId = "2.2..3.3";
|
||
$ppsDb='PPS_DB';
|
||
$tableName='bill_discount';
|
||
$strThisPage=$strTitleAccount.$strTitleSpace.$strTariffPlan.$strTitleSpace.$strDiscount;
|
||
|
||
|
||
/*
|
||
$strCallInsideZone ="小区通话";
|
||
$strCallOutsideZone ="区外市话";
|
||
$strDomesticLongCall ="国内长途";
|
||
$strInternationalLongCall ="国际长途";
|
||
$strLongCallToHKOMTW ="港澳台长途";
|
||
*/
|
||
|
||
$order="hours"; //排序
|
||
$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>";
|
||
|
||
//没有纪录时,显示无记录提示
|
||
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));
|
||
|
||
//初始化折扣表,管理员没有设置折扣时,系统自动将各时段的折扣设为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>
|