config=D('Config'); } public function selectdata(){ $URL = $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; $geturl=str_replace('.html','',$URL); $get = $_GET; if((count($get)!==1 or !isset($get['code']))){ header("HTTP/1.1 404 Not Found"); $this->display('error'); return false; } $data = base64_decode($_GET['code']); /*if(!preg_match('/[a-z0-9]/',substr($data,-1))){ header("HTTP/1.1 404 Not Found"); $this->display('error'); return false; }*/ if($_POST['code'] != ''&& $_POST['varify'] != ''){ $where = array(); $where['code'] = $_POST['code']; $where['varify_code'] = (int)$_POST['varify']; $code_table = getSubTable1('codes',$where['code']); $return = M($code_table)->where($where)->select(); $count = count($return); if($count>0){ echo 1; }else{ echo 0; } }else{ if($data==''){ header("HTTP/1.1 404 Not Found"); $this->display('error'); return false; }else{ /*$code =parse_url($data); $code = substr($code['path'],1);*/ $where = array(); $where['code'] = $data; $code_table = getSubTable1('codes',$where['code']); $return = M($code_table)->field('varify_code,Status,product_id')->where($where)->find(); if(count($return)>0){ if($return['Status']==0){ //未激活的状态 $return1 = M('product_box_type')->field('product_id')->where('id = '.$return['product_id'])->find(); switch ($return1['product_id']) { case 1: //金丝路 $this->display('jingsilu_1'); break; case 2: //小黄金 $this->display('hjy_1'); break; case 3: //炫尚 $this->display('xuanshang_1'); break; } }else{ $return1 = M('product_box_type')->field('product_id')->where('id = '.$return['product_id'])->find(); switch ($return1['product_id']) { case 1: //金丝路 $this->display('jingsilu'); break; case 2: //小黄金 $this->display('hjy'); break; case 3: //炫尚 $this->display('xuanshang'); break; } } }else{ header("HTTP/1.1 404 Not Found"); $this->display('error'); } } } } public function gosuccess(){ $this->display('hjy'); } }