Files
web.ems/wxc2_omc/element/toElement/pcrChannel.php
2024-10-22 10:34:29 +08:00

323 lines
9.4 KiB
PHP
Executable File
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
/*********************************************************
PCR configuration.
*********************************************************/
require("../sub_inc/commfunc.php");
$helpId = "1.1.1";
$DEBUG = 0;
$listPageUrl = "PCRconf.php?infoNo=$infoNo&linkset=$linkset&trunkgp=$trunkgp&sysNo=$sysNo&subSysNo=$subSysNo&E1no=$E1no";
$selfPage = "$PHP_SELF?infoNo=$infoNo&linkset=$linkset&trunkgp=$trunkgp&sysNo=$sysNo&subSysNo=$subSysNo&E1no=$E1no";
$subChannelName = "PCR-".$sysNo."-$subSysNo&nbsp;"."Channel $E1no";
$sysId = "130_$sysNo" . "_$subSysNo";
$objDB = 'OBJ_130';
$paramTab = 'param_'.$sysNo;
?>
<script LANGUAGE="JavaScript">
function slctDirection(item,i)
{
var direct;
var lccpE1, lccpTimeSlot;
lccpE1 = eval("document.Set.lccp_e1_" + i);
lccpTimeSlot = eval("document.Set.lccp_timeslot_" + i);
direct = item.options[item.selectedIndex].value;
//alert(direct);
if(direct==7)
{
lccpE1.disabled = false;
lccpTimeSlot.disabled = false;
}
else
{
lccpE1.disabled = true;
lccpTimeSlot.disabled = true;
}
}
</script>
<body topmargin="0" leftmargin="12">
<?php
$directionArr = array(
0 => 'Disable',
1 => 'IN',
3 => 'OUT',
5 => 'BI-direction',
7 => 'Lease-Line',
);
$LccpE1Arr = array(
0 => '0', 1 => '1', 2 => '2', 3 => '3', 4 => '4', 5 => '5', 6 => '6', 7 => '7'
);
$LccpTimeslotArr = array(
1 => '1', 2 => '2', 3 => '3', 4 => '4', 5 => '5', 6 => '6', 7 => '7', 8 => '8',
9 => '9', 10 => '10', 11 => '11', 12 => '12', 13 => '13', 14 => '14', 15 => '15',
17 => '17', 18 => '18', 19 => '19', 20 => '20', 21 => '21', 22 => '22', 23 => '23', 24 => '24',
25 => '25', 26 => '26', 27 => '27', 28 => '28', 29 => '29', 30 => '30', 31 => '31'
);
if($_SERVER['REQUEST_METHOD'] == "POST")
{
//direction
$oidstr = "2.1.3";
$objWhereStr = getLevelWhere($oidstr);
$selSql = "select initValue from $paramTab where $objWhereStr and subSysNo='$subSysNo' and instanceNO='$E1no' ";
$result = mysqli_query($pubConn,$selSql);
$row = mysqli_fetch_array($result);
$setValue = $row[initValue];
for($i=0;$i<32;$i++)
{
$tmp = ${"direction_$i"};
$tmp = omc_keep_length(decbin($tmp),'0',3);
$bitStr = $i.".0-".$i.".2";
$setValue = setBitValue($setValue,$bitStr,$tmp);
}
$setValue = strtoupper($setValue);
$updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='$subSysNo' and instanceNO='$E1no' ";
mysqli_query($pubConn,$updSql);
//Lccp
$oidstr = "2.1.4";
$objWhereStr = getLevelWhere($oidstr);
$selSql = "select initValue from $paramTab where $objWhereStr and subSysNo='$subSysNo' and instanceNO='$E1no' ";
$result = mysqli_query($pubConn,$selSql);
$row = mysqli_fetch_array($result);
$setValue = $row[initValue];
for($i=0;$i<32;$i++)
{
$tmp = ${"lccp_e1_$i"};
if(isset($tmp))
{
$tmp = omc_keep_length(decbin($tmp),'0',3);
$bitStr = $i.".5-".$i.".7";
$setValue = setBitValue($setValue,$bitStr,$tmp);
}
$tmp = ${"lccp_timeslot_$i"};
if(isset($tmp))
{
$tmp = omc_keep_length(decbin($tmp),'0',5);
$bitStr = $i.".0-".$i.".4";
$setValue = setBitValue($setValue,$bitStr,$tmp);
}
}
$setValue = strtoupper($setValue);
$updSql = "update $paramTab set initValue='$setValue' where $objWhereStr and subSysNo='$subSysNo' and instanceNO='$E1no' ";
mysqli_query($pubConn,$updSql);
echo "<script LANGUAGE=\"JavaScript\">";
if(!$DEBUG)
{
echo "\n window.location.href=\"$listPageUrl\";";
}
echo "\n </script>";
}
//==========================================================
//<2F><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʾ<EFBFBD><CABE><EFBFBD><EFBFBD>
//==========================================================
echo "<form method=\"POST\" name=\"Set\" action=\"$selfPage\">";
{
echo "<table border=\"0\" width=\"100%\">";
echo "<tr>";
echo "<td width=\"50%\">";
//echo "Configuration > Network > Element > PCR > Channel";
echo "Configuration > <a href=\"../overview/overview.php\">Network</a> > <a href=\"$listPageUrl\">PCR</a> > <a href=\"#\">Channel</a>";
echo "<td width=\"50%\" align=\"right\" title=\"Help\">";
showHelp($helpId);
echo "</td>";
echo "</tr>";
echo "</table>";
echo "<br>";
echo "<table width=\"100%\">";
echo "<tr><td width=\"70%\">";
echo "<b>PCR Channel set:&nbsp;&nbsp;</b>";
echo "$subChannelName";
echo "</td>";
echo "<td width=\"20%\">";
echo "<input type=\"submit\" value=$strSave class=\"button\" name=\"Set\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
echo "&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<input type=\"reset\" value=$strReset class=\"button\" name=\"Reset\" style=\"left: 1; top: 2; width: 60; height: 25; position: relative\">";
echo "</td>";
echo "<td width=\"10%\">";
echo "<p align=\"right\"><a href=\"$listPageUrl\"><img align=absBottom border=0 src=\"../../images/left.gif\" width=\"14\" height=\"14\">$strBack</a>";
echo "</td></tr>";
echo "</table>";
}
?>
<TABLE width=100%>
<?php
$oidstr = "2.1.3";
$objWhereStr = getLevelWhere($oidstr);
$selSql = "select initValue from $paramTab where $objWhereStr and subSysNo='$subSysNo' and instanceNO='$E1no' ";
$result = mysqli_query($pubConn,$selSql);
$row = mysqli_fetch_array($result);
$directionSource = $row[initValue];
$oidstr = "2.1.4";
$objWhereStr = getLevelWhere($oidstr);
$selSql = "select initValue from $paramTab where $objWhereStr and subSysNo='$subSysNo' and instanceNO='$E1no' ";
$result = mysqli_query($pubConn,$selSql);
$row = mysqli_fetch_array($result);
$LccpSource = $row[initValue];
echo "<tr>";
echo "<td width=\"49%\">";
echo "<table rules=\"rows\" border=\"1\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" >";
echo "<tr bgcolor=\"#E6E6E6\" >";
echo "<td>Timeslot#</td>";
echo "<td>Direction</td>";
echo "<td>LCCP-E1</td>";
echo "<td>LCCP-Timeslot</td>";
echo "</tr>";
for($i=0;$i<16;$i++)
{
echo "<tr>";
echo "<td bgcolor=\"#E6E6E6\">$i</td>";
{//Direction
$bitStr = $i.".0-".$i.".2";
$direction = bindec(getBitValue($directionSource,$bitStr));
echo "<td>";
echo "<select size=\"1\" value=\"$direction\" name=\"direction_$i\" onchange=\"slctDirection(this,$i)\">";
while (list ($key, $val) = each ($directionArr))
{
echo "<option value=\"$key\" ";
if($key == $direction)
echo "selected";
echo ">$val</option>";
}
reset($directionArr);
echo"</td>";
}//end direction
if($direction==7)//lease-Line
{
$disableStr = '';
}
else
$disableStr = 'disabled';
{//LCCP-E1
$lccp_e1_bitStr = $i.".5-".$i.".7";
$lccp_e1 = bindec(getBitValue($LccpSource,$lccp_e1_bitStr));
echo "<td>";
echo "<select size=\"1\" value=\"$direction\" name=\"lccp_e1_$i\" $disableStr>";
while (list ($key, $val) = each ($LccpE1Arr))
{
echo "<option value=\"$key\" ";
if($key == $lccp_e1)
echo "selected";
echo ">$val</option>";
}
reset($LccpE1Arr);
echo"</td>";
}//end LCCP-E1
{//LCCP-Timeslot
$lccp_timeslot_bitStr = $i.".0-".$i.".4";
$lccp_timeslot = bindec(getBitValue($LccpSource,$lccp_timeslot_bitStr));
echo "<td>";
echo "<select size=\"1\" value=\"$direction\" name=\"lccp_timeslot_$i\" $disableStr>";
while (list ($key, $val) = each ($LccpTimeslotArr))
{
echo "<option value=\"$key\" ";
if($key == $lccp_timeslot)
echo "selected";
echo ">$val</option>";
}
reset($LccpTimeslotArr);
echo"</td>";
}//end LCCP-Timeslot
echo "</tr>";
}
echo "</table>";
echo "</td>";
echo "<td width=\"49%\">";
echo "<table rules=\"rows\" border=\"1\" width=\"100%\" cellpadding=\"1\" cellspacing=\"0\" bordercolor=\"#666666\" bordercolordark=\"#FFFFFF\" >";
echo "<tr bgcolor=\"#E6E6E6\" >";
echo "<td>Timeslot#</td>";
echo "<td>Direction</td>";
echo "<td>LCCP-E1</td>";
echo "<td>LCCP-Timeslot</td>";
echo "</tr>";
for($i=16;$i<32;$i++)
{
echo "<tr>";
echo "<td bgcolor=\"#E6E6E6\">$i</td>";
{
$bitStr = $i.".0-".$i.".2";
$direction = bindec(getBitValue($directionSource,$bitStr));
echo "<td>";
echo "<select size=\"1\" value=\"$direction\" name=\"direction_$i\" onchange=\"slctDirection(this,$i)\">";
while (list ($key, $val) = each ($directionArr))
{
echo "<option value=\"$key\" ";
if($key == $direction)
echo "selected";
echo ">$val</option>";
}
reset($directionArr);
echo"</td>";
}
if($direction==7)//lease-Line
{
$disableStr = '';
}
else
$disableStr = 'disabled';
{
$lccp_e1_bitStr = $i.".5-".$i.".7";
$lccp_e1 = bindec(getBitValue($LccpSource,$lccp_e1_bitStr));
echo "<td>";
echo "<select size=\"1\" value=\"$direction\" name=\"lccp_e1_$i\" $disableStr>";
while (list ($key, $val) = each ($LccpE1Arr))
{
echo "<option value=\"$key\" ";
if($key == $lccp_e1)
echo "selected";
echo ">$val</option>";
}
reset($LccpE1Arr);
echo"</td>";
}
{
$lccp_timeslot_bitStr = $i.".0-".$i.".4";
$lccp_timeslot = bindec(getBitValue($LccpSource,$lccp_timeslot_bitStr));
echo "<td>";
echo "<select size=\"1\" value=\"$direction\" name=\"lccp_timeslot_$i\" $disableStr>";
while (list ($key, $val) = each ($LccpTimeslotArr))
{
echo "<option value=\"$key\" ";
if($key == $lccp_timeslot)
echo "selected";
echo ">$val</option>";
}
reset($LccpTimeslotArr);
echo"</td>";
}
echo "</tr>";
}
echo "</table>";
echo "</td>";
echo "</tr>";
echo "</table>";
echo "</form>";
echo "<br><br>";
?>