public function insert() { header('Content-type:text/html; charset=utf-8'); //创建数据对象 $order = D("Order"); $condition['product'] = I('post.product'); $condition['uname'] = I('post.uname'); $condition['tel'] = I('post.tel'); $condition['status'] = 1; $isorder = $order->where($condition)->count(); if ($isorder >= 1) { $this->error('Sorry,您已经下过订单了,请勿重复提交! '); exit; } if (!$order->create()) { $this->error($order->getError()); exit; } $data = array(); $data['product'] = $condition['product']; switch ($condition['product']) { case 1: $data['remark'] = '净颜梅体验装1盒 168元'; $data['number'] = 1; break; case 2: $data['remark'] = '净颜梅一周期2盒送1盒 336元'; $data['number'] = 2; break; case 3: $data['remark'] = '净颜梅二周期6盒送2盒 828元'; $data['number'] = 6; break; case 4: $data['remark'] = '净颜梅三周期9盒送3盒 1018元'; $data['number'] = 9; break; default: $data['remark'] = ''; break; } $data['user_id'] = ($user = $this->is_authed()) ? $user['user_id'] : NULL; $data['tel'] = $condition['tel']; $data['qq'] = I('post.qq'); $data['uname'] = lib_replace_end_tag($condition['uname']); $data['province'] = I('post.province'); $data['city'] = I('post.city'); $data['dist'] = I('post.dist'); $data['address'] = I('post.address'); $data['pay'] = I('post.pay'); $data['message'] = I('post.message'); $ip = get_client_ip(); $array = explode(",", $ip); $data['ip'] = $array[0]; $data['created_at'] = date('Y-m-d H:i:s'); $data['updated_at'] = date('Y-m-d H:i:s'); $result = $order->add($data); //写入订单数据 if ($result) { $this->success('<img src="/public/success.gif">下单成功'); } else { //错误提示 $this->error('<img src="Public/czy/images/failed.png">下单失败! '); exit; } }
$page_comment = htmlspecialchars($_POST['page_comment']); $comment_title = htmlspecialchars($_POST['comment_title']); $comment_content = htmlspecialchars($_POST['comment_content']); $forward = $_SERVER['HTTP_REFERER']; $cur_url = this . location . href; if ($forward == $cur_url) { $forward = $BOOK_URL; } if ($page_comment != 'page_comment') { echo '<center>数据有误,请您重新评论!</center>'; echo '<meta http-equiv="refresh" content="3;url=' . $forward . '">'; exit; } //安全过虑 $comment_title = lib_replace_end_tag($comment_title); $comment_content = lib_replace_end_tag($comment_content); $time = time(); //插入评论 //$ok=$dsql->ExecuteNoneQuery("insert into comments (aid,mname,title,content,createdate,checked) values ('$aid','游客','$comment_title','$comment_content','$time','$time','1')"); $ok = $dsql->ExecuteNoneQuery("insert into dede_comments (aid,cuid,mid,mname,title,content,score,createdate,updatedate,ip,checked) VALUES ('{$aid}','5','0','游客','{$comment_title}','{$comment_content}','0','{$time}','{$time}','','1')"); if ($ok) { $sbyou_net = ' <center>恭喜您,成功评论!</center> <meta http-equiv="refresh" content="3;url=' . $forward . '"> <script type="text/javascript">setcookie("Sbyou_neT_comment_' . $aid . '");</script> '; } else { $sbyou_net = ' <center>抱歉,评论失败,请您重新评论!</center> <meta http-equiv="refresh" content="3;url=' . $forward . '"> ';
$action = $_GET['action']; switch ($action) { case 'version_num': $type = lib_replace_end_tag(trim($_GET['type'])); $versions = DB::LimitQuery('app_version', array('condition' => array('type' => $type, 'state' => '1'), 'order' => 'ORDER BY createon DESC')); if (!empty($versions)) { $res['done'] = urlencode(1); $res['data'] = urlencode($versions[0]['number']); } else { $res['done'] = urlencode(0); $res['data'] = urlencode(0); } exit(json_encode($res)); break; case 'download_page': $type = intval(lib_replace_end_tag(trim($_GET['type']))); $str = "<link href='http://aaa.qnvip.com/static/css/app_downloadpage.css' rel='stylesheet' /><div class='wrapper'><div class='header'><div class='logo'><h1>大众点评</h1></div></div><div class='section'><ul><li>·随时随地,吃喝玩乐折扣尽享</li><li>·省时省力,自动搜索身边团购</li><li>·无需打印、无需短信,轻松管理优券</li><li>·手机支付快捷安全,随时随地想买就买</li></ul></div><div class='content'><div class='mcont'><h2>下载方式</h2><ul class='box'>"; if ($type == 1) { $str .= "<li class='download'><a id='d' href='https://itunes.apptz.net/898f355e15cbab38768fada6d365465e'><img src='http://aaa.qnvip.com/m/download/ios.png' alt='下载IOS安装包' width='38' height='41' /><p class='note'>青年优品Iphone客户端<span class='small'></span></p><p>免费下载安装</p></a></li><li class='market'><a id='d' href='http://m.qnvip.com'> <img src='http://aaa.qnvip.com/m/download/cm.png' alt='到android market下载' width='38' height='41' /><p class='note'>继续访问触摸板</p><p>无需下载安装<span class='strong'></span></p></a></li></ul></div></div></div>"; } else { if ($type == 2) { $str .= "<li class='download'><a id='d' href='http://m.qnvip.com/download/qnyp-Android.apk'><img src='http://aaa.qnvip.com/m/download/ios.png' alt='下载apk安装包' width='38' height='41' /><p class='note'>青年优品Android客户端<span class='small'></span></p><p>免费下载安装</p></a></li><li class='market'><a id='d' href='http://m.qnvip.com'> <img src='http://aaa.qnvip.com/m/download/cm.png' alt='到android market下载' width='38' height='41' /><p class='note'>继续访问触摸板</p><p>无需下载安装<span class='strong'></span></p></a></li></ul></div></div></div>"; } else { $str = ""; } } // if($type==1||$type==2){ // $res['done']=1; // $res['data']=$str; // }else{ // $res['done']=0;