-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathsystem_part.php
More file actions
104 lines (102 loc) · 3.4 KB
/
system_part.php
File metadata and controls
104 lines (102 loc) · 3.4 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
<?php
require(dirname(__FILE__)."/include/config_base.php");
require(dirname(__FILE__)."/include/config_rglobals.php");
require_once(dirname(__FILE__)."/include/checklogin.php");
if($action=='save'){
if($p_name==''){
ShowMsg('请输入公司部门的名称','-1');
exit();
}
$addsql="insert into #@__part(p_name,p_text) values('$p_name','$p_text')";
$message="添加公司部门".$p_name."成功";
$loginip=getip();
$logindate=getdatetimemk(time());
$username=GetCookie('VioomaUserID');
$asql=New Dedesql(false);
$asql->ExecuteNoneQuery($addsql);
$asql->close();
WriteNote($message,$logindate,$loginip,$username);
showmsg('成功添加了公司部门','system_part.php');
exit();
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/2019/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf8" />
<link href="style/main.css" rel="stylesheet" type="text/css" />
<title><?php echo $cfg_softname;?>部门管理</title>
</head>
<body>
<table width="100%" border="0" id="table_style_all" cellpadding="0" cellspacing="0">
<tr>
<td id="table_style" class="l_t"> </td>
<td> </td>
<td id="table_style" class="r_t"> </td>
</tr>
<tr>
<td> </td>
<td>
<table width="100%" border="0" cellpadding="0" cellspacing="2">
<tr>
<td><strong> 部门管理</strong> <a href="system_part.php?action=new">添加新的部门</a> | <a href="system_part.php">查看部门列表</a></td>
</tr>
<form action="system_part.php?action=save" method="post">
<tr>
<td bgcolor="#FFFFFF">
<?php if($action=='new'){ ?>
<table width="100%" cellspacing="0" cellpadding="0" border="0" id="table_border">
<tr>
<td id="row_style"> 部门名称:</td>
<td>
<input type="text" name="p_name" size="30" id="need"></td>
</tr>
<tr>
<td id="row_style"> 备注:</td>
<td>
<textarea name="p_text" rows="3" cols="30"></textarea></td>
</tr>
<tr>
<td id="row_style"> </td>
<td> <input type="submit" name="submit" value=" 添加部门 "></td>
</tr>
</form>
</table>
<?php
}
else
{
echo "<table width=\"100%\" cellspacing=\"0\" cellpadding=\"0\" border=\"0\" id=\"table_border\">";
$csql=New Dedesql(false);
$csql->SetQuery("select * from #@__part");
$csql->Execute();
$rowcount=$csql->GetTotalRow();
if($rowcount==0)
echo "<tr><td> 系统里还没有任何部门,请先<a href=system_part.php?action=new>添加部门</a>。</td></tr>";
else{
echo "<tr class='row_color_head'><td>ID</td><td>部门名称</td><td>备注</td><td>操作</td></tr>";
while($row=$csql->GetArray()){
echo "<tr><td>ID号:".$row['id']."</td><td> ".$row['p_name']."</td><td> ".$row['p_text']."</td><td><a href=system_part_edit.php?id=".$row['id'].">修改</a> | <a href=system_part_del.php?id=".$row['id'].">删除</a></td></tr>";
}
}
echo "</table>";
$csql->close();
}
?>
</td>
</tr>
</table>
</td>
<td> </td>
</tr>
<tr>
<td id="table_style" class="l_b"> </td>
<td> </td>
<td id="table_style" class="r_b"> </td>
</tr>
</table>
<?php
copyright();
?>
</body>
</html>