<?php
/*********************************************************      
 程序说明：         
    功能说明：hlr用户数据维护专用页面
		1、将用户数据表的数据导入到临时参数表。
		2、修改的用户数据保存到临时参数表中，
		3、设置用户参数时,返回值将修改用户表和临时表。

    调用关系：调用: header.inc
 
    变量说明：
		输入变量：
			$keyValue	:由用户列表传来
			$sysId		:由用户列表传来或本页面指定
			$dataTypeNo	:数据类型，0=用户数据，1=冲值卡数据
			$language	:语言种类
			$canSetNum	:每次最多可以修改的字段个数

 作者：
      
修改注释：      
NO.1      
姓名：Lilong
时间：6/30/2004
修改说明：for 7.0 HLR subscriber parameter
No.2
Name: Lilong
Date: 8/10/2004
Description: RSZI to 10 bytes
*********************************************************/  
require("../../inc/header.inc");
$DEBUG = 0;

if($DEBUG) echo "<br>正在调试中，给您的工作带来不便，请原谅！！：）";

//==========================================================
//变量定义
//==========================================================
$canwrite_flag=checkWritePrivilege();
$pubDb				= 'OMC_PUB';
$sysSubsConfTable	='OMC_PUB.sysSubsConf';
$systemConfTable	= 'OMC_PUB.sysConf';

$nReadComm			= 1;
$nChangeComm		= 2;
$nCreateComm		= 3;
$nDeleteComm		= 4;
$nLoadIndexComm		= 5;
$nReplaceIndexComm	= 6;

$maxLevelNum = 10;

$nInteger	= 2;
$nAscStr	= 3;
$nHexStr	= 4;

$odbGeneralDef=array(
		//array('inputName',	'offset'	,'remark'),
		array('BAOC',			'00.0'	,'BAOC'),
		array('BOIC',			'00.1'	,'BOIC'),
		array('BOIC_HPLMN',		'00.2'	,'BOIC-HPLMN'),
		array('BPRIC',		'00.3',     'BPRIC'),
		array('BPREC',		'00.4',			'BPREC'),
		array('BASS',			'00.5'	,'BASS'),
//		array('OSB1', 		'00.6',		'OSB1'),
//		array('OSB2',			'00.7',		'OSB2'),
		array('BAIC',			'02.0'	,'BAIC'),
		array('BAIC_ROAM',		'02.1'	,'BAIC-ROAM'),
		array('Roaming',		'02.3'	,'Roaming'),
		array('Roaming_CT',		'02.4'	,'Roaming CT')
);

$odbSpecificDef=array(
		array('OSB1',			'00.0',			'OSB1'),
		array('OSB2',			'00.1',			'OSB2')
);
$CamelFlagDef=array(
		array('supportFlag',	'00.7'	,'CAMEL'),
		array('OCSI',		'01.0'	,'O-CSI'),
		array('TCSI',		'01.1'	,'T-CSI'),
		array('SS_CSI',		'01.2'	,'SS-CSI'),
		array('SMS_CSI',	'01.3'	,'SMS-CSI'),
		array('GPRS_CSI',	'01.4'	,'GPRS-CSI')
);

$cfuStateDef=array(
		array('cfuABit',	'00.0'	,'Active'),
		array('cfuRBit',	'00.1'	,'Register'),
		array('cfuPBit',	'00.2'	,'Provision'),
		array('cfuQBit',	'00.3'	,'Quiescent')
);
$cfbStateDef=array(
		array('cfbABit',	'00.0'	,'Active'),
		array('cfbRBit',	'00.1'	,'Register'),
		array('cfbPBit',	'00.2'	,'Provision'),
		array('cfbQBit',	'00.3'	,'Quiescent')
);
$cfnryStateDef=array(
		array('cfnryABit',	'00.0'	,'Active'),
		array('cfnryRBit',	'00.1'	,'Register'),
		array('cfnryPBit',	'00.2'	,'Provision'),
		array('cfnryQBit',	'00.3'	,'Quiescent')
);
$cfnrcStateDef=array(
		array('cfnrcABit',	'00.0'	,'Active'),
		array('cfnrcRBit',	'00.1'	,'Register'),
		array('cfnrcPBit',	'00.2'	,'Provision'),
		array('cfnrcQBit',	'00.3'	,'Quiescent')
);
$baocStateDef=array(
		array('baocABit',	'00.0'	,'Active'),
		array('baocPBit',	'00.2'	,'Provision'),
		array('baocQBit',	'00.3'	,'Quiescent')
);
$boicStateDef=array(
		array('boicABit',	'00.0'	,'Active'),
		array('boicPBit',	'00.2'	,'Provision'),
		array('boicQBit',	'00.3'	,'Quiescent')
);
$boicExStateDef=array(
		array('boicExABit',	'00.0'	,'Active'),
		array('boicExPBit',	'00.2'	,'Provision'),
		array('boicExcQBit',	'00.3'	,'Quiescent')
);
$baicStateDef=array(
		array('baicABit',	'00.0'	,'Active'),
		array('baicPBit',	'00.2'	,'Provision'),
		array('baicQBit',	'00.3'	,'Quiescent')
);
$bicroamStateDef=array(
		array('baicRoABit',	'00.0'	,'Active'),
		array('baicRoPBit',	'00.2'	,'Provision'),
		array('baicRoQBit',	'00.3'	,'Quiescent')
);
$qpStateDef=array(
		array('PBit',	'00.2'	,'Provision'),
		array('QBit',	'00.3'	,'Quiescent')
);

$callWaitingStateDef=array(
		array('callWaitingABit',	'00.0'	,'Active'),
		array('callWaitingPBit',	'00.2'	,'Provision'),
		array('callWaitingQBit',	'00.3'	,'Quiescent')
);
$callHoldStateDef=array(
		array('callHoldPBit',	'00.2'	,'Provision'),
		array('callHoldQBit',	'00.3'	,'Quiescent')
);
$ectStateDef=array(
		array('ectPBit',	'00.2'	,'Provision'),
		array('ectQBit',	'00.3'	,'Quiescent')
);
$mtpyStateDef=array(
		array('mtpyPBit',	'00.2'	,'Provision'),
		array('mtpyQBit',	'00.3'	,'Quiescent')
);

$emlppStateDef=array(
		//array('emlppABit',	'00.0'	,'Active'),
		array('emlppPBit',	'00.2'	,'Provision'),
		array('emlppQBit',	'00.3'	,'Quiescent')
);

$clipStateDef=array(
		array('clipPBit',	'00.2'	,'Provision'),
		array('clipQBit',	'00.3'	,'Quiescent')
);
$clirStateDef=array(
		array('clirPBit',	'00.2'	,'Provision'),
		array('clirQBit',	'00.3'	,'Quiescent')
);
$colpStateDef=array(
		array('colpPBit',	'00.2'	,'Provision'),
		array('colpQBit',	'00.3'	,'Quiescent')
);
$colrStateDef=array(
		array('colrPBit',	'00.2'	,'Provision'),
		array('colrQBit',	'00.3'	,'Quiescent')
);
$teleDataDef=array(
		array('telephony',	'00.0'	,'Telephony'),
		array('emergencyCall',	'00.1'	,'Emergency call'),
		array('smsMtPP',	'00.2'	,'Short-message MT-PP'),
		array('smsMoPP',	'00.3'	,'Short-message MO-PP')
);

$pdpContextDef=array(
		array('pdpFlag','00.0-00.7','PDP flag'),
		array('pdpType','01.0-02.7','PDP type'),
		array('pdpAddress','04.0-19.7','PDP address'),//the byte3 is the length of the address 
		array('reliabilityClass','20.0-20.2','Reliability class'),
		array('delayClass','20.3-20.7','Delay class'),
		array('precedenceClass','21.0-21.3','Precedence class'),
		array('peakThroughput','21.4-21.7','Peak  throughput'),
		array('meanThroughput','22.0-22.7','Mean throughput'),
		array('vplmnAddressAllowedFlag','23.0-23.7','VPLMN Address Allowed Flag'),
		array('apn','24.0-55.7','APN'),
		array('ExtFlag','56.0-56.7','Ext Flag'),
		array('allocation_retentionPriority','57.0-57.7','Allocation/Retention Priority'),
		array('delivery_errSdus','58.0-58.2','Delivery err SDUs'),
		array('deliveryOrder','58.3-58.4','Delivery order'),
		array('trafficClass','58.5-58.7','Traffic class'),
		array('maximumSduSize','59.0-59.7','Maximum SDU size'),
		array('maximumRateuplinkRan','60.0-60.5','Maximum bit rate for uplink range(X)'),
		array('maximumRateuplinkBas','60.6-60.7','Maximum bit rate for uplink base'),
		array('maximumRatedownlinkRan','61.0-61.5','Maximum bit rate for downlink range(X)'),
		array('maximumRatedownlinkBas','61.6-61.7','Maximum bit rate for downlink base'),
		array('sduErrRatio','62.0-62.3','SDU error ratio'),
		array('residualErrRate','62.4-62.7','Residual Bit Error Rate'),
		array('trafficHandingPrior','63.0-63.1','Traffic handing priority'),
		array('transferDelay','63.2-63.7','Transfer delay'),
		array('guaranteedRateUplinkRan','64.0-64.5','Guaranteed bit rate uplink range(X)'),
		array('guaranteedRateUplinkBas','64.6-64.7','Guaranteed bit rate uplink base'),
		array('guaranteedRateDownlinkRan','65.0-65.5','Guaranteed bit rate downlink range(X)'),
		array('guaranteedRateDownlinkBas','65.6-65.7','Guaranteed bit rate downlink base'),
		array('sourceStatisticsDescriptor','66.0-66.3','Source statistics descriptor'),
		array('signallingIndication','66.4-66.4','Signalling Indication'),
		array('reserved','66.5-66.7','Reserved'),
		array('maximumRateDownlink','67.0-67.7','Maximum bit rate downlink(ext)'),
		array('guaranteedRateDownlink','68.0-68.7','Guaranteed bit rate downlinkr(ext)'),
		array('maximumRateUplink','69.0-69.7','Maximum bit rate uplink(ext)'),
		array('guaranteedRateUplink','70.0-70.7','Guaranteed bit rate uplink(ext)'),
		array('adress_len','03.0-03.7','adress_len')
);

$pdpPdpTypeDef=array(
		array('289','IPv4'),
		array('343','IPv6'),
		array('0','X.25')
);

$pdpPrecedenceClassDef=array(
		array('1','High'),
		array('2','Normal'),
		array('3','Low')
);

$pdpPeakThroughtputDef=array(
		array('1','8Kbps'),
		array('2','16Kbps'),
		array('3','32Kbps'),
		array('4','64Kbps'),
		array('5','128Kbps'),
		array('6','256Kbps'),
		array('7','512Kbps'),
		array('8','1024Kbps'),
		array('9','2048Kbps')
);

$pdpMeanThroughtputDef=array(
		array('1','100Bph'),
		array('2','200Bph'),
		array('3','500Bph'),
		array('4','1kBph'),
		array('5','2kBph'),
		array('6','5kBph'),
		array('7','10kBph'),
		array('8','20kBph'),
		array('9','50kBph'),
		array('10','100kBph'),
		array('11','200kBph'),
		array('12','500kBph'),
		array('13','1mBph'),
		array('14','2mBph'),
		array('15','5mBph'),
		array('16','10mBph'),
		array('17','20mBph'),
		array('18','50mBph'),
		array('31','Best Effort')
);

$pdpExtFlagDef=array(
		array('0','Non-included Ext'),
		array('1','Included Ext'),
		array('3','Included Ext and Ext2 only 1 octet'),
		array('7','Included Ext, Ext2'),
		array('15','Included Ext, Ext2, EXt3')
);

$DeliveryErrSDUsDef=array(
		array('1','No detect'),
		array('2','Err SDUs delilvered'),
		array('3','Err SDUs not delivered'),
		array('7','Reserved')
);

$deliveryOrderDef=array(
		array('1','delivery order'),
		array('2','no delivery order'),
		array('3','Reserved')
);

$trafficClassDef=array(
		array('1','Conversation class'),
		array('2','Streaming class'),
		array('3','Interactive class'),
		array('4','Background class'),
		array('7','Reserved')
);

$pdpMaximumSDUsizeDef=array(
		array('1','10 octexs'),
		array('20','200 octexs'),
		array('80','800 octexs'),
		array('100','1000 octexs'),
		array('148','1480 octexs'),
		array('150','1500 octexs'),
		array('151','1502 octexs'),
		array('152','1510 octexs'),
		array('153','1520 octexs'),
		array('255','Reserved')
);


$pdpMaximumDownlinkExtDef=array(
		array('0','<=8600kbps'),
		array('1','8700kbps'),
		array('74','16000kbps'),
		array('75','17Mbps'),
		array('186','128Mbps'),
		array('187','130Mbps'),
		array('250','256Mbps')
);

$pdpMaximumUplinkExtDef=array(
		array('0','<=8600kbps'),
		array('1','8700kbps'),
		array('74','16000kbps'),
		array('75','17Mbps'),
		array('186','128Mbps'),
		array('187','130Mbps'),
		array('250','256Mbps')
);

$pdpSduErrorRatioDef=array(
		array('1','1E-2'),
		array('2','7E-3'),
		array('3','1E-3'),
		array('4','1E-4'),
		array('5','1E-5'),
		array('6','1E-6'),
		array('7','1E-1'),
		array('15','Reserved')
);


$pdpResidualErrRateDef=array(
		array('1','5E-2'),
		array('2','1E-2'),
		array('3','5E-3'),
		array('4','4E-3'),
		array('5','1E-3'),
		array('6','1E-4'),
		array('7','1E-5'),
		array('8','1E-6'),
		array('9','6E-8'),
		array('15','Reserved')
);

$pdpTrafficHandingPriorityDef=array(
		array('1','level 1'),
		array('2','level 2'),
		array('3','level 3'),
		array('0','Reserved')
);

$pdpTransferDelayDef=array(
		array('0','X*10ms'),
		array('1','200ms+X*50ms'),
		array('2','1000ms+X*100ms'),
		array('3','2600ms+X*100ms'),
		array('63','Reserved')
);

$pdpRateDownUplinkBasDef=array(
		array('0','X*1Kbps'),
		array('1','64Kbps+(X*8Kbps)'),
		array('2','576Kbps+(X*64Kbps)'),
		array('3','4672Kbps+(X*64Kbps)')
);

$pdpRateDownUplinkRanDef=array(
		array('0','0'),
		array('1','1'),
		array('2','2'),
		array('3','3'),
		array('4','4'),
		array('5','5'),
		array('6','6'),
		array('7','7'),
		array('8','8'),
		array('9','9'),
		array('10','10'),
		array('11','11'),
		array('12','12'),
		array('13','13'),
		array('14','14'),
		array('15','15'),
		array('16','16'),
		array('17','17'),
		array('18','18'),
		array('19','19'),
		array('20','20'),
		array('21','21'),
		array('22','22'),
		array('23','23'),
		array('24','24'),
		array('25','25'),
		array('26','26'),
		array('27','27'),
		array('28','28'),
		array('29','29'),
		array('30','30'),
		array('31','31'),
		array('32','32'),
		array('33','33'),
		array('34','34'),
		array('35','35'),
		array('36','36'),
		array('37','37'),
		array('38','38'),
		array('39','39'),
		array('40','40'),
		array('41','41'),
		array('42','42'),
		array('43','43'),
		array('44','44'),
		array('45','45'),
		array('46','46'),
		array('47','47'),
		array('48','48'),
		array('49','49'),
		array('50','50'),
		array('51','51'),
		array('52','52'),
		array('53','53'),
		array('54','54'),
		array('55','55'),
		array('56','56'),
		array('57','57'),
		array('58','58'),
		array('59','59'),
		array('60','60'),
		array('61','61'),
		array('62','62'),
		array('63','63')		
);

$pdpGuaranteedUplinkExtDef=array(
		array('0','<=8600kbps'),
		array('1','8700kbps'),
		array('74','16000kbps'),
		array('75','17Mbps'),
		array('186','128Mbps'),
		array('187','130Mbps'),
		array('250','256Mbps')
);

$pdpGuaranteedDownlinkExtDef=array(
		array('0','<=8600kbps'),
		array('1','8700kbps'),
		array('74','16000kbps'),
		array('75','17Mbps'),
		array('186','128Mbps'),
		array('187','130Mbps'),
		array('250','256Mbps')
);

$pdpSignallingIndicationDef=array(
		array('0','Not optimised'),
		array('1','Optimised')
);

$pdpSourceStatisticsDescriptorDef=array(
		array('0','Spare'),
		array('1','Speech')
);



//==========================================================
//输入变量
//==========================================================
$canSetNum=$_REQUEST['canSetNum'];
$keyValue=$_REQUEST['keyValue'];
$subSysNo=$_REQUEST['subSysNo'];
$dataTypeNo=$_REQUEST['dataTypeNo'];

if ($_REQUEST['sysId'])
{
	$sysId =   $_REQUEST['sysId'];
	if($DEBUG) echo "<br>sysId=$sysId";
	$sysIdArr=explode('_',$sysId);
	$sysTypeNo=$sysIdArr[0];
	$sysNo=$sysIdArr[1];
	//	echo "sysTypeNo=$sysTypeNo,sysNo=$sysNo";
}

$canSetNum = isset($canSetNum)?$canSetNum:'all';
//显示用户数据编辑页面，需要的变量
if($DEBUG) echo "<br>sysId=$sysId";
if($DEBUG) echo "<br>canSetNum=$canSetNum";
if($DEBUG) echo "<br>keyValue=$keyValue";
if($DEBUG) echo "<br>sysTypeNo=$sysTypeNo";
if($DEBUG) echo "<br>sysNo=$sysNo";
if($DEBUG) echo "<br>subSysNo=$subSysNo";
if($DEBUG) echo "<br>dataTypeNo=$dataTypeNo";
//例如：
//$canSetNum =1; // 或= 'all'
//$sysId='330_0_0';
//$keyValue= '0460022157127016';

//操作类型变量
$isLoadIndex=$_REQUEST['isLoadIndex'];
$isTryCreate=$_REQUEST['isTryCreate'];
$isBatchCreate=$_REQUEST['isBatchCreate'];
$isCreate=$_REQUEST['isCreate'];
$isDelete=$_REQUEST['isDelete'];
$isChange=$_REQUEST['isChange'];
$isRead=$_REQUEST['isRead'];
$batchNum=$_REQUEST['batchNum'];
if($DEBUG) echo "<br>isRead=$isRead";
if($DEBUG) echo "<br>isChange=$isChange";
if($DEBUG) echo "<br>isCreate=$isCreate";
if($DEBUG) echo "<br>isDelete=$isDelete";
if($DEBUG) echo "<br>isLoadIndex=$isLoadIndex";

//保存用户数据修改的数据
$bgnNo=$_POST['bgnNo'];
$endNo=$_POST['endNo'];
if($DEBUG) echo "<br>bgnNo=$bgnNo";	
if($DEBUG) echo "<br>endNo=$endNo";	

//---------定义需要编辑保存的字段-------
$showAttrDef=array(
	array('fieldName'=>'imsi',			'inputName'=>'imsi'),	
	array('fieldName'=>'used_flag',		'inputName'=>'used_flag'),
	array('fieldName'=>'nam',			'inputName'=>'nam'),
	array('fieldName'=>'inter_msisdn',	'inputName'=>'interMsisdn'),
	array('fieldName'=>'fax_num',		'inputName'=>'faxNum'),	//add by arwean
	array('fieldName'=>'data_num',		'inputName'=>'dataNum'),	//add by arwean
	array('fieldName'=>'category',		'inputName'=>'category'),
	array('fieldName'=>'sub_status',	'inputName'=>'sub_status'),
	array('fieldName'=>'odb_general',	'inputName'=>'odb_general'),
	array('fieldName'=>'odb_specific','inputName'=>'odb_specific'),
	array('fieldName'=>'camel_flag',	'inputName'=>'camel_flag'),
	array('fieldName'=>'rszi',			'inputName'=>'rszi'),
	array('fieldName'=>'csr_type',		'inputName'=>'csr_type'),
	array('fieldName'=>'clip_state',	'inputName'=>'clip_state'),
	array('fieldName'=>'bc_type',		'inputName'=>'bc_type'),  //add by arwean
	array('fieldName'=>'clir_state',	'inputName'=>'clir_state'),
	array('fieldName'=>'colp_state',	'inputName'=>'colp_state'),
	array('fieldName'=>'colr_state',	'inputName'=>'colr_state'),
	array('fieldName'=>'passwd',		'inputName'=>'passwd'),
	array('fieldName'=>'baoc_state',	'inputName'=>'baoc_state'),
	array('fieldName'=>'boic_state',	'inputName'=>'boic_state'),
	array('fieldName'=>'boichc_state',	'inputName'=>'boichc_state'),
	array('fieldName'=>'baic_state',	'inputName'=>'baic_state'),
	array('fieldName'=>'bicroam_state',	'inputName'=>'bicroam_state'),
	array('fieldName'=>'cfu_state',		'inputName'=>'cfu_state'),
	array('fieldName'=>'cfu_num',		'inputName'=>'cfuNumber'),
	array('fieldName'=>'cfb_state',		'inputName'=>'cfb_state'),
	array('fieldName'=>'cfb_num',		'inputName'=>'cfbNumber'),
	array('fieldName'=>'cfnry_state',	'inputName'=>'cfnry_state'),
	array('fieldName'=>'cfnry_num',		'inputName'=>'cfnryNumber'),
	array('fieldName'=>'cfnry_time',	'inputName'=>'cfnry_time'),
	array('fieldName'=>'cfnrc_state',	'inputName'=>'cfnrc_state'),
	array('fieldName'=>'cfnrc_num',		'inputName'=>'cfnrcNumber'),
	array('fieldName'=>'callwait_state','inputName'=>'callwait_state'),
	array('fieldName'=>'callhold_state','inputName'=>'callhold_state'),
	array('fieldName'=>'ect_state',		'inputName'=>'ect_state'),
	array('fieldName'=>'mtpy_state',	'inputName'=>'mtpy_state'),
	array('fieldName'=>'emlpp_state',	'inputName'=>'emlpp_state'),
	array('fieldName'=>'emlpp_max_priority',		'inputName'=>'emlpp_max_priority'),
	array('fieldName'=>'emlpp_def_priority',		'inputName'=>'emlpp_def_priority'),
	array('fieldName'=>'gprs_flag',		'inputName'=>'gprs_flag'),
	array('fieldName'=>'pdp1',			'inputName'=>'pdp_1'),
	array('fieldName'=>'pdp2',			'inputName'=>'pdp_2'),
	array('fieldName'=>'pdp3',			'inputName'=>'pdp_3'),
	array('fieldName'=>'user_name',		'inputName'=>'user_name'),
	array('fieldName'=>'subs_option',	'inputName'=>'subs_option'),
	array('fieldName'=>'tele_data',		'inputName'=>'tele_data'),
	array('fieldName'=>'user_certifiacate','inputName'=>'user_certifiacate')
);
//如果fieldName和inputName相等，则不用做附加处理
//否则，需要根据这个变量的值来做一些附加处理，例如电话号码的前补91后补E,或是一些复选框的合并

//检查各个需要编辑的输入单元
//For operation log use
{
	$used_flag_def=array(
		"00"=>"Disable","0"=>"Disable",
		"01"=>"Enable","1"=>"Enable"
	);
	$nam_def=array(
		"00"=>"Both","0"=>"Both",
		"01"=>"Non-GPRS only","1"=>"Non-GPRS only",
		"02"=>"GPRS only","2"=>"GPRS only"
	);
	$category_def=array(
		"00"=>"Unknown","0"=>"Unknown",
		"01"=>"French language","1"=>"French language",
		"02"=>"English language","2"=>"English language",
		"03"=>"German language","3"=>"German language",
		"04"=>"Russian language","4"=>"Russian language",
		"05"=>"Spanish language","5"=>"Spanish language",
		"0A"=>"Ordinary",
		"0B"=>"Subscriber with priority"
	);
	
	$sub_status_def=array(
		"00"=>"Service granted","0"=>"Service granted",
		"01"=>"Operator determined","1"=>"Operator determined"
	);
	
	$csr_type_def=array(
		"00"=>"00","0"=>"00",
		"01"=>"01","1"=>"01",
		"02"=>"02","2"=>"02",
		"03"=>"03","3"=>"03",
		"04"=>"04","4"=>"04",
		"05"=>"05","5"=>"05",
		"06"=>"06","6"=>"06",
		"07"=>"07","7"=>"07",
		"255"=>"No restriction","FF"=>"No restriction"
	);
		
	$faxIdVar_def=array(
		"1"=>"01","2"=>"02",
		"3"=>"03","4"=>"04",
		"5"=>"05","6"=>"06",
		"7"=>"07","8"=>"08",
		"9"=>"09","10"=>"10",
		"11"=>"11","12"=>"12",
		"13"=>"13","14"=>"14",
		"15"=>"15","15"=>"15"
	);

	$subs_option_def=array(
		"00"=>"Service provider","0"=>"Service provider",
		"01"=>"Subscriber using password","1"=>"Subscriber using password",
		"02"=>"Subscriber not using password","2"=>"Subscriber not using password"
	);
	
	$emlpp_priority_def=array(
		"06"=>"Level A","6"=>"Level A",
		"05"=>"Level B","5"=>"Level B",
		"00"=>"Level 0","0"=>"Level 0",
		"01"=>"Level 1","1"=>"Level 1",
		"02"=>"Level 2","2"=>"Level 2",
		"03"=>"Level 3","3"=>"Level 3",
		"04"=>"Level 4","4"=>"Level 4"
	);
	
	$gprs_flag_def=array(
		"00"=>"Disable","0"=>"Disable",
		"01"=>"Enable","1"=>"Enable"
	);
	
	$pdp_type_def=array(
		"289"=>"IPv4",
		"343"=>"IPv6",
		"0"=>"X.25"
	);
	
	$reliabilityClass_def=array(
		"01"=>"1","1"=>"1",
		"02"=>"2","2"=>"2",
		"03"=>"3","3"=>"3",
		"04"=>"4","4"=>"4",
		"05"=>"5","5"=>"5"
	);
	
	$delayClass_def=array(
		"01"=>"1","1"=>"1",
		"02"=>"2","2"=>"2",
		"03"=>"3","3"=>"3",
		"04"=>"4","4"=>"4"
	);
	
	$allocationRetentionPriority_def=array(
		"01"=>"1","1"=>"1",
		"02"=>"2","2"=>"2",
		"03"=>"3","3"=>"3",
		"04"=>"4","4"=>"4"		
	);
	
	$precedenceClass_def=array(
		"01"=>"High","1"=>"High",
		"02"=>"Normal","2"=>"Normal",
		"03"=>"Low","3"=>"Low"
	);
	
	$peakThroughput_def=array(
		"01"=>"8Kbps","1"=>"8Kbps",
		"02"=>"16Kbps","2"=>"16Kbps",
		"03"=>"32Kbps","3"=>"32Kbps",
		"04"=>"64Kbps","4"=>"64Kbps",
		"05"=>"128Kbps","5"=>"128Kbps",
		"06"=>"256Kbps","6"=>"256Kbps",
		"07"=>"512Kbps","7"=>"512Kbps",
		"08"=>"1024Kbps","8"=>"1024Kbps",
		"09"=>"2048Kbps","9"=>"2048Kbps"
	);
	
	$meanThroughput_def=array(
		"1"=>"100Bph",
		"2"=>"200Bph",
		"3"=>"500Bph",
		"4"=>"1kBph",
		"5"=>"2kBph",
		"6"=>"5kBph",
		"7"=>"10kBph",
		"8"=>"20kBph",
		"9"=>"50kBph",
		"10"=>"100kBph",
		"11"=>"200kBph",
		"12"=>"500kBph",
		"13"=>"1mBph",
		"14"=>"2mBph",
		"15"=>"5mBph",
		"16"=>"10mBph",
		"17"=>"20mBph",
		"18"=>"50mBph",
		"31"=>"Best Effort"
	);
	
	$vplmnAddressAllowedFlag_def=array(
	 "00"=>"Not allowed","0"=>"Not allowed",
	 "01"=>"Allowed","1"=>"Allowed"
	);
}

$logFieldDef=array(
	'used_flag',
	'nam',
	'interMsisdn',
	'faxNum',
	'dataNum',
	'category',
	'sub_status',
	'odb_general',
	'odb_specific',
	'tele_data',
	'rszi_0',
	'rszi_1',
	'rszi_2',
	'rszi_3',
	'rszi_4',
	'rszi_5',
	'rszi_6',
	'rszi_7',
	'rszi_8',
	'rszi_9',
	'csr_type',
	'clip_state',
	'faxIdVar',
	'dataIdVar',
	'clir_state',
	'colp_state',
	'colr_state',
	'subs_option',
	'passwd',
	'baoc_state',
	'boic_state',
	'boichc_state',
	'baic_state',
	'bicroam_state',
	'cfu_state',
	'cfuNumber',
	'cfb_state',
	'cfbNumber',
	'cfnry_state',
	'cfnryNumber',
	'cfnry_time',
	'cfnrc_state',
	'cfnrcNumber',
	'callwait_state',
	'callhold_state',
	'ect_state',
	'mtpy_state',
	'emlpp_state',
	'emlpp_max_priority',
	'emlpp_def_priority',
	'camel_flag',
	'gprs_flag',
	'pdpFlag_1',
	'pdpType_1',
	'pdpAddress_1',
	'reliabilityClass_1',
	'delayClass_1',
	'precedenceClass_1',
	'peakThroughput_1',
	'meanThroughput_1',
	'vplmnAddressAllowedFlag_1',
	'apn_1',
	'ext_flag_1',
	'allocation_retentionPriority_1',
	'delivery_err_sdus_1',
	'delivery_order_1',
	'traffic_class_1',
	'maximumSDUsize_1',
	'maximumRateUplinkRan_1',
	'maximumRateUplinkBas_1',
	'maximumRateDownlinkRan_1',
	'maximumRateDownlinkBas_1',
	'sduErrorRatio_1',
	'residualErrRate_1',
	'trafficHandingPriority_1',
	'transferDelay_1',
	'guaranteedRateUplinkRan_1',
	'guaranteedRateUplinkBas_1',
	'guaranteedRateDownlinkRan_1',
	'guaranteedRateDownlinkBas_1',
	'sourceStatisticsDescriptor_1',
	'signallingIndication_1',
	'reserved_1',
	'maximumDownlinkExt_1',
	'guaranteedRateDownlinkExt_1',
	'maximumUplink_1',
	'guaranteedUplinkExt_1',
	'pdpFlag_2',
	'pdpType_2',
	'pdpAddress_2',
	'reliabilityClass_2',
	'delayClass_2',
	'precedenceClass_2',
	'peakThroughput_2',
	'meanThroughput_2',
	'vplmnAddressAllowedFlag_2',
	'apn_2',
	'ext_flag_2',
	'allocation_retentionPriority_2',
	'delivery_err_sdus_2',
	'delivery_order_2',
	'traffic_class_2',
	'maximumSDUsize_2',
	'maximumRateUplinkRan_2',
	'maximumRateUplinkBas_2',
	'maximumRateDownlinkRan_2',
	'maximumRateDownlinkBas_2',
	'sduErrorRatio_2',
	'residualErrRate_2',
	'trafficHandingPriority_2',
	'transferDelay_2',
	'guaranteedRateUplinkRan_2',
	'guaranteedRateUplinkBas_2',
	'guaranteedRateDownlinkRan_2',
	'guaranteedRateDownlinkBas_2',
	'sourceStatisticsDescriptor_2',
	'signallingIndication_2',
	'reserved_2',
	'maximumDownlinkExt_2',
	'guaranteedRateDownlinkExt_2',
	'maximumUplink_2',
	'guaranteedUplinkExt_2',
	'pdpFlag_3',
	'pdpType_3',
	'pdpAddress_3',
	'reliabilityClass_3',
	'delayClass_3',
	'precedenceClass_3',
	'peakThroughput_3',
	'meanThroughput_3',
	'vplmnAddressAllowedFlag_3',
	'apn_3',
	'ext_flag_3',
	'allocation_retentionPriority_3',
	'delivery_err_sdus_3',
	'delivery_order_3',
	'traffic_class_3',
	'maximumSDUsize_3',
	'maximumRateUplinkRan_3',
	'maximumRateUplinkBas_3',
	'maximumRateDownlinkRan_3',
	'maximumRateDownlinkBas_3',
	'sduErrorRatio_3',
	'residualErrRate_3',
	'trafficHandingPriority_3',
	'transferDelay_3',
	'guaranteedRateUplinkRan_3',
	'guaranteedRateUplinkBas_3',
	'guaranteedRateDownlinkRan_3',
	'guaranteedRateDownlinkBas_3',
	'sourceStatisticsDescriptor_3',
	'signallingIndication_3',
	'reserved_3',
	'maximumDownlinkExt_3',
	'guaranteedRateDownlinkExt_3',
	'maximumUplink_3',
	'guaranteedUplinkExt_3',
	'user_certifiacate',
	'user_name'
);
if($_SERVER['REQUEST_METHOD'] == "POST"){
	//system("echo '-------------------------------------'>>/tmp/test.txt");
	$pre_keyvalue = $_POST['pre_keyvalue'];
	$log_sysTypeName = $_POST['log_sysTypeName'];
	$log_sysNo = $_POST['log_sysNo'];
	$log_subSysNo = $_POST['log_subSysNo'];
	$preValueInfo="Change $pre_keyvalue ";
	$isChangeFlag=0;
	for($i=0;$i<sizeof($logFieldDef);$i++){
		$inputName	=$logFieldDef[$i];
		$inputValue	=${$inputName};
		$ppName=$inputName."_ppvalue";
		$ddName=$inputName."_ddef";
		$cdName=$inputName."_cdef";
		$nnName=$inputName."_name";
		$tmpv=$_POST[$ppName];
		$tmpd=$_POST[$ddName];
		$tmpc=$_POST[$cdName];
		$tmpn=$_POST[$nnName];
		if(strlen($inputValue)){
			//echo "<br>$inputName	= $inputValue";
			if(isset($$ddName))
			{
				$tmpv=$$ppName;
				$val1=${$$ddName}[$tmpv];
				$val2=${$$ddName}[$inputValue];
				if(strlen($$ppName) == 0)
					$val1="NoValue";
				
				if(strcasecmp($val1,$val2) != 0)
				{
					$isChangeFlag=1;
					$preValueInfo.="[{$$nnName},{$val1}->{$val2}]";
					//system("echo '[{$$nnName},{$val1}->{$val2}]' >>/tmp/test.txt");
				}
			}
			else if(isset($$cdName))
			{
				$newValue="";
				for($iii=0;$iii<sizeof(${$$cdName});$iii++)
				{
					$chkname=${$$cdName}[$iii][0];
					if($$chkname == '1')
						$newValue.=${$$cdName}[$iii][2].",";
				}
				$newValue=substr($newValue,0,strlen($newValue)-1);
				if(strcasecmp($$ppName,$newValue) != 0)
				{
					$isChangeFlag=1;
					$preValueInfo.="[{$$nnName},({$$ppName})->({$newValue})]";
					//system("echo '[{$$nnName},({$$ppName})->({$newValue})]' >>/tmp/test.txt");
				}
			}
			else
			{
				if(strlen($$ppName) == 0)
					$$ppName="NoValue";
				if(strcasecmp($$ppName,$inputValue) != 0)
				{
					$isChangeFlag=1;
					$preValueInfo.="[{$$nnName},{$$ppName}->$inputValue]";
					//system("echo '[{$$nnName},{$$ppName}->$inputValue]'>>/tmp/test.txt");
				}
			}
		}else{
			//echo "<br>Can not find $inputName's value";
		}
	}
	if($isChangeFlag==1)
	{
		$preValueInfo.=" in {$log_sysTypeName}_{$log_sysNo}_{$log_subSysNo}";
		insertLog($preValueInfo);
	}
}


//处理各个的输入单元的值，组成各个需要编辑的字段值
if($_SERVER['REQUEST_METHOD'] == "POST"){
	if($isCreate){
		//$imsi
		$imsi=$_POST['imsi'];
		for($i=strlen($imsi);$i<16;$i++){
			$imsi='0'.$imsi;
		}
	}
    $used_flag = $_POST['used_flag'];
    $nam = $_POST['nam'];
	//inter_msisdn
	$interMsisdn = $_POST['interMsisdn'];
//	echo "interMsisdn=$interMsisdn ";
	$inter_msisdn	= encodeTelNumber($interMsisdn);
	//fax_num
	$faxNum = $_POST['faxNum'];
	$fax_num = encodeTelNumber($faxNum);
	//data_num
	//$data_num = $_POST['dataNum'];
	//$dataNum = encodeTelNumber($data_num);
	$dataNum = $_POST['dataNum'];
	$data_num =  encodeTelNumber($dataNum);
	//categor
	$category = $_POST['category'];
	//odb_status
	$sub_status = $_POST['sub_status'];
	//odb_general
	$odb_general = $_POST['odb_general'];
	$orgValue=$odb_general;
	for($i=0;$i<sizeof($odbGeneralDef);$i++){
		$inputName	=$odbGeneralDef[$i][0];
		$inputValue	=$_POST[$inputName];
		if($DEBUG)
			echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$inputOffset=$odbGeneralDef[$i][1];
		if($DEBUG) echo "<br>setBitValue($orgValue,$inputOffset,$inputValue)";
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$odb_general=$orgValue;
	
	//odb_specific
	$odb_specific = $_POST['odb_specific'];
	$orgValue=$odb_specific;
	
	for($i=0;$i<sizeof($odbSpecificDef);$i++){
		$inputName	=$odbSpecificDef[$i][0];
		//$inputValue	=${$inputName};
		$inputValue	=$_POST[$inputName];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$inputOffset=$odbSpecificDef[$i][1];
		if($DEBUG) echo "<br>setBitValue($orgValue,$inputOffset,$inputValue)";
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$odb_specific=$orgValue;
	
	// camel_flag
	$camel_flag=$_POST['camel_flag'];
	//cfu_state
	$cfu_state = $_POST['cfu_state'];
	$orgValue=$cfu_state;
	for($i=0;$i<sizeof($cfuStateDef);$i++){
		$inputName	=$cfuStateDef[$i][0];
		//$inputValue	=${$inputName};
		$inputValue	=$_POST[$inputName];
		$inputOffset=$cfuStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$cfu_state=$orgValue;

	//cfb_state
	$cfb_state = $_POST['cfb_state'];
	$orgValue=$cfb_state;
	for($i=0;$i<sizeof($cfbStateDef);$i++){
		$inputName	=$cfbStateDef[$i][0];
		//$inputValue	=${$inputName};
		$inputValue	=$_POST[$inputName];
		$inputOffset=$cfbStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$cfb_state=$orgValue;

	//cfnry_state
	$cfnry_state = $_POST['cfnry_state'];
	$orgValue=$cfnry_state;
	for($i=0;$i<sizeof($cfnryStateDef);$i++){
		$inputName	=$cfnryStateDef[$i][0];
		//$inputValue	=${$inputName};
		$inputValue	=$_POST[$inputName];
		$inputOffset=$cfnryStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$cfnry_state=$orgValue;
	//cfnry_time
	$cfnry_time = $_POST['cfnry_time'];
	//cfb_state
	$cfnrc_state = $_POST['cfnrc_state'];
	$orgValue=$cfnrc_state;
	for($i=0;$i<sizeof($cfnrcStateDef);$i++){
		$inputName	=$cfnrcStateDef[$i][0];
		//$inputValue	=${$inputName};
		$inputValue	=$_POST[$inputName];
		$inputOffset=$cfnrcStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$cfnrc_state=$orgValue;

	//baoc_state
	$baoc_state = $_POST['baoc_state'];
	$orgValue=$baoc_state;
	for($i=0;$i<sizeof($baocStateDef);$i++){
		$inputName	=$baocStateDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$baocStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$baoc_state=$orgValue;

	//boic_state
	$boic_state = $_POST['boic_state'];
	$orgValue=$boic_state;
	for($i=0;$i<sizeof($boicStateDef);$i++){
		$inputName	=$boicStateDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$boicStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$boic_state=$orgValue;

	//boicEx_state
	$boichc_state = $_POST['boichc_state'];
	$orgValue=$boichc_state;
	for($i=0;$i<sizeof($boicExStateDef);$i++){
		$inputName	=$boicExStateDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$boicExStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$boichc_state=$orgValue;

	//baic_state
	$baic_state = $_POST['baic_state'];
	$orgValue=$baic_state;
	for($i=0;$i<sizeof($baicStateDef);$i++){
		$inputName	=$baicStateDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$baicStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$baic_state=$orgValue;

	//bic-roam
	$bicroam_state = $_POST['bicroam_state'];
	$orgValue=$bicroam_state;
	for($i=0;$i<sizeof($bicroamStateDef);$i++){
		$inputName	=$bicroamStateDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$bicroamStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$bicroam_state=$orgValue;

	//Call waiting state
	$callwait_state = $_POST['callwait_state'];
	$orgValue=$callwait_state;
	for($i=0;$i<sizeof($callWaitingStateDef);$i++){
		$inputName	=$callWaitingStateDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$callWaitingStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$callwait_state=$orgValue;
	
	//Call hold state
	$callhold_state = $_POST['callhold_state'];
	$orgValue=$callhold_state;
	for($i=0;$i<sizeof($callHoldStateDef);$i++){
		$inputName	=$callHoldStateDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$callHoldStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$callhold_state=$orgValue;

	//ECT state
	$ect_state = $_POST['ect_state'];
	$orgValue=$ect_state;
	for($i=0;$i<sizeof($ectStateDef);$i++){
		$inputName	=$ectStateDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$ectStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$ect_state=$orgValue;

	//MTPY state
	$mtpy_state = $_POST['mtpy_state'];
	$orgValue=$mtpy_state;
	for($i=0;$i<sizeof($mtpyStateDef);$i++){
		$inputName	=$mtpyStateDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$mtpyStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$mtpy_state=$orgValue;
	
	//emlpp state
	$emlpp_state = $_POST['emlpp_state'];
	$orgValue=$emlpp_state;
	for($i=0;$i<sizeof($emlppStateDef);$i++){
		$inputName	=$emlppStateDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$emlppStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$emlpp_state=$orgValue;
	
	//emlpp_max_priority
	$emlpp_max_priority= $_POST['emlpp_max_priority'];
	//emlpp_def_priority
	$emlpp_def_priority = $_POST['emlpp_def_priority'];
	//Tele service
	$tele_data = $_POST['tele_data'];
	$orgValue=$tele_data;	
	for($i=0;$i<sizeof($teleDataDef);$i++){
		$inputName	=$teleDataDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$teleDataDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$tele_data=$orgValue;
	//csr_type
	$csr_type = $_POST['csr_type'];
	//CLIP
	$clip_state = $_POST['clip_state'];
	$orgValue=$clip_state;
	for($i=0;$i<sizeof($clipStateDef);$i++){
		$inputName	=$clipStateDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$clipStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$clip_state=$orgValue;

	//Bearer capability type (Add by Arwean)
	$dataIdVar = $_POST['dataIdVar'];
	$faxIdVar = $_POST['faxIdVar'];
	$bc_type = dechex($dataIdVar) . dechex($faxIdVar);	
	
	//CLIR
	$clir_state = $_POST['clir_state'];
	$orgValue=$clir_state;
	for($i=0;$i<sizeof($clirStateDef);$i++){
		$inputName	=$clirStateDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$clirStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$clir_state=$orgValue;

	//COLP
	$colp_state = $_POST['colp_state'];
	$orgValue=$colp_state;
	for($i=0;$i<sizeof($colpStateDef);$i++){
		$inputName	=$colpStateDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$colpStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$colp_state=$orgValue;

	//COLR
	$colr_state = $_POST['colr_state'];
	$orgValue=$colr_state;
	for($i=0;$i<sizeof($colrStateDef);$i++){
		$inputName	=$colrStateDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$colrStateDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	} 
	$colr_state=$orgValue;
	
	//call barring passwd option
	$subs_option = $_POST['subs_option'];
	//passwd
	$passwd= $_POST['passwd'];
	//camel_flag
	$camel_flag = $_POST['camel_flag'];
	$orgValue=$camel_flag;
	for($i=0;$i<sizeof($CamelFlagDef);$i++){
		$inputName	=$CamelFlagDef[$i][0];
		$inputValue	=$_POST[$inputName];
		$inputOffset=$CamelFlagDef[$i][1];
		if($DEBUG) echo "<br>$inputName	= $inputValue";
		if(strlen($inputValue) == 0){
			$inputValue=0;
		}
		$orgValue=setBitValue($orgValue,$inputOffset,$inputValue);
	}
	$camel_flag=$orgValue;
	
	$gprs_flag = $_POST['gprs_flag'];
	//RSZI
	$rszi = "";
	for($i=0;$i<10;$i++){
	//	$tmp = ${"rszi_".$i};
		$tmp = $_POST["rszi_".$i];
	//	echo "rszi[$i] = $tmp ";
		if($tmp < 16){
			$tmp = "0".dechex($tmp);
		}else{
			$tmp = dechex($tmp);
		}
		$rszi = $rszi.$tmp;
	}

	$cfuNumber = $_POST['cfuNumber'];
	$cfbNumber = $_POST['cfbNumber'];
	$cfnryNumber = $_POST['cfnryNumber'];
	$cfnrcNumber = $_POST['cfnrcNumber'];
	$cfu_num	= encodeTelNumber($cfuNumber);
	$cfb_num	= encodeTelNumber($cfbNumber);
	$cfnry_num	= encodeTelNumber($cfnryNumber);
	$cfnrc_num	= encodeTelNumber($cfnrcNumber);

	//pdp context(group 1)
	$k=0;
	do 
	{
	${$pdpContextDef[$k][0].'_1'}=$_POST[$pdpContextDef[$k][0]."_1"];
	${$pdpContextDef[$k][0].'_2'}=$_POST[$pdpContextDef[$k][0]."_2"];
	${$pdpContextDef[$k][0].'_3'}=$_POST[$pdpContextDef[$k][0]."_3"];
//	echo "$k:${$pdpContextDef[$k][0].'_1'} ";
	$k++;
	}while ($k<36);
	
	$orgValue="";
	$i=0;
	$orgValue=$orgValue.omc_keep_length(${$pdpContextDef[$i][0].'_1'},"0","2","0");
	$i++;

	//echo "<br>xxx=$orgValue";
	$user_name = $_POST['user_name'];
	$user_certifiacate = $_POST['user_certifiacate'];
	
	$tmpValue="0000";
	$tmpValue=setBitValue($tmpValue,"0.0-1.7",DECHEX(${$pdpContextDef[$i][0].'_1'}));
	
	$tmpValue=omc_keep_length($tmpValue,"0","4","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	//echo "<br>xxx=$orgValue";
	//debug_log("/tmp/debug.txt","orgValue=$orgValue");

	if(${$pdpContextDef[$i-1][0].'_1'}==289){
		$tmpValue="04";
		$tmpValueArr=explode(".",${$pdpContextDef[$i][0].'_1'});
		$iplen=sizeof($tmpValueArr);
		for($j=0;$j<sizeof($tmpValueArr);$j++){
			$tmpValue_1=omc_keep_length(DECHEX($tmpValueArr[$j]),"0","2","1");
			$tmpValue=$tmpValue.$tmpValue_1;
		}
		if($iplen != 4)
			$tmpValue="0000000000";
	}else if(${$pdpContextDef[$i-1][0].'_1'}==343){
		$tmpValue="10";
		$tmpValueArr=explode(":",${$pdpContextDef[$i][0].'_1'});
		for($j=0;$j<sizeof($tmpValueArr);$j++){
			$tmpValue_1=omc_keep_length($tmpValueArr[$j],"0","4","1");
			$tmpValue=$tmpValue.$tmpValue_1;
		}
	}else{
		$tmpValue=strlen(${$pdpContextDef[$i][0].'_1'})/2;
		$tmpLenArr=explode(".",$tmpValue);
		$tmpValue=$tmpLenArr[0];
		
		$tmpValue=omc_keep_length($tmpValue,"0","2","1");
		$tmpValue=$tmpValue.${$pdpContextDef[$i][0].'_1'};
	}
	//debug_log("/tmp/debug.txt","tmpValue=$tmpValue");
	$tmpValue=omc_keep_length($tmpValue,"E","34","0");
	//debug_log("/tmp/debug.txt","tmpValue=$tmpValue");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	//echo "<br>xxx=$orgValue";
/*
	$orgValue=$orgValue.${$pdpContextDef[$i+1][0].'_1'};
	$i++;
	//echo "<br>xxx=$orgValue";

	$orgValue=$orgValue.${$pdpContextDef[$i-1][0].'_1'};
	$i++;
	//echo "<br>xxx=$orgValue";
*/
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_1'}),'0',3);
	//echo "<br>tmpBinValue=$tmpBinValue";
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_1'}),'0',3);
	$i++;
	//echo "<br>tmpBinValue=$tmpBinValue";
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;

	$orgValue=$orgValue.${$pdpContextDef[$i+1][0].'_1'};
	$i++;
	//echo "<br>xxx=$orgValue";

	$orgValue=$orgValue.${$pdpContextDef[$i-1][0].'_1'};
	$i++;
	//echo "<br>xxx=$orgValue";
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_1'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	//echo "<br>xxx=$orgValue";
	
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_1'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	//echo "<br>xxx=$orgValue";
	
	$tmpValue="";
	$tmpValue_1=${$pdpContextDef[$i][0].'_1'};
	for($j=0;$j<strlen(${$pdpContextDef[$i][0].'_1'});$j++){
		$tmpValue_2=omc_keep_length(DECHEX(ord($tmpValue_1[$j])),"0","2","1");
		$tmpValue.=$tmpValue_2;
	}
	$tmpValue=omc_keep_length($tmpValue,"0","64","0");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	//ext flag
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_1'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i][0].'_1'}),'0',3);
	$i++;
	//echo "<br>tmpBinValue=$tmpBinValue";
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;

	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+2][0].'_1'}),'0',3);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i][0].'_1'}),'0',2);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-2][0].'_1'}),'0',3);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
 
 	//Maximum SDU size
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_1'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	//Maximum bit rate for uplink
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_1'}),'0',2);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_1'}),'0',6);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Maximum bit rate for downlink
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_1'}),'0',2);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_1'}),'0',6);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Residual Bit Error Rate ,SDU error ratio
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_1'}),'0',4);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_1'}),'0',4);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	// Transfer delay ,Traffic handing priority
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_1'}),'0',6);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_1'}),'0',2);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Guaranteed bit rate uplink
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_1'}),'0',2);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_1'}),'0',6);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Guaranteed bit rate downlink
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_1'}),'0',2);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_1'}),'0',6);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Reserved,Signalling Indication,Source Statistics Descriptor
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+2][0].'_1'}),'0',3);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i][0].'_1'}),'0',1);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-2][0].'_1'}),'0',4);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Maximum bit rate downlink (ext)
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_1'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	//Guaranteed bit rate downlink (ext)
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_1'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	//Maximum bit rate uplink (ext)
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_1'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	//Guaranteed bit rate uplink (ext)
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_1'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$pdp1=$orgValue;
	//echo "<br>xxx=$orgValue";
	//exit();

	//pdp context(group 2)
	$orgValue="";
	$i=0;
	$orgValue=$orgValue.omc_keep_length(${$pdpContextDef[$i][0].'_2'},"0","2","0");
	$i++;

	//echo "<br>xxx=$orgValue";
	
	$tmpValue="0000";
	$tmpValue=setBitValue($tmpValue,"0.0-1.7",DECHEX(${$pdpContextDef[$i][0].'_2'}));
	
	$tmpValue=omc_keep_length($tmpValue,"0","4","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	//echo "<br>xxx=$orgValue";
	

	if(${$pdpContextDef[$i-1][0].'_2'}==289){
		$tmpValue="04";
		$tmpValueArr=explode(".",${$pdpContextDef[$i][0].'_2'});
		$iplen=sizeof($tmpValueArr);
		for($j=0;$j<sizeof($tmpValueArr);$j++){
			$tmpValue_1=omc_keep_length(DECHEX($tmpValueArr[$j]),"0","2","1");
			$tmpValue=$tmpValue.$tmpValue_1;
		}
		if($iplen != 4)
			$tmpValue="0000000000";
	}else if(${$pdpContextDef[$i-1][0].'_2'}==343){
		$tmpValue="10";
		$tmpValueArr=explode(":",${$pdpContextDef[$i][0].'_2'});
		for($j=0;$j<sizeof($tmpValueArr);$j++){
			$tmpValue_1=omc_keep_length($tmpValueArr[$j],"0","4","1");
			$tmpValue=$tmpValue.$tmpValue_1;
		}
	}else{
		$tmpValue=strlen(${$pdpContextDef[$i][0].'_2'})/2;
		$tmpLenArr=explode(".",$tmpValue);
		$tmpValue=$tmpLenArr[0];
		$tmpValue=omc_keep_length($tmpValue,"0","2","1");
		$tmpValue=$tmpValue.${$pdpContextDef[$i][0].'_2'};
	}
	$tmpValue=omc_keep_length($tmpValue,"E","34","0");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	//echo "<br>xxx=$orgValue";
/*
	$orgValue=$orgValue.${$pdpContextDef[$i+1][0].'_2'};
	$i++;
	//echo "<br>xxx=$orgValue";

	$orgValue=$orgValue.${$pdpContextDef[$i-1][0].'_2'};
	$i++;
	//echo "<br>xxx=$orgValue";
*/
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_2'}),'0',3);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_2'}),'0',3);
	$i++;
	//echo "tmpBinValue=$tmpBinValue";
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;

	$orgValue=$orgValue.${$pdpContextDef[$i+1][0].'_2'};
	$i++;
	//echo "<br>xxx=$orgValue";

	$orgValue=$orgValue.${$pdpContextDef[$i-1][0].'_2'};
	$i++;
	//echo "<br>xxx=$orgValue";
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_2'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	//echo "<br>xxx=$orgValue";
	
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_2'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	//echo "<br>xxx=$orgValue";
	
	$tmpValue="";
	$tmpValue_1=${$pdpContextDef[$i][0].'_2'};
	for($j=0;$j<strlen(${$pdpContextDef[$i][0].'_2'});$j++){
		$tmpValue_2=omc_keep_length(DECHEX(ord($tmpValue_1[$j])),"0","2","1");
		$tmpValue.=$tmpValue_2;
	}
	$tmpValue=omc_keep_length($tmpValue,"0","64","0");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	//ext flag
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_2'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i][0].'_2'}),'0',3);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;

	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+2][0].'_2'}),'0',3);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i][0].'_2'}),'0',2);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-2][0].'_2'}),'0',3);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
 
 	//Maximum SDU size
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_2'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	//Maximum bit rate for uplink
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_2'}),'0',2);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_2'}),'0',6);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Maximum bit rate for downlink
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_2'}),'0',2);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_2'}),'0',6);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Residual Bit Error Rate ,SDU error ratio
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_2'}),'0',4);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_2'}),'0',4);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	// Transfer delay ,Traffic handing priority
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_2'}),'0',6);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_2'}),'0',2);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Guaranteed bit rate uplink
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_2'}),'0',2);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_2'}),'0',6);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Guaranteed bit rate downlink
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_2'}),'0',2);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_2'}),'0',6);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Reserved,Signalling Indication,Source Statistics Descriptor
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+2][0].'_2'}),'0',3);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i][0].'_2'}),'0',1);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-2][0].'_2'}),'0',4);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Maximum bit rate downlink (ext)
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_2'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	//Guaranteed bit rate downlink (ext)
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_2'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	//Maximum bit rate uplink (ext)
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_2'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	//Guaranteed bit rate uplink (ext)
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_2'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$pdp2=$orgValue;
	//echo "<br>xxx=$orgValue";
	
	//exit();


	//pdp context(group 3)
	$orgValue="";
	$i=0;
	$orgValue=$orgValue.omc_keep_length(${$pdpContextDef[$i][0].'_3'},"0","2","0");
	
	$i++;

	//echo "<br>xxx=$orgValue";
	
	$tmpValue="0000";
	$tmpValue=setBitValue($tmpValue,"0.0-1.7",DECHEX(${$pdpContextDef[$i][0].'_3'}));	
	$tmpValue=omc_keep_length($tmpValue,"0","4","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	//echo "<br>xxx=$orgValue";
	

	$tmpValue="";
	if(${$pdpContextDef[$i-1][0].'_3'}==289){
		$tmpValue="04";
		$tmpValueArr=explode(".",${$pdpContextDef[$i][0].'_3'});
		$iplen=sizeof($tmpValueArr);
		for($j=0;$j<sizeof($tmpValueArr);$j++){
			$tmpValue_1=omc_keep_length(DECHEX($tmpValueArr[$j]),"0","2","1");
			$tmpValue=$tmpValue.$tmpValue_1;
		}
		if($iplen != 4)
			$tmpValue="0000000000";
	}else if(${$pdpContextDef[$i-1][0].'_3'}==343){
		$tmpValue="10";
		$tmpValueArr=explode(":",${$pdpContextDef[$i][0].'_3'});
		for($j=0;$j<sizeof($tmpValueArr);$j++){
			$tmpValue_1=omc_keep_length($tmpValueArr[$j],"0","4","1");
			$tmpValue=$tmpValue.$tmpValue_1;
		}
	}else{
		$tmpValue=strlen(${$pdpContextDef[$i][0].'_3'})/2;
		$tmpLenArr=explode(".",$tmpValue);
		$tmpValue=$tmpLenArr[0];
		$tmpValue=omc_keep_length($tmpValue,"0","2","1");
		$tmpValue=$tmpValue.${$pdpContextDef[$i][0].'_3'};
	}
	$tmpValue=omc_keep_length($tmpValue,"E","34","0");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	//echo "<br>xxx=$orgValue";
/*
	$orgValue=$orgValue.${$pdpContextDef[$i+1][0].'_3'};
	$i++;
	//echo "<br>xxx=$orgValue";

	$orgValue=$orgValue.${$pdpContextDef[$i-1][0].'_3'};
	$i++;
	//echo "<br>xxx=$orgValue";
*/
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_3'}),'0',3);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_3'}),'0',3);
	$i++;
	//echo "tmpBinValue=$tmpBinValue";
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	//echo "<br>xxx=$orgValue";
	//exit();

	$orgValue=$orgValue.${$pdpContextDef[$i+1][0].'_3'};
	$i++;
	//echo "<br>xxx=$orgValue";

	$orgValue=$orgValue.${$pdpContextDef[$i-1][0].'_3'};
	$i++;
	//echo "<br>xxx=$orgValue";
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_3'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	//echo "<br>xxx=$orgValue";
	
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_3'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	//echo "<br>xxx=$orgValue";
	
	$tmpValue="";
	$tmpValue_1=${$pdpContextDef[$i][0].'_3'};
	for($j=0;$j<strlen(${$pdpContextDef[$i][0].'_3'});$j++){
		$tmpValue_2=omc_keep_length(DECHEX(ord($tmpValue_1[$j])),"0","2","1");
		$tmpValue.=$tmpValue_2;
	}
	$tmpValue=omc_keep_length($tmpValue,"0","64","0");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	//ext flag
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_3'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i][0].'_3'}),'0',3);
	$i++;
	//echo "<br>tmpBinValue=$tmpBinValue";
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;

	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+2][0].'_3'}),'0',3);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i][0].'_3'}),'0',2);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-2][0].'_3'}),'0',3);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
 
 	//Maximum SDU size
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_3'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	//Maximum bit rate for uplink
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_3'}),'0',2);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_3'}),'0',6);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Maximum bit rate for downlink
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_3'}),'0',2);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_3'}),'0',6);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Residual Bit Error Rate ,SDU error ratio
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_3'}),'0',4);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_3'}),'0',4);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	// Transfer delay ,Traffic handing priority
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_3'}),'0',6);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_3'}),'0',2);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Guaranteed bit rate uplink
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_3'}),'0',2);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_3'}),'0',6);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Guaranteed bit rate downlink
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+1][0].'_3'}),'0',2);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-1][0].'_3'}),'0',6);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Reserved,Signalling Indication,Source Statistics Descriptor
	$tmpBinValue=omc_keep_length(decbin(${$pdpContextDef[$i+2][0].'_3'}),'0',3);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i][0].'_3'}),'0',1);
	$i++;
	$tmpBinValue=$tmpBinValue.omc_keep_length(decbin(${$pdpContextDef[$i-2][0].'_3'}),'0',4);
	$i++;
	$tmpHexValue=omc_keep_length(dechex(bindec($tmpBinValue)),'0',2);
	$orgValue=$orgValue.$tmpHexValue;
	
	//Maximum bit rate downlink (ext)
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_3'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	//Guaranteed bit rate downlink (ext)
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_3'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	//Maximum bit rate uplink (ext)
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_3'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	$i++;
	
	//Guaranteed bit rate uplink (ext)
	$tmpValue=omc_keep_length(DECHEX(${$pdpContextDef[$i][0].'_3'}),"0","2","1");
	$orgValue=$orgValue.$tmpValue;
	
	$pdp3=$orgValue;
	//echo "<br>xxx=$orgValue";
	
	//exit();

/*
	//找出原有的各个字段的值，来比较，确定各个字段是否改变
	$oldDateSql="SELECT * FROM HLR_DB.subscriberData WHERE imsi='$imsi'";
	$result=@mysql_db_query('HLR_DB',$oldDateSql);
	echo mysql_error();
	$rows=@mysql_fetch_array($result);
*/
	//格式化每个需要保存的字段，以便数据处理模块处理
	$bgnNo=0;
	$endNo=0;
	for($i=$bgnNo;$i<sizeof($showAttrDef);$i++){
		$tmpFieldName = $showAttrDef[$i]['fieldName'];
/*
		//比较是否改变
		if(${$tmpFieldName} == $rows[$tmpFieldName]){
			if($DEBUG) echo "<br>tmpFieldName not change!";
			continue;
		}		
*/		
		$tmp_dataNum = $_POST['tmp_dataNum'];
		$tmp_faxNum = $_POST['tmp_faxNum'];
		$tmp_interMsisdn = $_POST['tmp_interMsisdn'];
		//echo "$tmp_dataNum, $tmp_faxNum, $tmp_interMsisdn<br>";
		//echo "$dataNum,$faxNum,$interMsisdn<br>";
		if($tmp_interMsisdn==$interMsisdn && $i==3)
			continue;
		if($tmp_faxNum==$faxNum && $i==4)		
			continue;
		if($tmp_dataNum==$dataNum && $i==5)
			continue;	
		
		${'checkBox_'.$endNo} =1;
		${'fieldName_'.$endNo}=$tmpFieldName;
		${'editValue_'.$endNo}=${$tmpFieldName};
		if($DEBUG) echo "<br>checkBox_$endNo	= ${'checkBox_'.$endNo}";
		if($DEBUG) echo "<br>fieldName_$endNo	= ${'fieldName_'.$endNo}";
		if($DEBUG) echo "<br>editValue_$endNo	= ${'editValue_'.$endNo}";
		$endNo++;
		if($canSetNum != 'all' && $endNo > $canSetNum){
			break;
		}
	}
	//if($DEBUG) exit();
}
//==========================================================
//数据处理
//==========================================================
if (1 == $_REQUEST['isLoadIndex']) {
	$fieldNameList		= "imsi,inter_msisdn,fax_num,data_num,used_flag,nam,camel_flag";
} else {
	$fieldNameList		= "ALL";
}
if ($DEBUG) echo "fieldNameList=$fieldNameList<br>";
$DEBUG=0;
?>
<base target="_self">
<body leftmargin="15" rightmargin="10" onload="javascript:adjust_frame('down');" onresize="javascript:adjust_frame('down');" style="overflow:hidden;overflow-x:hidden;overflow-y:hidden;">
<?php
require("../pubSubsMng/sendComm.inc");
require("../pubSubsMng/dataProc.inc");

//==========================================================
//输出并显示数据
//==========================================================
$seqNo=0;
?>

<?php
adjust_head_frame("down");
adjust_title_head_frame("down");
adjust_title_tail_frame("down");

adjust_content_head_frame("down");	
echo "<br>";
//**********************************编辑参数时所用javascript*****************************************
?>
<script LANGUAGE="JavaScript">
function selCheckBox(thisCheckBox)
{
	if(thisCheckBox.checked == true){
		thisCheckBox.value=1;
	}else{
		thisCheckBox.value=0;
	}
}

function selectlimit(id1,id2)
{
	var val1=document.getElementById(id1).value;
	var val2=document.getElementById(id2).value;
		if(val1 == 63)
		{     		     
			if(val2 == 3)
			{			
				var r=confirm("The value you choose means 0kbps. Do you want to continue?");
				if (r==false)
				{
					document.getElementById(id1).value=0;
					document.getElementById(id2).value=0;
				}	
			}
		} 
		else if(val2 == 3)
		{
			if(val1 == 63)
			{			
				var r=confirm("The value you choose means 0kbps. Do you want to continue?");
				if (r==false)
				{
					document.getElementById(id1).value=0;
					document.getElementById(id2).value=0;
				}
			}
		}    
		
	}

function askSureToDel(keyName,keyId)
{
	var answer = confirm("Are you sure to delete this subscriber( "+keyName+"="
                          + keyId + ")?");
    if (answer == true){
		window.location.href = "<?php echo "$PHP_SELF?sysId=$sysId&dataTypeNo=$dataTypeNo&bufferNo=$bufferNo&keyValue=$keyValue&isDelete=1";?>";
		//alert('Try to send delete command');
	}else{
		return(false);
	}
}

function askSureToReplace(keyName,keyId)
{
	var answer = confirm("Are you sure to replace this subscriber's IMSI( "+keyName+"="
                          + keyId + ")?");
    if (answer == true){
		//var newKey = prompt("Please Input the new "+keyName+":","");
		//var check = confirm("Please confirm "+keyName+" replace \n Old:"+keyId
		//							+"\n     ->    \n New:"+ newKey + "?");
		//return(false);
		window.location.href = "<?php echo "$PHP_SELF?sysId=$sysId&dataTypeNo=$dataTypeNo&bufferNo=$bufferNo&keyValue=$keyValue&isReplaceIndex=1";?>";
	}else{
		return(false);
	}
}
</script>
<form method="POST" name="update" action="<?php echo"$PHP_SELF";?>" >
  <?php
	//显示用户参数编辑页面
	?>
  <table border="0" cellpadding="0" cellspacing="0" width="100%">
    <tr>
	<td><nobr>
	<?php echo "Server Id:"?>
	<select name="sysId" size="1">
	<?php
	$selSysIdSql="SELECT sysNo,subSysNo,sysTypeName 
				FROM sysInfo,sysConf 
				WHERE sysInfo.sysTypeNo='$sysTypeNo' AND sysConf.sysTypeNo='$sysTypeNo'
				ORDER BY baseStat DESC,updateTime DESC
				";
	if($DEBUG) echo "<br>$selSysIdSql";
	$sysIdResult=mysqli_query($pubConn,$selSysIdSql);
	echo mysqli_error($pubConn);
	while($sysIdRows=mysqli_fetch_array($sysIdResult)){
		echo "<option value=\"$sysTypeNo"."_$sysIdRows[sysNo]"."_$sysIdRows[subSysNo]\"";
		if(($sysNo == $sysIdRows[sysNo]) && ($subSysNo == $sysIdRows[subSysNo]))
			echo " selected";
		echo " >$sysIdRows[sysTypeName]"."_$sysIdRows[sysNo]"."_$sysIdRows[subSysNo]";
		echo "</option>";
	}
	?>
	</select>
	</nobr>
	</td>  
	<td><nobr>
	<?php
	if(!isset($isTryCreate)||$isTryCreate <= 0){
		//$showkeyValue= substr($keyValue,1); -redis
		$showkeyValue= $keyValue;
		$keyValueName='IMSI';
		echo "&nbsp;&nbsp;$keyValueName:$showkeyValue";
	}
	?>
	
	</nobr></td>
	<?php 
	if($isTryCreate > 0){	
		if($isBatchCreate> 0){
		?>
			<TD><NOBR>
				&nbsp;&nbsp;&nbsp;
				Batch amount(<=100):<input type="text" name="batchNum" class="text"  maxlength="3" size="3">
			</NOBR></TD>
		<?php 
		}
		?>
		<td >
		<?php
			if($canwrite_flag)
				echo "<input type=\"submit\" value=\"Create in $sysTypeName\" name=\"create\" title=\"\" class=\"button\" onClick=\"javascript:document.update.isCreate.value=1;\">";
			else
				echo "<input type=\"submit\" disabled value=\"Create in $sysTypeName\" name=\"create\" title=\"\" class=\"button\" onClick=\"javascript:document.update.isCreate.value=1;\">";
		?>
		<input type="hidden" value="0" name="isCreate">
		<input type="hidden" value="0" name="isChange">
		<input type="hidden" value="<?php echo "$isBatchCreate"; ?>" name="isBatchCreate">
		</td>
		<?php
			$myPrivilege = $userInfo[privilege];
			if($myPrivilege >=4){
		?>
		<td>
		<input type="submit" value="Create in OMC" name="create" title=""  class="button" onClick="javascript:document.update.isCreate.value=2;">
		</td>
		<?php
			}
		?>
	<?php
	}else{
	?>
		<td>
		
		<input type="submit" value="Get" name="read" title=""  class="button" onClick="javascript:document.update.isRead.value=1;">

		<input type="hidden" value="0" name="isRead">
		</td>

		<td>
		<?php
		if($canwrite_flag)
			echo "<input type=\"submit\" value=\"Set\" name=\"change\" title=\"\"  class=\"button\" onClick=\"javascript:document.update.isChange.value=1;\">";
		else
			echo "<input type=\"submit\" disabled value=\"Set\" name=\"change\" title=\"\"  class=\"button\" onClick=\"javascript:document.update.isChange.value=1;\">";
		?>
		<input type="hidden" value="0" name="isChange">
		<input type="hidden" value="0" name="isCreate">
		</td>
		
		<td>
		<?php
		if($canwrite_flag)
			echo "<input type=\"button\" value=\"Delete\" name=\"delete\" title=\"Delete this subscriber\"  class=\"button\" onClick=\"askSureToDel('$keyValueName','$keyValue');\">";
		else
			echo "<input type=\"button\" disabled value=\"Delete\" name=\"delete\" title=\"Delete this subscriber\"  class=\"button\" onClick=\"askSureToDel('$keyValueName','$keyValue');\">";
		?>
		<input type="hidden" value="0" name="isDelete">
		</td>

		<td>
		<?php
		if($canwrite_flag)
			echo "<input type=\"button\" value=\"Replace IMSI\" name=\"replace\" title=\"Replace this subscriber's IMSI\"  class=\"button\" onClick=\"askSureToReplace('$keyValueName','$keyValue');\">";
		else
			echo "<input type=\"button\" disabled value=\"Replace IMSI\" name=\"replace\" title=\"Replace this subscriber's IMSI\"  class=\"button\" onClick=\"askSureToReplace('$keyValueName','$keyValue');\">";
		?>
		<input type="hidden" value="0" name="isReplaceIndex">
		</td>

	<?php
	}
	?>
  <td width="100%">&nbsp;</td>
  </tr>  
</table>
<br>
<?php
//将已取出的用户数据显示出来
//$tmpRow[fieldName]
?>
<table border="1" width="100%" cellpadding="2" cellspacing="0"  bordercolor="#666666" bordercolordark="#FFFFFF" bgcolor="#FFFFFF">    
<tr bgcolor="#E6E6E6"> 
<td width="5%"> No.</td>   
<td width="25%">Name</td>   
<td width="20%">Value</td>     
<td width="50%">Description</td>    
</tr>
<?php

if($isTryCreate > 0){
	//imsi
	$imsi=$tmpRow[imsi];
	echo "\n <tr>";
	echo "<td> $seqNo </td>";
	$seqNo++;
	if($isBatchCreate > 0)
		echo "<td>Start IMSI</td>";
	else
		echo "<td>IMSI</td>";
	echo "<td>";
	echo "<input type=\"text\" name=\"imsi\" maxlength=\"15\" size=\"18\" value=\"$imsi\" class=\"text\">";
	echo "</td>";
	echo "<td>IMSI=MCC+MNC+MSIN<br>";		
	echo "MCC=mobile country code, MNC=mobile network code, MSIN=mobile subscriber identity number.<br>";
	echo "</td>";
	echo "</tr>";
}else{
	//修改用户数据时不能将这个数据给hlr
	//echo "<input type=\"hidden\" name=\"imsi\" value=\"$keyValue\">";
}

echo "<input type=\"hidden\" name=\"log_sysTypeName\" value=\"$sysTypeName\">";
echo "<input type=\"hidden\" name=\"log_sysNo\" value=\"$sysNo\">";
echo "<input type=\"hidden\" name=\"log_subSysNo\" value=\"$subSysNo\">";
echo "<input type=\"hidden\" name=\"pre_keyvalue\" value=\"{$keyValue}'s\">";

//imsi flag
$used_flag=$tmpRow[used_flag];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>IMSI flag</td>";
echo "<td>";
if('01' == $used_flag){
	echo "<input type=\"radio\" name=\"used_flag\" value=\"01\" checked>Enable";
	echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ";
	echo "<input type=\"radio\" name=\"used_flag\" value=\"00\">Disable";
}else{
	echo "<input type=\"radio\" name=\"used_flag\" value=\"01\">Enable";
	echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ";
	echo "<input type=\"radio\" name=\"used_flag\" value=\"00\" checked>Disable";
}
echo "</td>";
echo "<input type=\"hidden\" name=\"used_flag_name\" value=\"IMSI flag\">";
echo "<input type=\"hidden\" name=\"used_flag_ppvalue\" value=\"$used_flag\">";
echo "<input type=\"hidden\" name=\"used_flag_ddef\" value=\"used_flag_def\">";
echo "<td>Enable or disable IMSI. ";
echo "Disable means all services turned off";
echo "</td>";
echo "</tr>";

//network access mode
$nam = $tmpRow[nam];
$namDef=array(
		array('00','Both'),
		array('01','Non-GPRS only'),
		array('02','GPRS only'),
		);
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>Network access mode</td>";
echo "<td>";
echo "<select name='nam' size=1>";
for($i=0;$i<sizeof($namDef);$i++){
	if($namDef[$i][0] == hexdec($nam)){
		echo "<option value='$i' selected>{$namDef[$i][1]}</option>";
	}else{
		echo "<option value='$i'>{$namDef[$i][1]}</option>";
	}
}
echo "</td>";
echo "<input type=\"hidden\" name=\"nam_name\" value=\"Network access mode\">";
echo "<input type=\"hidden\" name=\"nam_ppvalue\" value=\"$nam\">";
echo "<input type=\"hidden\" name=\"nam_ddef\" value=\"nam_def\">";
echo "<td>Define what kind of network supported</td>";
echo "</tr>";

//Inter MSISDN
$interMsisdn=$tmpRow[inter_msisdn];
//$interMsisdn=decodeTelNumber($interMsisdn);
$tmp_interMsisdn=$interMsisdn;
echo "<input type=\"hidden\" name=\"tmp_interMsisdn\" maxlength=\"16\" size=\"18\" value=\"$tmp_interMsisdn\" class=\"text\">";
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
if($isBatchCreate > 0)
	echo "<td>Start MSISDN</td>";
else
	echo "<td>MSISDN</td>";

echo "<td>";
echo "<input type=\"text\" name=\"interMsisdn\" maxlength=\"16\" size=\"18\" value=\"$interMsisdn\" class=\"text\">";
echo "</td>";
echo "<input type=\"hidden\" name=\"interMsisdn_name\" value=\"MSISDN\">";
echo "<input type=\"hidden\" name=\"interMsisdn_ppvalue\" value=\"$interMsisdn\">";
echo "<td>Mobile station international ISDN number, MSISDN=CC+NDC+SN<br>";
echo "CC=country code, NDC=national domestic code, SN=subscriber phone number";
echo "</td>";
echo "</tr>";

//Fax number (add by Arwean)
$faxNum=$tmpRow[fax_num];
$faxNum=decodeTelNumber($faxNum);
$tmp_faxNum = $faxNum;
if($isTryCreate>0)
	$faxNum='';
echo "<input type=\"hidden\" name=\"tmp_faxNum\" maxlength=\"18\" size=\"18\" value=\"$tmp_faxNum\" class=\"text\">";
echo "\n<tr>";
	echo "<td> $seqNo </td>";
	$seqNo++;
	echo "<td> Fax number </td>";
	echo "<td>";
		echo "<input type=\"text\" name=\"faxNum\" maxlength=\"18\" size=\"18\" value=\"$faxNum\" class=\"text\">";
	echo "</td>";
	echo "<input type=\"hidden\" name=\"faxNum_name\" value=\"Fax number\">";
	echo "<input type=\"hidden\" name=\"faxNum_ppvalue\" value=\"$faxNum\">";
	echo "<td>";
		echo "ISDN number plan + ISDN number <br>ISDN=CC+NDC+SN=subscriber phone number<br>CC=country code, NDC=national domestic code";		
	echo "</td>";
echo "</tr>";

//Data number
$dataNum=$tmpRow[data_num];
$dataNum=decodeTelNumber($dataNum);
$tmp_dataNum = $dataNum;
if($isTryCreate>0)
	$dataNum='';

echo "<input type=\"hidden\" name=\"tmp_dataNum\" maxlength=\"18\" size=\"18\" value=\"$tmp_dataNum\" class=\"text\">";
echo "\n<tr>";
	echo "<td> $seqNo </td>";
	$seqNo++;
	echo "<td> Data number </td>";
	echo "<td>";
		echo "<input type=\"text\" name=\"dataNum\" maxlength=\"18\" size=\"18\" value=\"$dataNum\" class=\"text\">";
	echo "</td>";
	echo "<input type=\"hidden\" name=\"dataNum_name\" value=\"Data number\">";
	echo "<input type=\"hidden\" name=\"dataNum_ppvalue\" value=\"$dataNum\">";
	echo "<td>";
		echo "ISDN number plan + ISDN number <br>ISDN=CC+NDC+SN=subscriber phone number<br>CC=country code, NDC=national domestic code";		
	echo "</td>";
echo "</tr>";

//(end add by Arwean)


//Category
$category=$tmpRow[category];
$categoryDef=array(
		array('00','Unknown'),
		array('01','French language'),
		array('02','English language'),
		array('03','German language'),
		array('04','Russian language'),
		array('05','Spanish language'),
		array('0A','Ordinary'),
		array('0B','Subscriber with priority'),
		);
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>Category</td>";
echo "<td>";
echo "<select  name=\"category\" size=\"1\">";
for($i=0;$i<sizeof($categoryDef);$i++){
	if($categoryDef[$i][0] == $category){
		echo "<option value=\"{$categoryDef[$i][0]}\" selected>{$categoryDef[$i][1]}</option>";
	}else{
		echo "<option value=\"{$categoryDef[$i][0]}\" >{$categoryDef[$i][1]}</option>";
	}
}
echo "</select>";
echo "</td>";
echo "<input type=\"hidden\" name=\"category_name\" value=\"Category\">";
echo "<input type=\"hidden\" name=\"category_ppvalue\" value=\"$category\">";
echo "<input type=\"hidden\" name=\"category_ddef\" value=\"category_def\">";
echo "<td>Calling party defined in ISUP. Default is Ordinary</td>";
echo "</tr>";

//ODB status
$sub_status=$tmpRow[sub_status];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>ODB status</td>";
echo "<td>";
echo "<select  name=\"sub_status\" size=\"1\">";
if($sub_status > '0'){
	echo "<option value=\"00\" >service granted</option>";
	echo "<option value=\"01\" selected>operator determined</option>";
}else{
	echo "<option value=\"00\"  selected>Service granted</option>";
	echo "<option value=\"01\" >Operator determined</option>";
}
echo "</select>";
echo "</td>";
echo "<input type=\"hidden\" name=\"sub_status_name\" value=\"ODB status\">";
echo "<input type=\"hidden\" name=\"sub_status_ppvalue\" value=\"$sub_status\">";
echo "<input type=\"hidden\" name=\"sub_status_ddef\" value=\"sub_status_def\">";
echo "<td>A flag indicating whether a subscriber is subject to operator determined barring. ";
echo "Default is service granted";
echo "</td>";
echo "</tr>";

//ODB general data
$odbGeneral=$tmpRow[odb_general];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>ODB general data</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"odb_general\" value=\"$odbGeneral\">";
for($i=0;$i<sizeof($odbGeneralDef);$i++){
	$value=getBitValue($odbGeneral,$odbGeneralDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$odbGeneralDef[$i][0]}\"	 onClick=selCheckBox(this) value=\"1\" checked  >{$odbGeneralDef[$i][2]}</nobr><br>";
		$preValue.="{$odbGeneralDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$odbGeneralDef[$i][0]}\"	 onClick=selCheckBox(this) value=\"0\" >{$odbGeneralDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"odb_general_name\" value=\"ODB general data\">";
echo "<input type=\"hidden\" name=\"odb_general_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"odb_general_cdef\" value=\"odbGeneralDef\">";
echo "<td>BAOC (Barring of all outgoing calls)";
echo "<br>BOIC (Barring of all outgoing international calls)";
echo "<br>BOIC-HPLMN (ODB BOIC except those directed to home PLMN)";
echo "<br>BPRIC (Bar of premium rate (information) call)";
echo "<br>BPREC (Bar of premium rate (entertainment) call)";
echo "<br>BASS (Bar of supplementary service access)";
echo "<br>BAIC (Barring of all incoming calls)";
echo "<br>BAIC-ROAM (ODB BAIC when roaming outside home PLMN)";
echo "<br>Roaming (Barring of roaming outside home PLMN)";
echo "<br>Roaming CT (Barring of roaming outside home PLMN country)";
echo "</td>";
echo "</tr>";

//ODB specific data
$odbSpecific=$tmpRow[odb_specific];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>ODB specific data</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"odb_specific\" value=\"$odbSpecific\">";
for($i=0;$i<sizeof($odbSpecificDef);$i++){
	$value=getBitValue($odbSpecific,$odbSpecificDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$odbSpecificDef[$i][0]}\"	 onClick=selCheckBox(this) value=\"1\" checked  >{$odbSpecificDef[$i][2]}</nobr><br>";
		$preValue.="{$odbSpecificDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$odbSpecificDef[$i][0]}\"	 onClick=selCheckBox(this) value=\"0\" >{$odbSpecificDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"odb_specific_name\" value=\"ODB specific data\">";
echo "<input type=\"hidden\" name=\"odb_specific_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"odb_specific_cdef\" value=\"odbSpecificDef\">";
echo "<td>Operator Specific Barring (OSB)<br>";
echo "</td>";
echo "</tr>";

//Tele service
$tele_data=$tmpRow[tele_data];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>Tele service</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"tele_data\" value=\"$tele_data\">";
for($i=0;$i<sizeof($teleDataDef);$i++){
	$value=getBitValue($tele_data,$teleDataDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$teleDataDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$teleDataDef[$i][2]}</nobr><br>";
		$preValue.="{$teleDataDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$teleDataDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$teleDataDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"tele_data_name\" value=\"Tele service\">";
echo "<input type=\"hidden\" name=\"tele_data_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"tele_data_cdef\" value=\"teleDataDef\">";
echo "<td>Default=all services turn on.</td>";
echo "</tr>";

//RSZI LIST
$rszi=$tmpRow[rszi];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>RSZI list</td>";
echo "<td>";
for($i=0;$i<10;$i++){
	$value = substr($rszi,$i*2,2);
	$value = hexdec($value);
	if($i<10)
		echo "RSZI0$i";
	else
		echo "RSZI$i";
	echo "<input class=text name='rszi_$i' value='$value' size=3>";
	echo "<input type=\"hidden\" name=\"rszi_{$i}_name\" value=\"RSZI{$i}\">";
	echo "<input type=\"hidden\" name=\"rszi_{$i}_ppvalue\" value=\"$value\">";
	if ($i%2==1){
		echo "<br>";
	}else{
		echo "&nbsp;&nbsp;&nbsp;&nbsp;";
	}
}

//echo "<input class=text name=rszi value='$rszi' size=16>";
echo "</td>";
echo "<td>Regional subscription zone identity list. A PLMN specific regional subscription defines unambiguously for the entire PLMN the region in which roaming is allowed.</td>";
echo "</tr>";

//CSRR TYPE
$csr_type=$tmpRow[csr_type];
$cstTypeDef=array(
		array('00','00'),
		array('01','01'),
		array('02','02'),
		array('03','03'),
		array('04','04'),
		array('05','05'),
		array('06','06'),
		array('07','07'),
		array('255','No restriction')
);
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>CSRR type</td>";
echo "<td>";
echo "<select name='csr_type' size=1>";
for($i=0;$i<sizeof($cstTypeDef);$i++){
	if($i == (sizeof($cstTypeDef)-1)){
		$nVal	= FF;
	}else{
		$nVal	= $i;
	}
	if($cstTypeDef[$i][0] == hexdec($csr_type)){
		echo "<option value='$nVal' selected>{$cstTypeDef[$i][1]}</option>";
	}else{
		echo "<option value='$nVal'>{$cstTypeDef[$i][1]}</option>";
	}
}
echo "</td>";
echo "<input type=\"hidden\" name=\"csr_type_name\" value=\"CSRR type\">";
echo "<input type=\"hidden\" name=\"csr_type_ppvalue\" value=\"$csr_type\">";
echo "<input type=\"hidden\" name=\"csr_type_ddef\" value=\"csr_type_def\">";
echo "<td>Define 8 CSRR (county specific roaming restrictions) types' attribute to confine the international roaming range of a subscriber.Each CSRR defines roaming restrictions for 256 VPLMNs.There are 8 CSRR combination types.</td>";
echo "</tr>";

//CLIP
$clip_state=$tmpRow[clip_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>CLIP state</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"clip_state\" value=\"$clip_state\">";
for($i=0;$i<sizeof($clipStateDef);$i++){
	$value=getBitValue($clip_state,$clipStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$clipStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$clipStateDef[$i][2]}</nobr><br>";
		$preValue.="{$clipStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$clipStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$clipStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"clip_state_name\" value=\"CLIP state\">";
echo "<input type=\"hidden\" name=\"clip_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"clip_state_cdef\" value=\"clipStateDef\">";
echo "<td>Calling line identification presentation state, set on called party<br>Provisioned=Called party displays caller number (given caller party set CLIR as Not provisioned)<br>Not provisioned=Called party does not display caller number</td>";
echo "</tr>";

//Bearer capability type (add by Arwean)
//echo "bc_type:" . $tmpRow[bc_type];
$bc_type = $tmpRow[bc_type];
$dataIdVar = substr($bc_type,0,1);
$faxIdVar = substr($bc_type,1,1);
$faxIdDf=array(
				array('0','00'),
				array('1','01'),
				array('2','02'),
				array('3','03'),
				array('4','04'),
				array('5','05'),
				array('6','06'),
				array('7','07'),
				array('8','08'),
				array('9','09'),
				array('10','10'),
				array('11','11'),
				array('12','12'),
				array('13','13'),
				array('14','14'),
				array('15','15')
				);
				
$dataIdDf=array(
				array('0','00'),
				array('1','01'),
				array('2','02'),
				array('3','03'),
				array('4','04'),
				array('5','05'),
				array('6','06'),
				array('7','07'),
				array('8','08'),
				array('9','09'),
				array('10','10'),
				array('11','11'),
				array('12','12'),
				array('13','13'),
				array('14','14'),
				array('15','15')
				);				
echo "\n<tr>";
	echo "<td> $seqNo </td>";
	$seqNo++;
	echo "<td> BC type </td>";
	echo "<td>";		
		echo "GsmBC id for fax : ";
		echo "<select name='faxIdVar' size=1>";
		for($i=0;$i<sizeof($faxIdDf);$i++)
		{			
			if($faxIdDf[$i][0] == hexdec($faxIdVar))
			{
				echo "<option value='$i' selected>{$faxIdDf[$i][1]}</option>";
			}
			else
			{
				echo "<option value='$i'>{$faxIdDf[$i][1]}</option>";
			}
		}
		echo "</select>";
		echo "<br>";
		$tmpValue=hexdec($faxIdVar);
		echo "<input type=\"hidden\" name=\"faxIdVar_name\" value=\"GsmBC id for fax\">";
		echo "<input type=\"hidden\" name=\"faxIdVar_ppvalue\" value=\"$tmpValue\">";
		echo "<input type=\"hidden\" name=\"faxIdVar_ddef\" value=\"faxIdVar_def\">";
		
		echo "GsmBC id for data: ";
		echo "<select name='dataIdVar' size=1>";
		for($i=0;$i<sizeof($dataIdDf);$i++)
		{			
			if($dataIdDf[$i][0] == hexdec($dataIdVar))
			{
				echo "<option value='$i' selected>{$dataIdDf[$i][1]}</option>";
			}
			else
			{
				echo "<option value='$i'>{$dataIdDf[$i][1]}</option>";
			}
		}
		echo "</select>";
		$tmpValue=hexdec($dataIdVar);
		echo "<input type=\"hidden\" name=\"dataIdVar_name\" value=\"GsmBC id for data\">";
		echo "<input type=\"hidden\" name=\"dataIdVar_ppvalue\" value=\"$tmpValue\">";
		echo "<input type=\"hidden\" name=\"dataIdVar_ddef\" value=\"faxIdVar_def\">";
		
	echo "</td>";
	echo "<td>";
		echo "Define 16 BC(Bearer Capability) type's attribution respectively for fax's and data's  GsmBC id ";		
	echo "</td>";
echo "</tr>";

//(end add by Arwean)


//CLIR
$clir_state=$tmpRow[clir_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>CLIR state</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"clir_state\" value=\"$clir_state\">";
for($i=0;$i<sizeof($clirStateDef);$i++){
	$value=getBitValue($clir_state,$clirStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$clirStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$clirStateDef[$i][2]}</nobr><br>";
		$preValue.="{$clirStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$clirStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$clirStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"clir_state_name\" value=\"CLIR state\">";
echo "<input type=\"hidden\" name=\"clir_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"clir_state_cdef\" value=\"clirStateDef\">";
echo "<td>Calling line identification restriction state, set on caller party<br>Provisioned=called party does not display caller number<br>Not provisioned=caller party displays caller number (given called party set CLIP as Provisioned)</td>";
echo "</tr>";

//COLP
$colp_state=$tmpRow[colp_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>COLP state</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"colp_state\" value=\"$colp_state\">";
for($i=0;$i<sizeof($colpStateDef);$i++){
	$value=getBitValue($colp_state,$colpStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$colpStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$colpStateDef[$i][2]}</nobr><br>";
		$preValue.="{$colpStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$colpStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$colpStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"colp_state_name\" value=\"CLOP state\">";
echo "<input type=\"hidden\" name=\"colp_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"colp_state_cdef\" value=\"colpStateDef\">";
echo "<td>Connected line identification presentation state, set on caller party<br>Provisioned=caller party displays called number including forwarded number (given called party set COLR as Not provsioned)<br>Not provisioned=caller party does not display called number</td>";
echo "</tr>";

//COLR
$colr_state=$tmpRow[colr_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>COLR state</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"colr_state\" value=\"$colr_state\">";
for($i=0;$i<sizeof($colrStateDef);$i++){
	$value=getBitValue($colr_state,$colrStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$colrStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$colrStateDef[$i][2]}</nobr><br>";
		$preValue.="{$colrStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$colrStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$colrStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"colr_state_name\" value=\"CLOR state\">";
echo "<input type=\"hidden\" name=\"colr_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"colr_state_cdef\" value=\"colrStateDef\">";
echo "<td>Connected line identification restriction state, set on called party<br>Provisioned=caller party does not display called number<br>Not provisioned=caller party displays called number (given caller party set COLP as provisioned)</td>";
echo "</tr>";

//Call barring subscription
$subs_option=$tmpRow[subs_option];
$subsOptionDef=array(
		array('00','Service provider'),
		array('01','Subscriber using password'),
		array('02','Subscriber not using password')
		);
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>Call barring subscription</td>";
echo "<td>";
echo "<select name='subs_option' size=1>";
for($i=0;$i<sizeof($subsOptionDef);$i++){
	if($subsOptionDef[$i][0] == hexdec($subs_option)){
		echo "<option value='$i' selected>{$subsOptionDef[$i][1]}</option>";
	}else{
		echo "<option value='$i'>{$subsOptionDef[$i][1]}</option>";
	}
}
echo "</td>";
$tmpValue=hexdec($subs_option);
echo "<input type=\"hidden\" name=\"subs_option_name\" value=\"Call barring subscription\">";
echo "<input type=\"hidden\" name=\"subs_option_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"subs_option_ddef\" value=\"subs_option_def\">";
echo "<td>Define call barring service subscription mode for all call barring</td>";
echo "</tr>";

//SS call barring password
$passwd=$tmpRow[passwd];
echo "\n <tr>";
echo "<td> $seqNo</td>";
$seqNo++;
echo "<td>SS call barring password </td>";
echo "<td>";
echo "<input type=\"text\" name=\"passwd\" maxlength=\"4\" size=\"10\" value=\"$passwd\"  class=\"text\">";
echo "</td>";
echo "<input type=\"hidden\" name=\"passwd_name\" value=\"SS call barring password\">";
echo "<input type=\"hidden\" name=\"passwd_ppvalue\" value=\"$passwd\">";
echo "<td>For barring service conntrolled by subscriber, ";
echo "used for all call barring. Only use digit '0'-'9'</td>";
echo "</tr>";

//BAOC
$baoc_state=$tmpRow[baoc_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>BAOC state</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"baoc_state\" value=\"$baoc_state\">";
for($i=0;$i<sizeof($baocStateDef);$i++){
	$value=getBitValue($baoc_state,$baocStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$baocStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$baocStateDef[$i][2]}</nobr><br>";
		$preValue.="{$baocStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$baocStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$baocStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"baoc_state_name\" value=\"BAOC state\">";
echo "<input type=\"hidden\" name=\"baoc_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"baoc_state_cdef\" value=\"baocStateDef\">";
echo "<td>Barring of all outgoing calls</td>";
echo "</tr>";

//BOIC
$boic_state=$tmpRow[boic_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>BOIC state</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"boic_state\" value=\"$boic_state\">";
for($i=0;$i<sizeof($boicStateDef);$i++){
	$value=getBitValue($boic_state,$boicStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$boicStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$boicStateDef[$i][2]}</nobr><br>";
		$preValue.="{$boicStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$boicStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$boicStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"boic_state_name\" value=\"BOIC state\">";
echo "<input type=\"hidden\" name=\"boic_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"boic_state_cdef\" value=\"boicStateDef\">";
echo "<td>Barring of all outgoing international calls</td>";
echo "</tr>";

//BOIC-exHPLMN
$boichc_state=$tmpRow[boichc_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>BOIC HPLMN state</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"boichc_state\" value=\"$boichc_state\">";
for($i=0;$i<sizeof($boicExStateDef);$i++){
	$value=getBitValue($boichc_state,$boicExStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$boicExStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$boicExStateDef[$i][2]}</nobr><br>";
		$preValue.="{$boicExStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$boicExStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$boicExStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"boichc_state_name\" value=\"BOIC HPLMN state\">";
echo "<input type=\"hidden\" name=\"boichc_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"boichc_state_cdef\" value=\"boicExStateDef\">";
echo "<td>BOIC except directed to home HPLMN</td>";
echo "</tr>";

//BAIC
$baic_state=$tmpRow[baic_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>BAIC state</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"baic_state\" value=\"$baic_state\">";
for($i=0;$i<sizeof($baicStateDef);$i++){
	$value=getBitValue($baic_state,$baicStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$baicStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$baicStateDef[$i][2]}</nobr><br>";
		$preValue.="{$baicStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$baicStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$baicStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"baic_state_name\" value=\"BAIC state\">";
echo "<input type=\"hidden\" name=\"baic_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"baic_state_cdef\" value=\"baicStateDef\">";
echo "<td>Barring of all incoming calls</td>";
echo "</tr>";

//BIC-ROAM
$bicroam_state=$tmpRow[bicroam_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>BIC ROAM state</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"bicroam_state\" value=\"$bicroam_state\">";
for($i=0;$i<sizeof($bicroamStateDef);$i++){
	$value=getBitValue($bicroam_state,$bicroamStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$bicroamStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$bicroamStateDef[$i][2]}</nobr><br>";
		$preValue.="{$bicroamStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$bicroamStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$bicroamStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"bicroam_state_name\" value=\"BIC ROAM state\">";
echo "<input type=\"hidden\" name=\"bicroam_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"bicroam_state_cdef\" value=\"bicroamStateDef\">";
echo "<td>BIC when roaming outside home PLMN</td>";
echo "</tr>";

//CFU state
$cfu_state =$tmpRow[cfu_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>CFU</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"cfu_state\" value=\"$cfu_state\">";
for($i=0;$i<sizeof($cfuStateDef);$i++){
	$value=getBitValue($cfu_state,$cfuStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$cfuStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$cfuStateDef[$i][2]}</nobr><br>";
		$preValue.="{$cfuStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$cfuStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$cfuStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"cfu_state_name\" value=\"CFU\">";
echo "<input type=\"hidden\" name=\"cfu_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"cfu_state_cdef\" value=\"cfuStateDef\">";
echo "<td>State of call forwarding unconditional</td>";
echo "</tr>";

//CFU number
$cfuNumber=$tmpRow[cfu_num];
$cfuNumber=decodeTelNumber($cfuNumber);	
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>CFU number</td>";
echo "<td>";
echo "<input type=\"text\" name=\"cfuNumber\" maxlength=\"16\" size=\"18\" value=\"$cfuNumber\"  class=\"text\">";
echo "</td>";
echo "<input type=\"hidden\" name=\"cfuNumber_name\" value=\"CFU number\">";
echo "<input type=\"hidden\" name=\"cfuNumber_ppvalue\" value=\"$cfuNumber\">";
echo "<td>&nbsp;</td>";
echo "</tr>";

//CFB state
$cfb_state =$tmpRow[cfb_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>CFB</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"cfb_state\" value=\"$cfb_state\">";
for($i=0;$i<sizeof($cfbStateDef);$i++){
	$value=getBitValue($cfb_state,$cfbStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$cfbStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$cfbStateDef[$i][2]}</nobr><br>";
		$preValue.="{$cfbStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$cfbStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$cfbStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"cfb_state_name\" value=\"CFB\">";
echo "<input type=\"hidden\" name=\"cfb_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"cfb_state_cdef\" value=\"cfbStateDef\">";
echo "<td>State of call forwarding on mobile subscriber busy</td>";
echo "</tr>";

//CFB number
$cfbNumber=$tmpRow[cfb_num];
$cfbNumber=decodeTelNumber($cfbNumber);	
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>CFB number</td>";
echo "<td>";
echo "<input type=\"text\" name=\"cfbNumber\" maxlength=\"16\" size=\"18\" value=\"$cfbNumber\"  class=\"text\">";
echo "</td>";
echo "<input type=\"hidden\" name=\"cfbNumber_name\" value=\"CFB number\">";
echo "<input type=\"hidden\" name=\"cfbNumber_ppvalue\" value=\"$cfbNumber\">";
echo "<td>&nbsp;</td>";
echo "</tr>";

//CFNRy state
$cfnry_state =$tmpRow[cfnry_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>CFNRy</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"cfnry_state\" value=\"$cfnry_state\">";
for($i=0;$i<sizeof($cfnryStateDef);$i++){
	$value=getBitValue($cfnry_state,$cfnryStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$cfnryStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$cfnryStateDef[$i][2]}</nobr><br>";
		$preValue.="{$cfnryStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$cfnryStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$cfnryStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"cfnry_state_name\" value=\"CFNRy\">";
echo "<input type=\"hidden\" name=\"cfnry_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"cfnry_state_cdef\" value=\"cfnryStateDef\">";
echo "<td>State of call forwarding on no reply</td>";
echo "</tr>";

//CFNRy number
$cfnryNumber=$tmpRow[cfnry_num];
$cfnryNumber=decodeTelNumber($cfnryNumber);	
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>CFNRy number</td>";
echo "<td>";
echo "<input type=\"text\" name=\"cfnryNumber\" maxlength=\"16\" size=\"18\" value=\"$cfnryNumber\"  class=\"text\">";
echo "</td>";
echo "<input type=\"hidden\" name=\"cfnryNumber_name\" value=\"CFNRy number\">";
echo "<input type=\"hidden\" name=\"cfnryNumber_ppvalue\" value=\"$cfnryNumber\">";
echo "<td>&nbsp;</td>";
echo "</tr>";

//CFNRy timer
$cfnry_time=$tmpRow[cfnry_time];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>CFNRy timer</td>";
echo "<td>";
echo "<input type=\"text\" name=\"cfnry_time\" maxlength=\"2\" size=\"4\" value=\"$cfnry_time\"  class=\"text\">";
echo "</td>";
echo "<input type=\"hidden\" name=\"cfnry_time_name\" value=\"CFNRy timer\">";
echo "<input type=\"hidden\" name=\"cfnry_time_ppvalue\" value=\"$cfnry_time\">";
echo "<td>Indicates \"no reply condition timer\", ranges from 5 to 30 seconds on a steps of 5-second
</td>";
echo "</tr>";

//CFNRc state
$cfnrc_state =$tmpRow[cfnrc_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>CFNRc</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"cfnrc_state\" value=\"$cfnrc_state\">";
for($i=0;$i<sizeof($cfnrcStateDef);$i++){
	$value=getBitValue($cfnrc_state,$cfnrcStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$cfnrcStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$cfnrcStateDef[$i][2]}</nobr><br>";
		$preValue.="{$cfnrcStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$cfnrcStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$cfnrcStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"cfnrc_state_name\" value=\"CFNRc\">";
echo "<input type=\"hidden\" name=\"cfnrc_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"cfnrc_state_cdef\" value=\"cfnrcStateDef\">";
echo "<td>State of call forwarding on mobile subscriber not reachable </td>";
echo "</tr>";

//CFNRc number
$cfnrcNumber=$tmpRow[cfnrc_num];
$cfnrcNumber=decodeTelNumber($cfnrcNumber);	
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>CFNRc number</td>";
echo "<td>";
echo "<input type=\"text\" name=\"cfnrcNumber\" maxlength=\"16\" size=\"18\" value=\"$cfnrcNumber\"  class=\"text\">";
echo "</td>";
echo "<input type=\"hidden\" name=\"cfnrcNumber_name\" value=\"CFNRc number\">";
echo "<input type=\"hidden\" name=\"cfnrcNumber_ppvalue\" value=\"$cfnrcNumber\">";
echo "<td>&nbsp;</td>";
echo "</tr>";

//Call waiting state
$callwait_state=$tmpRow[callwait_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>Call waiting state</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"callwait_state\" value=\"$callwait_state\">";
for($i=0;$i<sizeof($callWaitingStateDef);$i++){
	$value=getBitValue($callwait_state,$callWaitingStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$callWaitingStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$callWaitingStateDef[$i][2]}</nobr><br>";
		$preValue.="{$callWaitingStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$callWaitingStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$callWaitingStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"callwait_state_name\" value=\"Call waiting state\">";
echo "<input type=\"hidden\" name=\"callwait_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"callwait_state_cdef\" value=\"callWaitingStateDef\">";
echo "<td>Call waiting state</td>";
echo "</tr>";

//Call hold state
$callhold_state=$tmpRow[callhold_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>Call hold state</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"callhold_state\" value=\"$callhold_state\">";
for($i=0;$i<sizeof($callHoldStateDef);$i++){
	$value=getBitValue($callhold_state,$callHoldStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$callHoldStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$callHoldStateDef[$i][2]}</nobr><br>";
		$preValue.="{$callHoldStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$callHoldStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$callHoldStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"callhold_state_name\" value=\"Call hold state\">";
echo "<input type=\"hidden\" name=\"callhold_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"callhold_state_cdef\" value=\"callHoldStateDef\">";
echo "<td>Call hold state</td>";
echo "</tr>";

//Explicit call transfer
$ect_state=$tmpRow[ect_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>ECT state</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"ect_state\" value=\"$ect_state\">";
for($i=0;$i<sizeof($ectStateDef);$i++){
	$value=getBitValue($ect_state,$ectStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$ectStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$ectStateDef[$i][2]}</nobr><br>";
		$preValue.="{$ectStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$ectStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$ectStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"ect_state_name\" value=\"ECT state\">";
echo "<input type=\"hidden\" name=\"ect_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"ect_state_cdef\" value=\"ectStateDef\">";
echo "<td>Explicit call transfer state</td>";
echo "</tr>";

//Multi-party state
$mtpy_state=$tmpRow[mtpy_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>Multi-party state</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"mtpy_state\" value=\"$mtpy_state\">";
for($i=0;$i<sizeof($mtpyStateDef);$i++){
	$value=getBitValue($mtpy_state,$mtpyStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$mtpyStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$mtpyStateDef[$i][2]}</nobr><br>";
		$preValue.="{$mtpyStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$mtpyStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$mtpyStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"mtpy_state_name\" value=\"Multi-party state\">";
echo "<input type=\"hidden\" name=\"mtpy_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"mtpy_state_cdef\" value=\"mtpyStateDef\">";
echo "<td>Multi-party call state</td>";
echo "</tr>";

//emlpp state
$emlpp_state=$tmpRow[emlpp_state];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>eMLPP state</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"emlpp_state\" value=\"$emlpp_state\">";
for($i=0;$i<sizeof($emlppStateDef);$i++){
	$value=getBitValue($emlpp_state,$emlppStateDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$emlppStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"1\" checked  >{$emlppStateDef[$i][2]}</nobr><br>";
		$preValue.="{$emlppStateDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$emlppStateDef[$i][0]}\"";
		echo "onClick=selCheckBox(this) value=\"0\" >{$emlppStateDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"emlpp_state_name\" value=\"eMLPP state\">";
echo "<input type=\"hidden\" name=\"emlpp_state_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"emlpp_state_cdef\" value=\"emlppStateDef\">";
echo "<td>eMLPP state</td>";
echo "</tr>";

//emlpp_max_priority
$emlpp_max_priority=$tmpRow[emlpp_max_priority];
$emlpp_max_priority_FlagDef=array(
		array('06','Level A'),
		array('05','Level B'),
		array('00','Level 0'),
		array('01','Level 1'),
		array('02','Level 2'),
		array('03','Level 3'),
		array('04','Level 4')
		);
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>eMLPP Max Priority</td>";
echo "<td>";
echo "<select name='emlpp_max_priority' size=1>";
for($i=0;$i<sizeof($emlpp_max_priority_FlagDef);$i++){
	$val=$emlpp_max_priority_FlagDef[$i][0];
	if($emlpp_max_priority_FlagDef[$i][0] == hexdec($emlpp_max_priority)){
		echo "<option value='$val' selected>{$emlpp_max_priority_FlagDef[$i][1]}</option>";
	}else{
		echo "<option value='$val'>{$emlpp_max_priority_FlagDef[$i][1]}</option>";
	}
}
echo "</td>";
echo "<input type=\"hidden\" name=\"emlpp_max_priority_name\" value=\"eMLPP Max Priority\">";
echo "<input type=\"hidden\" name=\"emlpp_max_priority_ppvalue\" value=\"$emlpp_max_priority\">";
echo "<input type=\"hidden\" name=\"emlpp_max_priority_ddef\" value=\"emlpp_priority_def\">";
echo "<td>eMLPP Max Priority</td>";
echo "</tr>";

//emlpp_def_priority
$emlpp_def_priority=$tmpRow[emlpp_def_priority];
$emlpp_def_priority_FlagDef=array(
		array('06','Level A'),
		array('05','Level B'),
		array('00','Level 0'),
		array('01','Level 1'),
		array('02','Level 2'),
		array('03','Level 3'),
		array('04','Level 4')
		);
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>eMLPP Default Priority</td>";
echo "<td>";
echo "<select name='emlpp_def_priority' size=1>";
for($i=0;$i<sizeof($emlpp_def_priority_FlagDef);$i++){
	$val=$emlpp_def_priority_FlagDef[$i][0];
	if($emlpp_def_priority_FlagDef[$i][0] == hexdec($emlpp_def_priority)){
		echo "<option value='$val' selected>{$emlpp_def_priority_FlagDef[$i][1]}</option>";
	}else{
		echo "<option value='$val'>{$emlpp_def_priority_FlagDef[$i][1]}</option>";
	}
}
echo "</td>";
echo "<input type=\"hidden\" name=\"emlpp_def_priority_name\" value=\"eMLPP Default Priority\">";
echo "<input type=\"hidden\" name=\"emlpp_def_priority_ppvalue\" value=\"$emlpp_def_priority\">";
echo "<input type=\"hidden\" name=\"emlpp_def_priority_ddef\" value=\"emlpp_priority_def\">";
echo "<td>eMLPP Default Priority</td>";
echo "</tr>";

//camel_flag
$camel_flag=$tmpRow[camel_flag];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>Camel flag</td>";
echo "<td>";
$preValue="";
echo "<input type=\"hidden\" name=\"camel_flag\" value=\"$camel_flag\">";
for($i=0;$i<sizeof($CamelFlagDef);$i++){
	$value=getBitValue($camel_flag,$CamelFlagDef[$i][1]);
	if($value == '1'){
		echo "<nobr><input type=\"checkbox\" name=\"{$CamelFlagDef[$i][0]}\"	 onClick=selCheckBox(this) value=\"1\" checked  >{$CamelFlagDef[$i][2]}</nobr><br>";
		$preValue.="{$CamelFlagDef[$i][2]},";
	}else{
		echo "<nobr><input type=\"checkbox\" name=\"{$CamelFlagDef[$i][0]}\"	 onClick=selCheckBox(this) value=\"0\" >{$CamelFlagDef[$i][2]}</nobr><br>";
	}
}
$preValue=substr($preValue,0,strlen($preValue)-1);
echo "</td>";
echo "<input type=\"hidden\" name=\"camel_flag_name\" value=\"Camel flag\">";
echo "<input type=\"hidden\" name=\"camel_flag_ppvalue\" value=\"$preValue\">";
echo "<input type=\"hidden\" name=\"camel_flag_cdef\" value=\"CamelFlagDef\">";
echo "<td>CAMEL service enable or disable";
echo "<br>Support CAMEL is a total flag of CAMEL provisioning. To enable any CAMEL service, select this option";
echo "<br>O-CSI: Originating CAMEL subscription information";
echo "<br>T-CSI: Terminating CAMEL subscription information";
echo "<br>SS-CSI: Supplementary service notification CAMEL subscription information";
echo "<br>SMS-CSI: Short message service notification CAMEL subscrition information";
echo "<br>GPRS-CSI: GPRS notification CAMEL subscription information";
echo "</td>";
echo "</tr>";

//MS purge flag
$purgeMsFlag=$tmpRow[purgems_flag];
$purgeMsFlagDef=array(
//		array('GSM Network',	'00.0'),
		array('GSM&nbsp;',	'00.0'),
		array('GPRS',	'00.1')
);
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>Purge MS flag</td>";
echo "<td>";
for($i=0;$i<sizeof($purgeMsFlagDef);$i++){
	$value=getBitValue($purgeMsFlag,$purgeMsFlagDef[$i][1]);
	if($value == '0'){
		echo "{$purgeMsFlagDef[$i][0]}: <font color=\"#0000FF\">online</font><br>";
	}else{
		echo "{$purgeMsFlagDef[$i][0]}: <font color=\"#0000FF\">offline</font><br>";
	}
}
echo "</td>";
echo "<td>Status of MS purge. Online=MS not purged. Offline=MS purged</td>";
echo "</tr>";

//GPRS FLAG
$gprs_flag=$tmpRow[gprs_flag];
$gprsFlagDef=array(
		array('00','Disable'),
		array('01','Enable')
		);
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>GPRS flag</td>";
echo "<td>";
echo "<select name='gprs_flag' size=1>";
for($i=0;$i<sizeof($gprsFlagDef);$i++){
	if($gprsFlagDef[$i][0] == hexdec($gprs_flag)){
		echo "<option value='$i' selected>{$gprsFlagDef[$i][1]}</option>";
	}else{
		echo "<option value='$i'>{$gprsFlagDef[$i][1]}</option>";
	}
}
echo "</td>";
echo "<input type=\"hidden\" name=\"gprs_flag_name\" value=\"GPRS flag\">";
echo "<input type=\"hidden\" name=\"gprs_flag_ppvalue\" value=\"$gprs_flag\">";
echo "<input type=\"hidden\" name=\"gprs_flag_ddef\" value=\"gprs_flag_def\">";
echo "<td>GPRS service flag</td>";
echo "</tr>";

//pdp context (group 1)
$pdp_1=$tmpRow[pdp1];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>PDP context (group 1)</td>";
echo "<td>";
echo "<input type=\"hidden\" name=\"pdp_1\" value=\"$pdp_1\">";
$i=0;
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
if('01' == $pdpValue){
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"01\" checked>Enable";
	echo "&nbsp;";
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"00\">Disable";
}else{
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"01\">Enable";
	echo "&nbsp;";
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"00\" checked>Disable";
}
echo "</nobr>";
echo "<br>";
echo "<input type=\"hidden\" name=\"pdpFlag_1_name\" value=\"PDP context (group 1) PDP flag\">";
echo "<input type=\"hidden\" name=\"pdpFlag_1_ppvalue\" value=\"$pdpValue\">";
echo "<input type=\"hidden\" name=\"pdpFlag_1_ddef\" value=\"gprs_flag_def\">";
$i++;

$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpPdpTypeDef);$j++){
	if($pdpPdpTypeDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpPdpTypeDef[$j][0]}\" selected>{$pdpPdpTypeDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpPdpTypeDef[$j][0]}\" >{$pdpPdpTypeDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"pdpType_1_name\" value=\"PDP context (group 1) PDP type\">";
echo "<input type=\"hidden\" name=\"pdpType_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"pdpType_1_ddef\" value=\"pdp_type_def\">";
$i++;



$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$addressLen=hexdec(getBitValue($pdp_1,$pdpContextDef[35][1]));
//echo "addressLen=$addressLen";
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
//$xxxxxxxxx=getBitValue($pdp_1,$pdpContextDef[$i-1][1]);
//echo "xxxxxxxxxx=$xxxxxxxxx";
if('289' == HEXDEC(getBitValue($pdp_1,$pdpContextDef[$i-1][1]))){
	$tmpPdpValue=HEXDEC(substr($pdpValue,0,2)).'.'.HEXDEC(substr($pdpValue,2,2)).'.'.HEXDEC(substr($pdpValue,4,2)).'.'.HEXDEC(substr($pdpValue,6,2));
	if($addressLen == 0)
		$tmpPdpValue="";
	echo "<input type=\"text\" name=\"$pdpName\" maxlength=\"39\" size=\"39\" value=\"$tmpPdpValue\" class=\"text\">";
}else if('343' == HEXDEC(getBitValue($pdp_1,$pdpContextDef[$i-1][1]))){
	$tmpPdpValue=substr($pdpValue,0,4).':'.substr($pdpValue,4,4).':'.substr($pdpValue,8,4).':'.substr($pdpValue,12,4).':'.substr($pdpValue,16,4).':'.substr($pdpValue,20,4).':'.substr($pdpValue,24,4).':'.substr($pdpValue,28,4);
	echo "<input type=\"text\" name=\"$pdpName\" maxlength=\"39\" size=\"39\" value=\"$tmpPdpValue\" class=\"text\">";
}else{
	$tmpArr=explode("E",$pdpValue);
	$tmpPdpValue=$tmpArr[0];
	echo "<input type=\"text\" name=\"$pdpName\" maxlength=\"39\" size=\"39\" value=\"$tmpPdpValue\" class=\"text\">";
}
echo "</nobr>";
echo "<br>";
echo "<input type=\"hidden\" name=\"pdpAddress_1_name\" value=\"PDP context (group 1) PDP address\">";
echo "<input type=\"hidden\" name=\"pdpAddress_1_ppvalue\" value=\"$tmpPdpValue\">";
$i++;

$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=1;$j<6;$j++){
	if(BINDEC($pdpValue)== $j){
		echo "<option value=\"$j\" selected>$j</option>";
	}else{
		echo "<option value=\"$j\" >$j</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"reliabilityClass_1_name\" value=\"PDP context (group 1) Reliability class\">";
echo "<input type=\"hidden\" name=\"reliabilityClass_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"reliabilityClass_1_ddef\" value=\"reliabilityClass_def\">";
$i++;

$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=1;$j<5;$j++){
	if(BINDEC($pdpValue)== $j){
		echo "<option value=\"$j\" selected>$j</option>";
	}else{
		echo "<option value=\"$j\" >$j</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"delayClass_1_name\" value=\"PDP context (group 1) Delay class\">";
echo "<input type=\"hidden\" name=\"delayClass_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"delayClass_1_ddef\" value=\"delayClass_def\">";
$i++;

$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpPrecedenceClassDef);$j++){
	if($pdpPrecedenceClassDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpPrecedenceClassDef[$j][0]}\" selected>{$pdpPrecedenceClassDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpPrecedenceClassDef[$j][0]}\" >{$pdpPrecedenceClassDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"precedenceClass_1_name\" value=\"PDP context (group 1) Precedence class\">";
echo "<input type=\"hidden\" name=\"precedenceClass_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"precedenceClass_1_ddef\" value=\"precedenceClass_def\">";
$i++;

$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpPeakThroughtputDef);$j++){
	if($pdpPeakThroughtputDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpPeakThroughtputDef[$j][0]}\" selected>{$pdpPeakThroughtputDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpPeakThroughtputDef[$j][0]}\" >{$pdpPeakThroughtputDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"peakThroughput_1_name\" value=\"PDP context (group 1) Peak throughput\">";
echo "<input type=\"hidden\" name=\"peakThroughput_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"peakThroughput_1_ddef\" value=\"peakThroughput_def\">";
$i++;

$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpMeanThroughtputDef);$j++){
	if($pdpMeanThroughtputDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpMeanThroughtputDef[$j][0]}\" selected>{$pdpMeanThroughtputDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpMeanThroughtputDef[$j][0]}\" >{$pdpMeanThroughtputDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"meanThroughput_1_name\" value=\"PDP context (group 1) Mean throughput\">";
echo "<input type=\"hidden\" name=\"meanThroughput_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"meanThroughput_1_ddef\" value=\"meanThroughput_def\">";
$i++;

$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
if('01' == $pdpValue){
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"01\" checked>Allowed";
	echo "&nbsp; ";
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"00\">Not allowed";
}else{
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"01\">Allowed";
	echo "&nbsp; ";
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"00\" checked>Not allowed";
}
echo "</nobr>";
echo "<br>";
echo "<input type=\"hidden\" name=\"vplmnAddressAllowedFlag_1_name\" value=\"PDP context (group 1) VPLMN Address Allowed Flag\">";
echo "<input type=\"hidden\" name=\"vplmnAddressAllowedFlag_1_ppvalue\" value=\"$pdpValue\">";
echo "<input type=\"hidden\" name=\"vplmnAddressAllowedFlag_1_ddef\" value=\"vplmnAddressAllowedFlag_def\">";
$i++;

$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
$j=0;
$tmpPdpValue="";
if($pdpValue!=""){
	for($j=0;$j<64;$j+=2){
		if($pdpValue[$j]=='0'&&$pdpValue[$j+1]=='0')
			break;
		$tmp=sprintf("%c",HEXDEC(substr($pdpValue,$j,2)));
		$tmpPdpValue=$tmpPdpValue.$tmp;
	}
}

echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<input type=\"text\" name=\"$pdpName\" maxlength=\"32\" size=\"32\" value=\"$tmpPdpValue\" class=\"text\">";
echo "<input type=\"hidden\" name=\"apn_1_name\" value=\"PDP context (group 1) APN\">";
echo "<input type=\"hidden\" name=\"apn_1_ppvalue\" value=\"$tmpPdpValue\">";
$i++;
echo "</nobr>";
echo "<br>";

//Ext Flag
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpExtFlagDef);$j++){
	if($pdpExtFlagDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpExtFlagDef[$j][0]}\" selected>{$pdpExtFlagDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpExtFlagDef[$j][0]}\" >{$pdpExtFlagDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"ext_flag_1_name\" value=\"PDP context (group 1) Ext flag\">";
echo "<input type=\"hidden\" name=\"ext_flag_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"ext_flag_1_ddef\" value=\"pdpExtFlagDef\">";
$i++;

//Allocation/Retention Priority
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<u><b>Ext Qos</b></u>";
echo "<br><nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=1;$j<5;$j++){
	if($j ==  HEXDEC($pdpValue)){
		echo "<option value=\"$j\" selected>$j</option>";
	}else{
		echo "<option value=\"$j\" >$j</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"allocation_retentionPriority_1_name\" value=\"PDP context (group 1) Allocation/Retention Priority\">";
echo "<input type=\"hidden\" name=\"allocation_retentionPriority_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"allocation_retentionPriority_1_ddef\" value=\"allocationRetentionPriority_def\">";
$i++;


//Delivery err SDUs
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($DeliveryErrSDUsDef);$j++){
	if($DeliveryErrSDUsDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$DeliveryErrSDUsDef[$j][0]}\" selected>{$DeliveryErrSDUsDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$DeliveryErrSDUsDef[$j][0]}\" >{$DeliveryErrSDUsDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"delivery_err_sdus_1_name\" value=\"PDP context (group 1) Delivery err SDUs\">";
echo "<input type=\"hidden\" name=\"delivery_err_sdus_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"delivery_err_sdus_1_ddef\" value=\"DeliveryErrSDUsDef\">";
$i++;

//Delivery order
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($deliveryOrderDef);$j++){
	if($deliveryOrderDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$deliveryOrderDef[$j][0]}\" selected>{$deliveryOrderDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$deliveryOrderDef[$j][0]}\" >{$deliveryOrderDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"delivery_order_1_name\" value=\"PDP context (group 1) Delivery order\">";
echo "<input type=\"hidden\" name=\"delivery_order_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"delivery_order_1_ddef\" value=\"deliveryOrderDef\">";
$i++;

//Traffic class
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($trafficClassDef);$j++){
	if($trafficClassDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$trafficClassDef[$j][0]}\" selected>{$trafficClassDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$trafficClassDef[$j][0]}\" >{$trafficClassDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"traffic_class_1_name\" value=\"PDP context (group 1) Traffic class\">";
echo "<input type=\"hidden\" name=\"traffic_class_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"traffic_class_1_ddef\" value=\"trafficClassDef\">";
$i++;

//Maximum SDU size
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpMaximumSDUsizeDef);$j++){
	if($pdpMaximumSDUsizeDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpMaximumSDUsizeDef[$j][0]}\" selected>{$pdpMaximumSDUsizeDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpMaximumSDUsizeDef[$j][0]}\" >{$pdpMaximumSDUsizeDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumSDUsize_1_name\" value=\"PDP context (group 1) Maximum SDU size\">";
echo "<input type=\"hidden\" name=\"maximumSDUsize_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumSDUsize_1_ddef\" value=\"pdpMaximumSDUsizeDef\">";
$i++;

//Maximum bit rate for uplink range
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' id=\"range1_1\" size=1 onChange=\"javascript:selectlimit('range1_1','base1_1');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkRanDef);$j++){
	if($pdpRateDownUplinkRanDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" selected>{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" >{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumRateUplinkRan_1_name\" value=\"PDP context (group 1) Maximum bit rate for uplink\">";
echo "<input type=\"hidden\" name=\"maximumRateUplinkRan_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumRateUplinkRan_1_ddef\" value=\"pdpRateDownUplinkRanDef\">";
$i++;

//Maximum bit rate for uplink base
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1 id=\"base1_1\" onChange=\"javascript:selectlimit('range1_1','base1_1');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkBasDef);$j++){
	if($pdpRateDownUplinkBasDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" selected>{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" >{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumRateUplinkBas_1_name\" value=\"PDP context (group 1) Maximum bit rate for uplink\">";
echo "<input type=\"hidden\" name=\"maximumRateUplinkBas_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumRateUplinkBas_1_ddef\" value=\"pdpRateDownUplinkBasDef\">";
$i++;

//Maximum bit rate for downlink range
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;";
echo "<select name='$pdpName' id=\"range2_1\" size=1 onChange=\"javascript:selectlimit('range2_1','base2_1');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkRanDef);$j++){
	if($pdpRateDownUplinkRanDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" selected>{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" >{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumRateDownlinkRan_1_name\" value=\"PDP context (group 1) Maximum bit rate for downlink\">";
echo "<input type=\"hidden\" name=\"maximumRateDownlinkRan_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumRateDownlinkRan_1_ddef\" value=\"pdpRateDownUplinkRanDef\">";
$i++;

//Maximum bit rate for downlink base
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
//echo "<select name='$pdpName' size=1>";
echo "<select name='$pdpName' size=1 id=\"base2_1\" onChange=\"javascript:selectlimit('range2_1','base2_1');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkBasDef);$j++){
	if($pdpRateDownUplinkBasDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" selected>{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" >{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumRateDownlinkBas_1_name\" value=\"PDP context (group 1) Maximum bit rate for downlink\">";
echo "<input type=\"hidden\" name=\"maximumRateDownlinkBas_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumRateDownlinkBas_1_ddef\" value=\"pdpRateDownUplinkBasDef\">";
$i++;

//SDU error ratio
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpSduErrorRatioDef);$j++){
	if($pdpSduErrorRatioDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpSduErrorRatioDef[$j][0]}\" selected>{$pdpSduErrorRatioDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpSduErrorRatioDef[$j][0]}\" >{$pdpSduErrorRatioDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"sduErrorRatio_1_name\" value=\"PDP context (group 1) SDU error ratio\">";
echo "<input type=\"hidden\" name=\"sduErrorRatio_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"sduErrorRatio_1_ddef\" value=\"pdpSduErrorRatioDef\">";
$i++;

//Residual Bit Error Rate
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpResidualErrRateDef);$j++){
	if($pdpResidualErrRateDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpResidualErrRateDef[$j][0]}\" selected>{$pdpResidualErrRateDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpResidualErrRateDef[$j][0]}\" >{$pdpResidualErrRateDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"residualErrRate_1_name\" value=\"PDP context (group 1) Residual Bit Error Rate\">";
echo "<input type=\"hidden\" name=\"residualErrRate_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"residualErrRate_1_ddef\" value=\"pdpResidualErrRateDef\">";
$i++;

//Traffic handing priority
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpTrafficHandingPriorityDef);$j++){
	if($pdpTrafficHandingPriorityDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpTrafficHandingPriorityDef[$j][0]}\" selected>{$pdpTrafficHandingPriorityDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpTrafficHandingPriorityDef[$j][0]}\" >{$pdpTrafficHandingPriorityDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"trafficHandingPriority_1_name\" value=\"PDP context (group 1) Traffic handing priority\">";
echo "<input type=\"hidden\" name=\"trafficHandingPriority_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"trafficHandingPriority_1_ddef\" value=\"pdpTrafficHandingPriorityDef\">";
$i++;

//Transfer delay
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpTransferDelayDef);$j++){
	if($pdpTransferDelayDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpTransferDelayDef[$j][0]}\" selected>{$pdpTransferDelayDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpTransferDelayDef[$j][0]}\" >{$pdpTransferDelayDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"transferDelay_1_name\" value=\"PDP context (group 1) Transfer delay\">";
echo "<input type=\"hidden\" name=\"transferDelay_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"transferDelay_1_ddef\" value=\"pdpTransferDelayDef\">";
$i++;

//Guaranteed bit rate uplink range
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1 id=\"range3_1\" onChange=\"javascript:selectlimit('range3_1','base3_1');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkRanDef);$j++){
	if($pdpRateDownUplinkRanDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" selected>{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" >{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkRan_1_name\" value=\"PDP context (group 1) Guaranteed bit rate uplink\">";
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkRan_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkRan_1_ddef\" value=\"pdpRateDownUplinkRanDef\">";
$i++;

//Guaranteed bit rate uplink base
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1 id=\"base3_1\" onChange=\"javascript:selectlimit('range3_1','base3_1');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkBasDef);$j++){
	if($pdpRateDownUplinkBasDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" selected>{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" >{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkBas_1_name\" value=\"PDP context (group 1) Guaranteed bit rate uplink\">";
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkBas_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkBas_1_ddef\" value=\"pdpRateDownUplinkBasDef\">";
$i++;

//Guaranteed bit rate downlink range
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1 id=\"range4_1\" onChange=\"javascript:selectlimit('range4_1','base4_1');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkRanDef);$j++){
	if($pdpRateDownUplinkRanDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" selected>{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" >{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkRan_1_name\" value=\"PDP context (group 1) Guaranteed bit rate downlink\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkRan_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkRan_1_ddef\" value=\"pdpRateDownUplinkRanDef\">";
$i++;

//Guaranteed bit rate downlink base
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
//echo "<select name='$pdpName' size=1>";
echo "<select name='$pdpName' size=1 id=\"base4_1\" onChange=\"javascript:selectlimit('range4_1','base4_1');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkBasDef);$j++){
	if($pdpRateDownUplinkBasDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" selected>{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" >{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkBas_1_name\" value=\"PDP context (group 1) Guaranteed bit rate downlink\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkBas_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkBas_1_ddef\" value=\"pdpRateDownUplinkBasDef\">";
$i++;

//Source statistics descriptor
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<u><b>Ext2 Qos</b></u>";
echo "<br><nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpSourceStatisticsDescriptorDef);$j++){
	if($pdpSourceStatisticsDescriptorDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpSourceStatisticsDescriptorDef[$j][0]}\" selected>{$pdpSourceStatisticsDescriptorDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpSourceStatisticsDescriptorDef[$j][0]}\" >{$pdpSourceStatisticsDescriptorDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"sourceStatisticsDescriptor_1_name\" value=\"PDP context (group 1) Source statistics descriptor\">";
echo "<input type=\"hidden\" name=\"sourceStatisticsDescriptor_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"sourceStatisticsDescriptor_1_ddef\" value=\"pdpSourceStatisticsDescriptorDef\">";
$i++;

//Signalling Indication
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpSignallingIndicationDef);$j++){
	if($pdpSignallingIndicationDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpSignallingIndicationDef[$j][0]}\" selected>{$pdpSignallingIndicationDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpSignallingIndicationDef[$j][0]}\" >{$pdpSignallingIndicationDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"signallingIndication_1_name\" value=\"PDP context (group 1) Signalling Indication\">";
echo "<input type=\"hidden\" name=\"signallingIndication_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"signallingIndication_1_ddef\" value=\"pdpSignallingIndicationDef\">";
$i++;

//Reserved
/*$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
/*for($j=0;$j<sizeof($pdpSignallingIndicationDef);$j++){
	if($pdpSignallingIndicationDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpSignallingIndicationDef[$j][0]}\" selected>{$pdpSignallingIndicationDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpSignallingIndicationDef[$j][0]}\" >{$pdpSignallingIndicationDef[$j][1]}</option>";
	}
}*/
/*echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"reserved_1_name\" value=\"PDP context (group 1) reserved\">";
echo "<input type=\"hidden\" name=\"reserved_1_ppvalue\" value=\"$tmpValue\">";
//echo "<input type=\"hidden\" name=\"reserved_1_ddef\" value=\"pdpreservedDef\">";
*/$i++;

//Maximum bit rate downlink(ext)
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpMaximumDownlinkExtDef);$j++){
	if($pdpMaximumDownlinkExtDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpMaximumDownlinkExtDef[$j][0]}\" selected>{$pdpMaximumDownlinkExtDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpMaximumDownlinkExtDef[$j][0]}\" >{$pdpMaximumDownlinkExtDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumDownlinkExt_1_name\" value=\"PDP context (group 1) Maximum bit rate downlink(ext)\">";
echo "<input type=\"hidden\" name=\"maximumDownlinkExt_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumDownlinkExt_1_ddef\" value=\"pdpMaximumDownlinkExtDef\">";
$i++;

//Guaranteed bit rate downlink(ext)
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpGuaranteedDownlinkExtDef);$j++){
	if($pdpGuaranteedDownlinkExtDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpGuaranteedDownlinkExtDef[$j][0]}\" selected>{$pdpGuaranteedDownlinkExtDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpGuaranteedDownlinkExtDef[$j][0]}\" >{$pdpGuaranteedDownlinkExtDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkExt_1_name\" value=\"PDP context (group 1) Guaranteed bit rate downlink(ext)\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkExt_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkExt_1_ddef\" value=\"pdpGuaranteedDownlinkExtDef\">";
$i++;

//Maximum bit rate uplink(ext)
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<u><b>Ext3 Qos</b></u>";
echo "<br><nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpMaximumUplinkExtDef);$j++){
	if($pdpMaximumUplinkExtDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpMaximumUplinkExtDef[$j][0]}\" selected>{$pdpMaximumUplinkExtDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpMaximumUplinkExtDef[$j][0]}\" >{$pdpMaximumUplinkExtDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumUplink_1_name\" value=\"PDP context (group 1) Maximum bit rate uplink(ext)\">";
echo "<input type=\"hidden\" name=\"maximumUplink_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumUplink_1_ddef\" value=\"pdpMaximumUplinkExtDef\">";
$i++;

//Guaranteed bit rate uplink(ext)
$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
//debug_log("/tmp/debug.txt","pdpValue=$pdpValue");
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpGuaranteedUplinkExtDef);$j++){
	if($pdpGuaranteedUplinkExtDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpGuaranteedUplinkExtDef[$j][0]}\" selected>{$pdpGuaranteedUplinkExtDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpGuaranteedUplinkExtDef[$j][0]}\" >{$pdpGuaranteedUplinkExtDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedUplinkExt_1_name\" value=\"PDP context (group 1) Guaranteed bit rate uplink(ext)\">";
echo "<input type=\"hidden\" name=\"guaranteedUplinkExt_1_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedUplinkExt_1_ddef\" value=\"pdpGuaranteedUplinkExtDef\">";

echo "</td>";


echo "<td>PDP context identifier: 1-3.";
echo "<br>PDP Type: 0x0121 = IPv4, 0x0157 = IPv6, 0x0000 = X.25";
echo "<br>PDP Address:";
echo "<br>IPv4 Len = 4, <IPv4 hex address>";
echo "<br>IPv6 Len = 16, <IPv6 hex address>";
echo "<br>X.25 Len = 3 to 9, <X.121 address digits>";
echo "<br>Empty Address· Field of any type has Len =0";
echo "<br>QoS";
echo "<br>Reliability Class:";
echo "<br>1 = Error sensitive,no error correction,limited error tolerance, non real-time traffic";
echo "<br>2 = Error sensitive, limited error correction,good error tolerance, non real-time traffic";
echo "<br>3 = Not error sensitive, error correction capability and/or very good error tolerance capability, non real-time traffic";
echo "<br>4 = Real-time traffic, error sensitive, cope with data loss5 = Real-time traffic, error non-sensitive, cope with data loss";
echo "<br>Delay Class:	1 (predictive), 2 (predictive), 3 (predictive) and 4 (Best effort)";
echo "<br>Precedence Class: 1 = High, 2 = Normal, 3 = Low";
echo "<br>Peak Throughput	1 through 9 (8 Kbps to 2.048 Kbps)";
echo "<br>Mean Throughput	1 through 18 (100 to 50 Million Octets per sec), and 31(Best effort)";
echo "<br>VPLMN Address Allowed: 0 = Not Allowed, 1 = Allowed";
echo "<br>APN:Specific APN name APN is made of one or more labels. Each label is made of a length byte and that many number of octets coded in ASCII of A-Z, a-z, 0-9, and “-“(dash). APN cannot exceed 63 octets. It should not start with strings “rac”,”lac” or “sgsn” and it should not end with “.gprs”. APN stored at HLR is not terminated by a length byte of zero.Wild card “*” Len = 1 and single octet coded with ASCII of  asterisks.";
echo "<br>Ext Flag:0 = Non-included Ext,1 = Included Ext,3 = Included Ext and Ext2 only 1 octet,7 = Included Ext, Ext2 Qos,15 = Included Ext, Ext2, EXt3 Qos.";
echo "<br>Ext Qos";
echo "<br>Allocation/Retention Priority:There are four priority : Priority 1,Priority 2,Priority 3,Priority 4.";
echo "<br>Delivery err SDUs:1=No detect,2=Err SDUs delilvered,3=Err SDUs not delivered,7=Reserved";
echo "<br>Delivery order:1 =with delivery order,2 = without delivery order,3 = Reserved";
echo "<br>Traffic class:1=Conversation class,2=Streaming class,3=Interactive class,4=Background class,7=Reserved";
echo "<br>Maximum SDU size:Giving a range of values from 10 octets to 1520 octets";
echo "<br>1=10 octets,20=200 octets,80=800 octets,100=1000 octets,148=1480 octets,150=1500 octets,151=1502 octets,152=1510 octets,153=1520 octets,255=Reserved";
echo "<br>Maximum bit rate for uplink range:0 through 63 (0 Kbps to 63 Kbps)";
echo "<br>Maximum bit rate for uplink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)";
echo "<br>Maximum bit rate for downlink range:0 through 63 (0 Kbps to 63 Kbps)";
echo "<br>Maximum bit rate for downlink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)";
echo "<br>SDU error ratio:The range is from 5E-2 to 6E-8,1=1E-2,2=7E-3,3=1E-3,4=1E-4,5=1E-5,6=1E-6,7=1E-1,15=Reserved";
echo "<br>Residual Bit Error Rate:The range is from 1E-1 to 1E-6,1=5E-2,2=1E-2,3=5E-3,4=4E-3,5=1E-3,6=1E-4,7=1E-5,8=1E-6,9=6E-8,15=Reserved";
echo "<br>Traffic handing priority:1=priority Level 1,2=priority Level 2,3=priority Level 3,0=Reserved";
echo "<br>Transfer delay:0=X*10ms,1=200ms+X*50ms,2=1000ms+X*100ms,3=2600ms+X*100ms";
echo "<br>Guaranteed bit rate uplink range:0 through 63 (0 Kbps to 63 Kbps)";
echo "<br>Guaranteed bit rate uplink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)";
echo "<br>Guaranteed bit rate downlink range:0 through 63 (0 Kbps to 63 Kbps)";
echo "<br>Guaranteed bit rate downlink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)";
echo "<br>Ext2 Qos";
echo "<br>Source Statistics Descriptor:0=Spare,1=Speech (MS=>NW)";
echo "<br>Signalling Indication:0=Not Optimised for Signalling Traffic,1=Optimised for Signalling Traffic.";
echo "<br>Reserved:66.5-66.7";
echo "<br>Maximum bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)";
echo "<br>Guaranteed bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps)250(256Mbps)";
echo "<br>Ext3 Qos";
echo "<br>Maximum bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)";
echo "<br>Guaranteed bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)";
echo "</td>";
echo "</tr>";

//pdp context (group 2)
$pdp_2=$tmpRow[pdp2];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>PDP context (group 2)</td>";
echo "<td>";
echo "<input type=\"hidden\" name=\"pdp_2\" value=\"$pdp_2\">";
$i=0;
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
if('01' == $pdpValue){
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"01\" checked>Enable";
	echo "&nbsp;";
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"00\">Disable";
}else{
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"01\">Enable";
	echo "&nbsp;";
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"00\" checked>Disable";
}
echo "</nobr>";
echo "<br>";
echo "<input type=\"hidden\" name=\"pdpFlag_2_name\" value=\"PDP context (group 2) PDP flag\">";
echo "<input type=\"hidden\" name=\"pdpFlag_2_ppvalue\" value=\"$pdpValue\">";
echo "<input type=\"hidden\" name=\"pdpFlag_2_ddef\" value=\"gprs_flag_def\">";
$i++;

$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpPdpTypeDef);$j++){
	if($pdpPdpTypeDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpPdpTypeDef[$j][0]}\" selected>{$pdpPdpTypeDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpPdpTypeDef[$j][0]}\" >{$pdpPdpTypeDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"pdpType_2_name\" value=\"PDP context (group 2) PDP type\">";
echo "<input type=\"hidden\" name=\"pdpType_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"pdpType_2_ddef\" value=\"pdp_type_def\">";
$i++;

$tmpPdpValue="";
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$addressLen=hexdec(getBitValue($pdp_2,$pdpContextDef[35][1]));
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
if('289' == HEXDEC(getBitValue($pdp_2,$pdpContextDef[$i-1][1]))){
	$tmpPdpValue=HEXDEC(substr($pdpValue,0,2)).'.'.HEXDEC(substr($pdpValue,2,2)).'.'.HEXDEC(substr($pdpValue,4,2)).'.'.HEXDEC(substr($pdpValue,6,2));
	if($addressLen == 0)
		$tmpPdpValue="";
	echo "<input type=\"text\" name=\"$pdpName\" maxlength=\"39\" size=\"39\" value=\"$tmpPdpValue\" class=\"text\">";
}else if('343' == HEXDEC(getBitValue($pdp_2,$pdpContextDef[$i-1][1]))){
	$tmpPdpValue=substr($pdpValue,0,4).':'.substr($pdpValue,4,4).':'.substr($pdpValue,8,4).':'.substr($pdpValue,12,4).':'.substr($pdpValue,16,4).':'.substr($pdpValue,20,4).':'.substr($pdpValue,24,4).':'.substr($pdpValue,28,4);
	echo "<input type=\"text\" name=\"$pdpName\" maxlength=\"39\" size=\"39\" value=\"$tmpPdpValue\" class=\"text\">";
}else{
	$tmpArr=explode("E",$pdpValue);
	$tmpPdpValue=$tmpArr[0];
	echo "<input type=\"text\" name=\"$pdpName\" maxlength=\"39\" size=\"39\" value=\"$tmpPdpValue\" class=\"text\">";
}
echo "</nobr>";
echo "<br>";
echo "<input type=\"hidden\" name=\"pdpAddress_2_name\" value=\"PDP context (group 2) PDP address\">";
echo "<input type=\"hidden\" name=\"pdpAddress_2_ppvalue\" value=\"$tmpPdpValue\">";
$i++;

$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=1;$j<6;$j++){
	if(BINDEC($pdpValue)== $j){
		echo "<option value=\"$j\" selected>$j</option>";
	}else{
		echo "<option value=\"$j\" >$j</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"reliabilityClass_2_name\" value=\"PDP context (group 2) Reliability class\">";
echo "<input type=\"hidden\" name=\"reliabilityClass_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"reliabilityClass_2_ddef\" value=\"reliabilityClass_def\">";
$i++;

$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=1;$j<5;$j++){
	if(BINDEC($pdpValue)== $j){
		echo "<option value=\"$j\" selected>$j</option>";
	}else{
		echo "<option value=\"$j\" >$j</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"delayClass_2_name\" value=\"PDP context (group 2) Delay class\">";
echo "<input type=\"hidden\" name=\"delayClass_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"delayClass_2_ddef\" value=\"delayClass_def\">";
$i++;

$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpPrecedenceClassDef);$j++){
	if($pdpPrecedenceClassDef[$j][0]== BINDEC($pdpValue)){
		echo "xxx={$pdpPrecedenceClass[$j][0]}";
		echo "<option value=\"{$pdpPrecedenceClassDef[$j][0]}\" selected>{$pdpPrecedenceClassDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpPrecedenceClassDef[$j][0]}\" >{$pdpPrecedenceClassDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"precedenceClass_2_name\" value=\"PDP context (group 2) Precedence class\">";
echo "<input type=\"hidden\" name=\"precedenceClass_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"precedenceClass_2_ddef\" value=\"precedenceClass_def\">";
$i++;

$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpPeakThroughtputDef);$j++){
	if($pdpPeakThroughtputDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpPeakThroughtputDef[$j][0]}\" selected>{$pdpPeakThroughtputDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpPeakThroughtputDef[$j][0]}\" >{$pdpPeakThroughtputDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"peakThroughput_2_name\" value=\"PDP context (group 2) Peak throughput\">";
echo "<input type=\"hidden\" name=\"peakThroughput_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"peakThroughput_2_ddef\" value=\"peakThroughput_def\">";
$i++;

$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpMeanThroughtputDef);$j++){
	if($pdpMeanThroughtputDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpMeanThroughtputDef[$j][0]}\" selected>{$pdpMeanThroughtputDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpMeanThroughtputDef[$j][0]}\" >{$pdpMeanThroughtputDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"meanThroughput_2_name\" value=\"PDP context (group 2) Mean throughput\">";
echo "<input type=\"hidden\" name=\"meanThroughput_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"meanThroughput_2_ddef\" value=\"meanThroughput_def\">";
$i++;

$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
if('01' == $pdpValue){
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"01\" checked>Allowed";
	echo "&nbsp; ";
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"00\">Not allowed";
}else{
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"01\">Allowed";
	echo "&nbsp; ";
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"00\" checked>Not allowed";
}
echo "</nobr>";
echo "<br>";
echo "<input type=\"hidden\" name=\"vplmnAddressAllowedFlag_2_name\" value=\"PDP context (group 2) VPLMN Address Allowed Flag\">";
echo "<input type=\"hidden\" name=\"vplmnAddressAllowedFlag_2_ppvalue\" value=\"$pdpValue\">";
echo "<input type=\"hidden\" name=\"vplmnAddressAllowedFlag_2_ddef\" value=\"vplmnAddressAllowedFlag_def\">";
$i++;

$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
$j=0;
$tmpPdpValue="";
if($pdpValue!=""){
	for($j=0;$j<64;$j+=2){
		if($pdpValue[$j]=='0'&&$pdpValue[$j+1]=='0')
			break;
		$tmp=sprintf("%c",HEXDEC(substr($pdpValue,$j,2)));
		$tmpPdpValue=$tmpPdpValue.$tmp;
	}
}
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<input type=\"text\" name=\"$pdpName\" maxlength=\"32\" size=\"32\" value=\"$tmpPdpValue\" class=\"text\">";
echo "<input type=\"hidden\" name=\"apn_2_name\" value=\"PDP context (group 2) APN\">";
echo "<input type=\"hidden\" name=\"apn_2_ppvalue\" value=\"$tmpPdpValue\">";
$i++;
echo "</nobr>";
echo "<br>";

//Ext Flag
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpExtFlagDef);$j++){
	if($pdpExtFlagDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpExtFlagDef[$j][0]}\" selected>{$pdpExtFlagDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpExtFlagDef[$j][0]}\" >{$pdpExtFlagDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"ext_flag_2_name\" value=\"PDP context (group 2) Ext flag\">";
echo "<input type=\"hidden\" name=\"ext_flag_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"ext_flag_2_ddef\" value=\"pdpExtFlagDef\">";
$i++;

//Allocation/Retention Priority
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<u><b>Ext Qos</b></u>";
echo "<br><nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<5;$j++){
	if(HEXDEC($pdpValue)== $j){
		echo "<option value=\"$j\" selected>$j</option>";
	}else{
		echo "<option value=\"$j\" >$j</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"allocation_retentionPriority_2_name\" value=\"PDP context (group 2) Allocation/Retention Priority\">";
echo "<input type=\"hidden\" name=\"allocation_retentionPriority_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"allocation_retentionPriority_2_ddef\" value=\"allocationRetentionPriority_def\">";
$i++;

//Delivery err SDUs
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($DeliveryErrSDUsDef);$j++){
	if($DeliveryErrSDUsDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$DeliveryErrSDUsDef[$j][0]}\" selected>{$DeliveryErrSDUsDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$DeliveryErrSDUsDef[$j][0]}\" >{$DeliveryErrSDUsDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"delivery_err_sdus_2_name\" value=\"PDP context (group 2) Delivery err SDUs\">";
echo "<input type=\"hidden\" name=\"delivery_err_sdus_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"delivery_err_sdus_2_ddef\" value=\"DeliveryErrSDUsDef\">";
$i++;

//Delivery order
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($deliveryOrderDef);$j++){
	if($deliveryOrderDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$deliveryOrderDef[$j][0]}\" selected>{$deliveryOrderDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$deliveryOrderDef[$j][0]}\" >{$deliveryOrderDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"delivery_order_2_name\" value=\"PDP context (group 2) Delivery order\">";
echo "<input type=\"hidden\" name=\"delivery_order_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"delivery_order_2_ddef\" value=\"deliveryOrderDef\">";
$i++;

//Traffic class
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($trafficClassDef);$j++){
	if($trafficClassDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$trafficClassDef[$j][0]}\" selected>{$trafficClassDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$trafficClassDef[$j][0]}\" >{$trafficClassDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"traffic_class_2_name\" value=\"PDP context (group 2) Traffic class\">";
echo "<input type=\"hidden\" name=\"traffic_class_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"traffic_class_2_ddef\" value=\"trafficClassDef\">";
$i++;

//Maximum SDU size
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpMaximumSDUsizeDef);$j++){
	if($pdpMaximumSDUsizeDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpMaximumSDUsizeDef[$j][0]}\" selected>{$pdpMaximumSDUsizeDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpMaximumSDUsizeDef[$j][0]}\" >{$pdpMaximumSDUsizeDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumSDUsize_2_name\" value=\"PDP context (group 2) Maximum SDU size\">";
echo "<input type=\"hidden\" name=\"maximumSDUsize_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumSDUsize_2_ddef\" value=\"pdpMaximumSDUsizeDef\">";
$i++;

//Maximum bit rate for uplink range
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1 id=\"range1_2\" onChange=\"javascript:selectlimit('range1_2','base1_2');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkRanDef);$j++){
	if($pdpRateDownUplinkRanDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" selected>{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" >{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumRateUplinkRan_2_name\" value=\"PDP context (group 2) Maximum bit rate for uplink\">";
echo "<input type=\"hidden\" name=\"maximumRateUplinkRan_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumRateUplinkRan_2_ddef\" value=\"pdpRateDownUplinkRanDef\">";
$i++;

//Maximum bit rate for uplink base
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
//echo "<select name='$pdpName' size=1>";
echo "<select name='$pdpName' size=1 id=\"base1_2\" onChange=\"javascript:selectlimit('range1_2','base1_2');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkBasDef);$j++){
	if($pdpRateDownUplinkBasDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" selected>{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" >{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumRateUplinkBas_2_name\" value=\"PDP context (group 2) Maximum bit rate for uplink\">";
echo "<input type=\"hidden\" name=\"maximumRateUplinkBas_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumRateUplinkBas_2_ddef\" value=\"pdpRateDownUplinkBasDef\">";
$i++;

//Maximum bit rate for downlink range
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;";
echo "<select name='$pdpName' size=1 id=\"range2_2\" onChange=\"javascript:selectlimit('range2_2','base2_2');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkRanDef);$j++){
	if($pdpRateDownUplinkRanDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" selected>{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" >{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumRateDownlinkRan_2_name\" value=\"PDP context (group 2) Maximum bit rate for downlink\">";
echo "<input type=\"hidden\" name=\"maximumRateDownlinkRan_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumRateDownlinkRan_2_ddef\" value=\"pdpRateDownUplinkRanDef\">";
$i++;

//Maximum bit rate for downlink base
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
//echo "<select name='$pdpName' size=1>";
echo "<select name='$pdpName' size=1 id=\"base2_2\" onChange=\"javascript:selectlimit('range2_2','base2_2');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkBasDef);$j++){
	if($pdpRateDownUplinkBasDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" selected>{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" >{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumRateDownlinkBas_2_name\" value=\"PDP context (group 2) Maximum bit rate for downlink\">";
echo "<input type=\"hidden\" name=\"maximumRateDownlinkBas_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumRateDownlinkBas_2_ddef\" value=\"pdpRateDownUplinkBasDef\">";
$i++;

//SDU error ratio
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpSduErrorRatioDef);$j++){
	if($pdpSduErrorRatioDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpSduErrorRatioDef[$j][0]}\" selected>{$pdpSduErrorRatioDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpSduErrorRatioDef[$j][0]}\" >{$pdpSduErrorRatioDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"sduErrorRatio_2_name\" value=\"PDP context (group 2) SDU error ratio\">";
echo "<input type=\"hidden\" name=\"sduErrorRatio_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"sduErrorRatio_2_ddef\" value=\"pdpSduErrorRatioDef\">";
$i++;

//Residual Bit Error Rate
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpResidualErrRateDef);$j++){
	if($pdpResidualErrRateDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpResidualErrRateDef[$j][0]}\" selected>{$pdpResidualErrRateDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpResidualErrRateDef[$j][0]}\" >{$pdpResidualErrRateDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"residualErrRate_2_name\" value=\"PDP context (group 2) Residual Bit Error Rate\">";
echo "<input type=\"hidden\" name=\"residualErrRate_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"residualErrRate_2_ddef\" value=\"pdpResidualErrRateDef\">";
$i++;

//Traffic handing priority
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpTrafficHandingPriorityDef);$j++){
	if($pdpTrafficHandingPriorityDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpTrafficHandingPriorityDef[$j][0]}\" selected>{$pdpTrafficHandingPriorityDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpTrafficHandingPriorityDef[$j][0]}\" >{$pdpTrafficHandingPriorityDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"trafficHandingPriority_2_name\" value=\"PDP context (group 2) Traffic handing priority\">";
echo "<input type=\"hidden\" name=\"trafficHandingPriority_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"trafficHandingPriority_2_ddef\" value=\"pdpTrafficHandingPriorityDef\">";
$i++;

//Transfer delay
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpTransferDelayDef);$j++){
	if($pdpTransferDelayDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpTransferDelayDef[$j][0]}\" selected>{$pdpTransferDelayDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpTransferDelayDef[$j][0]}\" >{$pdpTransferDelayDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"transferDelay_2_name\" value=\"PDP context (group 2) Transfer delay\">";
echo "<input type=\"hidden\" name=\"transferDelay_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"transferDelay_2_ddef\" value=\"pdpTransferDelayDef\">";
$i++;

//Guaranteed bit rate uplink range
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1 id=\"range3_2\" onChange=\"javascript:selectlimit('range3_2','base3_2');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkRanDef);$j++){
	if($pdpRateDownUplinkRanDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" selected>{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" >{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkRan_2_name\" value=\"PDP context (group 2) Guaranteed bit rate uplink\">";
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkRan_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkRan_2_ddef\" value=\"pdpRateDownUplinkRanDef\">";
$i++;

//Guaranteed bit rate uplink base
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
//echo "<select name='$pdpName' size=1>";
echo "<select name='$pdpName' size=1 id=\"base3_2\" onChange=\"javascript:selectlimit('range3_2','base3_2');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkBasDef);$j++){
	if($pdpRateDownUplinkBasDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" selected>{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" >{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkBas_2_name\" value=\"PDP context (group 2) Guaranteed bit rate uplink\">";
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkBas_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkBas_2_ddef\" value=\"pdpRateDownUplinkBasDef\">";
$i++;

//Guaranteed bit rate downlink range
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1 id=\"range4_2\" onChange=\"javascript:selectlimit('range4_2','base4_2');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkRanDef);$j++){
	if($pdpRateDownUplinkRanDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" selected>{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" >{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkRan_2_name\" value=\"PDP context (group 2) Guaranteed bit rate downlink\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkRan_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkRan_2_ddef\" value=\"pdpRateDownUplinkRanDef\">";
$i++;

//Guaranteed bit rate downlink base
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
//echo "<select name='$pdpName' size=1 id=\"base4_2\">";
echo "<select name='$pdpName' size=1 id=\"base4_2\" onChange=\"javascript:selectlimit('range4_2','base4_2');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkBasDef);$j++){
	if($pdpRateDownUplinkBasDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" selected>{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" >{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkBas_2_name\" value=\"PDP context (group 2) Guaranteed bit rate downlink\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkBas_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkBas_2_ddef\" value=\"pdpRateDownUplinkBasDef\">";
$i++;

//Source statistics descriptor
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<u><b>Ext2 Qos</b></u>";
echo "<br><nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpSourceStatisticsDescriptorDef);$j++){
	if($pdpSourceStatisticsDescriptorDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpSourceStatisticsDescriptorDef[$j][0]}\" selected>{$pdpSourceStatisticsDescriptorDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpSourceStatisticsDescriptorDef[$j][0]}\" >{$pdpSourceStatisticsDescriptorDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"sourceStatisticsDescriptor_2_name\" value=\"PDP context (group 2) Source statistics descriptor\">";
echo "<input type=\"hidden\" name=\"sourceStatisticsDescriptor_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"sourceStatisticsDescriptor_2_ddef\" value=\"pdpSourceStatisticsDescriptorDef\">";
$i++;

//Signalling Indication
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpSignallingIndicationDef);$j++){
	if($pdpSignallingIndicationDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpSignallingIndicationDef[$j][0]}\" selected>{$pdpSignallingIndicationDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpSignallingIndicationDef[$j][0]}\" >{$pdpSignallingIndicationDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"signallingIndication_2_name\" value=\"PDP context (group 2) Signalling Indication\">";
echo "<input type=\"hidden\" name=\"signallingIndication_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"signallingIndication_2_ddef\" value=\"pdpSignallingIndicationDef\">";
$i++;

//Reserved
/*$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
/*for($j=0;$j<sizeof($pdpSignallingIndicationDef);$j++){
	if($pdpSignallingIndicationDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpSignallingIndicationDef[$j][0]}\" selected>{$pdpSignallingIndicationDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpSignallingIndicationDef[$j][0]}\" >{$pdpSignallingIndicationDef[$j][1]}</option>";
	}
}*/
/*echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"reserved_2_name\" value=\"PDP context (group 1) reserved\">";
echo "<input type=\"hidden\" name=\"reserved_2_ppvalue\" value=\"$tmpValue\">";
//echo "<input type=\"hidden\" name=\"reserved_2_ddef\" value=\"pdpreservedDef\">";
*/
$i++;

//Maximum bit rate downlink(ext)
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpMaximumDownlinkExtDef);$j++){
	if($pdpMaximumDownlinkExtDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpMaximumDownlinkExtDef[$j][0]}\" selected>{$pdpMaximumDownlinkExtDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpMaximumDownlinkExtDef[$j][0]}\" >{$pdpMaximumDownlinkExtDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumDownlinkExt_2_name\" value=\"PDP context (group 2) Maximum bit rate downlink(ext)\">";
echo "<input type=\"hidden\" name=\"maximumDownlinkExt_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumDownlinkExt_2_ddef\" value=\"pdpMaximumDownlinkExtDef\">";
$i++;

//Guaranteed bit rate downlink(ext)
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpGuaranteedDownlinkExtDef);$j++){
	if($pdpGuaranteedDownlinkExtDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpGuaranteedDownlinkExtDef[$j][0]}\" selected>{$pdpGuaranteedDownlinkExtDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpGuaranteedDownlinkExtDef[$j][0]}\" >{$pdpGuaranteedDownlinkExtDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkExt_2_name\" value=\"PDP context (group 2) Guaranteed bit rate downlink(ext)\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkExt_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkExt_2_ddef\" value=\"pdpGuaranteedDownlinkExtDef\">";
$i++;

//Maximum bit rate uplink(ext)
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<u><b>Ext3 Qos</b></u>";
echo "<br><nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpMaximumUplinkExtDef);$j++){
	if($pdpMaximumUplinkExtDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpMaximumUplinkExtDef[$j][0]}\" selected>{$pdpMaximumUplinkExtDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpMaximumUplinkExtDef[$j][0]}\" >{$pdpMaximumUplinkExtDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumUplink_2_name\" value=\"PDP context (group 2) Maximum bit rate uplink(ext)\">";
echo "<input type=\"hidden\" name=\"maximumUplink_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumUplink_2_ddef\" value=\"pdpMaximumUplinkExtDef\">";
$i++;

//Guaranteed bit rate uplink(ext)
$pdpValue=getBitValue($pdp_2,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_2';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpGuaranteedUplinkExtDef);$j++){
	if($pdpGuaranteedUplinkExtDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpGuaranteedUplinkExtDef[$j][0]}\" selected>{$pdpGuaranteedUplinkExtDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpGuaranteedUplinkExtDef[$j][0]}\" >{$pdpGuaranteedUplinkExtDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedUplinkExt_2_name\" value=\"PDP context (group 2) Guaranteed bit rate uplink(ext)\">";
echo "<input type=\"hidden\" name=\"guaranteedUplinkExt_2_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedUplinkExt_2_ddef\" value=\"pdpGuaranteedUplinkExtDef\">";


echo "</nobr>";
echo "<br>";
echo "</td>";

echo "<td>PDP context identifier: 1-3.";
echo "<br>PDP Type: 0x0121 = IPv4, 0x0157 = IPv6, 0x0000 = X.25";
echo "<br>PDP Address:";
echo "<br>IPv4 Len = 4, <IPv4 hex address>";
echo "<br>IPv6 Len = 16, <IPv6 hex address>";
echo "<br>X.25 Len = 3 to 9, <X.121 address digits>";
echo "<br>Empty Address· Field of any type has Len =0";
echo "<br>QoS";
echo "<br>Reliability Class:";
echo "<br>1 = Error sensitive,no error correction,limited error tolerance, non real-time traffic";
echo "<br>2 = Error sensitive, limited error correction,good error tolerance, non real-time traffic";
echo "<br>3 = Not error sensitive, error correction capability and/or very good error tolerance capability, non real-time traffic";
echo "<br>4 = Real-time traffic, error sensitive, cope with data loss5 = Real-time traffic, error non-sensitive, cope with data loss";
echo "<br>Delay Class:	1 (predictive), 2 (predictive), 3 (predictive) and 4 (Best effort)";
echo "<br>Precedence Class: 1 = High, 2 = Normal, 3 = Low";
echo "<br>Peak Throughput	1 through 9 (8 Kbps to 2.048 Kbps)";
echo "<br>Mean Throughput	1 through 18 (100 to 50 Million Octets per sec), and 31(Best effort)";
echo "<br>VPLMN Address Allowed: 0 = Not Allowed, 1 = Allowed";
echo "<br>APN:Specific APN name APN is made of one or more labels. Each label is made of a length byte and that many number of octets coded in ASCII of A-Z, a-z, 0-9, and “-“(dash). APN cannot exceed 63 octets. It should not start with strings “rac”,”lac” or “sgsn” and it should not end with “.gprs”. APN stored at HLR is not terminated by a length byte of zero.Wild card “*” Len = 1 and single octet coded with ASCII of  asterisks.";
echo "<br>Ext Flag:0 = Non-included Ext,1 = Included Ext,3 = Included Ext and Ext2 only 1 octet,7 = Included Ext, Ext2 Qos,15 = Included Ext, Ext2, EXt3 Qos.";
echo "<br>Ext Qos";
echo "<br>Allocation/Retention Priority:There are four priority : Priority 1,Priority 2,Priority 3,Priority 4.";
echo "<br>Delivery err SDUs:1=No detect,2=Err SDUs delilvered,3=Err SDUs not delivered,7=Reserved";
echo "<br>Delivery order:1 =with delivery order,2 = without delivery order,3 = Reserved";
echo "<br>Traffic class:1=Conversation class,2=Streaming class,3=Interactive class,4=Background class,7=Reserved";
echo "<br>Maximum SDU size:Giving a range of values from 10 octets to 1520 octets";
echo "<br>1=10 octets,20=200 octets,80=800 octets,100=1000 octets,148=1480 octets,150=1500 octets,151=1502 octets,152=1510 octets,153=1520 octets,255=Reserved";
echo "<br>Maximum bit rate for uplink range:0 through 63 (0 Kbps to 63 Kbps)";
echo "<br>Maximum bit rate for uplink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)";
echo "<br>Maximum bit rate for downlink range:0 through 63 (0 Kbps to 63 Kbps)";
echo "<br>Maximum bit rate for downlink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)";
echo "<br>SDU error ratio:The range is from 5E-2 to 6E-8,1=1E-2,2=7E-3,3=1E-3,4=1E-4,5=1E-5,6=1E-6,7=1E-1,15=Reserved";
echo "<br>Residual Bit Error Rate:The range is from 1E-1 to 1E-6,1=5E-2,2=1E-2,3=5E-3,4=4E-3,5=1E-3,6=1E-4,7=1E-5,8=1E-6,9=6E-8,15=Reserved";
echo "<br>Traffic handing priority:1=priority Level 1,2=priority Level 2,3=priority Level 3,0=Reserved";
echo "<br>Transfer delay:0=X*10ms,1=200ms+X*50ms,2=1000ms+X*100ms,3=2600ms+X*100ms";
echo "<br>Guaranteed bit rate uplink range:0 through 63 (0 Kbps to 63 Kbps)";
echo "<br>Guaranteed bit rate uplink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)";
echo "<br>Guaranteed bit rate downlink range:0 through 63 (0 Kbps to 63 Kbps)";
echo "<br>Guaranteed bit rate downlink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)";
echo "<br>Ext2 Qos";
echo "<br>Source Statistics Descriptor:0=Spare,1=Speech (MS=>NW)";
echo "<br>Signalling Indication:0=Not Optimised for Signalling Traffic,1=Optimised for Signalling Traffic.";
echo "<br>Reserved:66.5-66.7";
echo "<br>Maximum bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)";
echo "<br>Guaranteed bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps)250(256Mbps)";
echo "<br>Ext3 Qos";
echo "<br>Maximum bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)";
echo "<br>Guaranteed bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)";

echo "</td>";
echo "</tr>";


//pdp context (group 3)
$pdp_3=$tmpRow[pdp3];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>PDP context (group 3)</td>";
echo "<td>";
echo "<input type=\"hidden\" name=\"pdp_3\" value=\"$pdp_3\">";
$i=0;
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
if('01' == $pdpValue){
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"01\" checked>Enable";
	echo "&nbsp;";
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"00\">Disable";
}else{
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"01\">Enable";
	echo "&nbsp;";
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"00\" checked>Disable";
}
echo "</nobr>";
echo "<br>";
echo "<input type=\"hidden\" name=\"pdpFlag_3_name\" value=\"PDP context (group 3) PDP flag\">";
echo "<input type=\"hidden\" name=\"pdpFlag_3_ppvalue\" value=\"$pdpValue\">";
echo "<input type=\"hidden\" name=\"pdpFlag_3_ddef\" value=\"gprs_flag_def\">";
$i++;

$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpPdpTypeDef);$j++){
	if($pdpPdpTypeDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpPdpTypeDef[$j][0]}\" selected>{$pdpPdpTypeDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpPdpTypeDef[$j][0]}\" >{$pdpPdpTypeDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"pdpType_3_name\" value=\"PDP context (group 3) PDP type\">";
echo "<input type=\"hidden\" name=\"pdpType_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"pdpType_3_ddef\" value=\"pdp_type_def\">";
$i++;

$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$addressLen=hexdec(getBitValue($pdp_3,$pdpContextDef[35][1]));
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
if('289' == HEXDEC(getBitValue($pdp_3,$pdpContextDef[$i-1][1]))){
	$tmpPdpValue=HEXDEC(substr($pdpValue,0,2)).'.'.HEXDEC(substr($pdpValue,2,2)).'.'.HEXDEC(substr($pdpValue,4,2)).'.'.HEXDEC(substr($pdpValue,6,2));
	if($addressLen == 0)
		$tmpPdpValue="";
	echo "<input type=\"text\" name=\"$pdpName\" maxlength=\"39\" size=\"39\" value=\"$tmpPdpValue\" class=\"text\">";
}else if('343' == HEXDEC(getBitValue($pdp_3,$pdpContextDef[$i-1][1]))){
	$tmpPdpValue=substr($pdpValue,0,4).':'.substr($pdpValue,4,4).':'.substr($pdpValue,8,4).':'.substr($pdpValue,12,4).':'.substr($pdpValue,16,4).':'.substr($pdpValue,20,4).':'.substr($pdpValue,24,4).':'.substr($pdpValue,28,4);
	echo "<input type=\"text\" name=\"$pdpName\" maxlength=\"39\" size=\"39\" value=\"$tmpPdpValue\" class=\"text\">";
}else{
	$tmpArr=explode("E",$pdpValue);
	$tmpPdpValue=$tmpArr[0];
	echo "<input type=\"text\" name=\"$pdpName\" maxlength=\"39\" size=\"39\" value=\"$tmpPdpValue\" class=\"text\">";
}
echo "</nobr>";
echo "<br>";
echo "<input type=\"hidden\" name=\"pdpAddress_3_name\" value=\"PDP context (group 3) PDP address\">";
echo "<input type=\"hidden\" name=\"pdpAddress_3_ppvalue\" value=\"$tmpPdpValue\">";
$i++;

$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=1;$j<6;$j++){
	if(BINDEC($pdpValue)== $j){
		echo "<option value=\"$j\" selected>$j</option>";
	}else{
		echo "<option value=\"$j\" >$j</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"reliabilityClass_3_name\" value=\"PDP context (group 3) Reliability class\">";
echo "<input type=\"hidden\" name=\"reliabilityClass_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"reliabilityClass_3_ddef\" value=\"reliabilityClass_def\">";
$i++;

$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=1;$j<5;$j++){
	if(BINDEC($pdpValue)== $j){
		echo "<option value=\"$j\" selected>$j</option>";
	}else{
		echo "<option value=\"$j\" >$j</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"delayClass_3_name\" value=\"PDP context (group 3) Delay class\">";
echo "<input type=\"hidden\" name=\"delayClass_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"delayClass_3_ddef\" value=\"delayClass_def\">";
$i++;

$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpPrecedenceClassDef);$j++){
	if($pdpPrecedenceClassDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpPrecedenceClassDef[$j][0]}\" selected>{$pdpPrecedenceClassDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpPrecedenceClassDef[$j][0]}\" >{$pdpPrecedenceClassDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"precedenceClass_3_name\" value=\"PDP context (group 3) Precedence class\">";
echo "<input type=\"hidden\" name=\"precedenceClass_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"precedenceClass_3_ddef\" value=\"precedenceClass_def\">";
$i++;

$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpPeakThroughtputDef);$j++){
	if($pdpPeakThroughtputDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpPeakThroughtputDef[$j][0]}\" selected>{$pdpPeakThroughtputDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpPeakThroughtputDef[$j][0]}\" >{$pdpPeakThroughtputDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"peakThroughput_3_name\" value=\"PDP context (group 3) Peak throughput\">";
echo "<input type=\"hidden\" name=\"peakThroughput_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"peakThroughput_3_ddef\" value=\"peakThroughput_def\">";
$i++;

$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpMeanThroughtputDef);$j++){
	if($pdpMeanThroughtputDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpMeanThroughtputDef[$j][0]}\" selected>{$pdpMeanThroughtputDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpMeanThroughtputDef[$j][0]}\" >{$pdpMeanThroughtputDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"meanThroughput_3_name\" value=\"PDP context (group 3) Mean throughput\">";
echo "<input type=\"hidden\" name=\"meanThroughput_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"meanThroughput_3_ddef\" value=\"meanThroughput_def\">";
$i++;

$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
if('01' == $pdpValue){
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"01\" checked>Allowed";
	echo "&nbsp; ";
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"00\">Not allowed";
}else{
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"01\">Allowed";
	echo "&nbsp; ";
	echo "<input type=\"radio\" name=\"$pdpName\" value=\"00\" checked>Not allowed";
}
echo "</nobr>";
echo "<br>";
echo "<input type=\"hidden\" name=\"vplmnAddressAllowedFlag_3_name\" value=\"PDP context (group 3) VPLMN Address Allowed Flag\">";
echo "<input type=\"hidden\" name=\"vplmnAddressAllowedFlag_3_ppvalue\" value=\"$pdpValue\">";
echo "<input type=\"hidden\" name=\"vplmnAddressAllowedFlag_3_ddef\" value=\"vplmnAddressAllowedFlag_def\">";
$i++;

$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
$j=0;
$tmpPdpValue="";
if($pdpValue!=""){
	for($j=0;$j<64;$j+=2){
		if($pdpValue[$j]=='0'&&$pdpValue[$j+1]=='0')
			break;
		$tmp=sprintf("%c",HEXDEC(substr($pdpValue,$j,2)));
		$tmpPdpValue=$tmpPdpValue.$tmp;
	}
}
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<input type=\"text\" name=\"$pdpName\" maxlength=\"32\" size=\"32\" value=\"$tmpPdpValue\" class=\"text\">";
echo "<input type=\"hidden\" name=\"apn_3_name\" value=\"PDP context (group 3) APN\">";
echo "<input type=\"hidden\" name=\"apn_3_ppvalue\" value=\"$tmpPdpValue\">";
$i++;
echo "</nobr>";
echo "<br>";

//Ext Flag
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpExtFlagDef);$j++){
	if($pdpExtFlagDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpExtFlagDef[$j][0]}\" selected>{$pdpExtFlagDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpExtFlagDef[$j][0]}\" >{$pdpExtFlagDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"ext_flag_3_name\" value=\"PDP context (group 3) Ext flag\">";
echo "<input type=\"hidden\" name=\"ext_flag_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"ext_flag_3_ddef\" value=\"pdpExtFlagDef\">";
$i++;

//Allocation/Retention Priority
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<u><b>Ext Qos</b></u>";
echo "<br><nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<5;$j++){
	if(HEXDEC($pdpValue)== $j){
		echo "<option value=\"$j\" selected>$j</option>";
	}else{
		echo "<option value=\"$j\" >$j</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"allocation_retentionPriority_3_name\" value=\"PDP context (group 3) Allocation/Retention Priority\">";
echo "<input type=\"hidden\" name=\"allocation_retentionPriority_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"allocation_retentionPriority_3_ddef\" value=\"allocationRetentionPriority_def\">";
$i++;

//Delivery err SDUs
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($DeliveryErrSDUsDef);$j++){
	if($DeliveryErrSDUsDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$DeliveryErrSDUsDef[$j][0]}\" selected>{$DeliveryErrSDUsDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$DeliveryErrSDUsDef[$j][0]}\" >{$DeliveryErrSDUsDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"delivery_err_sdus_3_name\" value=\"PDP context (group 3) Delivery err SDUs\">";
echo "<input type=\"hidden\" name=\"delivery_err_sdus_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"delivery_err_sdus_3_ddef\" value=\"DeliveryErrSDUsDef\">";
$i++;

//Delivery order
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($deliveryOrderDef);$j++){
	if($deliveryOrderDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$deliveryOrderDef[$j][0]}\" selected>{$deliveryOrderDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$deliveryOrderDef[$j][0]}\" >{$deliveryOrderDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"delivery_order_3_name\" value=\"PDP context (group 3) Delivery order\">";
echo "<input type=\"hidden\" name=\"delivery_order_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"delivery_order_3_ddef\" value=\"deliveryOrderDef\">";
$i++;

//Traffic class
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($trafficClassDef);$j++){
	if($trafficClassDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$trafficClassDef[$j][0]}\" selected>{$trafficClassDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$trafficClassDef[$j][0]}\" >{$trafficClassDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"traffic_class_3_name\" value=\"PDP context (group 3) Traffic class\">";
echo "<input type=\"hidden\" name=\"traffic_class_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"traffic_class_3_ddef\" value=\"trafficClassDef\">";
$i++;

//Maximum SDU size
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpMaximumSDUsizeDef);$j++){
	if($pdpMaximumSDUsizeDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpMaximumSDUsizeDef[$j][0]}\" selected>{$pdpMaximumSDUsizeDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpMaximumSDUsizeDef[$j][0]}\" >{$pdpMaximumSDUsizeDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumSDUsize_3_name\" value=\"PDP context (group 3) Maximum SDU size\">";
echo "<input type=\"hidden\" name=\"maximumSDUsize_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumSDUsize_3_ddef\" value=\"pdpMaximumSDUsizeDef\">";
$i++;

//Maximum bit rate for uplink range
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1 id=\"range1_3\" onChange=\"javascript:selectlimit('range1_3','base1_3');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkRanDef);$j++){
	if($pdpRateDownUplinkRanDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" selected>{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" >{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumRateUplinkRan_3_name\" value=\"PDP context (group 3) Maximum bit rate for uplink\">";
echo "<input type=\"hidden\" name=\"maximumRateUplinkRan_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumRateUplinkRan_3_ddef\" value=\"pdpRateDownUplinkRanDef\">";
$i++;

//Maximum bit rate for uplink base
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
//echo "<select name='$pdpName' size=1>";
echo "<select name='$pdpName' size=1 id=\"base1_3\" onChange=\"javascript:selectlimit('range1_3','base1_3');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkBasDef);$j++){
	if($pdpRateDownUplinkBasDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" selected>{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" >{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumRateUplinkBas_3_name\" value=\"PDP context (group 3) Maximum bit rate for uplink\">";
echo "<input type=\"hidden\" name=\"maximumRateUplinkBas_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumRateUplinkBas_3_ddef\" value=\"pdpRateDownUplinkBasDef\">";
$i++;

//Maximum bit rate for downlink range
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;";
echo "<select name='$pdpName' size=1 id=\"range2_3\" onChange=\"javascript:selectlimit('range2_3','base2_3');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkRanDef);$j++){
	if($pdpRateDownUplinkRanDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" selected>{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" >{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumRateDownlinkRan_3_name\" value=\"PDP context (group 3) Maximum bit rate for downlink\">";
echo "<input type=\"hidden\" name=\"maximumRateDownlinkRan_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumRateDownlinkRan_3_ddef\" value=\"pdpRateDownUplinkRanDef\">";
$i++;

//Maximum bit rate for downlink base
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
//echo "<select name='$pdpName' size=1>";
echo "<select name='$pdpName' size=1 id=\"base2_3\" onChange=\"javascript:selectlimit('range2_3','base2_3');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkBasDef);$j++){
	if($pdpRateDownUplinkBasDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" selected>{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" >{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumRateDownlinkBas_3_name\" value=\"PDP context (group 3) Maximum bit rate for downlink\">";
echo "<input type=\"hidden\" name=\"maximumRateDownlinkBas_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumRateDownlinkBas_3_ddef\" value=\"pdpRateDownUplinkBasDef\">";
$i++;

//SDU error ratio
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpSduErrorRatioDef);$j++){
	if($pdpSduErrorRatioDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpSduErrorRatioDef[$j][0]}\" selected>{$pdpSduErrorRatioDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpSduErrorRatioDef[$j][0]}\" >{$pdpSduErrorRatioDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"sduErrorRatio_3_name\" value=\"PDP context (group 3) SDU error ratio\">";
echo "<input type=\"hidden\" name=\"sduErrorRatio_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"sduErrorRatio_3_ddef\" value=\"pdpSduErrorRatioDef\">";
$i++;

//Residual Bit Error Rate
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpResidualErrRateDef);$j++){
	if($pdpResidualErrRateDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpResidualErrRateDef[$j][0]}\" selected>{$pdpResidualErrRateDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpResidualErrRateDef[$j][0]}\" >{$pdpResidualErrRateDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"residualErrRate_3_name\" value=\"PDP context (group 3) Residual Bit Error Rate\">";
echo "<input type=\"hidden\" name=\"residualErrRate_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"residualErrRate_3_ddef\" value=\"pdpResidualErrRateDef\">";
$i++;

//Traffic handing priority
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpTrafficHandingPriorityDef);$j++){
	if($pdpTrafficHandingPriorityDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpTrafficHandingPriorityDef[$j][0]}\" selected>{$pdpTrafficHandingPriorityDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpTrafficHandingPriorityDef[$j][0]}\" >{$pdpTrafficHandingPriorityDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"trafficHandingPriority_3_name\" value=\"PDP context (group 3) Traffic handing priority\">";
echo "<input type=\"hidden\" name=\"trafficHandingPriority_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"trafficHandingPriority_3_ddef\" value=\"pdpTrafficHandingPriorityDef\">";
$i++;

//Transfer delay
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpTransferDelayDef);$j++){
	if($pdpTransferDelayDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpTransferDelayDef[$j][0]}\" selected>{$pdpTransferDelayDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpTransferDelayDef[$j][0]}\" >{$pdpTransferDelayDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"transferDelay_3_name\" value=\"PDP context (group 3) Transfer delay\">";
echo "<input type=\"hidden\" name=\"transferDelay_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"transferDelay_3_ddef\" value=\"pdpTransferDelayDef\">";
$i++;

//Guaranteed bit rate uplink range
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1 id=\"range3_3\" onChange=\"javascript:selectlimit('range3_3','base3_3');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkRanDef);$j++){
	if($pdpRateDownUplinkRanDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" selected>{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" >{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkRan_3_name\" value=\"PDP context (group 3) Guaranteed bit rate uplink\">";
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkRan_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkRan_3_ddef\" value=\"pdpRateDownUplinkRanDef\">";
$i++;

//Guaranteed bit rate uplink base
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
//echo "<select name='$pdpName' size=1>";
echo "<select name='$pdpName' size=1 id=\"base3_3\" onChange=\"javascript:selectlimit('range3_3','base3_3');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkBasDef);$j++){
	if($pdpRateDownUplinkBasDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" selected>{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" >{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkBas_3_name\" value=\"PDP context (group 3) Guaranteed bit rate uplink\">";
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkBas_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedRateUplinkBas_3_ddef\" value=\"pdpRateDownUplinkBasDef\">";
$i++;

//Guaranteed bit rate downlink range
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1 id=\"range4_3\" onChange=\"javascript:selectlimit('range4_3','base4_3');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkRanDef);$j++){
	if($pdpRateDownUplinkRanDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" selected>{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkRanDef[$j][0]}\" >{$pdpRateDownUplinkRanDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkRan_3_name\" value=\"PDP context (group 3) Guaranteed bit rate downlink\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkRan_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkRan_3_ddef\" value=\"pdpRateDownUplinkRanDef\">";
$i++;

//Guaranteed bit rate downlink base
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
//echo "<select name='$pdpName' size=1>";
echo "<select name='$pdpName' size=1 id=\"base4_3\" onChange=\"javascript:selectlimit('range4_3','base4_3');\">";
for($j=0;$j<sizeof($pdpRateDownUplinkBasDef);$j++){
	if($pdpRateDownUplinkBasDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" selected>{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpRateDownUplinkBasDef[$j][0]}\" >{$pdpRateDownUplinkBasDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkBas_3_name\" value=\"PDP context (group 3) Guaranteed bit rate downlink\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkBas_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkBas_3_ddef\" value=\"pdpRateDownUplinkBasDef\">";
$i++;

//Source statistics descriptor
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<u><b>Ext2 Qos</b></u>";
echo "<br><nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpSourceStatisticsDescriptorDef);$j++){
	if($pdpSourceStatisticsDescriptorDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpSourceStatisticsDescriptorDef[$j][0]}\" selected>{$pdpSourceStatisticsDescriptorDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpSourceStatisticsDescriptorDef[$j][0]}\" >{$pdpSourceStatisticsDescriptorDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"sourceStatisticsDescriptor_3_name\" value=\"PDP context (group 3) Source statistics descriptor\">";
echo "<input type=\"hidden\" name=\"sourceStatisticsDescriptor_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"sourceStatisticsDescriptor_3_ddef\" value=\"pdpSourceStatisticsDescriptorDef\">";
$i++;

//Signalling Indication
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpSignallingIndicationDef);$j++){
	if($pdpSignallingIndicationDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpSignallingIndicationDef[$j][0]}\" selected>{$pdpSignallingIndicationDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpSignallingIndicationDef[$j][0]}\" >{$pdpSignallingIndicationDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"signallingIndication_3_name\" value=\"PDP context (group 3) Signalling Indication\">";
echo "<input type=\"hidden\" name=\"signallingIndication_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"signallingIndication_3_ddef\" value=\"pdpSignallingIndicationDef\">";
$i++;

//Reserved
/*$pdpValue=getBitValue($pdp_1,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_1';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
/*for($j=0;$j<sizeof($pdpSignallingIndicationDef);$j++){
	if($pdpSignallingIndicationDef[$j][0]== BINDEC($pdpValue)){
		echo "<option value=\"{$pdpSignallingIndicationDef[$j][0]}\" selected>{$pdpSignallingIndicationDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpSignallingIndicationDef[$j][0]}\" >{$pdpSignallingIndicationDef[$j][1]}</option>";
	}
}*/
/*echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=BINDEC($pdpValue);
echo "<input type=\"hidden\" name=\"reserved_1_name\" value=\"PDP context (group 1) reserved\">";
echo "<input type=\"hidden\" name=\"reserved_1_ppvalue\" value=\"$tmpValue\">";
//echo "<input type=\"hidden\" name=\"reserved_1_ddef\" value=\"pdpreservedDef\">";
*/$i++;

//Maximum bit rate downlink(ext)
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpMaximumDownlinkExtDef);$j++){
	if($pdpMaximumDownlinkExtDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpMaximumDownlinkExtDef[$j][0]}\" selected>{$pdpMaximumDownlinkExtDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpMaximumDownlinkExtDef[$j][0]}\" >{$pdpMaximumDownlinkExtDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumDownlinkExt_3_name\" value=\"PDP context (group 3) Maximum bit rate downlink(ext)\">";
echo "<input type=\"hidden\" name=\"maximumDownlinkExt_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumDownlinkExt_3_ddef\" value=\"pdpMaximumDownlinkExtDef\">";
$i++;

//Guaranteed bit rate downlink(ext)
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpGuaranteedDownlinkExtDef);$j++){
	if($pdpGuaranteedDownlinkExtDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpGuaranteedDownlinkExtDef[$j][0]}\" selected>{$pdpGuaranteedDownlinkExtDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpGuaranteedDownlinkExtDef[$j][0]}\" >{$pdpGuaranteedDownlinkExtDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkExt_3_name\" value=\"PDP context (group 3) Guaranteed bit rate downlink(ext)\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkExt_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedRateDownlinkExt_3_ddef\" value=\"pdpGuaranteedDownlinkExtDef\">";
$i++;

//Maximum bit rate uplink(ext)
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<u><b>Ext3 Qos</b></u>";
echo "<br><nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpMaximumUplinkExtDef);$j++){
	if($pdpMaximumUplinkExtDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpMaximumUplinkExtDef[$j][0]}\" selected>{$pdpMaximumUplinkExtDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpMaximumUplinkExtDef[$j][0]}\" >{$pdpMaximumUplinkExtDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"maximumUplink_3_name\" value=\"PDP context (group 3) Maximum bit rate uplink(ext)\">";
echo "<input type=\"hidden\" name=\"maximumUplink_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"maximumUplink_3_ddef\" value=\"pdpMaximumUplinkExtDef\">";
$i++;

//Guaranteed bit rate uplink(ext)
$pdpValue=getBitValue($pdp_3,$pdpContextDef[$i][1]);
$pdpName=$pdpContextDef[$i][0].'_3';
echo "<nobr>{$pdpContextDef[$i][2]}:";
echo "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;";
echo "<select name='$pdpName' size=1>";
for($j=0;$j<sizeof($pdpGuaranteedUplinkExtDef);$j++){
	if($pdpGuaranteedUplinkExtDef[$j][0]== HEXDEC($pdpValue)){
		echo "<option value=\"{$pdpGuaranteedUplinkExtDef[$j][0]}\" selected>{$pdpGuaranteedUplinkExtDef[$j][1]}</option>";
	}else{
		echo "<option value=\"{$pdpGuaranteedUplinkExtDef[$j][0]}\" >{$pdpGuaranteedUplinkExtDef[$j][1]}</option>";
	}
}echo "</select>";
echo "</nobr>";
echo "<br>";
$tmpValue=HEXDEC($pdpValue);
echo "<input type=\"hidden\" name=\"guaranteedUplinkExt_3_name\" value=\"PDP context (group 3) Guaranteed bit rate uplink(ext)\">";
echo "<input type=\"hidden\" name=\"guaranteedUplinkExt_3_ppvalue\" value=\"$tmpValue\">";
echo "<input type=\"hidden\" name=\"guaranteedUplinkExt_3_ddef\" value=\"pdpGuaranteedUplinkExtDef\">";

echo "</nobr>";
echo "<br>";
echo "</td>";

echo "<td>PDP context identifier: 1-3.";
echo "<br>PDP Type: 0x0121 = IPv4, 0x0157 = IPv6, 0x0000 = X.25";
echo "<br>PDP Address:";
echo "<br>IPv4 Len = 4, <IPv4 hex address>";
echo "<br>IPv6 Len = 16, <IPv6 hex address>";
echo "<br>X.25 Len = 3 to 9, <X.121 address digits>";
echo "<br>Empty Address· Field of any type has Len =0";
echo "<br>QoS";
echo "<br>Reliability Class:";
echo "<br>1 = Error sensitive,no error correction,limited error tolerance, non real-time traffic";
echo "<br>2 = Error sensitive, limited error correction,good error tolerance, non real-time traffic";
echo "<br>3 = Not error sensitive, error correction capability and/or very good error tolerance capability, non real-time traffic";
echo "<br>4 = Real-time traffic, error sensitive, cope with data loss5 = Real-time traffic, error non-sensitive, cope with data loss";
echo "<br>Delay Class:	1 (predictive), 2 (predictive), 3 (predictive) and 4 (Best effort)";
echo "<br>Precedence Class: 1 = High, 2 = Normal, 3 = Low";
echo "<br>Peak Throughput	1 through 9 (8 Kbps to 2.048 Kbps)";
echo "<br>Mean Throughput	1 through 18 (100 to 50 Million Octets per sec), and 31(Best effort)";
echo "<br>VPLMN Address Allowed: 0 = Not Allowed, 1 = Allowed";
echo "<br>APN:Specific APN name APN is made of one or more labels. Each label is made of a length byte and that many number of octets coded in ASCII of A-Z, a-z, 0-9, and “-“(dash). APN cannot exceed 63 octets. It should not start with strings “rac”,”lac” or “sgsn” and it should not end with “.gprs”. APN stored at HLR is not terminated by a length byte of zero.Wild card “*” Len = 1 and single octet coded with ASCII of  asterisks.";

echo "<br>Ext Flag:0 = Non-included Ext,1 = Included Ext,3 = Included Ext and Ext2 only 1 octet,7 = Included Ext, Ext2 Qos,15 = Included Ext, Ext2, EXt3 Qos.";
echo "<br>Ext Qos";
echo "<br>Allocation/Retention Priority:There are four priority : Priority 1,Priority 2,Priority 3,Priority 4.";
echo "<br>Delivery err SDUs:1=No detect,2=Err SDUs delilvered,3=Err SDUs not delivered,7=Reserved";
echo "<br>Delivery order:1 =with delivery order,2 = without delivery order,3 = Reserved";
echo "<br>Traffic class:1=Conversation class,2=Streaming class,3=Interactive class,4=Background class,7=Reserved";
echo "<br>Maximum SDU size:Giving a range of values from 10 octets to 1520 octets";
echo "<br>1=10 octets,20=200 octets,80=800 octets,100=1000 octets,148=1480 octets,150=1500 octets,151=1502 octets,152=1510 octets,153=1520 octets,255=Reserved";
echo "<br>Maximum bit rate for uplink range:0 through 63 (0 Kbps to 63 Kbps)";
echo "<br>Maximum bit rate for uplink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)";
echo "<br>Maximum bit rate for downlink range:0 through 63 (0 Kbps to 63 Kbps)";
echo "<br>Maximum bit rate for downlink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)";
echo "<br>SDU error ratio:The range is from 5E-2 to 6E-8,1=1E-2,2=7E-3,3=1E-3,4=1E-4,5=1E-5,6=1E-6,7=1E-1,15=Reserved";
echo "<br>Residual Bit Error Rate:The range is from 1E-1 to 1E-6,1=5E-2,2=1E-2,3=5E-3,4=4E-3,5=1E-3,6=1E-4,7=1E-5,8=1E-6,9=6E-8,15=Reserved";
echo "<br>Traffic handing priority:1=priority Level 1,2=priority Level 2,3=priority Level 3,0=Reserved";
echo "<br>Transfer delay:0=X*10ms,1=200ms+X*50ms,2=1000ms+X*100ms,3=2600ms+X*100ms";
echo "<br>Guaranteed bit rate uplink range:0 through 63 (0 Kbps to 63 Kbps)";
echo "<br>Guaranteed bit rate uplink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)";
echo "<br>Guaranteed bit rate downlink range:0 through 63 (0 Kbps to 63 Kbps)";
echo "<br>Guaranteed bit rate downlink base:0=X*1kbps,1=64kbps+(X*8kbps),2=576kbps+(X*64kbps),3=4672kbps+(X*64kbps)";
echo "<br>Ext2 Qos";
echo "<br>Source Statistics Descriptor:0=Spare,1=Speech (MS=>NW)";
echo "<br>Signalling Indication:0=Not Optimised for Signalling Traffic,1=Optimised for Signalling Traffic.";
echo "<br>Reserved:66.5-66.7";
echo "<br>Maximum bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)";
echo "<br>Guaranteed bit rate downlink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps)250(256Mbps)";
echo "<br>Ext3 Qos";
echo "<br>Maximum bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)";
echo "<br>Guaranteed bit rate uplink (extended):0(<=8600kbps),1(8700kbps),74(16000kbps),75(17Mbps),186(128Mbps),187(130Mbps),250(256Mbps)";
echo "</td>";
echo "</tr>";



//User name
$user_name=$tmpRow[user_name];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>User name</td>";
echo "<td>";
echo "<input name='user_name' value='$user_name' type=\"text\">";
echo "</td>";
echo "<td>User real name. For post-pay subscriber registration</td>";
echo "</tr>";
echo "<input type=\"hidden\" name=\"user_name_name\" value=\"User name\">";
echo "<input type=\"hidden\" name=\"user_name_ppvalue\" value=\"$user_name\">";


//User certificate
$user_certifiacate=$tmpRow[user_certifiacate];
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>User certificate</td>";
echo "<td>";
echo "<input name='user_certifiacate' value='$user_certifiacate' type=\"text\">";
echo "</td>";
echo "<td>User ID</td>";
echo "</tr>";
echo "<input type=\"hidden\" name=\"user_certifiacate_name\" value=\"User certificate\">";
echo "<input type=\"hidden\" name=\"user_certifiacate_ppvalue\" value=\"$user_certifiacate\">";


//VLR number
$vlrNumber=$tmpRow[vlr_num];
$vlrNumber=decodeTelNumber($vlrNumber);	
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>VLR number</td>";
echo "<td>";
echo "&nbsp;$vlrNumber";
echo "</td>";
echo "<td>VLR E.164 number</td>";
echo "</tr>";

//MSC number
$mscNumber=$tmpRow[msc_num];
$mscNumber=decodeTelNumber($mscNumber);	
echo "\n <tr>";
echo "<td> $seqNo </td>";
$seqNo++;
echo "<td>MSC number</td>";
echo "<td>";
echo "&nbsp;$mscNumber";
echo "</td>";
echo "<td>MSC E.164 number</td>";
echo "</tr>";

?>
</table> 
<?php
//*****************************************隐藏输入框,用于传递值****************************************
echo "\n<input type=\"hidden\" name=\"dataTypeNo\"		value=\"$dataTypeNo\">";
echo "\n<input type=\"hidden\" name=\"indexFieldName\"	value=\"$indexFieldName\">";
echo "\n<input type=\"hidden\" name=\"keyValue\"		value=\"$keyValue\">";
?>

</form>
&nbsp;
<?php
adjust_content_tail("down");
?>
</body>
</html>
<?php
flush();
?>
