-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsign.php
38 lines (38 loc) · 1.29 KB
/
sign.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
include './lib/mysql_contral.php';
include './lib/class_other.php';
include './lib/session_mem.php';
if(isset($_SESSION['uid'])){
if(!isset($_GET['aid'])){
$o=new other_func();
$o->jref('active.php');
exit();
}
$db=new db_contral();
$db->connect_db();
switch($_GET['action']){
case 'search':
if(isset($_GET['searchtext'])){
$searchtext='%'.$_GET['searchtext'].'%';
//echo $searchtext;
$r=$db->all_query_stmt("SELECT appid,name,tel,address,department,apply.personid FROM apply,person where apply.personid=person.personid AND apply.status=0 AND apply.actid=? AND apply.searchinfo LIKE ?",array($_GET['aid'],$searchtext));
echo json_encode($r);
// include './template/sign.html';
}
break;
case 'confirm'://修改参数
$db->update_data_basic('apply',array('status'),array('1'),'appid','=',$_GET['appid']);
break;
case 'edit':
$r=$db->update_data_basic('apply',array('status'),array('0'),'appid','=',$_GET['appid']);
break;
default://无参数自动显示签到列表
$r=$db->all_query_stmt('SELECT appid,name,tel,address,department,apply.personid FROM apply,person where apply.personid=person.personid AND apply.status=0 AND apply.actid=?', array($_GET['aid']));
echo json_encode($r);
}
}
else{
$r[0]['error']=1;
echo json_encode($r);
}
?>