\n"; echo "\n"; exit(); } /************************************************ * Retrieve the Bts Manager ID from object ID * AdjHand.11.0.12 --substr--> 11.0.12 --> 11 ************************************************/ $btsmgrid = substr($objectid,8); if ($btsmgrid[1] == '.') { $btsmgrid=substr($btsmgrid,0,1); } else if ($btsmgrid[2] == '.') { $btsmgrid=substr($btsmgrid,0,2); } else { echo strlen($objectid) . "Error Object ID:" . $objectid . "\n"; return 0; } include("adjhandlist.inc"); include("meta_table_type.inc"); include("login_parm.inc"); $db = mysql_connect($hostname, $username, $password); mysql_select_db($dbname,$db); //echo "=)AdjHand.$btsmgrid.0.*"; echo "{${$parameter}[title]}"; echo "

\n"; /******************************************************** * Step 1: Find out the next available Adjhand object ID ********************************************************/ $sqlstring = "select MIN(0+SUBSTRING_INDEX(ObjectId,'.',-1)) from OMCR_AdjHand where bssid=$bssid" . " and (BcchFrequency=-1 or CellGlobalIdentityLaiMcc=0" . " or CellGlobalIdentityLaiMnc=0 or CellGlobalIdentityCi=0 or LocationAreaCodes=0)" . " and ObjectId LIKE 'AdjHand.$btsmgrid.0.%'"; //echo $sqlstring . "
"; $result = mysql_query($sqlstring,$db) or die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); $row = mysqli_fetch_row($result); if ($row[0] == null) { echo "\nThere are no space for new neighbour cell."; return; } $new_neighbor_id = "AdjHand.$btsmgrid.0.$row[0]"; mysql_free_result($result); /************************************************ * Step 2: Display the present neighbor list ************************************************/ /************************************************ * Generate the Neighbor cell list from SQL DB ************************************************/ $sqlstring = "CREATE TEMPORARY TABLE tmp SELECT t1.Label AS NAME," . "t1.MobileCountryCode AS MCC,t1.MobileNetworkCode AS MNC,t1.LocationAreaCode AS LAC," . "t1.CellIdentity AS CI,t1.CellAllocation_0 AS BCCH,t1.BsIdentityCode AS BSIC " . "FROM OMCR_Bts AS t1, OMCR_BSSTREE AS t2 WHERE " . "t2.Presence=1 AND t1.ObjectId=t2.ObjectId AND t1.ObjectId<>'Bts.$btsmgrid.0' AND " . "t1.MobileCountryCode>0 AND t1.MobileNetworkCode>0 AND t1.LocationAreaCode>0 AND " . "t1.CellIdentity>0 AND t1.CellAllocation_0>0 AND t1.BsIdentityCode>=0"; //echo $sqlstring . "
"; $result = mysql_query($sqlstring,$db) or die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); $sqlstring = "INSERT INTO tmp SELECT t1.Label AS NAME," . "t1.CellGlobalIdentityLaiMcc AS MCC,t1.CellGlobalIdentityLaiMnc AS MNC,t1.LocationAreaCodes AS LAC," . "t1.CellGlobalIdentityCi AS CI,t1.BcchFrequency AS BCCH,t1.BsIdentityCode AS BSIC " . "FROM OMCR_AdjHand AS t1, OMCR_BSSTREE AS t2 " . "WHERE t2.Presence=1 AND t1.ObjectId=t2.ObjectId AND " . "t1.ObjectId NOT LIKE 'AdjHand.$btsmgrid.0.%' AND t1.CellGlobalIdentityLaiMcc>0 AND " . "t1.CellGlobalIdentityLaiMnc>0 AND t1.LocationAreaCodes>0 AND " . "t1.CellGlobalIdentityCi>0 AND t1.BcchFrequency>0 AND t1.BsIdentityCode>=0"; //echo $sqlstring . "
"; $result = mysql_query($sqlstring,$db) or die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); $sqlstring = "SELECT DISTINCT * FROM tmp"; //echo $sqlstring . "
"; $result = mysql_query($sqlstring,$db) or die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); /* $sqlstring = "select DISTINCT Label,CellGlobalIdentityLaiMcc,CellGlobalIdentityLaiMnc," . "LocationAreaCodes,CellGlobalIdentityCi,BcchFrequency,BsIdentityCode from OMCR_AdjHand " . "where BcchFrequency<>-1 and CellGlobalIdentityLaiMcc<>0 and CellGlobalIdentityLaiMnc<>0 " . "and CellGlobalIdentityCi<>0 and LocationAreaCodes<>0 and (bssid<>$bssid OR " . "(bssid=$bssid AND ObjectId NOT LIKE 'AdjHand.$btsmgrid.0.%')) ORDER BY CellGlobalIdentityCi"; */ //echo $sqlstring . "
"; $result = mysql_query($sqlstring,$db) or die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); $no_of_fields=mysql_num_fields($result); echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; $num=0; while ( $row = mysqli_fetch_row($result) ) { $num++; echo "\n"; echo "\n"; //echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo ""; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; echo "\n"; } if (mysqli_num_rows($result) == 0) { $no_of_fields += 1; echo ""; } echo "
{${$parameter}[cellname]}{${$parameter}[mcc]}{${$parameter}[mnc]}{${$parameter}[lac]}{${$parameter}[cellid]}{${$parameter}[bcch]}{${$parameter}[bsic]}{${$parameter}[control]}
$num" . ($row[0]==''?"-":rawurldecode($row[0])) . "$row[1]$row[2]$row[3]$row[4]$row[5]$row[6]
" . ${$parameter}[noneighbor] . "
"; echo "


\n"; echo "\n"; $sqlstring = "DROP TABLE tmp"; //echo $sqlstring . "
"; $result = mysql_query($sqlstring,$db) or die("Invalid query: $sqlstring\n" . mysqli_error($pubConn)); ?>