authLogin($_GET); //如果巨人通行证登陆二次验证不通过,则进行登陆。 if(!$res){ $loginv2->goLogin(); exit; }else{ echo ''; } break; case 'logout': $loginv2 = Login::getInstance(); $loginv2->goLogout(ACT_URL); break; case 'upd': if(time()-1, 'msg'=>'活动未开启')); break; } if(time()-1, 'msg'=>'活动已结束')); break; } $account = Login::getAccount(); $accid = Login::getUid(); $loginv2 = Login::getInstance(); $showaccount = $loginv2->getLoginShowAccount(); if(!$account){ echo json_encode(array('status'=>-9, 'msg'=>'登录超时')); break; } $ddh = new Ddh($accid, $account, $showaccount); $ddh->updStatus(); echo json_encode(array('status'=>1, 'msg'=>'')); break; case 'submit': if(time()-1, 'msg'=>'活动未开启')); break; } if(time()-1, 'msg'=>'活动已结束')); break; } $account = Login::getAccount(); $accid = Login::getUid(); $loginv2 = Login::getInstance(); $showaccount = $loginv2->getLoginShowAccount(); if(!$account){ echo json_encode(array('status'=>-9, 'msg'=>'登录超时')); break; } $name = htmlspecialchars(trim($_POST['name'])); $sex = intval($_POST['sex']); $idcard = htmlspecialchars(trim($_POST['idcard'])); $phone = htmlspecialchars(trim($_POST['phone'])); $chkcode = htmlspecialchars(trim($_POST['ckcode'])); if ( strtolower($_SESSION['chkcode']) != strtolower($chkcode) ) { echo json_encode(array('status'=>-2, 'msg'=>'请填写正确的验证码')); break; } if( !$name || !$sex || !$idcard || !$phone ){ echo json_encode(array('status'=>-3, 'msg'=>'请完整填写相关信息')); break; } if( strlen($phone)!=11 || !in_array($sex, array(1,2)) ){ echo json_encode(array('status'=>-4, 'msg'=>'请完整填写相关信息')); break; } $ddh = new Ddh($accid, $account, $showaccount); $bdcount = $ddh->getBdcount($accid); if($bdcount==0){ echo json_encode(array('status'=>-5, 'msg'=>'对不起,您不符合本次活动要求。')); break; } $info = $ddh->getInfo(); if($info){ $res = $ddh->editInfo($name, $sex, $idcard, $phone, $info['id']); }else{ $res = $ddh->editInfo($name, $sex, $idcard, $phone); } echo json_encode($res); break; case 'xxcount': /*$accid = intval($_GET['accid']); $ddh = new Ddh($account, $showaccount); $c = $ddh->getBdcount($accid); echo $c;*/ $ddh = new Ddh($accid, $account, $showaccount); $data = $ddh->getAllBdcount(); echo $data; break; /*case 'export': $option = array( 'order' => 'id desc' ); $db = Factory::loadDB(); $list = $db->select('ddh_info', '*', $option); $ddh = new Ddh($accid, $account, $showaccount); $xxdata = $ddh->getAllBdcount(); $xxdata = json_decode($xxdata); foreach ($xxdata as $key => $value) { $xxcount[$value[0]] = $value[1]; } foreach ($list as $k => &$v) { $v['xxcount'] = $xxcount[$v['accid']]; } header("Content-type:application/vnd.ms-excel;"); header("Content-Disposition:attachment;filename=list.xls"); echo ''; foreach($list as $item){ $sex = $item['sex']==1?'男':'女'; echo ''; } echo '
ID 账号 保单数量 姓名 性别 身份证 电话 时间 IP
'.$item['id'].' '.$item['showaccount'].' '.$item['xxcount'].' '.$item['name'].' '.$sex.' '.$item['idcard'].' '.$item['phone'].' '.$item['dtime'].' '.$item['ip'].'
'; break;*/ default: $account = Login::getAccount(); $accid = Login::getUid(); $loginv2 = Login::getInstance(); $showaccount = $loginv2->getLoginShowAccount(); $info = array(); if($account){ $ddh = new Ddh($accid, $account, $showaccount); $bdcount = $ddh->getBdcount($accid); if($bdcount==0){ $bdstatus = 1; }else{ $info = $ddh->getInfo(); if(!$info){ $bdstatus = 2; }else{ $bdstatus = 3; } } } include 'tpl/index.tpl.php'; break; } ?>