Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
php
/
citic-mdrt
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
c51a2da1
authored
Apr 21, 2020
by
doszhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dos
parent
712aafe2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
22 deletions
+48
-22
Application/Home/Controller/IndexController.class.php
+30
-20
Public/static/js/common.js
+18
-2
No files found.
Application/Home/Controller/IndexController.class.php
View file @
c51a2da1
...
...
@@ -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
Public/static/js/common.js
View file @
c51a2da1
...
...
@@ -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
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment