-
Notifications
You must be signed in to change notification settings - Fork 0
/
disease.php
51 lines (45 loc) · 1.36 KB
/
disease.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
50
51
<?php
/**
* 管理常见疾病
**/
define('IN_ECS', true);
require(dirname(__FILE__) . '/includes/init.php');
/**
* 常见疾病列表
**/
if ($_REQUEST['act'] == 'disease_list')
{
//检查用户权限
admin_priv('users_manage');
$sql = 'SELECT * FROM '.$ecs->table('disease');
$disease_list = $db->getAll($sql);
$smarty->assign('user_ranks', $ranks);
$smarty->assign('ur_here', $_LANG['15_disease_man']);
$smarty->assign('disease_list', $disease_list);
$smarty->assign('full_page', 1);
$smarty->assign('sort_user_id', '<img src="images/sort_desc.gif">');
assign_query_info();
$smarty->display('disease_list.htm');
}
//添加新的疾病
elseif ($_REQUEST['act'] == 'add')
{
$sql='INSERT INTO '.$ecs->table('disease').'(disease)VALUES("'.$_GET['disease'].'")';
if($db->query($sql))
{
$sql = 'SELECT * FROM '.$ecs->table('disease')." WHERE disease='$_GET[disease]' OR disease_id=".mysql_insert_id();
$disease = $db->getRow($sql);
require_once('../includes/cls_json.php');
$json = new JSON;
die($json->encode($disease));
}
}
elseif ($_REQUEST['act'] == 'del')
{
$sql = 'DELETE FROM '.$ecs->table('disease').' WHERE disease_id='.$_GET['id'];
if ($db->query($sql))
{
echo $_GET['id'];
}
}
?>