'0', 'remark' => 'Not executable', 'color' => '#FF0000'), array('num' => '1', 'remark' => 'Booking', 'color' => '#00FF00'), array('num' => '2', 'remark' => 'On going', 'color' => '#0000FF'), array('num' => '3', 'remark' => 'Finished', 'color' => '#000000') ); ?> subSysNo=$subSysNo"; $portNo = $pNum%8; if($DEBUG)echo "
portNo=$portNo"; //Attributes of TG $oidTg = "2.2"; $pTg = explode(".",$oidTg); $i = 0; $wTg = ''; while(isset($pTg[$i])) { $lNum = $i+1; if($DEBUG) echo "
pTg[$i]=$pTg[$i]"; $wTg = $wTg." AND level_$lNum = $pTg[$i] "; $i++; } function judgeDigit($inString){ $stringLen = strlen($inString); for($i=0;$i<$stringLen;$i++){ $tmpStr = substr($inString,$i,1); switch($tmpStr){ case "0": case "1": case "2": case "3": case "4": case "5": case "6": case "7": case "8": case "9": break; default: return(0); } } return(1); }; if($set || $add) { $drt = ceil(($drt_d*1440+$drt_h*60+$drt_m)/15); if($DEBUG)echo "
drt=$drt"; $nowTime=date("Y-m-d H:i:s",mktime()); $dstTime=date("Y-m-d H:i:s", mktime($hour,$minute,0,$month,$day,date("Y"))); $maxTime=date("Y-m-d H:i:s", mktime(date("H"),date("i"),date("s"),date("m"),date("d")+20,date("Y"))); if($DEBUG)echo "
nowTime=$nowTime"; if($DEBUG)echo "
dstTime=$dstTime"; if($DEBUG)echo "
maxTime=$maxTime"; $bgnDate = date("Y-m-d H:i:s", mktime($hour,$minute,0,$month,$day,date("Y"))); $endDate = date("Y-m-d H:i:s", mktime($hour,$minute+15*$drt,0,$month,$day,date("Y"))); if($DEBUG)echo "
bgnDate=$bgnDate"; if($DEBUG)echo "
endDate=$endDate"; $bgnTime = ''; $timeNum = 0; if($DEBUG)echo "
Analysis new group."; $sltSql = "SELECT count(*) FROM subscriberData WHERE inter_msisdn like '%$aphNum%'"; if($DEBUG)echo "
sltSql=$sltSql"; $sltRes = mysqli_query($pubConn,$sltSql); $sltRow = mysqli_fetch_array($sltRes); $aphCount = $sltRow[0]; if($DEBUG)echo "
aphCount=$aphCount"; for($i=0;$i<$maxDurNum;$i++){ if($DEBUG)echo "
i=$i"; $tmpBgnDate = date("Y-m-d H:i:s", mktime(date("H"),date("i")+$i*15,0,date("m"),date("d"),date("Y"))); $tmpEndDate = date("Y-m-d H:i:s", mktime(date("H"),date("i")+($i+1)*15,0,date("m"),date("d"),date("Y"))); if($DEBUG)echo "
tmpBgnDate=$tmpBgnDate"; if($DEBUG)echo "
tmpEndDate=$tmpEndDate"; if($tmpEndDate > $bgnDate && $tmpEndDate <= $endDate){ $timeNum ++; if(strlen($bgnTime) < 1){ $bgnTime = $i; } $nowArr[$i][0] = $grpNum; $nowArr[$i][1] = $cphNum; $nowArr[$i][2] = $maxNum; }else if($tmpEndDate > $endDate && $tmpBgnDate < $endDate){ $timeNum ++; $nowArr[$i][0] = $grpNum; $nowArr[$i][1] = $cphNum; $nowArr[$i][2] = $maxNum; }else if($tmpEndDate <= $bgnDate){ continue; }else{ break; } } if($DEBUG)echo "
Analysis all old groups."; //added by QShuang in 06-23. /************select value to see************/ //Location management $tgSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_0 WHERE subSysNo = '0' ".$wTg." ORDER BY instanceNo "; if($DEBUG) echo "
tgSql=$tgSql"; $tgRes = @mysqli_query($pubConn,$tgSql); $tgRow = @mysqli_fetch_array($tgRes); echo mysqli_error($pubConn); $wDef = " AND ("; $defaultValue_1 = "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE000000EE"; do { $instanceNo = $tgRow[instanceNo]; if($instanceNo == $tNum)//owner continue; $initValue = $tgRow[initValue]; if($initValue == $defaultValue || $initValue == $defaultValue_1){ $cnfShow[$instanceNo] = 0; continue; }else{ $cnfShow[$instanceNo] = 1; $wDef = $wDef." instanceNo = $instanceNo OR "; } $grpNumTmp = $cnfArr[$instanceNo][0] = HexDec(substr($initValue,0,2)); if($DEBUG)echo "
grpNumTmp=$grpNumTmp"; $cphNumTmp = substr($initValue,2,16); $p1 = explode("E",$cphNumTmp); $cphNumTmp = $cnfArr[$instanceNo][1] = $p1[0]; if($DEBUG)echo "
cphNumTmp=$cphNumTmp"; $pwdTmp = $cnfArr[$instanceNo][2] = substr($initValue,18,4); $aphNumTmp = substr($initValue,22,16); $p3 = explode("E",$aphNumTmp); $aphNumTmp = $cnfArr[$instanceNo][3] = $p3[0]; if($DEBUG)echo "
aphNumTmp=$aphNumTmp"; $monthTmp = omc_keep_length(HexDec(substr($initValue,38,2)),0,2); $dayTmp = omc_keep_length(HexDec(substr($initValue,40,2)),0,2); $hourTmp = omc_keep_length(HexDec(substr($initValue,42,2)),0,2); $minuteTmp = omc_keep_length(HexDec(substr($initValue,44,2)),0,2); $bgnTimeTmp = $cnfArr[$instanceNo][4] = $monthTmp."-".$dayTmp." ".$hourTmp.":".$minuteTmp; //echo "cnfArr[$instanceNo][4]={$cnfArr[$instanceNo][4]}
"; $drtTmp = $cnfArr[$instanceNo][5] = HexDec(substr($initValue,46,4)); $bgnDate = date("Y-m-d H:i:s", mktime($hourTmp,$minuteTmp,0,$monthTmp,$dayTmp,date("Y"))); $endDate = date("Y-m-d H:i:s", mktime($hourTmp,$minuteTmp+15*$drtTmp,0,$monthTmp,$dayTmp,date("Y"))); $maxNumTmp = $cnfArr[$instanceNo][6] = HexDec(substr($initValue,50,2)); $sttNumTmp = HexDec(substr($initValue,52,2)); $statusTmp = $cnfArr[$instanceNo][7] = $statusArr[$sttNumTmp][remark]; $colorArr[$instanceNo][7] = $statusArr[$sttNumTmp][color]; if($DEBUG)echo "
bgnDate=$bgnDate"; if($DEBUG)echo "
endDate=$endDate"; if($DEBUG)echo "
statusTmp=$statusTmp"; if($statusTmp == 'Invalid' || $statusTmp == 'Finished'){ continue; } //echo "
status=$status"; for($i=0;$i<$maxDurNum;$i++){ if($DEBUG)echo "
i=$i"; $tmpBgnDate = date("Y-m-d H:i:s", mktime(date("H"),date("i")+$i*15,0,date("m"),date("d"),date("Y"))); $tmpEndDate = date("Y-m-d H:i:s", mktime(date("H"),date("i")+($i+1)*15,0,date("m"),date("d"),date("Y"))); if($DEBUG)echo "
tmpBgnDate=$tmpBgnDate"; if($DEBUG)echo "
tmpEndDate=$tmpEndDate"; if($tmpEndDate > $bgnDate && $tmpEndDate <= $endDate){ if(strlen($timeArr[$i][0]) < 1){ $timeArr[$i][0] = "-".$grpNumTmp."-"; $timeArr[$i][1] = "-".$cphNumTmp."-"; }else{ $timeArr[$i][0] .= $grpNumTmp."-"; $timeArr[$i][1] .= $cphNumTmp."-"; } $timeArr[$i][2] += $maxNumTmp; }else if($tmpEndDate > $endDate && $tmpBgnDate < $endDate){ if(strlen($timeArr[$i][0]) < 1){ $timeArr[$i][0] = "-".$grpNumTmp."-"; $timeArr[$i][1] = "-".$cphNumTmp."-"; }else{ $timeArr[$i][0] .= $grpNumTmp."-"; $timeArr[$i][1] .= $cphNumTmp."-"; } $timeArr[$i][2] += $maxNumTmp; }else if($tmpEndDate <= $bgnDate){ continue; }else{ break; } } }while($tgRow = @mysqli_fetch_array($tgRes)); //echo "
bgnTime=$bgnTime"; //echo "
timeNum=$timeNum"; //select conf ID for($j=1;$j<39;$j++){ if($j%10 == 9 || $j%10 == 0) continue; $noFind = 1; if($DEBUG)echo "
j=$j"; for($i=$bgnTime;$i<$bgnTime+$timeNum;$i++){ if($DEBUG)echo "
timeArr[$i][0]=$timeArr[$i][0]"; if(strlen(strpos($timeArr[$i][0],"-".$j."-"))){ $noFind = 1; break; }else{ $noFind = 0; } } if($noFind == 0){ $grpNum = $j; break; }elseif($noFind == 1 && $j == 38){ $noUsedId = 1; } } //echo "
grpNum=$grpNum"; for($i=$bgnTime;$i<$bgnTime+$timeNum;$i++){ if($DEBUG)echo "
i=$i"; if($DEBUG)echo "
grpOut="; if($DEBUG)echo strpos($timeArr[$i][0],"-".$nowArr[$i][0]."-"); if($DEBUG)echo "
noOut="; if($DEBUG)echo strpos($timeArr[$i][1],"-".$nowArr[$i][1]."-"); if($DEBUG)echo "
numOut="; if($DEBUG)echo $timeArr[$i][2]+$nowArr[$i][2]; /* if(strlen(strpos($timeArr[$i][0],"-".$nowArr[$i][0]."-"))){ $grpOutflag = 1; $grpOutNo = $i; break; }else*/ if(strlen(strpos($timeArr[$i][1],"-".$nowArr[$i][1]."-"))){ $noOutflag = 1; $noOutNo = $i; break; }elseif($timeArr[$i][2]+$nowArr[$i][2] > $maxUseNum){ $numOutflag = 1; $numOutNo = $i; break; } } if($DEBUG){ for($i=0;$i<10;$i++){//for test echo "
timeArr[$i][0]={$timeArr[$i][0]}"; echo "
timeArr[$i][1]={$timeArr[$i][1]}"; echo "
timeArr[$i][2]={$timeArr[$i][2]}"; echo "
nowArr[$i][0]={$nowArr[$i][0]}"; echo "
nowArr[$i][1]={$nowArr[$i][1]}"; echo "
nowArr[$i][2]={$nowArr[$i][2]}"; } } if($dstTime > $maxTime){ echo ""; }elseif($dstTime < $nowTime){ echo ""; }elseif($noUsedId){ echo ""; }elseif(strlen($cphNum) < 1){ echo ""; }elseif(judgeDigit($cphNum) < 1){ echo ""; }elseif(strlen($pwd) < 4){ echo ""; }elseif(judgeDigit($pwd) < 1){ echo ""; }elseif(strlen($aphNum) < 1){ echo ""; }elseif(judgeDigit($aphNum) < 1){ echo ""; }elseif($aphCount != 1){ echo ""; }elseif($drt < 1){ echo ""; }elseif($maxNum < 3){ echo ""; }elseif($grpOutflag){ echo ""; }elseif($noOutflag){ echo ""; }elseif($numOutflag){ echo ""; }else{ $field_1 = omc_keep_length(DecHex($grpNum),0,2); if($DEBUG)echo "
field_1=$field_1"; $field_2 = omc_keep_length($cphNum,E,16,0); if($DEBUG)echo "
field_2=$field_2"; $field_3 = omc_keep_length($pwd,0,4); if($DEBUG)echo "
field_3=$field_3"; $field_4 = omc_keep_length($aphNum,E,16,0); if($DEBUG)echo "
field_4=$field_4"; $field_5 = omc_keep_length(DecHex($month),0,2).omc_keep_length(DecHex($day),0,2).omc_keep_length(DecHex($hour),0,2).omc_keep_length(DecHex($minute),0,2); $field_6 = omc_keep_length(DecHex($drt),0,4); $field_7 = omc_keep_length(DecHex($maxNum),0,2); //if($add) $sttNum = 4; $field_8 = omc_keep_length(DecHex($sttNum),0,2); $initValue = $field_1.$field_2.$field_3.$field_4.$field_5.$field_6.$field_7.$field_8; $initValue = strtoupper($initValue); if($DEBUG)echo "
initValue=$initValue"; $uTgSql = " UPDATE $tb_0 set initValue = '$initValue' WHERE subSysNo = '0' AND instanceNo = '$tNum' ".$wTg; if($DEBUG) echo "
uTgSql=$uTgSql"; $uTgRes = @mysqli_query($pubConn,$uTgSql); echo mysqli_error($pubConn); echo ""; } } //echo "
oType=$oType"; if($oType < 1 && !$retryInput){ /************select value to see************/ //Attributes of TG $tgSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_0 WHERE subSysNo = '0' AND instanceNo = '$tNum' ".$wTg." ORDER BY instanceNo "; if($DEBUG) echo "
tgSql=$tgSql"; $tgRes = @mysqli_query($pubConn,$tgSql); $tgRow = @mysqli_fetch_array($tgRes); echo mysqli_error($pubConn); $wDef = " AND ("; do { $instanceNo = $tgRow[instanceNo]; $initValue = $tgRow[initValue]; if($initValue == $defaultValue || $initValue == $defaultValue_1){ $cnfShow[$instanceNo] = 0; }else{ $cnfShow[$instanceNo] = 1; $wDef = $wDef." instanceNo = $instanceNo OR "; } //echo "
tgShow[$instanceNo]=$cnfShow[$instanceNo]"; $grpNum = $cnfArr[$instanceNo][0] = HexDec(substr($initValue,0,2)); if($DEBUG)echo "
grpNum=$grpNum"; $cphNum = substr($initValue,2,16); $p1 = explode("E",$cphNum); $cphNum = $cnfArr[$instanceNo][1] = $p1[0]; if($DEBUG)echo "
cphNum=$cphNum"; $pwd = $cnfArr[$instanceNo][2] = substr($initValue,18,4); $aphNum = substr($initValue,22,16); $p3 = explode("E",$aphNum); $aphNum = $cnfArr[$instanceNo][3] = $p3[0]; if($DEBUG)echo "
aphNum=$aphNum"; $month = omc_keep_length(HexDec(substr($initValue,38,2)),0,2); $day = omc_keep_length(HexDec(substr($initValue,40,2)),0,2); $hour = omc_keep_length(HexDec(substr($initValue,42,2)),0,2); $minute = omc_keep_length(HexDec(substr($initValue,44,2)),0,2); $bgnTime = $cnfArr[$instanceNo][4] = $month."-".$day." ".$hour.":".$minute; $drt = $cnfArr[$instanceNo][5] = HexDec(substr($initValue,46,4)); $drt_d = floor($drt*15/1440); $drt_h = floor(($drt*15-$drt_d*1440)/60); $drt_m = $drt*15-$drt_d*1440-$drt_h*60; if($DEBUG)echo "
drt=$drt"; if($DEBUG)echo "
drt_d=$drt_d"; if($DEBUG)echo "
drt_h=$drt_h"; if($DEBUG)echo "
drt_m=$drt_m"; $maxNum = $cnfArr[$instanceNo][6] = HexDec(substr($initValue,50,2)); $sttNum = HexDec(substr($initValue,52,2)); $status = $cnfArr[$instanceNo][7] = $statusArr[$sttNum][remark]; }while($tgRow = @mysqli_fetch_array($tgRes)); } echo "
"; echo ""; if($oType){ //$nowDate = getdate(); $month = date("m", mktime(date("H"),date("i")+6,date("s"),date("m"),date("d"),date("Y"))); $day = date("d", mktime(date("H"),date("i")+6,date("s"),date("m"),date("d"),date("Y"))); $hour = date("H", mktime(date("H"),date("i")+6,date("s"),date("m"),date("d"),date("Y"))); $minute = date("i", mktime(date("H"),date("i")+6,date("s"),date("m"),date("d"),date("Y"))); //echo "
month=$month"; //echo "
day=$day"; //echo "
hour=$hour"; //echo "
minute=$minute"; /************get default value**************/ $defSql = " SELECT initValue FROM paramConf WHERE keyId > 0 ".$wTg; $defRes = @mysqli_query($pubConn,$defSql); $defRow = @mysqli_fetch_array($defRes); $defaultValue = $defRow[initValue]; $defaultValue_1 = "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE000000EE"; $tgFlagSql = " SELECT instanceNo,initValue,editValue,readValue FROM $tb_0 WHERE subSysNo = '0' ".$wTg." ORDER BY instanceNo "; if($DEBUG)echo "
tgFlagSql=$tgFlagSql"; $tgFlagRes = @mysqli_query($pubConn,$tgFlagSql); $tgFlagRow = @mysqli_fetch_array($tgFlagRes); echo mysqli_error($pubConn); $crtConfNum = 0; do { $instanceNo = $tgFlagRow[instanceNo]; $initValue = $tgFlagRow[initValue]; $tmpConfId = substr($initValue,0,2); //echo "
tmpConfId=$tmpConfId"; if($tmpConfId > 0 && $tmpConfId <= $maxConfNum){ $confArr[$crtConfNum++] = $tmpConfId; } if($initValue == $defaultValue || $initValue == $defaultValue_1){ $cnfShow[$instanceNo] = 0; }else{ $cnfShow[$instanceNo] = 1; } }while($tgFlagRow = @mysqli_fetch_array($tgFlagRes)); /* echo ""; echo ""; echo ""; */ echo ""; //echo ""; //echo ""; echo ""; break; } } //echo ""; //echo ""; echo ""; /* //echo "
crtConfNum=$crtConfNum"; echo ""; echo ""; echo ""; echo ""; */ }else{ echo ""; echo ""; echo ""; /* echo ""; echo ""; echo ""; echo ""; */ } /* echo ""; echo ""; echo ""; echo ""; */ echo ""; echo ""; echo ""; echo ""; //class=\"button\" echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; echo ""; //echo ""; echo ""; echo ""; echo ""; echo ""; //echo ""; echo ""; echo ""; echo ""; echo "
Please add records.
Reservation "; //echo "Reservation $i
Conf ID"; //echo ""; echo ""; echo "
Reservation $tNum
Conf ID"; echo "$grpNum"; echo "
Conf ID"; //echo ""; echo ""; echo "
Conf number
Password(Please input 4 digits)
Applicant
Start time"; //echo "-"; echo ""; echo "-"; echo ""; echo "  "; //echo " "; echo ""; echo ":"; //echo ":"; echo ""; //echo ""; //echo "(e.g. 06-13 09:50)"; echo "
Duration(x15min)"; echo ""; echo "D  "; echo ""; echo "H  "; echo ""; echo "M  "; /* echo ""; echo "(x15min)"; */ echo "
Max. party"; echo ""; echo "
"; //echo "
Remark:"; echo "
"; if($oType){ echo ""; echo "  "; }else{ echo ""; echo "  "; echo ""; //echo ""; } echo ""; echo ""; echo ""; echo ""; echo "
"; ?> Remarks:

Reservation: Reservation number of the conference. A CNF supports 400 conference reservations

Conf ID: The Conf ID ranges from 1 to 40. A CNF contains four cards. Each card can host ten groups (Card 0-3 has conference 1-10, 11-20, 21-30, and 31-40 respectively). When to select Conf ID, do not assign a group ID to more than one conference which are scheduled at the same time, and make sure that at any time, do not arrange groups with totally more than 30 conference parties on a single card at the same time

Conf number: Before setting the Conf number, make sure that the prefix to CNF has been set in MSC. There are total 40 different conference numbers available for 40 conferences. Each conference number is dedicated to one conference and begins with the same CNF prefix. Both conference number and group ID is in control of a conference. For example, the prefix to the CNF is set as 8888 in MSC. We can set 888801 to 888840 for group 1 to 40 respectively

Applicant: The Applicant is a system subscriber who will be charged for this conference. The applicant can be suggested by any proposer and confirmed by operator

Password: A 4-digit Password used to secure entering to a conference. This password may be proposed by either operator or applicant

Start time: The Start time is scheduled per reservation. The format is month-day hour-minute. Debiting will be starts at this scheduled time unless this conference is canceled before the start time

Duration: Booked duration of a conference, unit = 15 minutes. Conference will be concluded when the duration is used up

Max. party: Limits the quantity of parties for this conference. The quantity of parties is involved in debiting. Conference debiting = Duration x Billing rate x Max party num. System supports maximum 15 parties for a single conference. Each party will be charged as normal call during the conference

Status: Read only, status of conference, refreshed on a daily basis. Booked = conference is booked, In use = ongoing conference, Finished = conference has finished, Invalid = applicant is invalid because of low balance or suspended