<?php
require($netsFileConfig['sysCoreRoot'].'Cache/DbDescription/shopauction.php');
require($netsFileConfig['sysCoreRoot'].'Cache/DbDescription/shopauctioncont.php');
require($netsFileConfig['sysCoreRoot'].'Cache/DbDescription/shopauctiondiscuss.php');
require($netsFileConfig['sysCoreRoot'].'Cache/DbDescription/shopauctiondiscusscont.php');
require($netsFileConfig['sysCoreRoot'].'Inc/m_Shop/Sale/shopauction.php');
require($netsFileConfig['sysCoreRoot'].'Inc/m_Shop/Sale/shopauctiondiscuss.php');


class PaDefault extends CustomPage {
	public $ssetParid=2;
	
	public function PaDefault(){
		$this->CustomPage();
	}
	public function OnBInitial(){
		$this->sMetaTitle='拍卖详细信息';
		$this->getUser('1,2,3,4,5,');
		$this->sApp=new shopauction($this->sConnString);
		$this->sTemplatePath='shop/auctionDetail_Normal.php';

		//-- ------ #Option ------ --
		//Parid
		$tmpAR0=$this->sControl->sDbInTemplate;
		$tmpAR0['Connection']=$this->sConnString;
		$tmpAR0['SQL']=' SELECT A.shagtID,A.shagtName,A.shagtParid FROM '.$this->sysTableHead.'shopauctiongroup AS A
			WHERE 1=1 AND A.shagtRecycle=0 AND A.shagtChecked>1 AND A.shagtParid={Nets.Parid}
			ORDER BY A.shagtOrderBy DESC,A.shagtID DESC ';
		$tmpAR0['SQL0']=' SELECT A.shagtID,A.shagtName,A.shagtParid FROM '.$this->sysTableHead.'shopauctiongroup AS A
			WHERE 1=1 AND A.shagtRecycle=0 AND A.shagtChecked>1 AND A.shagtID={Nets.Parid}
			ORDER BY A.shagtOrderBy DESC,A.shagtID DESC ';
		$tmpAR0['InitialString']=$this->ssetParid;
		$tmpAR0['Parid']='shagtID';
		$tmpAR0['Text']='shagtName';
		$tmpAR0['Value']='shagtID';
		$tmpAR0['Type']=0;
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		$tmpCacheFlag='shop/shopauction_group';
		$this->sControl->getOptions($tmpAR0,$tmpCacheFlag,$this->sControl->sDpReturnTemplate,$this->sParid1);
		$this->sParid2=$this->sParid1;
		$tmpAR0=$this->sControl->sDpReturnTemplate;
		$tmpAR0['Text']='[所有的分类]';
		$tmpAR0['Value']='-1';
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		array_push($this->sParid2,$tmpAR0);
		//Type
		$tmpAR0=$this->sControl->sDbInTemplate;
		$tmpAR0['Connection']=$this->sConnString;
		$tmpAR0['SQL']=$this->sOptionSQL;
		$tmpAR0['InitialString']=133;
		$tmpAR0['Parid']='sotID';
		$tmpAR0['Text']='sotName';
		$tmpAR0['Value']='sotValue';
		$tmpAR0['Type']=1;
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		$tmpCacheFlag='nets/option_Shopauction_type';
		$this->sControl->getOptions($tmpAR0,$tmpCacheFlag,$this->sControl->sDpReturnTemplate,$this->sType1);
		$this->sType2=$this->sType1;
		$tmpAR0=$this->sControl->sDpReturnTemplate;
		$tmpAR0['Text']='[所有类型]';
		$tmpAR0['Value']='-1';
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		array_push($this->sType2,$tmpAR0);
		//Info_State
		$tmpAR0=$this->sControl->sDbInTemplate;
		$tmpAR0['Connection']=$this->sConnString;
		$tmpAR0['SQL']=$this->sOptionSQL;
		$tmpAR0['InitialString']=131;
		$tmpAR0['Parid']='sotID';
		$tmpAR0['Text']='sotName';
		$tmpAR0['Value']='sotValue';
		$tmpAR0['Type']=1;
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		$tmpCacheFlag='Shop/options_Auction_Info_State';
		$this->sControl->getOptions($tmpAR0,$tmpCacheFlag,$this->sControl->sDpReturnTemplate,$this->sInfo_State1);
		$this->sInfo_State2=$this->sInfo_State1;
		$tmpAR0=$this->sControl->sDpReturnTemplate;
		$tmpAR0['Text']='[所有状态]';
		$tmpAR0['Value']='-1';
		$tmpAR0['Style']='';
		$tmpAR0['Title']='';
		$tmpAR0['AddOne']='';
		array_push($this->sInfo_State2,$tmpAR0);
		//-- ------ #ActionType ------ --
		if ($this->sActionType=='Bid_Data') {
			$this->OnBid_Data();
		}
		if ($this->sActionTypeF=='DBid') {
			$this->OnBid();
		}
		
	}
	public function OnAdd(){
		$tmpApp=new shopauctiondiscuss($this->sConnString);
		$tmpTable=array(
			array('sttTableName'=>$this->sysTableHead.'shopauctiondiscuss','sttColumnHead'=>'shsdt'),
			array('sttTableName'=>$this->sysTableHead.'shopauctiondiscusscont','sttColumnHead'=>'shsdct'),);
		
		$tmpDbDescriptions=array();
		foreach ($tmpTable as $tableCell){
			$tmpDbDescriptions[]=$this->sDbDescriptions[$tableCell['sttTableName']];
		}
		$tmpMainid=$this->AnalyerRequest('mainID',0,1);
		$this->sMainID=$tmpMainid[0];
		$tmpMainUserid=$this->AnalyerRequest('mainUserid',0,1);
		$this->sMainUserid=$tmpMainid[0];
		$tmpMainTableid=$this->AnalyerRequest('mainTableid',0,1);
		$this->sMainTableid=$tmpMainid[0];
		//-- ------ #Submit limit check ------ --
		$tmpINT=$this->submitLimitRead($this->sysPage,-1,-1,-1);
		if($tmpINT!=0){
			$this->sJscript=$this->Message('SUCCESS','','对不起，您登陆次数过多，请'.$this->sysFileConfig['SubmitLimitFreeze'].'秒后再尝试登陆。','');
			return 1;
		}
		//-- ------ #CCode ------ --
		$tmpSTR='CCode_B';
		$tmpAR0=$this->AnalyerRequest($tmpSTR.'Txt','',1);
		$tmpCCode=$tmpAR0[0];
		$tmpSTR=$tmpSTR.'Txt_IFrame';
		if(!array_key_exists($tmpSTR,$_SESSION)){
			$this->submitLimitWrite($this->sysPage,-1,-1,-1);
			$this->sJscript=$this->Message('ERROR','提交失败','验证码错误','');
			return 1;
		}
		if($_SESSION[$tmpSTR]=='' || $_SESSION[$tmpSTR]!=$tmpCCode){
			$this->submitLimitWrite($this->sysPage,-1,-1,-1);
			$this->sJscript=$this->Message('ERROR','提交失败','验证码错误','');
			return 1;
		}
		//-- ------ #Add ------ --
		$tmpApp->TransStart();
		//#Get numCode
		$tmpSTR=$tmpTable[0]['sttColumnHead'].'NumCode';
		$tmpDbDescriptions[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$tmpDbDescriptions[0]['Columns'][$tmpSTR]['Value']='N'.$this->sysSPLIT11.date('YmdHis');
		$tmpApp->numCode($tmpDbDescriptions[0]);
		//#Set value
		$tmpAR0=$this->AnalyerRequest('mainID','',1);
		$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'Parid']['Value']=$this->sCode->Int32($tmpAR0[0],0);
		$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateBy']['Value']=$this->sCode->Int32($this->sUserInfo[0]['Columns']['uitID']['Value'],0);
		
		$tmpAR0=$this->AnalyerRequest('shsdtParentid_BTxt','',1);
		$tmpDbDescriptions[0]['Columns']['shsdtParentid']['Value']=$tmpAR0[0];
		$tmpAR0=$this->AnalyerRequest('shsdtType_BTxt','',1);
		$tmpDbDescriptions[0]['Columns']['shsdtType']['Value']=$tmpAR0[0];
		$tmpAR0=$this->AnalyerRequest('shsdctContent_BTxt','',1);
		$tmpDbDescriptions[1]['Columns']['shsdctContent']['Value']=$tmpAR0[0];

		//-- #Set conventional --
		if(isset($tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateBy']['Value'])){
			$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateBy']['Value']=$tmpMainUserid[0];
		}
		if(isset($tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateTime'])){
			$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateTime']['Value']=date($this->sysTimeFormat);
		}
		//DB name,Condition,User index,User column name
		$tmpFlag=0;
		foreach ($this->AnonymousUserData as $Row0){
			if (count($tmpDbDescriptions)>1) {
				if(isset($tmpDbDescriptions[1]['Columns'][$tmpTable[1]['sttColumnHead'].$Row0[0]])){
					$tmpFlag=1;
				}
			}
			if ($this->sUserInfo[0]['Columns']['uitID']['Value']==0 && $tmpFlag==1) {
				$tmpDbDescriptions[1]['Columns'][$tmpTable[1]['sttColumnHead'].$Row0[0]]['Value']=$Row0[4];
			}else if ($tmpFlag==1) {
				$tmpDbDescriptions[1]['Columns'][$tmpTable[1]['sttColumnHead'].$Row0[0]]['Value']=$this->sUserInfo[$Row0[2]]['Columns'][$Row0[3]]['Value'];
			}
		}
		//Spical value array
		foreach ($this->sSpicalValue as $Cell){
			if(isset($tmpDbDescription[$Cell[0]]['Columns'][$Cell[1]]['Value'])){
				$tmpDbDescription[$Cell[0]]['Columns'][$Cell[1]]['Value']=$Cell[2];
			}
		}
		//-- #Set spical --
		$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'Name']['Value']=$this->sCode->SubString($tmpDbDescriptions[1]['Columns'][$tmpTable[1]['sttColumnHead'].'Content']['Value'],0,60);
		$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateTime']['Value']=date($this->sysTimeFormat);
		$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'Checked']['Value']=$this->sysFileConfig['CheckCmsDocDiscuss'];
		if ($tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateBy']['Value']==0) {
			$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateBy']['Value']=2;
		}
		//#Add
		$tmpDbDescriptions[1]['Columns'][$tmpTable[1]['sttColumnHead'].'Content']['Value']=$this->sCode->FilterINPUT($tmpDbDescriptions[1]['Columns'][$tmpTable[1]['sttColumnHead'].'Content']['Value'],3);
		$tmpINT=$tmpApp->Check($tmpDbDescriptions,array(),array());
		if($tmpINT!=0){
			$tmpApp->TransRollback();
			$this->sJscript=$this->Message('ERROR','',$tmpApp->sysLastError,'');
			return 1;
		}
		$Coun0=0;
		while (count($tmpDbDescriptions)>$Coun0){
			if($Coun0==0){
				$tmpDbDescriptions[$Coun0]['TableDescription']['SearchColumn']=$tmpTable[$Coun0]['sttColumnHead'].'NumCode,'.$tmpTable[$Coun0]['sttColumnHead'].'ID';
			}else {
				$tmpDbDescriptions[$Coun0]['TableDescription']['SearchColumn']=$tmpTable[$Coun0]['sttColumnHead'].'IndexID';
			}
			$Coun0++;
		}
		$tmpINT=$tmpApp->add($tmpDbDescriptions);
		if($tmpINT!=0){
			$tmpApp->TransRollback();
			$this->sJscript=$this->Message('ERROR','',$tmpApp->sysLastError,'');
			return 1;
		}
		
		$this->submitLimitWrite($this->sysPage,-1,-1,-1);
		$tmpApp->TransCommit();
		$this->sJscript=$this->Message('SUCCESS','','评论成功',$this->sysPage.'?ID='.$this->sMainID);
		/*
		$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 OnBid(){
		$tmpApp=new shopauctiondiscuss($this->sConnString);
		$tmpTable=array(
			array('sttTableName'=>$this->sysTableHead.'shopauctiondiscuss','sttColumnHead'=>'shadt'),
			array('sttTableName'=>$this->sysTableHead.'shopauctiondiscusscont','sttColumnHead'=>'shadct'),);
		
		$tmpDbDescriptions=array();
		foreach ($tmpTable as $tableCell){
			$tmpDbDescriptions[]=$this->sDbDescriptions[$tableCell['sttTableName']];
		}
		$tmpMainid=$this->AnalyerRequest('mainID',0,1);
		$this->sMainID=$tmpMainid[0];
		$tmpMainUserid=$this->AnalyerRequest('mainUserid',0,1);
		$this->sMainUserid=$tmpMainid[0];
		$tmpMainTableid=$this->AnalyerRequest('mainTableid',0,1);
		$this->sMainTableid=$tmpMainid[0];
		//-- ------ #Submit limit check ------ --
		$tmpINT=$this->submitLimitRead($this->sysPage,-1,-1,-1);
		if($tmpINT!=0){
			$this->sJscript=$this->Message('SUCCESS','','对不起，您登陆次数过多，请'.$this->sysFileConfig['SubmitLimitFreeze'].'秒后再尝试登陆。','');
			return 1;
		}
		//-- ------ #Add ------ --
		//#Get numCode
		$tmpSTR=$tmpTable[0]['sttColumnHead'].'NumCode';
		$tmpDbDescriptions[0]['TableDescription']['SearchColumn']=$tmpSTR;
		$tmpDbDescriptions[0]['Columns'][$tmpSTR]['Value']='N'.$this->sysSPLIT11.date('YmdHis');
		$tmpApp->numCode($tmpDbDescriptions[0]);
		//#Set value
		$tmpAR0=$this->AnalyerRequest('mainID','',1);
		$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'Parid']['Value']=$this->sCode->Int32($tmpAR0[0],0);
		$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateBy']['Value']=$this->sCode->Int32($this->sUserInfo[0]['Columns']['uitID']['Value'],0);
		
		$tmpAR0=$this->AnalyerRequest('shadtPriceTxt','',1);
		$tmpDbDescriptions[0]['Columns']['shadtPrice']['Value']=$tmpAR0[0];

		//-- #Set conventional --
		if(isset($tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateBy']['Value'])){
			$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateBy']['Value']=$tmpMainUserid[0];
		}
		if(isset($tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateTime'])){
			$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateTime']['Value']=date($this->sysTimeFormat);
		}
		//DB name,Condition,User index,User column name
		$tmpFlag=0;
		foreach ($this->AnonymousUserData as $Row0){
			if (count($tmpDbDescriptions)>1) {
				if(isset($tmpDbDescriptions[1]['Columns'][$tmpTable[1]['sttColumnHead'].$Row0[0]])){
					$tmpFlag=1;
				}
			}
			if ($this->sUserInfo[0]['Columns']['uitID']['Value']==0 && $tmpFlag==1) {
				$tmpDbDescriptions[1]['Columns'][$tmpTable[1]['sttColumnHead'].$Row0[0]]['Value']=$Row0[4];
			}else if ($tmpFlag==1) {
				$tmpDbDescriptions[1]['Columns'][$tmpTable[1]['sttColumnHead'].$Row0[0]]['Value']=$this->sUserInfo[$Row0[2]]['Columns'][$Row0[3]]['Value'];
			}
		}
		//Spical value array
		foreach ($this->sSpicalValue as $Cell){
			if(isset($tmpDbDescription[$Cell[0]]['Columns'][$Cell[1]]['Value'])){
				$tmpDbDescription[$Cell[0]]['Columns'][$Cell[1]]['Value']=$Cell[2];
			}
		}
		//-- #Set spical --
		$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'Name']['Value']=$this->sCode->SubString($tmpDbDescriptions[1]['Columns'][$tmpTable[1]['sttColumnHead'].'Content']['Value'],0,60);
		$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateTime']['Value']=date($this->sysTimeFormat);
		$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'Checked']['Value']=$this->sysFileConfig['CheckCmsDocDiscuss'];
		if ($tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateBy']['Value']==0) {
			$tmpDbDescriptions[0]['Columns'][$tmpTable[0]['sttColumnHead'].'CreateBy']['Value']=2;
		}
		//#Add
		$tmpDbDescriptions[1]['Columns'][$tmpTable[1]['sttColumnHead'].'Content']['Value']=$this->sCode->FilterINPUT($tmpDbDescriptions[1]['Columns'][$tmpTable[1]['sttColumnHead'].'Content']['Value'],3);
		$tmpINT=$tmpApp->Check($tmpDbDescriptions,array(),array());
		if($tmpINT!=0){
			$tmpApp->TransRollback();
			$this->sJscript=$this->Message('ERROR','',$tmpApp->sysLastError,'');
			return 1;
		}
		$Coun0=0;
		while (count($tmpDbDescriptions)>$Coun0){
			if($Coun0==0){
				$tmpDbDescriptions[$Coun0]['TableDescription']['SearchColumn']=$tmpTable[$Coun0]['sttColumnHead'].'NumCode,'.$tmpTable[$Coun0]['sttColumnHead'].'ID';
			}else {
				$tmpDbDescriptions[$Coun0]['TableDescription']['SearchColumn']=$tmpTable[$Coun0]['sttColumnHead'].'IndexID';
			}
			$Coun0++;
		}
		$tmpINT=$tmpApp->OnBid($tmpDbDescriptions);
		if($tmpINT!=0){
			$tmpApp->TransRollback();
			$this->sJscript=$this->Message('ERROR','',$tmpApp->sysLastError,'');
			return 1;
		}
		
		$this->submitLimitWrite($this->sysPage,-1,-1,-1);
		$this->sJscript=$this->Message('SUCCESS','','出价成功',$this->sysPage.'?ID='.$this->sMainID);
		/*
		$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(){
		$tmpAR0=$this->AnalyerRequest('ID',1,0);
		$this->sMainID=$tmpAR0[0];
		//-- ------ #Initial ------ --
		$tmpINT=$this->sApp->initialObject($this->sMainID);
		//-- ------ #Datas ------ --
		$tmpSQL=' SELECT *
			FROM {Nets.TableHead}shopauction AS A 
			INNER JOIN {Nets.TableHead}shopauctioncont AS B ON B.shactIndexID=A.shatID
			INNER JOIN {Nets.TableHead}shopsale AS C ON C.shstID=A.shatSaleid
			INNER JOIN {Nets.TableHead}shopsalecont AS D ON D.shsctIndexID=C.shstID
			
			WHERE 1=1 AND A.shatRecycle=0 AND A.shatChecked>1 AND A.shatID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sMainID,$tmpSTR);
		$this->sDetailData=$this->sDb->Search($tmpSTR);
		if(count($this->sDetailData)==0){
			//#Error
			//#Other
			$tmpSQL=' SELECT A.shatID,A.shatName,A.shatParid,A.shatCreateTime
				FROM {Nets.TableHead}shopauction AS A 
				WHERE 1=1 AND A.shatRecycle=0 AND A.shatChecked>1
				ORDER BY A.shatOrderBy DESC,A.shatID DESC LIMIT 0,8 ';
			$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
			$this->sOtherData=$this->sDb->Search($tmpSTR);
			return 1;
		}
		$this->sMainID=$this->sDetailData[0]['shatID'];
		$this->sMetaTitle=$this->sDetailData[0]['shatName'];
		$this->sParid=$this->sDetailData[0]['shatParid'];
		
		//-- ------ #Group ------ --
		$tmpSQL=' SELECT A.shagtID,A.shagtName,B.shagctTemplateid_Detail
			FROM {Nets.TableHead}shopauctiongroup AS A
			INNER JOIN {Nets.TableHead}shopauctiongroupcont AS B ON B.shagctIndexID=A.shagtID
			WHERE 1=1 AND A.shagtRecycle=0 AND A.shagtChecked>1 AND A.shagtID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sParid,$tmpSTR);
		$this->sData_Group=$this->sDb->Search($tmpSTR);
		if(count($this->sData_Group)==0){
			//#Non group
			//#Other
			$this->sData_Group[0]=array(
				'shagtID'=>0,
				'shagtName'=>$this->sysFileConfig['bussinessName'],
				'shagctTemplateid_Detail'=>0,
				);
		}
		//-- ------ #Template ------ --
		//#List
		$tmpSQL=' SELECT A.stemtID,A.stemtName,B.stemctPath 
			FROM {Nets.TableHead}netssystemplate AS A
			INNER JOIN {Nets.TableHead}netssystemplatecont AS B ON B.stemctIndexID=A.stemtID
			WHERE 1=1 AND A.stemtRecycle=0 AND A.stemtChecked>1 AND A.stemtID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sData_Group[0]['shagctTemplateid_Detail'],$tmpSTR);
		$tmpData0=$this->sDb->Search($tmpSTR);
		if(count($tmpData0)!=0){
			$this->sTemplatePath=$tmpData0[0]['stemctPath'];
		}
		//#Detail
		$tmpSQL=' SELECT A.stemtID,A.stemtName,B.stemctPath 
			FROM {Nets.TableHead}netssystemplate AS A
			INNER JOIN {Nets.TableHead}netssystemplatecont AS B ON B.stemctIndexID=A.stemtID
			WHERE 1=1 AND A.stemtRecycle=0 AND A.stemtChecked>1 AND A.stemtID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sDetailData[0]['shactTemplateid_Detail'],$tmpSTR);
		$tmpData0=$this->sDb->Search($tmpSTR);
		if(count($tmpData0)!=0){
			$this->sTemplatePath=$tmpData0[0]['stemctPath'];
		}
		//-- ------ #shatClassid ------ --
		$tmpSQL=' SELECT A.shatID,A.shatName,A.shatNameStyle
			FROM {Nets.TableHead}shopauction AS A
			WHERE 1=1 AND A.shatRecycle=0 AND A.shatChecked>1 AND 
			((A.shatClassid={Nets.Classid} AND A.shatClassid>0) OR (A.shatID={Nets.ID})) ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.Classid}',$this->sDetailData[0]['shatClassid'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.ID}',$this->sMainID,$tmpSTR);
		$this->sSale_Classids=$this->sDb->Search($tmpSTR);
		
		//-- ------ #Evaluation ------ --
		//-- ------ #Navigation ------ --
		$this->sNavigation=$this->sDb->getParent($this->sDetailData[0]['shatParid'],$this->sysTableHead.'shopauctiongroup','shagt');
		//-- ------ #Other ------ --
		//Next
		$tmpSQL=' SELECT A.shatID,A.shatName,A.shatCreateTime
			FROM {Nets.TableHead}shopauction AS A 
			WHERE 1=1 AND A.shatRecycle=0 AND A.shatChecked>1 AND shatID>{Nets.ID} AND A.shatParid={Nets.Parid}
			ORDER BY A.shatOrderBy DESC,A.shatID DESC LIMIT 0,1 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sDetailData[0]['shatID'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Parid}',$this->sDetailData[0]['shatParid'],$tmpSTR);
		$this->sNextData=$this->sDb->Search($tmpSTR);
		//Previous
		$tmpSQL=' SELECT A.shatID,A.shatName,A.shatCreateTime
			FROM {Nets.TableHead}shopauction AS A 
			WHERE 1=1 AND A.shatRecycle=0 AND A.shatChecked>1 AND shatID<{Nets.ID} AND A.shatParid={Nets.Parid}
			ORDER BY A.shatOrderBy DESC,A.shatID DESC LIMIT 0,1 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sDetailData[0]['shatID'],$tmpSTR);
		$tmpSTR=str_replace('{Nets.Parid}',$this->sDetailData[0]['shatParid'],$tmpSTR);
		$this->sPreviousData=$this->sDb->Search($tmpSTR);
		//Other
		$tmpSQL=' SELECT A.shatID,A.shatName,A.shatCreateTime
			FROM {Nets.TableHead}shopauction AS A 
			WHERE 1=1 AND A.shatOrderBy=0 AND A.shatChecked>1 AND A.shatParid={Nets.Parid}
			ORDER BY A.shatOrderBy DESC,A.shatID DESC LIMIT 0,8 ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSTR);
		$tmpSTR=str_replace('{Nets.Parid}',$this->sDetailData[0]['shatParid'],$tmpSTR);
		$this->sOtherData=$this->sDb->Search($tmpSTR);
		//-- ------ #Discuss_B ------ --
		$tmpSearchSTR0='DSearch_DiscussB';
		$tmpSearchAR0=$this->AnalyerRequest($tmpSearchSTR0,-1,0);
		$tmpListSTR0='DList_DiscussA';
		$tmpListAR0=$this->AnalyerRequest($tmpListSTR0,'1,0,12,0',0);
		$tmpSortSTR0='DSort0';
		$tmpSortAR0=$this->AnalyerRequest($tmpSortSTR0,'cddtID,2',0);
		//Data
		$tmpSQL=' SELECT A.shadtID,A.shadtCreateTime,
			B.shadctCode_Positive,B.shadctPublisher_Name,B.shadctContent
			FROM {Nets.TableHead}shopauctiondiscuss AS A
			INNER JOIN {Nets.TableHead}shopauctiondiscusscont AS B ON B.shadctIndexID=A.shadtID
			WHERE 1=1 AND A.shadtRecycle=0 AND A.shadtChecked>1 AND A.shadtParid={Nets.ID} ';
		if ($tmpSearchAR0[0]!=-1) {
			$tmpSQL.=' AND A.shadtType='.$tmpSearchAR0[0].' ';
		}
		$tmpSQL.=' ORDER BY A.shadtOrderBy DESC,A.shadtID ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sMainID,$tmpSTR);
		$this->sData_Discuss_B=$this->sDb->SearchP($tmpSTR,$tmpListAR0);
		$this->sCount_Discuss_B=$this->sDb->sysPageInfo[3];
		//#Set page button
		$this->sPButton_Ajax_B=new netsPAjaxButton();
		$this->sPButton_Ajax_B->resetTemlate('../../../Config/m_default/File/pageAjaxButton3.htm');
		$this->sPButton_Ajax_B->sFlag='discussBox_B';
		$this->sPButton_Ajax_B->sPanel='discussBox_B';
		$this->sPButton_Ajax_B->sPage=$this->sysPage;
		$this->sPButton_Ajax_B->sExtendParameter='&ID='.$this->sMainID.'&'.$tmpSearchSTR0.'='.$tmpSearchAR0[0];
		$this->sPButton_Ajax_B->setPage($this->sDb->sysPageInfo);
		//-- ------ #Bid ------ --
		$tmpSearchSTR0='DSearch_Bid';
		$tmpSearchAR0=$this->AnalyerRequest($tmpSearchSTR0,-1,0);
		$tmpListSTR0='DList_Bid';
		$tmpListAR0=$this->AnalyerRequest($tmpListSTR0,'1,0,12,0',0);
		$tmpSortSTR0='DSort0';
		$tmpSortAR0=$this->AnalyerRequest($tmpSortSTR0,'cddtID,2',0);
		//Data
		$tmpSQL=' SELECT A.shadtID,A.shadtPrice,A.shadtCreateTime,
			B.shadctCode_Positive,B.shadctPublisher_Name,B.shadctContent
			FROM {Nets.TableHead}shopauctiondiscuss AS A
			INNER JOIN {Nets.TableHead}shopauctiondiscusscont AS B ON B.shadctIndexID=A.shadtID
			WHERE 1=1 AND A.shadtRecycle=0 AND A.shadtChecked>1 AND A.shadtType=1 AND A.shadtParid={Nets.ID}
			ORDER BY A.shadtID DESC ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sMainID,$tmpSTR);
		//$this->sData_Bid=$this->sDb->SearchP($tmpSTR,$tmpListAR0);
		$this->sData_Bid=$this->sDb->Search($tmpSTR);
		//#Set page button
		
		//-- ------ #Discuss form ------ --
		$this->sUiDescription_0=array();
		$tmpSTR=$this->sUiDescriptionPath.'Plus/shop/sale_discuss.php';
		if(file_exists($tmpSTR)){
			require($tmpSTR);
			$this->sUiDescription_0=$sysUiDescriptions['sale_discuss'];
			$sysUiDescriptions=array();
		}
		//-- ------ ### ------ --
		$this->sURL_Cache=$this->sysFileConfig['PathRoot'].$this->sysFileConfig['sysDbFlagPath'].'Shop/auction_bid_'.$this->sMainID.'.php';
		
		
	}
	public function OnBid_Data(){
		$tmpAR0=$this->AnalyerRequest('Bid_Data',0,0);
		$this->sMainID=$tmpAR0[0];
		//-- ------ #Bid ------ --
		$tmpSearchSTR0='DSearch_Bid';
		$tmpSearchAR0=$this->AnalyerRequest($tmpSearchSTR0,-1,0);
		$tmpListSTR0='DList_Bid';
		$tmpListAR0=$this->AnalyerRequest($tmpListSTR0,'1,0,12,0',0);
		$tmpSortSTR0='DSort0';
		$tmpSortAR0=$this->AnalyerRequest($tmpSortSTR0,'cddtID,2',0);
		//Data
		$tmpSQL=' SELECT A.shadtID,A.shadtPrice,A.shadtCreateTime,
			B.shadctCode_Positive,B.shadctPublisher_Name,B.shadctContent
			FROM {Nets.TableHead}shopauctiondiscuss AS A
			INNER JOIN {Nets.TableHead}shopauctiondiscusscont AS B ON B.shadctIndexID=A.shadtID
			WHERE 1=1 AND A.shadtRecycle=0 AND A.shadtChecked>1 AND A.shadtType=1 AND A.shadtParid={Nets.ID}
			ORDER BY A.shadtID DESC ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sMainID,$tmpSTR);
		//$this->sData_Bid=$this->sDb->SearchP($tmpSTR,$tmpListAR0);
		$this->sData_Bid=$this->sDb->Search($tmpSTR);
		//#Set page button
		
		//-- ------ #Datas ------ --
		$tmpSQL=' SELECT A.shatPrice,B.shactInfo_UpdatePrice
			FROM {Nets.TableHead}shopauction AS A 
			INNER JOIN {Nets.TableHead}shopauctioncont AS B ON B.shactIndexID=A.shatID

			WHERE 1=1 AND A.shatRecycle=0 AND A.shatChecked>1 AND A.shatID={Nets.ID} ';
		$tmpSTR=str_replace('{Nets.TableHead}',$this->sysTableHead,$tmpSQL);
		$tmpSTR=str_replace('{Nets.ID}',$this->sMainID,$tmpSTR);
		$tmpData0=$this->sDb->Search($tmpSTR);
		$this->sData_PriceNow=0;
		$this->sData_PriceUpdate=0;
		if(count($tmpData0)>0){
			$this->sData_PriceNow=$tmpData0[0]['shatPrice'];
			$this->sData_PriceUpdate=$tmpData0[0]['shactInfo_UpdatePrice'];
			
		}
		
		
		
		return 0;
	}
	
	public function DefUiPanel(&$pColumn,$pFlag){
		if($pColumn['stcotName']=='shsdctContent_B' && $pFlag=='Normal'){
			$pColumn['ControlStyle']='width:500px;height:40px;';
			$pColumn['Parameter_JS_Onfocus']="tmpMCommon.OnDiscussInput(this.name,0);CCode_BTxt_ShowCACode(0);";
		}else if($pColumn['stcotName']=='shsdtType_B' && $pFlag=='Normal'){
			$pColumn['Option']=$this->sType_Question1;
			
		}else if($pColumn['stcotName']=='shsdctContent_C' && $pFlag=='Normal'){
			$pColumn['ControlStyle']='width:500px;height:40px;';
			$pColumn['Parameter_JS_Onfocus']="tmpMCommon.OnDiscussInput(this.name,0);CCode_CTxt_ShowCACode(0);";
			
			
		}
	}
	
}


?>