-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathajax.php
49 lines (35 loc) · 1.28 KB
/
ajax.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
39
40
41
42
43
44
45
46
47
48
49
<?php
/**
*
*@file ajax.php
*@author xieyoujiang
*@data 2016年1月30日
*@language PHP
*@e-mail xie_youjiang@163.com
*@copyright(c) 扬州格佳科技有限公司
*
*/
require_once './classpackage/Db.class.php';
if(isset($_GET['id']))
{
$strUserSql = "select f_id,f_username,f_password,f_fullname,f_phone,f_rank,f_head,f_head_phone,f_boss_phone,f_time,f_last_login,f_last_ip,f_last_time from t_users where f_id = ?";
$strRankSql = "select f_id,f_title from t_rank where f_type=1";
$strBossSql = "select f_id,f_fullname from t_head where f_boss>0";
$rsUser = DbOperator::querySql($strUserSql,array($_GET['id']));
$rsRank = DbOperator::queryAll($strRankSql);
$rsBoss = DbOperator::queryAll($strBossSql);
$rsUser['rank'] = $rsRank;
$rsUser['boss'] = $rsBoss;
echo json_encode($rsUser, JSON_UNESCAPED_UNICODE);
}
else if(isset($_GET['active']) && $_GET['active'] == "addStaff")
{
$strRankSql = "select f_id,f_title from t_rank where f_type=1";
$strBossSql = "select f_id,f_fullname from t_head where f_boss>0";
$rsRank = DbOperator::queryAll($strRankSql);
$rsBoss = DbOperator::queryAll($strBossSql);
$rs['rank'] = $rsRank;
$rs['boss'] = $rsBoss;
echo json_encode($rs, JSON_UNESCAPED_UNICODE);
}
?>