ÕýÔÚµ÷ÊÔÖУ¡£¡"; ?> getsql = $getsql"; $result = @mysqli_query($pubConn,$getsql); $Net_row = @mysqli_fetch_array($result); ${$NetworkCodeArr[$i][1]} = str_replace('E','',$Net_row[0]); echo mysqli_error($pubConn); }; if($DEBUG) { echo "
instanceNo = $instanceNo
"; echo "cc = $cc
"; echo "ndc = $ndc
"; echo "IPrefix = $IPrefix
"; echo "NPrefix = $NPrefix
"; } //=========================================================// //Get Database data // //=========================================================// if($typeFlag == 'TLDN') { $getsql = "select initValue from $vlr_paramConf where level_1 = '2' and level_2 = '1' and level_3 = '13'"; $msrn_org = @mysqli_query($pubConn,$getsql); $msrn_org = @mysqli_fetch_array($msrn_org); if($DEBUG) echo "getsql = $getsql
"; $msrn_org = $msrn_org[0]; echo mysqli_error($pubConn); if($DEBUG) echo "msrn_org = $msrn_org
"; $getsql = "select initValue from $msc_paramConf where level_1 = '2' and level_2 = '1' and level_3 = '1'"; $subprefix_org = @mysqli_query($pubConn,$getsql); $subprefix_org = @mysqli_fetch_array($subprefix_org); $subprefix_org = $subprefix_org[0]; echo mysqli_error($pubConn); if($DEBUG) echo "subprefix_org = $subprefix_org
"; $getsql = "select initValue from $msc_paramConf where level_1 = '2' and level_2 = '1' and level_3 = '2'"; $subpre_attr_org = @mysqli_query($pubConn,$getsql); $subpre_attr_org = @mysqli_fetch_array($subpre_attr_org); $subpre_attr_org = $subpre_attr_org[0]; echo mysqli_error($pubConn); if($DEBUG) echo "subpre_attr_org = $subpre_attr_org
"; $getsql = "select initValue from $msc_paramTable where level_1 = '2' and level_2 = '1' and level_3 = '1' and instanceNo < '400'"; $sub_prefix_rst = @mysqli_query($pubConn,$getsql); echo mysqli_error($pubConn); if($DEBUG) echo "getsql = $getsql
"; $sub_ra_org = hexdec(getBitValue($subprefix_org,'8.0-8.7')); if($DEBUG) echo "sub_ra_org=$sub_ra_org
"; $subprefix_no = 0; $unused_no = 0; $i = 0; while($sub_prefix_row = @mysqli_fetch_array($sub_prefix_rst)) { $sub_prefix_row = $sub_prefix_row[0]; $sub_ra = hexdec(getBitValue($sub_prefix_row,'8.0-8.7')); if($DEBUG) echo "sub_ra=$sub_ra
"; if($sub_ra == $DEFAULT_MSRN_RAC) { $curr_sub_ins = $i; break; } else if($sub_prefix_row == $subprefix_org) { $unused_sub_ins[$unused_no] = $i; $unused_no++; } $i++; } } else { $getsql = "select initValue from $mc_paramConf where level_1 = '2' and level_2 = '1' and level_3 = '4'"; $msisdn_org = @mysqli_query($pubConn,$getsql); $msisdn_org = @mysqli_fetch_array($msisdn_org); $msisdn_org = $msisdn_org[0]; echo mysqli_error($pubConn); if($DEBUG) echo "msisdn_org = $msisdn_org
"; } if($_SERVER['REQUEST_METHOD'] == "POST") { //update vlr-TLDN if($typeFlag == 'TLDN') { //blank if start or end value equals cc+ndc $start == '' ? $start = '' : $start = $cc.$ndc.$start; $end == '' ? $end = '' : $end = $cc.$ndc.$end; $start = omc_keep_length($start,'F','16','0'); $end = omc_keep_length($end,'F','16','0'); $init = setBitValue($msrn_org,'0.0-7.7',$start); $init = setBitValue($init,'8.0-15.7',$end); $setsql = "update $vlr_paramTable set initValue = '$init' where level_1 = '2' and level_2 = '1' and level_3 = '13' and instanceNo = '$DEFAULT_MSRN_RAC'"; if($DEBUG) echo "setsql = $setsql
"; mysqli_query($pubConn,$setsql); echo mysqli_error($pubConn); for($i=0; $i < strlen($start); $i++) { if(substr($start,0,$i) != substr($end,0,$i)) break; $msrn_prefix = substr($start,0,$i); } if($DEBUG) echo "msrn_prefix=$msrn_prefix
"; $prefix_loc = array('0.0-7.7','8.0-8.7'); $ra_no = omc_keep_length(dechex($DEFAULT_MSRN_RAC),'0','2'); $prefix_arr = array(omc_keep_length($msrn_prefix,'E','16','0'),$ra_no); $pre_attr_loc = array('0.0-0.3','0.4-0.7','10.0-10.0','10.2-10.3','10.4-10.6','10.7-10.7','11.0-11.7','12.0-12.3', '12.4-12.7','13.0-16.7','17.0-17.7'); //array('TON incoming call','TON outgoing call','CDR','Properties','Call type','Enable','Length of dialed number','deletion count', // 'insertion count','inserted digits','Cli-type','annoucement'); $pre_attr_arr = array('0100','0100','0','10','000','1',omc_keep_length(strlen($cc.$ndc.$msrn_start),'0','2'),'0', '0',omc_keep_length(0,'E','8','0'),'02'); $prefix_init = $subprefix_org; for($j=0; $j < sizeof($prefix_loc); $j++) $prefix_init = setBitValue($prefix_init,$prefix_loc[$j],$prefix_arr[$j]); $prefix_attr_init = $subpre_attr_org; for($j=0; $j < sizeof($pre_attr_loc); $j++) { if($DEBUG) { echo "pre_attr_loc = $pre_attr_loc[$j]
"; echo "pre_attr_arr = {$pre_attr_arr[$i][$j]}
"; } $prefix_attr_init = setBitValue($prefix_attr_init,$pre_attr_loc[$j],$pre_attr_arr[$j]); } if($DEBUG) { echo "prefix_init = $prefix_init
"; echo "prefix_attr_init = $prefix_attr_init
"; } if(!isset($curr_sub_ins)) $curr_sub_ins = $unused_sub_ins[0]; $setsql = "update $msc_paramTable set initValue = '$prefix_init' where level_1 = '2' and level_2 = '1' and level_3 = '1' and instanceNo = '$curr_sub_ins'"; if($DEBUG) echo "setsql = $setsql
"; mysqli_query($pubConn,$setsql); echo mysqli_error($pubConn); $setsql = "update $msc_paramTable set initValue = '$prefix_attr_init' where level_1 = '2' and level_2 = '1' and level_3 = '2' and instanceNo = '$curr_sub_ins'"; if($DEBUG) echo "setsql = $setsql
"; mysqli_query($pubConn,$setsql); echo mysqli_error($pubConn); } else { if($DEBUG) { echo "start = $start
"; echo "end = $end
"; } $init = $msisdn_org; //blank if start or end value equals cc+ndc if($start != '') { //$start = omc_keep_length($cc.$ndc.$start,'E','18','0'); $start = omc_keep_length($start,'E','18','0'); $init = setBitValue($init,'00.0-08.7',$start); } if($end != '') { //$end = omc_keep_length($cc.$ndc.$end,'E','18','0'); $end = omc_keep_length($end,'E','18','0'); $init = setBitValue($init,'09.0-17.7',$end); } $setsql = "update $mc_paramTable set initValue = '$init' where level_1 = '2' and level_2 = '1' and level_3 = '4' and instanceNo = '$instanceNo'"; if($DEBUG) echo "setsql = $setsql
"; mysqli_query($pubConn,$setsql); echo mysqli_error($pubConn); } echo ""; } $i = 0; $free_no = 0; if($typeFlag == 'TLDN') { $getsql = "select initValue from $vlr_paramTable where level_1 = '2' and level_2 = '1' and level_3 = '13' and instanceNo = '$DEFAULT_MSRN_RAC'"; $msrn_rst = @mysqli_query($pubConn,$getsql); echo mysqli_error($pubConn); if($DEBUG) echo "getsql = $getsql
"; $msrn_row = @mysqli_fetch_array($msrn_rst); $msrn_row = $msrn_row[0]; if($DEBUG) echo "
msrn_row = $msrn_row
"; $start = getBitValue($msrn_row,'00.0-07.7'); $end = getBitValue($msrn_row,'08.0-15.7'); $prefix_length = strlen($cc.$ndc); $tmp_len = strlen($start) - $prefix_length; $start = substr($start,$prefix_length,$tmp_len); $tmp_len = strlen($end) - $prefix_length; $end = substr($end,$prefix_length,$tmp_len); $start = str_replace('F','',$start); $end = str_replace('F','',$end); if($DEBUG) { echo "start = $start
"; echo "end = $end
"; } } else { $getsql = "select initValue from $mc_paramTable where level_1 = '2' and level_2 = '1' and level_3 = '4' and instanceNo = '$instanceNo'"; $msisdn_rst = @mysqli_query($pubConn,$getsql); $msisdn_rst = @mysqli_fetch_array($msisdn_rst); $msisdn_rst = $msisdn_rst[0]; echo mysqli_error($pubConn); if($DEBUG) echo "getsql = $getsql
"; if($DEBUG) echo "
msisdn_rst = $msisdn_rst
"; if($msisdn_rst == $msisdn_org) $msisdn_rst = ''; $start = getBitValue($msisdn_rst,'00.0-08.7'); $end = getBitValue($msisdn_rst,'09.0-17.7'); if($DEBUG) { echo "start = $start
"; echo "end = $end
"; } /* $prefix_length = strlen($cc.$ndc); $tmp_len = strlen($start) - $prefix_length; $start = substr($start,$prefix_length,$tmp_len); $tmp_len = strlen($end) - $prefix_length; $end = substr($end,$prefix_length,$tmp_len); */ $start = str_replace('E','',$start); $end = str_replace('E','',$end); if($DEBUG) { echo "start = $start
"; echo "end = $end
"; } } echo "
"; echo ""; echo ""; echo ""; echo ""; echo "
"; if($typeFlag == 'TLDN') { echo "Configuration > Network > Element > MSC "; echo ""; //showHelp($helpId); echo "
"; echo "
"; echo ""; echo ""; echo ""; echo "
"; echo "Routing area:    "; if($instanceNo == 'new') { echo "    "; } else { echo "$instanceNo    "; } } else { echo "$strConfiguration > Network > SMSC > $typeFlag"; echo ""; //showHelp($helpId); echo "
"; echo "
"; } echo ""; echo ""; echo ""; $backurl=$backurl."?scroll_y=".$sub_page_top; echo ""; echo "
 "; //echo "$typeFlag Segment:    "; echo ""; echo ""; echo "    "; echo ""; echo "

$strBack"; echo "

"; ?> "; echo ""; echo ""; echo ""; } //TLDN or MSISDN { $prefix = $cc.$ndc; if($typeFlag == 'TLDN') $len = 16 - strlen($prefix); else $len = 18 - strlen($prefix); echo ""; echo ""; //echo ""; echo ""; echo ""; echo ""; //echo ""; echo ""; echo ""; } echo ""; echo ""; echo ""; echo "
ParametersValue
Start $typeFlag$prefix
End $typeFlag$prefix
"; ?> "; ?>