<?php
require('../../../QPlatform/Common/Component/ComInitialHead.php');
require($netsFileConfig['sysCoreRoot_Real'].'Cache/DbDescription/shopsaleorderrecord.php');
require($netsFileConfig['sysCoreRoot_Real'].'Cache/DbDescription/shopsaleorderrecordcont.php');
require($netsFileConfig['sysCoreRoot'].'Inc/m_Shop/Sale/shopcodesaleorder.php');

class PaDefault extends CustomPage {
	public $ssetParid=1;
	
	public function PaDefault(){
		$this->CustomPage();
	}
	public function OnPInitial(){
		$this->checkUser('1,2,3,');
		$this->sTable=array(
			array('sttTableName'=>$this->sysTableHead.'shopcodesaleorder','sttColumnHead'=>'shcsot'),
			array('sttTableName'=>$this->sysTableHead.'shopcodesaleordercont','sttColumnHead'=>'shcsoct'),);
		$this->sUiName='Platform/shop/shopcodesaleorder';
	}
	public function OnBInitial(){
		$this->sMetaTitle='积分订单';
		$this->sLimitCount=0;
		$this->sApp=new shopcodesaleorder($this->sConnString);
		
		//-- ------ #Option ------ --
		//State
		$tmpAR0=$this->sControl->sDbInTemplate;
		$tmpAR0['Connection']=$this->sConnString;
		$tmpAR0['SQL']=$this->sOptionSQL;
		$tmpAR0['InitialString']=110;
		$tmpAR0['Parid']='sotID';
		$tmpAR0['Text']='sotName';
		$tmpAR0['Value']='sotValue';
		$tmpAR0['Type']=1;
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		$tmpCacheFlag='nets/option_Shopsaleorder_state';
		$this->sControl->getOptions($tmpAR0,$tmpCacheFlag,$this->sControl->sDpReturnTemplate,$this->sState1);
		$this->sState2=$this->sState1;
		$tmpAR0=$this->sControl->sDpReturnTemplate;
		$tmpAR0['Text']='[所有订单状态]';
		$tmpAR0['Value']='-1';
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		array_push($this->sState2,$tmpAR0);
		
		//-- ------ #ActionTypeF ------ --
		if($this->sActionTypeF=='Confirm_RecieveConfirm'){
			$this->OnConfirm_RecieveConfirm();
		}else if($this->sActionTypeF=='Confirm_Complete'){
			$this->OnConfirm_Complete();
		}else if($this->sActionTypeF=='Confirm_ReturnsSuccess'){
			$this->OnConfirm_ReturnsSuccess();
		}else if($this->sActionTypeF=='Confirm_Cancel'){
			$this->OnConfirm_Cancel();
		}
		
		
		
	}
	public function OnConfirm_RecieveConfirm(){
		$tmpDbDescriptions=array();
		foreach ($this->sTable as $tableCell){
			$tmpDbDescriptions[]=$this->sDbDescriptions[$tableCell['sttTableName']];
		}
		$tmpMainid=$this->AnalyerRequest('mainID',0,1);
		$this->sMainID=$tmpMainid[0];
		//-- ------ #Operation ------ --
		//-- #Set --
		$tmpDbDescriptions[0]['Columns']['shsortID']['Value']=$this->sMainID;
		$tmpAR0=$this->AnalyerRequest('shsortNumCodeTxt','',1);
		$tmpDbDescriptions[0]['Columns']['shsortNumCode']['Value']=$tmpAR0[0];
		//-- #Record --
		$this->sApp->sDbDescriptions_Other=array(
			$this->sysDbDescriptions[$this->sysTableHead.'shopsaleorderrecord'],
			$this->sysDbDescriptions[$this->sysTableHead.'shopsaleorderrecordcont'],
			);
		$tmpSTR='shsortType';
		$tmpAR0=$this->AnalyerRequest($tmpSTR.'Txt','',1);
		$this->sApp->sDbDescriptions_Other[0]['Columns'][$tmpSTR]['Value']=$this->sCode->Int32($tmpAR0[0],0);
		$tmpSTR='shsorctContent';
		$tmpAR0=$this->AnalyerRequest($tmpSTR.'Txt','',1);
		$this->sApp->sDbDescriptions_Other[1]['Columns'][$tmpSTR]['Value']=$tmpAR0[0];
		$tmpSTR='shsortCreateBy';
		$this->sApp->sDbDescriptions_Other[0]['Columns'][$tmpSTR]['Value']=$this->sMainUserid;
		$tmpSTR='shsortSaleType';
		$this->sApp->sDbDescriptions_Other[0]['Columns'][$tmpSTR]['Value']=0;
		
		//-- ### --
		$tmpINT=$this->sApp->order_RecieveConfirm($tmpDbDescriptions);
		$tmpINT=0;
		if($tmpINT!=0){
			$this->sJscript=$this->Message('ERROR','',$this->sApp->sysLastError,$this->sysPage.'?ActionType=Report&Report='.$tmpMainid[0].',0');
			return 1;
		}
		
		$this->sJscript=$this->Message('SUCCESS','','操作成功',$this->sysPage.'?ActionType=Report&Report='.$tmpMainid[0].',0');
		/*
		$this->sJscript=$this->Message_Frame('A,0',
			$this->sysFileConfig['sysCoreRoot'].$this->sysFileConfig['PathManaFrameMessage'],
			$this->sCode->URL_MakeParameter('添加成功',0),
			$this->sCode->URL_MakeParameter($this->sApp->sysLastError,0),
			$this->sCode->URL_MakeParameter($this->sysFileConfig['sysCoreRoot'].'Mana/m_cms/doc/doc.php',0));
		*/
		return 0;
	}
	public function OnConfirm_Complete(){
		$tmpDbDescriptions=array();
		foreach ($this->sTable as $tableCell){
			$tmpDbDescriptions[]=$this->sDbDescriptions[$tableCell['sttTableName']];
		}
		$tmpMainid=$this->AnalyerRequest('mainID',0,1);
		$this->sMainID=$tmpMainid[0];
		//-- ------ #Operation ------ --
		//-- #Set --
		$tmpDbDescriptions[0]['Columns']['shsortID']['Value']=$this->sMainID;
		$tmpAR0=$this->AnalyerRequest('shsortNumCodeTxt','',1);
		$tmpDbDescriptions[0]['Columns']['shsortNumCode']['Value']=$tmpAR0[0];
		//-- #Record --
		$this->sApp->sDbDescriptions_Other=array(
			$this->sysDbDescriptions[$this->sysTableHead.'shopsaleorderrecord'],
			$this->sysDbDescriptions[$this->sysTableHead.'shopsaleorderrecordcont'],
			);
		$tmpSTR='shsortType';
		$tmpAR0=$this->AnalyerRequest($tmpSTR.'Txt','',1);
		$this->sApp->sDbDescriptions_Other[0]['Columns'][$tmpSTR]['Value']=$this->sCode->Int32($tmpAR0[0],0);
		$tmpSTR='shsorctContent';
		$tmpAR0=$this->AnalyerRequest($tmpSTR.'Txt','',1);
		$this->sApp->sDbDescriptions_Other[1]['Columns'][$tmpSTR]['Value']=$tmpAR0[0];
		$tmpSTR='shsortCreateBy';
		$this->sApp->sDbDescriptions_Other[0]['Columns'][$tmpSTR]['Value']=$this->sMainUserid;
		$tmpSTR='shsortSaleType';
		$this->sApp->sDbDescriptions_Other[0]['Columns'][$tmpSTR]['Value']=0;
		
		//-- ### --
		$tmpINT=$this->sApp->order_Complete($tmpDbDescriptions);
		if($tmpINT!=0){
			$this->sJscript=$this->Message('ERROR','',$this->sApp->sysLastError,$this->sysPage.'?ActionType=Report&Report='.$tmpMainid[0].',0');
			return 1;
		}
		
		$this->sJscript=$this->Message('SUCCESS','','操作成功',$this->sysPage.'?ActionType=Report&Report='.$tmpMainid[0].',0');
		/*
		$this->sJscript=$this->Message_Frame('A,0',
			$this->sysFileConfig['sysCoreRoot'].$this->sysFileConfig['PathManaFrameMessage'],
			$this->sCode->URL_MakeParameter('添加成功',0),
			$this->sCode->URL_MakeParameter($this->sApp->sysLastError,0),
			$this->sCode->URL_MakeParameter($this->sysFileConfig['sysCoreRoot'].'Mana/m_cms/doc/doc.php',0));
		*/
		return 0;
	}
	public function OnConfirm_ReturnsSuccess(){
		$tmpDbDescriptions=array();
		foreach ($this->sTable as $tableCell){
			$tmpDbDescriptions[]=$this->sDbDescriptions[$tableCell['sttTableName']];
		}
		$tmpMainid=$this->AnalyerRequest('mainID',0,1);
		$this->sMainID=$tmpMainid[0];
		//-- ------ #Operation ------ --
		//-- #Set --
		$tmpDbDescriptions[0]['Columns']['shsortID']['Value']=$this->sMainID;
		$tmpAR0=$this->AnalyerRequest('shsortNumCodeTxt','',1);
		$tmpDbDescriptions[0]['Columns']['shsortNumCode']['Value']=$tmpAR0[0];
		//-- #Record --
		$this->sApp->sDbDescriptions_Other=array(
			$this->sysDbDescriptions[$this->sysTableHead.'shopsaleorderrecord'],
			$this->sysDbDescriptions[$this->sysTableHead.'shopsaleorderrecordcont'],
			);
		$tmpSTR='shsortType';
		$tmpAR0=$this->AnalyerRequest($tmpSTR.'Txt','',1);
		$this->sApp->sDbDescriptions_Other[0]['Columns'][$tmpSTR]['Value']=$this->sCode->Int32($tmpAR0[0],0);
		$tmpSTR='shsorctContent';
		$tmpAR0=$this->AnalyerRequest($tmpSTR.'Txt','',1);
		$this->sApp->sDbDescriptions_Other[1]['Columns'][$tmpSTR]['Value']=$tmpAR0[0];
		$tmpSTR='shsortCreateBy';
		$this->sApp->sDbDescriptions_Other[0]['Columns'][$tmpSTR]['Value']=$this->sMainUserid;
		$tmpSTR='shsortSaleType';
		$this->sApp->sDbDescriptions_Other[0]['Columns'][$tmpSTR]['Value']=0;
		
		//-- ### --
		$tmpINT=$this->sApp->order_ReturnsSuccess($tmpDbDescriptions);
		if($tmpINT!=0){
			$this->sJscript=$this->Message('ERROR','',$this->sApp->sysLastError,$this->sysPage.'?ActionType=Report&Report='.$tmpMainid[0].',0');
			return 1;
		}
		
		$this->sJscript=$this->Message('SUCCESS','','操作成功',$this->sysPage.'?ActionType=Report&Report='.$tmpMainid[0].',0');
		/*
		$this->sJscript=$this->Message_Frame('A,0',
			$this->sysFileConfig['sysCoreRoot'].$this->sysFileConfig['PathManaFrameMessage'],
			$this->sCode->URL_MakeParameter('添加成功',0),
			$this->sCode->URL_MakeParameter($this->sApp->sysLastError,0),
			$this->sCode->URL_MakeParameter($this->sysFileConfig['sysCoreRoot'].'Mana/m_cms/doc/doc.php',0));
		*/
		return 0;
	}
	public function OnConfirm_Cancel(){
		$tmpDbDescriptions=array();
		foreach ($this->sTable as $tableCell){
			$tmpDbDescriptions[]=$this->sDbDescriptions[$tableCell['sttTableName']];
		}
		$tmpMainid=$this->AnalyerRequest('mainID',0,1);
		$this->sMainID=$tmpMainid[0];
		//-- ------ #Operation ------ --
		//-- #Set --
		$tmpDbDescriptions[0]['Columns']['shsortID']['Value']=$this->sMainID;
		$tmpAR0=$this->AnalyerRequest('shsortNumCodeTxt','',1);
		$tmpDbDescriptions[0]['Columns']['shsortNumCode']['Value']=$tmpAR0[0];
		//-- #Record --
		$this->sApp->sDbDescriptions_Other=array(
			$this->sysDbDescriptions[$this->sysTableHead.'shopsaleorderrecord'],
			$this->sysDbDescriptions[$this->sysTableHead.'shopsaleorderrecordcont'],
			);
		$tmpSTR='shsortType';
		$tmpAR0=$this->AnalyerRequest($tmpSTR.'Txt','',1);
		$this->sApp->sDbDescriptions_Other[0]['Columns'][$tmpSTR]['Value']=$this->sCode->Int32($tmpAR0[0],0);
		$tmpSTR='shsorctContent';
		$tmpAR0=$this->AnalyerRequest($tmpSTR.'Txt','',1);
		$this->sApp->sDbDescriptions_Other[1]['Columns'][$tmpSTR]['Value']=$tmpAR0[0];
		$tmpSTR='shsortCreateBy';
		$this->sApp->sDbDescriptions_Other[0]['Columns'][$tmpSTR]['Value']=$this->sMainUserid;
		$tmpSTR='shsortSaleType';
		$this->sApp->sDbDescriptions_Other[0]['Columns'][$tmpSTR]['Value']=0;
		
		//-- ### --
		$tmpINT=$this->sApp->order_Cancel($tmpDbDescriptions);
		if($tmpINT!=0){
			$this->sJscript=$this->Message('ERROR','',$this->sApp->sysLastError,$this->sysPage.'?ActionType=Report&Report='.$tmpMainid[0].',0');
			return 1;
		}
		
		$this->sJscript=$this->Message('SUCCESS','','操作成功',$this->sysPage.'?ActionType=Report&Report='.$tmpMainid[0].',0');
		/*
		$this->sJscript=$this->Message_Frame('A,0',
			$this->sysFileConfig['sysCoreRoot'].$this->sysFileConfig['PathManaFrameMessage'],
			$this->sCode->URL_MakeParameter('添加成功',0),
			$this->sCode->URL_MakeParameter($this->sApp->sysLastError,0),
			$this->sCode->URL_MakeParameter($this->sysFileConfig['sysCoreRoot'].'Mana/m_cms/doc/doc.php',0));
		*/
		return 0;
	}
	public function OnList(){
		//-- ------ #Search data ------ --
		$tmpSTR0='DList0';
		$tmpAR0=$this->getQueryString($tmpSTR0);
		$tmpSTR1='DSort0';
		$tmpAR1=$this->AnalyerRequest($tmpSTR1,'shcsotID,2',0);
		$tmpSTR2='Search0';
		$this->sSearchData=$this->AnalyerRequest($tmpSTR2,',,-1',0);
		//#Spell sql
		$tmpSQL=' SELECT A.shcsotID,A.shcsotName,A.shcsotNumCode,A.shcsotState
			FROM '.$this->sysTableHead.'shopcodesaleorder AS A 
			WHERE 1=1 
			AND A.shcsotID>'.$this->sLimitCount;
		if($this->sSearchData[0]!=''){
			$tmpSQL.=' AND A.shcsotName LIKE \'%'.$this->sSearchData[0].'%\' ';
		}
		if($this->sSearchData[1]!=''){
			$tmpSQL.=' AND A.shcsotName LIKE \'%'.$this->sSearchData[1].'%\' ';
		}
		if($this->sSearchData[2]!='-1'){
			$tmpSQL.=' AND A.shcsotState='.$this->sSearchData[2].' ';
		}
		if($tmpAR1[1]==1){
			$tmpSQL.=' ORDER BY '.$tmpAR1[0].' ';
		}else if($tmpAR1[1]==2){
			$tmpSQL.=' ORDER BY '.$tmpAR1[0].' DESC ';
		}
		$this->sListData=$this->sDb->SearchP($tmpSQL,$tmpAR0);
		//#Set page button
		$this->sPButton->sPage=$this->sysPage;
		$this->sPButton->sExtendParameter='&'.$tmpSTR2.'='.
			$this->sSearchData[0].$this->sysSPLIT1.
			$this->sSearchData[1].$this->sysSPLIT1.
			$this->sSearchData[2];
		$this->sPButton->setPage($this->sDb->sysPageInfo);
		$this->sPButton->setSort($tmpAR1);
		$this->sSortButton[0]=array('stcotName'=>'shcsotID','stcoctUiName'=>'编号');
		$this->sSortButton[1]=array('stcotName'=>'shcsotName','stcoctUiName'=>'积分订单名称');
		
		return 0;
	}
	public function OnExternal_Search(){
		//-- ------ #Search data ------ --
		$tmpSTR0='DList0';
		$tmpAR0=$this->getQueryString($tmpSTR0);
		$tmpSTR1='DSort0';
		$tmpAR1=$this->AnalyerRequest($tmpSTR1,'shcsotID,2',0);
		$tmpSTR2='Search0';
		$this->sSearchData=$this->AnalyerRequest($tmpSTR2,',-1',0);
		$this->sExternal_SearchData=$this->AnalyerRequest($this->sActionType,',-1',0);
		//#Spell sql
		$tmpSQL=' SELECT A.shcsotID,A.shcsotName,A.shcsotParid
			FROM '.$this->sysTableHead.'shopcodesaleorder AS A 
			WHERE 1=1 
			AND A.shcsotID>'.$this->sLimitCount;
		if($this->sSearchData[0]!=''){
			$tmpSQL.=' AND A.shcsotName LIKE \'%'.$this->sSearchData[0].'%\' ';
		}
		if($this->sSearchData[1]!='-1'){
			$tmpSQL.=' AND A.shcsotParid='.$this->sSearchData[1].' ';
		}
		if($tmpAR1[1]==1){
			$tmpSQL.=' ORDER BY '.$tmpAR1[0].' ';
		}else if($tmpAR1[1]==2){
			$tmpSQL.=' ORDER BY '.$tmpAR1[0].' DESC ';
		}
		$this->sListData=$this->sDb->SearchP($tmpSQL,$tmpAR0);
		//#Set page button
		$this->sExtendParameter='&ActionType='.$this->sActionType.'&'.$this->sActionType.'='.$this->sExternal_SearchData[0].','.$this->sExternal_SearchData[1];
		$this->sysPages[0]=$this->sysPage.'?'.$this->sExtendParameter;
		
		$this->sPButton->sPage=$this->sysPage;
		$this->sPButton->sExtendParameter='&'.$tmpSTR2.'='.$this->sSearchData[0].$this->sExtendParameter;
		$this->sPButton->setPage($this->sDb->sysPageInfo);
		$this->sPButton->setSort($tmpAR1);
		$this->sSortButton[0]=array('stcotName'=>'shcsotID','stcoctUiName'=>'编号');
		$this->sSortButton[1]=array('stcotName'=>'shcsotName','stcoctUiName'=>'积分订单名称');
		
		return 0;
	}
	public function OnExternal_ChildChoose(){
		//-- ------ #Search data ------ --
		$tmpSTR0='External_ChildChoose';
		$this->sExternal_ChildChooseSData=$this->AnalyerRequest($tmpSTR0,'0,,0,0',0);
		//#Spell sql
		$tmpSQL='';
		if($this->sExternal_ChildChooseSData[0]==0 || $this->sExternal_ChildChooseSData[0]==2){
			//-- Same grade --
			$tmpSQL=' SELECT A.shcsotID,A.shcsotName,A.shcsotParid 
				FROM '.$this->sysTableHead.'shopcodesaleorder AS A
				WHERE 1=1 AND A.shcsotRecycle=0 AND A.shcsotChecked>1 AND 
				A.shcsotParid=(SELECT shcsotParid FROM shopcodesaleorder WHERE 1=1 AND shcsotRecycle=0 AND shcsotChecked>1 AND shcsotID={Nets.ID})
				ORDER BY A.shcsotOrderBy DESC,A.shcsotID DESC ';
		}else if($this->sExternal_ChildChooseSData[0]==1 || $this->sExternal_ChildChooseSData[0]==3){
			//-- Child grade --
			$tmpSQL=' SELECT A.shcsotID,A.shcsotName,A.shcsotParid 
				FROM '.$this->sysTableHead.'shopcodesaleorder AS A
				WHERE 1=1 AND A.shcsotRecycle=0 AND A.shcsotChecked>1 AND A.shcsotParid={Nets.ID}
				ORDER BY A.shcsotOrderBy DESC,A.shcsotID DESC ';
		}
		$tmpSTR=str_replace('{Nets.ID}',$this->sExternal_ChildChooseSData[2],$tmpSQL);
		$this->sExternal_ChildChooseData=$this->sDb->Search($tmpSTR);
		
		return 0;
	}
	public function OnNormal(){
		$tmpINT=0;
		$tmpAR0=$this->AnalyerRequest('Normal','0,0',0);
		
		$tmpSQL=' SELECT * 
			FROM '.$this->sysTableHead.'shopcodesaleorder AS A 
			INNER JOIN '.$this->sysTableHead.'shopcodesaleordercont AS B ON B.shcsoctIndexID=A.shcsotID ';
		$Coun0=2;
		foreach ($this->sTable as $Row0){
			if (count($this->sTable)>2) {
				$tmpSQL.=' INNER JOIN '.$Row0['sttTableName'].' AS '.$this->sysTableMark[$Coun0].' ON '.$this->sysTableMark[$Coun0].'.'.$Row0['sttColumnHead'].'IndexID=A.shcsotID ';
				$Coun0++;
			}
		}
		$tmpSQL.=' WHERE 1=1 AND A.shcsotID='.$tmpAR0[0].' ';
		$tmpDataCollection0=$this->sDb->Search($tmpSQL);
		if(count($tmpDataCollection0)>0){
			$tmpRow=$tmpDataCollection0[0];
			$this->sMainID=$tmpRow[$this->sTable[0]['sttColumnHead'].'ID'];
			//-- #Get value --
			$Coun0=0;
			while (count($this->sUiDescription_Normal)>$Coun0) {
				if(isset($tmpRow[$this->sUiDescription_Normal[$Coun0]['stcotName']])){
					$this->sUiDescription_Normal[$Coun0]['Value']=$tmpRow[$this->sUiDescription_Normal[$Coun0]['stcotName']];
					//-- ------ #Spical set ------ --
					if($this->sUiDescription_Normal[$Coun0]['stcotName']=='shcsotParid'){
					}else if($this->sUiDescription_Normal[$Coun0]['stcotName']=='shcsotModelid_Detail'){
						$this->sUiDescription_Normal[$Coun0]['Value']=$this->sMainTableid;
					}
				}
				$Coun0++;
			}
		}else {
			$Coun0=0;
			foreach($this->sUiDescription_Normal as $Row0){
				if($Row0['stcotName']=='shcsotTableid'){
					$this->sUiDescription_Normal[$Coun0]['Value']=$this->sMainTableid;
				}
				$Coun0++;
			}
		}
	}
	public function OnReport(){
		$tmpAR0=$this->AnalyerRequest('Report','0,0',0);
		
		//-- ------ ### ------ --
		$tmpSQL=' SELECT A.shcsotID,A.shcsotName,A.shcsotNumCode,A.shcsotState,A.shcsotCreateTime,
			A.shcsotPayyet,A.shcsotTotalPrice,
			B.shcsoctSales,B.shcsoctReceiveaddressid,B.shcsoctSendmodelid,B.shcsoctContent
			FROM {Nets.TableHead}shopcodesaleorder AS A
			INNER JOIN {Nets.TableHead}shopcodesaleordercont AS B ON B.shcsoctIndexID=A.shcsotID
			WHERE 1=1 AND A.shcsotID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$tmpAR0[0],$tmpSTR);
		$this->sDetailData=$this->sDb->Search($tmpSTR);
		if (count($this->sDetailData)==0) {
			return 1;
		}
		$this->sMainID=$this->sDetailData[0]['shcsotID'];
		$this->sData_Userinfohabits['Order_Userreceiveaddress']=$this->sDetailData[0]['shcsoctReceiveaddressid'];
		$this->sData_Userinfohabits['Order_Sendmodel']=$this->sDetailData[0]['shcsoctSendmodelid'];

		//-- #Spell SQL --
		$tmpSQL=' SELECT A.shcstID,A.shcstName,A.shcstNameStyle,A.shcstPrice,
			B.shcsctPrice0,B.shcsctDiscount0,B.shcsctCount_PeopleLowLimit,B.shcsctCount_PeopleHighLimit,B.shcsctCount_Total
			FROM {Nets.TableHead}shopcodesale AS A
			INNER JOIN {Nets.TableHead}shopcodesalecont AS B ON B.shcsctIndexID=A.shcstID
			WHERE 1=1 AND A.shcstRecycle=0 AND A.shcstChecked>1 AND (1=2 {Nets.IDS})
			ORDER BY A.shcstOrderBy DESC,A.shcstID DESC ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR_0='';
		$tmpAR0=explode($this->sysSPLIT5,$this->sDetailData[0]['shcsoctSales']);
		foreach ($tmpAR0 as $Row0){
			$tmpAR1=explode($this->sysSPLIT2,$Row0);
			if (count($tmpAR1)==$this->sApp->sCellCount) {
				$tmpSTR_0.=' OR A.shcstID='.$this->sCode->Int32($tmpAR1[0],0);
			}
			
		}
		$tmpSTR=str_replace('{Nets.IDS}',$tmpSTR_0,$tmpSTR);
		$this->sData_Orderlist=$this->sDb->Search($tmpSTR);
		//-- ### --
		$tmpAR0=explode($this->sysSPLIT5,$this->sDetailData[0]['shcsoctSales']);
		$Coun0=0;
		while (count($this->sData_Orderlist)>$Coun0) {
			foreach ($tmpAR0 as $Row0) {
				$tmpAR1=explode($this->sysSPLIT2,$Row0);
				if (count($tmpAR1)==$this->sApp->sCellCount) {
					if ($this->sData_Orderlist[$Coun0]['shcstID']==$tmpAR1[0]) {
						$this->sData_Orderlist[$Coun0]['Count']=$tmpAR1[1];
						$this->sData_Orderlist[$Coun0]['Price']=$tmpAR1[2];
						$this->sData_Orderlist[$Coun0]['Code']=$tmpAR1[3];
						$this->sData_Orderlist[$Coun0]['Activeid']=$tmpAR1[4];
						$this->sData_Orderlist[$Coun0]['Parentid']=$tmpAR1[5];
						$this->sData_Orderlist[$Coun0]['Type']=$tmpAR1[6];
						$this->sData_Orderlist[$Coun0]['Parameters']=$tmpAR1[7];
						
					}
				}
			}
			$Coun0++;
		}
		//-- ------ #Options ------ --
		//State
		$tmpAR0=$this->sControl->sDbInTemplate;
		$tmpAR0['Connection']=$this->sConnString;
		$tmpAR0['SQL']=$this->sOptionSQL;
		$tmpAR0['InitialString']=110;
		$tmpAR0['Parid']='sotID';
		$tmpAR0['Text']='sotName';
		$tmpAR0['Value']='sotValue';
		$tmpAR0['Type']=1;
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		$tmpCacheFlag='nets/shopsaleorder_State';
		$this->sControl->getOptions($tmpAR0,$tmpCacheFlag,$this->sControl->sDpReturnTemplate,$this->sState1);

		//#sReceiveaddress
		$tmpSQL=' SELECT A.shuratID,A.shuratName,
			B.shuractZoneChoose,B.shuractZoneDetail,B.shuractAddress,B.shuractPostCode,B.shuractCompany,
			B.shuractSourceR00,B.shuractIntroduct,B.shuractPublisher_Name,B.shuractPublisher_Email,
			B.shuractPublisher_Mobile,B.shuractPublisher_Tele,B.shuractPublisher_Software,B.shuractPublisher_Homepage
			
			FROM {Nets.TableHead}shopuserreceiveaddress AS A
			INNER JOIN {Nets.TableHead}shopuserreceiveaddresscont AS B ON B.shuractIndexID=A.shuratID
			WHERE 1=1 AND A.shuratChecked=0 AND A.shuratCreateBy={Nets.CreateBy}
			ORDER BY A.shuratOrderBy DESC,A.shuratID DESC ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.CreateBy}',$this->sUserInfo[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sReceiveaddress=array();
		$Coun0=0;
		foreach ($tmpData0 as $Row0){
			$this->sReceiveaddress[$Coun0]=$this->sControl->sDpReturnTemplate;
			$this->sReceiveaddress[$Coun0]['Text']=$Row0['shuratName'];
			$this->sReceiveaddress[$Coun0]['Value']=$Row0['shuratID'];
			
			$this->sReceiveaddress[$Coun0]['shuractZoneChoose']=$Row0['shuractZoneChoose'];
			$this->sReceiveaddress[$Coun0]['shuractZoneDetail']=$Row0['shuractZoneDetail'];
			$this->sReceiveaddress[$Coun0]['shuractAddress']=$Row0['shuractAddress'];
			$this->sReceiveaddress[$Coun0]['shuractPostCode']=$Row0['shuractPostCode'];
			$this->sReceiveaddress[$Coun0]['shuractCompany']=$Row0['shuractCompany'];
			$this->sReceiveaddress[$Coun0]['shuractSourceR00']=$Row0['shuractSourceR00'];
			$this->sReceiveaddress[$Coun0]['shuractIntroduct']=$Row0['shuractIntroduct'];
			$this->sReceiveaddress[$Coun0]['shuractPublisher_Name']=$Row0['shuractPublisher_Name'];
			$this->sReceiveaddress[$Coun0]['shuractPublisher_Email']=$Row0['shuractPublisher_Email'];
			$this->sReceiveaddress[$Coun0]['shuractPublisher_Mobile']=$Row0['shuractPublisher_Mobile'];
			$this->sReceiveaddress[$Coun0]['shuractPublisher_Tele']=$Row0['shuractPublisher_Tele'];
			$this->sReceiveaddress[$Coun0]['shuractPublisher_Software']=$Row0['shuractPublisher_Software'];
			$this->sReceiveaddress[$Coun0]['shuractPublisher_Homepage']=$Row0['shuractPublisher_Homepage'];
			
			$Coun0++;
		}
		//#sSendmodel
		$tmpSQL=' SELECT A.shsmtID,A.shsmtName,A.shsmtPrice,A.shsmtPriceLimit,
			A.shsmtPriceMultiply,A.shsmtIntrodcut

			FROM {Nets.TableHead}shopsendmodel AS A
			INNER JOIN {Nets.TableHead}shopsendmodelcont AS B ON B.shsmctIndexID=A.shsmtID
			WHERE 1=1 AND A.shsmtRecycle=0 AND A.shsmtChecked>1
			ORDER BY A.shsmtOrderBy DESC,A.shsmtID DESC ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sSendmodel=array();
		$Coun0=0;
		foreach ($tmpData0 as $Row0){
			$this->sSendmodel[$Coun0]=$this->sControl->sDpReturnTemplate;
			$this->sSendmodel[$Coun0]['Text']=$Row0['shsmtName'].'<span class="FBlack4">'.$Row0['shsmtIntrodcut'].'</span>';
			$this->sSendmodel[$Coun0]['Value']=$Row0['shsmtID'];
			$Coun0++;
		}
		//#sPaytype_Net
		$tmpSQL=' SELECT A.shupttID,A.shupttName,A.shupttConfirmcode,
			B.shuptctIntroduct,B.shuptctSourceR00
			
			FROM {Nets.TableHead}shopuserpaytype AS A
			INNER JOIN {Nets.TableHead}shopuserpaytypecont AS B ON B.shuptctIndexID=A.shupttID
			WHERE 1=1 AND A.shupttRecycle=0 AND A.shupttChecked>1 AND A.shupttType=1
			ORDER BY A.shupttOrderBy DESC,A.shupttID DESC ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sPaytype_Net=array();
		$Coun0=0;
		foreach ($tmpData0 as $Row0){
			$this->sPaytype_Net[$Coun0]=$this->sControl->sDpReturnTemplate;
			$this->sPaytype_Net[$Coun0]['Text']=$Row0['shupttName'];
			$this->sPaytype_Net[$Coun0]['Value']=$Row0['shupttID'];
			$this->sPaytype_Net[$Coun0]['Source']=$Row0['shuptctSourceR00'];
			$this->sPaytype_Net[$Coun0]['Introduct']=$Row0['shuptctIntroduct'];
			$Coun0++;
		}
		//#sPaytype_Bank
		$tmpSQL=' SELECT A.shupttID,A.shupttName,A.shupttConfirmcode,
			B.shuptctIntroduct,B.shuptctSourceR00
			
			FROM {Nets.TableHead}shopuserpaytype AS A
			INNER JOIN {Nets.TableHead}shopuserpaytypecont AS B ON B.shuptctIndexID=A.shupttID
			WHERE 1=1 AND A.shupttRecycle=0 AND A.shupttChecked>1 AND A.shupttType=2
			ORDER BY A.shupttOrderBy DESC,A.shupttID DESC ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sPaytype_Bank=array();
		$Coun0=0;
		foreach ($tmpData0 as $Row0){
			$this->sPaytype_Bank[$Coun0]=$this->sControl->sDpReturnTemplate;
			$this->sPaytype_Bank[$Coun0]['Text']=$Row0['shupttName'];
			$this->sPaytype_Bank[$Coun0]['Value']=$Row0['shupttID'];
			$this->sPaytype_Bank[$Coun0]['Source']=$Row0['shuptctSourceR00'];
			$this->sPaytype_Bank[$Coun0]['Introduct']=$Row0['shuptctIntroduct'];
			$Coun0++;
		}
		//#sPaytype_Other
		$tmpSQL=' SELECT A.shupttID,A.shupttName,A.shupttConfirmcode,
			B.shuptctIntroduct,B.shuptctSourceR00
			
			FROM {Nets.TableHead}shopuserpaytype AS A
			INNER JOIN {Nets.TableHead}shopuserpaytypecont AS B ON B.shuptctIndexID=A.shupttID
			WHERE 1=1 AND A.shupttRecycle=0 AND A.shupttChecked>1 AND A.shupttType=3
			ORDER BY A.shupttOrderBy DESC,A.shupttID DESC ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sPaytype_Other=array();
		$Coun0=0;
		foreach ($tmpData0 as $Row0){
			$this->sPaytype_Other[$Coun0]=$this->sControl->sDpReturnTemplate;
			$this->sPaytype_Other[$Coun0]['Text']=$Row0['shupttName'];
			$this->sPaytype_Other[$Coun0]['Value']=$Row0['shupttID'];
			$this->sPaytype_Other[$Coun0]['Source']=$Row0['shuptctSourceR00'];
			$this->sPaytype_Other[$Coun0]['Introduct']=$Row0['shuptctIntroduct'];
			$Coun0++;
		}
		//#sPaytype
		$tmpSQL=' SELECT A.shupttID,A.shupttName,A.shupttConfirmcode,
			B.shuptctIntroduct,B.shuptctSourceR00
			
			FROM {Nets.TableHead}shopuserpaytype AS A
			INNER JOIN {Nets.TableHead}shopuserpaytypecont AS B ON B.shuptctIndexID=A.shupttID
			WHERE 1=1 AND A.shupttRecycle=0 AND A.shupttChecked>1
			ORDER BY A.shupttOrderBy DESC,A.shupttID DESC ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sPaytype=array();
		$Coun0=0;
		foreach ($tmpData0 as $Row0){
			$this->sPaytype[$Coun0]=$this->sControl->sDpReturnTemplate;
			$this->sPaytype[$Coun0]['Text']=$Row0['shupttName'];
			$this->sPaytype[$Coun0]['Value']=$Row0['shupttID'];
			$this->sPaytype[$Coun0]['Source']=$Row0['shuptctSourceR00'];
			$this->sPaytype[$Coun0]['Introduct']=$Row0['shuptctIntroduct'];
			$Coun0++;
		}
		//#sPayBeforehand
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$this->sOptionSQL);
		$tmpSTR=str_replace('{Nets.Parid}',90,$tmpSTR);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sPayBeforehand=array();
		$Coun0=0;
		foreach ($tmpData0 as $Row0){
			$this->sPayBeforehand[$Coun0]=$this->sControl->sDpReturnTemplate;
			$this->sPayBeforehand[$Coun0]['Text']=$Row0['sotName'];
			$this->sPayBeforehand[$Coun0]['Value']=$Row0['sotValue'];
			$Coun0++;
		}
		//#sInvoice
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$this->sOptionSQL);
		$tmpSTR=str_replace('{Nets.Parid}',87,$tmpSTR);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sInvoice=array();
		$Coun0=0;
		foreach ($tmpData0 as $Row0){
			$this->sInvoice[$Coun0]=$this->sControl->sDpReturnTemplate;
			$this->sInvoice[$Coun0]['Text']=$Row0['sotName'];
			$this->sInvoice[$Coun0]['Value']=$Row0['sotValue'];
			$Coun0++;
		}
		//#sInvoice_Unit
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$this->sOptionSQL);
		$tmpSTR=str_replace('{Nets.Parid}',88,$tmpSTR);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sInvoice_Unit=array();
		$Coun0=0;
		foreach ($tmpData0 as $Row0){
			$this->sInvoice_Unit[$Coun0]=$this->sControl->sDpReturnTemplate;
			$this->sInvoice_Unit[$Coun0]['Text']=$Row0['sotName'];
			$this->sInvoice_Unit[$Coun0]['Value']=$Row0['sotValue'];
			$Coun0++;
		}
		//#sInvoice_TitleType
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$this->sOptionSQL);
		$tmpSTR=str_replace('{Nets.Parid}',89,$tmpSTR);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sInvoice_TitleType=array();
		$Coun0=0;
		foreach ($tmpData0 as $Row0){
			$this->sInvoice_TitleType[$Coun0]=$this->sControl->sDpReturnTemplate;
			$this->sInvoice_TitleType[$Coun0]['Text']=$Row0['sotName'];
			$this->sInvoice_TitleType[$Coun0]['Value']=$Row0['sotValue'];
			$Coun0++;
		}
		
		//#sFavourableids
		$tmpSQL=' SELECT A.shfrtID,B.shftID,B.shftName
			
			FROM {Nets.TableHead}shopfavourablerecord AS A
			INNER JOIN {Nets.TableHead}shopfavourable AS B ON B.shftID=A.shfrtParid
			WHERE 1=1 AND B.shftRecycle=0 AND B.shftChecked>1 AND B.shftCreateBy={Nets.CreateBy} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.CreateBy}',$this->sUserInfo[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sFavourableids=array();
		$Coun0=0;
		foreach ($tmpData0 as $Row0){
			$this->sFavourableids[$Coun0]=$this->sControl->sDpReturnTemplate;
			$this->sFavourableids[$Coun0]['Text']=$Row0['shftName'];
			$this->sFavourableids[$Coun0]['Value']=$Row0['shfrtID'];
			$Coun0++;
		}
		//Type
		$tmpAR0=$this->sControl->sDbInTemplate;
		$tmpAR0['Connection']=$this->sConnString;
		$tmpAR0['SQL']=$this->sOptionSQL;
		$tmpAR0['InitialString']=134;
		$tmpAR0['Parid']='sotID';
		$tmpAR0['Text']='sotName';
		$tmpAR0['Value']='sotValue';
		$tmpAR0['Type']=1;
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		$tmpCacheFlag='nets/options_Type_shopsaleorderdiscuss';
		$this->sControl->getOptions($tmpAR0,$tmpCacheFlag,$this->sControl->sDpReturnTemplate,$this->sRecordType1);
		$this->sRecordType2=$this->sRecordType1;
		$tmpAR0=$this->sControl->sDpReturnTemplate;
		$tmpAR0['Text']='[所有类型]';
		$tmpAR0['Value']='-1';
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		array_push($this->sRecordType2,$tmpAR0);
		//-- ------ #Userinfo ------ --
		$tmpSQL=' SELECT A.uihtID,A.uihtName,A.uihtFlag,A.uihtValue
			FROM {Nets.TableHead}netsuserinfohabits AS A
			WHERE 1=1 AND A.uihtCreateBy={Nets.CreateBy} AND
			(1=2 OR A.uihtFlag=\'Order_Userreceiveaddress\' OR A.uihtFlag=\'Order_Userpaytype\' OR A.uihtFlag=\'Order_PayBeforehand\' 
				OR A.uihtFlag=\'Order_Sendmodel\' OR A.uihtFlag=\'Order_Invoice\' ) ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.CreateBy}',$this->sUserInfo[0]['Columns']['uitID']['Value'],$tmpSTR);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sData_Userinfohabits=array(
			'Order_Userreceiveaddress'=>'',
			'Order_Userpaytype'=>'',
			'Order_PayBeforehand'=>'',
			'Order_Sendmodel'=>'',
			'Order_Invoice'=>'',
			);
		foreach ($tmpData0 as $Row0){
			if ($Row0['uihtFlag']=='Order_Userreceiveaddress'){
				$this->sData_Userinfohabits['Order_Userreceiveaddress']=$Row0['uihtValue'];
			}else if ($Row0['uihtFlag']=='Order_Userpaytype'){
				$this->sData_Userinfohabits['Order_Userpaytype']=$Row0['uihtValue'];
			}else if ($Row0['uihtFlag']=='Order_PayBeforehand'){
				$this->sData_Userinfohabits['Order_PayBeforehand']=$Row0['uihtValue'];
			}else if ($Row0['uihtFlag']=='Order_Sendmodel'){
				$this->sData_Userinfohabits['Order_Sendmodel']=$Row0['uihtValue'];
			}else if ($Row0['uihtFlag']=='Order_Invoice'){
				$this->sData_Userinfohabits['Order_Invoice']=$Row0['uihtValue'];
				
			}
		}
		//-- ### --
		$this->sData_Invoice=array(
			0,//Invoice
			0,//InvoiceUnit
			'',//InvoiceTitle
			0,//InvoiceTitleType
			'',//Favourableids
			);
		if (count($this->sData_Userinfohabits)>0) {
			$tmpAR0=explode($this->sysSPLIT5,$this->sData_Userinfohabits['Order_Invoice']);
			if (count($tmpAR0)==6) {
				$this->sData_Invoice=array(
					$tmpAR0[0],
					$tmpAR0[1],
					$tmpAR0[2],
					$tmpAR0[3],
					$tmpAR0[4],
					$tmpAR0[5],
					);
			}
			
		}
		
		//-- ------ #Form ------ --
		$tmpUiDescriptions=array();
		$tmpSTR=$this->sUiDescriptionPath.'User/shop/o_order.php';
		if(file_exists($tmpSTR)){
			require($tmpSTR);
			$tmpUiDescriptions=$sysUiDescriptions['o_order'];
			$sysUiDescriptions=array();
		}
		$tmpTableApp=new netssystable($this->sConnString);
		$this->sUiDescription_Normal=$tmpTableApp->filterColumnByFlag($tmpUiDescriptions,'Normal');
		$this->sUiDescription_CCode=$tmpTableApp->filterColumnByFlag($tmpUiDescriptions,'CCode');
		//-- ------ #Records ------ --
		$tmpSQL=' SELECT A.shsortID,A.shsortName,A.shsortNumCode,A.shsortParid,
			A.shsortType,A.shsortSaleType,A.shsortCreateTime,B.shsorctContent
			FROM {Nets.TableHead}shopsaleorderrecord AS A
			INNER JOIN {Nets.TableHead}shopsaleorderrecordcont AS B ON B.shsorctIndexID=A.shsortID
			WHERE 1=1 AND A.shsortRecycle=0 AND A.shsortChecked>1 AND A.shsortParid={Nets.Parid}
			ORDER BY A.shsortOrderBy DESC,A.shsortID DESC ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Parid}',$this->sMainID,$tmpSTR);
		$this->sData_Record=$this->sDb->Search($tmpSTR);
		
		//-- ------ #Form record ------ --
		$this->sUiDescription_Record=array();
		$tmpSTR=$this->sUiDescriptionPath.'Mana/shop/shopsaleorderrecord_remark.php';
		if(file_exists($tmpSTR)){
			require($tmpSTR);
			$this->sUiDescription_Record=$sysUiDescriptions['shopsaleorderrecord_remark'];
			$sysUiDescriptions=array();
		}
		
		
		return 0;
	}
	
	public function DefUiPanel(&$pColumn,$pFlag){
		parent::DefUiPanel($pColumn,$pFlag);
		if($pColumn['stcotName']=='shcsotState' && $pFlag=='Search'){
			$pColumn['Option']=$this->sState2;
		}else if($pColumn['stcotName']=='shcsotState' && ($pFlag=='Normal' || $pFlag=='List')){
			$pColumn['Option']=$this->sState1;
			
		}else if($pColumn['stcotName']=='shsortType' && $pFlag=='Search'){
			$pColumn['Option']=$this->sRecordType2;
		}else if($pColumn['stcotName']=='shsortType' && ($pFlag=='Normal' || $pFlag=='List')){
			$pColumn['Option']=$this->sRecordType1;
		}else if($pColumn['stcotName']=='shsorctContent' && ($pFlag=='Normal' || $pFlag=='List')){
			$pColumn['ControlStyle']='height:80px;';
			
			
		}
		return $pColumn;
	}
	public function DefUiButton($pFlag,$Exception){
		parent::DefUiButton($pFlag,array('Report','ReportHead','ReportLink','ReportChildLink',));
		if ($pFlag=='Report' && !in_array($pFlag,$Exception)) { ?>
<?php if (isset($this->sDetailData)) { if(count($this->sDetailData)>0){ ?>
<?php if($this->sDetailData[0]['shcsotState']==0){ ?>
<li class="ButBut Button_Normal"><a href="#Here" class="Link1 FBlack2" onclick="tmpCommon.setActionType('Report','Confirm_Cancel','',''); tmpCommon.netsSubmit();">取消</a></li>
<?php }else if($this->sDetailData[0]['shcsotState']==1){ ?>
<li class="ButBut Button_Normal"><a href="#Here" class="Link1 FBlack2" onclick="tmpCommon.setActionType('Report','Confirm_Cancel','',''); tmpCommon.netsSubmit();">取消</a></li>
<?php }else if($this->sDetailData[0]['shcsotState']==2){ ?>
<?php }else if($this->sDetailData[0]['shcsotState']==3){ ?>
<li class="ButBut Button_Normal"><a href="#Here" class="Link1 FBlack2" onclick="tmpCommon.setActionType('Report','Confirm_RecieveConfirm','',''); tmpCommon.netsSubmit();">确认收货</a></li>
<?php }else if($this->sDetailData[0]['shcsotState']==4){ ?>
<li class="ButBut Button_Normal"><a href="#Here" class="Link1 FBlack2" onclick="tmpCommon.setActionType('Report','Confirm_Complete','',''); tmpCommon.netsSubmit();">确认结单</a></li>
<?php }else if($this->sDetailData[0]['shcsotState']==5){ ?>
<?php }else if($this->sDetailData[0]['shcsotState']==6){ ?>
<li class="ButBut Button_Normal"><a href="#Here" class="Link1 FBlack2" onclick="tmpCommon.setActionType('Report','Confirm_ReturnsSuccess','',''); tmpCommon.netsSubmit();">收到退货</a></li>
<?php } } } ?>



<?php }else if ($pFlag=='ReportHead' && !in_array($pFlag,$Exception)) { ?>
<?php if (isset($this->sDetailData)) { if(count($this->sDetailData)>0){ ?>
<?php if($this->sDetailData[0]['shcsotState']==0){ ?>
<li class="Tab_Option_Button">
	<div class="Tab_Option_ButtonCell"><img src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/Common/Img/Common/icon_head_5.jpg" /></div>
	<div class="Tab_Option_ButtonCell"><a href="#Here" class="Link1 FBlue2" onclick="tmpCommon.setActionType('Report','Confirm_Cancel','',''); tmpCommon.netsSubmit();">取消</a></div></li>
<?php }else if($this->sDetailData[0]['shcsotState']==1){ ?>
<li class="Tab_Option_Button">
	<div class="Tab_Option_ButtonCell"><img src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/Common/Img/Common/icon_head_5.jpg" /></div>
	<div class="Tab_Option_ButtonCell"><a href="#Here" class="Link1 FBlue2" onclick="tmpCommon.setActionType('Report','Confirm_Cancel','',''); tmpCommon.netsSubmit();">取消</a></div></li>
<?php }else if($this->sDetailData[0]['shcsotState']==2){ ?>
<?php }else if($this->sDetailData[0]['shcsotState']==3){ ?>
<li class="Tab_Option_Button">
	<div class="Tab_Option_ButtonCell"><img src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/Common/Img/Common/icon_head_5.jpg" /></div>
	<div class="Tab_Option_ButtonCell"><a href="#Here" class="Link1 FBlue2" onclick="tmpCommon.setActionType('Report','Confirm_RecieveConfirm','',''); tmpCommon.netsSubmit();">确认收货</a></div></li>
<?php }else if($this->sDetailData[0]['shcsotState']==4){ ?>
<li class="Tab_Option_Button">
	<div class="Tab_Option_ButtonCell"><img src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/Common/Img/Common/icon_head_5.jpg" /></div>
	<div class="Tab_Option_ButtonCell"><a href="#Here" class="Link1 FBlue2" onclick="tmpCommon.setActionType('Report','Confirm_Complete','',''); tmpCommon.netsSubmit();">确认结单</a></div></li>
<?php }else if($this->sDetailData[0]['shsortState']==5){ ?>
<?php }else if($this->sDetailData[0]['shcsotState']==6){ ?>
<li class="Tab_Option_Button">
	<div class="Tab_Option_ButtonCell"><img src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/Common/Img/Common/icon_head_5.jpg" /></div>
	<div class="Tab_Option_ButtonCell"><a href="#Here" class="Link1 FBlue2" onclick="tmpCommon.setActionType('Report','Confirm_ReturnsSuccess','',''); tmpCommon.netsSubmit();">收到退货</a></div></li>
<?php } } } ?>


<?php }else if ($pFlag=='ReportLink' && !in_array($pFlag,$Exception)) { ?>
<li id="ListTab_0" class="TabSelected"><a href="<?php echo($this->sysPage); ?>" class="Link1 FBlue1" onclick="tmpControl.onTabSlide(0);">管理<?php echo ($this->sMetaTitle); ?></a></li>
<?php if ($this->sChildlist_ParColumnName!='') { ?><li id="ListTab_1" class="TabNormal"><a href="<?php echo($this->sysPage); ?>?ActionType=Childlist_List" class="Link1 FBlue1" onclick="tmpControl.onTabSlide(1);">子级管理<?php echo ($this->sMetaTitle); ?></a></li><?php }?>
<!--
<li class="TabNormal"><a href="#Here" class="Link1 FBlue1"><?php echo ($this->sMetaTitle); ?>管理</a></li>
-->
<?php }else if ($pFlag=='ReportChildLink' && !in_array($pFlag,$Exception)) { ?>
<li id="ListTabChild_0" class="TabChildNormal"><a href="<?php echo ($this->sysPage); ?>?ActionType=Normal&Normal=<?php echo($this->sMainID); ?>,0" class="Link1 FGreen1">返回编辑页面</a></li>
<li id="ListTabChild_0" class="TabChildNormal"><a href="<?php echo ($this->sysPage); ?>" class="Link1 FGreen1">更多<?php echo ($this->sMetaTitle); ?></a></li>
<!--
<li class="TabChildSelected"><a href="#Here" class="Link2 FBlue1"><?php echo ($this->sMetaTitle); ?>管理</a></li>
<li class="DLeft"><img src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/m_nets/Img/Mana/34.jpg" /></li>
<li class="TabChildNormal"><a href="#Here" class="Link1 FBlue1"><?php echo ($this->sMetaTitle); ?>管理</a></li>
-->


<?php }
	}
	public function DefUiListLine($pFlag,$Exception){
		parent::DefUiListLine($pFlag,array('List',));
		if($pFlag=='List'){
			//-- ------ #List ------ --
			$tmpSTR='';
			$Coun0=0;
			foreach ($this->sListData as $Row0){
				$tmpLineStyle='ListCell';
				$tmpINT=$Coun0+1;
				if($tmpINT%2==0){
					$tmpLineStyle='ListCell0';
				}
?>
<tr id="<?php echo ($this->sTable[0]['sttColumnHead']); ?>Row<?php echo($Coun0); ?>" class="<?php echo ($tmpLineStyle); ?>" onmouseover="tmpControl.onRowMouseover('<?php echo ($this->sTable[0]['sttColumnHead']); ?>',<?php echo($Coun0); ?>);" onmouseout="tmpControl.onRowMouseout('<?php echo ($this->sTable[0]['sttColumnHead']); ?>',<?php echo($Coun0); ?>,'<?php echo ($tmpLineStyle); ?>');">
<td class="ListCellID">
	<?php echo ($Row0[$this->sTable[0]['sttColumnHead'].'ID']); ?>
	<input id="<?php echo ($this->sTable[0]['sttColumnHead']); ?>IDTxtList<?php echo ($Coun0); ?>" name="<?php echo ($this->sTable[0]['sttColumnHead']); ?>IDTxtList<?php echo ($Coun0); ?>" type="hidden" value="<?php echo ($Row0[$this->sTable[0]['sttColumnHead'].'ID']); ?>" />
	<input id="<?php echo ($this->sTable[0]['sttColumnHead']); ?>RowStyle<?php echo ($Coun0); ?>" name="<?php echo ($this->sTable[0]['sttColumnHead']); ?>RowStyle<?php echo ($Coun0); ?>" type="hidden" value="<?php echo ($tmpLineStyle); ?>" /></td>
<td class="ListCellTitle"><a href="<?php echo ($this->sysPage); ?>?ActionType=Report&Report=<?php echo ($Row0[$this->sTable[0]['sttColumnHead'].'ID']); ?>,<?php if(isset($this->sTable[1])){ if(isset($Row0[$this->sTable[1]['sttColumnHead'].'Modelid_List'])){ echo($Row0[$this->sTable[1]['sttColumnHead'].'Modelid_List']); }else if(isset($Row0[$this->sTable[1]['sttColumnHead'].'Modelid_Detail'])){ echo($Row0[$this->sTable[1]['sttColumnHead'].'Modelid_Detail']); } } ?>" class="Link1 FBlue1 <?php if(isset($Row0[$this->sTable[0]['sttColumnHead'].'NameStyle'])){echo($Row0[$this->sTable[0]['sttColumnHead'].'NameStyle']); }?>"><?php echo ($Row0[$this->sTable[0]['sttColumnHead'].'Name']); ?></a></td>
<?php
				$tmpFlag='List';
				$tmpDataCollection1=$this->sUiDescription_List;
				$Coun1=0;
				foreach ($tmpDataCollection1 as $Row1){
					$tmpAR0=array();
					$tmpSTR.=$Row1['stcotName'].$this->sysSPLIT2;
					$Row1['Value']=$Row0[$Row1['stcotName']];
					$Row1['NameExtend']=$tmpFlag.$Coun0;
					$this->DefUiPanel($Row1,$tmpFlag);
					if($this->DefUiCustom($Row1,$tmpFlag)==0){
						$this->sControls->getList($Row1);
					}
					$Coun1++;
				}
?>
<td class="ListCellCheck"><input id="checkedBox<?php echo ($Coun0); ?>" name="checkedBox[]" type="checkbox" class="SControl1 ControlCheckbox" value="<?php echo ($Row0[$this->sTable[0]['sttColumnHead'].'ID']); ?>" onclick="tmpControl.onRowChecked('<?php echo ($this->sTable[0]['sttColumnHead']); ?>',<?php echo($Coun0); ?>);" /></td>
<td class="ListCellOption">
<table class="" cellpadding="0" cellspacing="0"><tr>
<td><a href="<?php echo ($this->sysPage); ?>?ActionType=Normal&Normal=<?php echo ($Row0[$this->sTable[0]['sttColumnHead'].'ID']); ?>,<?php if(isset($this->sTable[1])){ if(isset($Row0[$this->sTable[1]['sttColumnHead'].'Modelid_Detail'])){ echo($Row0[$this->sTable[1]['sttColumnHead'].'Modelid_Detail']); } } ?>"><img alt="查看详细内容" src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/Common/Img/Common/icon_17.jpg" /></a></td>

<?php if (in_array($this->sFunctionname.'_modify',$this->sAR_UserPower) && count($this->sAR_UserPower)>1) { ?>
<td><a href="#Here"><img alt="保存本行更改" src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/Common/Img/Common/icon_18_Gray.jpg" /></a></td>
<?php }else { ?>
<td><input type="image" title="保存本行更改" src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/Common/Img/Common/icon_18.jpg" onclick="tmpControl.onModify_PageLine('<?php echo ($Row0[$this->sTable[0]['sttColumnHead'].'ID']); ?>','<?php echo ($Coun0); ?>');tmpCommon.setActionType('','DModify_PageLine','');" /></td>
<?php } if (in_array($this->sFunctionname.'_delete',$this->sAR_UserPower) && count($this->sAR_UserPower)>1) { ?>
<td><a href="#Here"><img alt="删除此信息" src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/Common/Img/Common/icon_19_Gray.jpg" /></a></td>
<?php }else { ?>
<td><input type="image" title="删除此信息" src="<?php echo($this->sysFileConfig['sysUiCoreRoot']); ?>Ui/Common/Img/Common/icon_19.jpg" onclick="tmpControl.onDelete('<?php echo ($Row0[$this->sTable[0]['sttColumnHead'].'ID']); ?>');tmpCommon.setActionType('','DDelete','');" /></td>
<?php } ?>
</tr></table>
</td>
</tr>
<?php $Coun0++; } ?>
<input id="ListBox" name="ListBox" type="hidden" value="<?php echo ($tmpSTR); ?>" />
<?php

		}
	}
	

}
//-- ------ #Instanct ------ --
$tmpDefault=new PaDefault();
$tmpDefault->OnPage();
$tmpControls=new CustomControls();
$tmpControlPage=new CustomControlPage();
$tmpComHead->sMenuid=$tmpDefault->sMenuid;
$tmpDefault->sysMetaTitle=$tmpDefault->sMetaTitle.' - '.$tmpDefault->sysFileConfig['sysTitle'];
//-- ------ #Template ------ --
if($tmpDefault->sActionType=='Report'){
	require($tmpDefault->sysFileConfig['sysCoreRoot'].$tmpDefault->sysQPlatformTemplatePath.'Component/Head_0.php');
	require($tmpDefault->sysFileConfig['sysCoreRoot'].$tmpDefault->sysQPlatformTemplatePath.'Shop/Order_Report_Code.php');
	require($tmpDefault->sysFileConfig['sysCoreRoot'].$tmpDefault->sysQPlatformTemplatePath.'Component/End_0.php');
}else{
	require($tmpDefault->sysFileConfig['sysCoreRoot'].$tmpDefault->sysQPlatformTemplatePath.'Component/Group_0.php');
} ?>