Commit c51a2da1 by doszhang

dos

parent 712aafe2
......@@ -19,21 +19,10 @@ class IndexController extends Controller
public function index()
{
session_start();
$_SESSION['joinTime'] = time();
$num = M('num')->where('id=1')->select();
$num = $num[0]['num'];
$this->assign('num',$num);
$this->display();
}
public function addNum(){
if(time() > 1584720000)
{
header("HTTP/1.0 404 Not Found");
exit;
}
$referer = $_SERVER['HTTP_REFERER'];
$refererInfo = parse_url( $referer );
if( $refererInfo['host'] != $_SERVER['HTTP_HOST'] )
......@@ -48,16 +37,38 @@ class IndexController extends Controller
exit;
}
$name = $_POST['name'];
$business = $_POST['business'];
if($name != '')
$code = $_POST['code'];
$job_number = M('list')->where(array(
'code' => $code
))->find();
if($job_number)
{
M('num')->where('id=1')->setInc('num');
M('info')->add(array(
'name' => $name,
'business' => $business,
'addtime' => time()
if($job_number['name'] == $name)
{
$this->ajaxReturn(array(
'status' => 1,
'poster' => $job_number['level'],
'msg' => '查询成功',
'step' => 1
));
return;
}
else {
$this->ajaxReturn(array(
'status' => 0,
'msg' => '您填写的姓名有误',
'step' => 1
));
return;
}
}else {
$this->ajaxReturn(array(
'status' => 0,
'msg' => '您填写的工号有误',
'step' => 1
));
return;
}
}
}
\ No newline at end of file
......@@ -91,7 +91,7 @@ $(document).ready(function () {
});
//提交信息
$('.page1 .btn-next').on('click', toUploadPage);
$('.page1 .btn-next').on('click', checkInfo);
// $('input[name=btn-upload]').change(function () {
// $('.regulate-block').show();
......@@ -118,7 +118,6 @@ $(document).ready(function () {
});
function toUploadPage() {
checkInfo();
$('.page1').hide();
$('.upload-page').show();
}
......@@ -135,6 +134,23 @@ function checkInfo() {
my_notify('请填写工号');
return false;
}
$.ajax({
url: '/index/getInfo',
type: 'POST',
data: {
name: name,
code: code
},
success: function (resp) {
if (resp.status == 1) {
toUploadPage();
} else {
$('#notification_area').remove();
my_notify(resp.msg);
return false;
}
}
})
}
function initPage() {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment