redirect("https://www.orico.cc/usmobile"); } else { return $this->redirect('https://www.orico.com.cn/mobile'); } } //验证上级来源页 /*if (!isset($_SERVER['HTTP_REFERER'])) { $domainUrl = $_SERVER['HTTP_HOST'].$_SERVER['REQUEST_URI']; if ($domainUrl== 'www.orico.cc/' || $domainUrl == 'orico.cc/') { return $this->redirect("http://www.orico.cc/us/Group/oricoindex"); } //return $this->redirect("http://www.orico.cc/us/Group/oricoindex"); return $this->fetch('/index'); } else{*/ $lebel_list = getDifferentProduct("recommend",12); $this->assign('recomment_items',$lebel_list); $blog_list = getArticleList(); $this->assign('blog_items',$blog_list); $faqData = getFaqList(); $this->assign('faqData',$faqData); return $this->fetch('/index'); //} } public function info(){ echo "\nstart: ".date("Y-m-d H:i:s")."\n"; $TransDb = new TransDb(); $TransDb->selectAllStruct("ProductCategory"); //$getDb = $TransDb->getkv(); echo "\nend :".date("Y-m-d H:i:s")."\n"; dump($TransDb); // phpinfo(); } public function feedback() { if ($this->request->isPost()) { $data = $this->request->post(); if (empty($data) || !is_array($data)) { return $this->error('Unknown Error'); } $data['way'] = isset($data['way']) ? $data['way'] : 'E-mail'; //$this->verify_check('yanzhengma', $data['authcode']) || $this->error('Incorrect security code'); $this->verify_check($data['authcode'], 'authcode') || $this->error('Incorrect security code'); $validaterule = [ 'name' => 'require', 'subject' => 'require', 'contact' => 'require', ]; $validatemsg = [ 'name.require' => 'Name cannot be empty', 'subject.require' => 'Theme cannot be empty', 'contact.require' => 'Content cannot be empty', ]; if (empty($data['way'])) { return $this->error('Please select the correct contact information'); } else { if ($data['way'] == 'E-mail') { $validaterule['contact'] = 'email'; $validatemsg['contact.email'] = 'The contact information format is incorrect'; } if ($data['way'] == 'tel') { $validaterule['contact'] = ['regex' => '^1[345789]\d{9}$|^([0-9]{3,4}-?)?[0-9]{7,8}$']; $validatemsg['contact.regex'] = 'The contact information format is incorrect'; } } $valid_result = $this->validate($data, $validaterule, $validatemsg); if (true !== $valid_result) { // 验证失败 输出错误信息 return $this->error($valid_result); } $referer = isset($data['refer']) ? $data['refer'] : ''; $url = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : ''; $searchFeed = getKeywords($referer); $channel = isset($searchFeed['channel']) ? $searchFeed['channel'] : ''; $keyword = isset($searchFeed['search']) ? $searchFeed['search'] : ''; $fed = visitLog(); $set = [ 'feedback_type' => isset($data['feedback_type']) ? $data['feedback_type'] : '', 'name' => isset($data['name']) ? $data['name'] : 'Name', 'subject' => isset($data['subject']) ? $data['subject'] : '', 'content' => isset($data['content']) ? $data['content'] : '', 'way' => isset($data['way']) ? $data['way'] : '', 'contact' => isset($data['contact']) ? $data['contact'] : '', 'order_id' => isset($data['order_id']) ? $data['order_id'] : '', 'country' => isset($data['country']) ? $data['country'] : '', 'channel' => isset($data['channel']) ? $data['channel'] : '', 'addtime' => date('Y-m-d H:i:s'), 'refer' => $referer, 'url' => $url, 'channels' => $channel, 'keyword' => $keyword, 'ip' => $fed['ip'], 'state' => $fed['country'], 'province' => $fed['province'], 'city' => $fed['city'], 'drvice' => $fed['drive'], 'user_agent' => $fed['system']." ".$fed['brower'], ]; $model = Loader::model('Msgform')->insertRow($set); if ($model && $model->getData('id')) { return $this->success('Success! Wait for administrator to view', url('/')); } else { return $this->error('Operation Failed'); } } return $this->result(['code' => false, 'msg' => '未知错误'], false, '未知错误'); } }