<?php
require('../../../Interface/Common/Component/ComInitialHead.php');
set_time_limit(500);
require($netsFileConfig['sysCoreRoot_Real'].'Cache/DbDescription/Servicesaleorder.php');
require($netsFileConfig['sysCoreRoot_Real'].'Cache/DbDescription/Servicesaleordercont.php');
require($netsFileConfig['sysCoreRoot_Real'].'Cache/DbDescription/netssyschildsiterecord.php');
require($netsFileConfig['sysCoreRoot_Real'].'Cache/DbDescription/netssyschildsiterecordcont.php');
require($netsFileConfig['sysCoreRoot'].'Inc/m_Servicesale/Servicesale/Servicesaleorder.php');
require($netsFileConfig['sysCoreRoot'].'Inc/m_Nets/System/netssyschildsiterecord.php');
require($netsFileConfig['sysCoreRoot'].'Inc/netsFunc/Func/netsXml.php');


class PaDefault extends CustomPage {
	public function PaDefault(){
		$this->CustomPage();
	}
	public function OnBInitial(){
		//-- ------ #ActionType ------ --
		if ($this->sActionType=='DCollection') {
			$this->OnCollection();
		}
	}
	public function OnCollection(){
		$tmpXml=new netsXml();
		$tmpURL='';
		$tmpData_Parameter=array();
		$tmpErrorCode='SUCCESS';
		$tmpMessage='成功采集指定内容';
		//-- ------ #Check userinfo ------ --
		$tmpAR0=$this->AnalyerRequest('Check',',',0);
		
		$tmpSQL=' SELECT A.uitID,A.uitName,A.uitNumCode
			FROM {Nets.TableHead}netsuserinfo AS A
			WHERE 1=1 AND A.uitRecycle=0 AND A.uitChecked>1 AND 
			A.uitName LIKE \'{Nets.Name}\' AND A.uitNumCode LIKE \'{Nets.NumCode}\' ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Name}',$tmpAR0[0],$tmpSTR);
		$tmpSTR=str_replace('{Nets.NumCode}',$tmpAR0[1],$tmpSTR);
		$tmpData_User=$this->sDb->Search($tmpSTR);
		if (count($tmpData_User)==1) {
		}else {
			$tmpData_Parameter=array(array(
				'ID'=>0,
				'Name'=>'',
				'NumCode'=>'',
				'Callback_Flag'=>'',
				'Callback_ID'=>'',
				'Callback_Index'=>'',
				'Callback_NextFlag'=>'',
				));
			$tmpErrorCode='ERROR';
			$tmpMessage='系统认证错误：您提交用户信息不正确(用户NAME,NUMCODE)';
			$tmpCONTENT[]=array($tmpErrorCode,1,$tmpData_Parameter,$tmpMessage,);
			$this->sMainData=$tmpXml->makeNETSXML($tmpCONTENT);
			return 1;
		}
		
		//Action(ALL.---,SINGLE.---),pID,pIndex,pNextflag(0.normal,1.next)
		//DEMO: ?ActionType=DCollection&DCollection=ALL,0,0,0&Check=uitName,uitNumCode
		$tmpAR0=$this->AnalyerRequest('DCollection',',0,0,0',0);
		$this->sCallback_Flag='';
		$this->sCallback_ID=0;
		$this->sCallback_Index=0;
		$this->sCallback_NextFlag='';
		
		if ($tmpAR0[0]=='ALL') {
			//-- ------ #Get IDS ------ --
			$tmpSQL=' SELECT A.gsnutID
				FROM {Nets.TableHead}gsnavigationunit AS A
				WHERE 1=1 AND A.gsnutRecycle=0 AND A.gsnutChecked>1
				ORDER BY A.gsnutID LIMIT 0,5 ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$tmpData0=$this->sDb->Search($tmpSTR);
			foreach ($tmpData0 as $Row0) {
				$this->sCallback_ID.=$Row0['gsnutID'].$this->sysSPLIT2;
			}
			$this->sCallback_Flag='SETIDS';
			
		}else if ($tmpAR0[0]=='SINGLE') {
			$tmpDbDescriptions=array(
				$this->sysDbDescriptions[$this->sysTableHead.'gsnavigationactive'],
				$this->sysDbDescriptions[$this->sysTableHead.'gsnavigationactivecont'],);
			$this->sApp->sDbDescriptions_Other=array(
				$this->sysDbDescriptions[$this->sysTableHead.'gsnavigationactive'],
				$this->sysDbDescriptions[$this->sysTableHead.'gsnavigationactivecont'],
				);
			$tmpDbDescriptions[0]['Columns']['gsnutID']['Value']=$this->sCode->Int32($tmpAR0[1],0);
			$tmpIndex=$tmpAR0[2];
			$tmpINT=$this->sApp->collection_ID($tmpDbDescriptions,$tmpIndex);
			
			$this->sCallback_Flag='NEXTID';
			$this->sCallback_ID=0;
			$this->sCallback_Index=$tmpIndex;
		}

		$tmpData_Parameter=array(array(
			'ID'=>$tmpData_User[0]['uitID'],
			'Name'=>$tmpData_User[0]['uitName'],
			'NumCode'=>$tmpData_User[0]['uitNumCode'],
			'Callback_Flag'=>$this->sCallback_Flag,
			'Callback_ID'=>$this->sCallback_ID,
			'Callback_Index'=>$this->sCallback_Index,
			'Callback_NextFlag'=>$this->sCallback_NextFlag,
			));
		//-- ------ #MakeXml ------ --
		$tmpCONTENT=array();
		$tmpCONTENT[]=array($tmpErrorCode,1,$tmpData_Parameter,$tmpMessage,);
		$this->sMainData=$tmpXml->makeNETSXML($tmpCONTENT);
		return 0;
	}
	
}
//-- ------ #Instanct ------ --
$tmpDefault=new PaDefault();
$tmpDefault->OnPage();
$tmpDefault->sysMetaTitle=$tmpDefault->sMetaTitle.' - '.$tmpDefault->sysFileConfig['sysTitle'];
//-- ------ #Template ------ --
require($tmpDefault->sysFileConfig['sysCoreRoot'].$tmpDefault->sysInterfaceTemplatePath.'Component/Head_Xml.php');
if($tmpDefault->sActionType=='Error'){
	require($tmpDefault->sysFileConfig['sysCoreRoot'].$tmpDefault->sysInterfaceTemplatePath.'Common/normal_xml.php');
}else {
	require($tmpDefault->sysFileConfig['sysCoreRoot'].$tmpDefault->sysInterfaceTemplatePath.'Common/normal_xml.php');
}
require($tmpDefault->sysFileConfig['sysCoreRoot'].$tmpDefault->sysInterfaceTemplatePath.'Component/End_Xml.php'); ?>