-
Notifications
You must be signed in to change notification settings - Fork 1
/
delDepart.php
executable file
·101 lines (87 loc) · 2.93 KB
/
delDepart.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
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
<!DOCTYPE html>
<html>
<head lang="en">
<meta charset="UTF-8">
<title></title>
<script type="text/javascript" src="./js/jquery-1.8.0.js"></script>
<link type="text/css" rel="stylesheet" href="bootstrap/css/bootstrap.min.css">
<script type="text/javascript" src="bootstrap/js/bootstrap.min.js"></script>
<script type="text/javascript" src="./Ajax/Ajax.js"></script>
<script>
var xmlHttp=getXmlHttpRequest();
function tips(num,id)
{
if(num!=0) {
var t = confirm("该部门人员不为零,是否转移?");
if (t == true) {
document.location.href = "./delresponse.php?id="+id;//test
}
else {
}
}
else{
var a=confirm('确认删除该部门?');
if(a==true) {
sendRequest('./Ajax/responsPhp/ajax_del_depart.php', info, 'id=' + id);
}
}
}
function info()
{
if(xmlHttp.readyState==4)
{
alert('部门已从列表中移除!');
document.location.href='./delDepart.php';
}
}
function modify(id)
{
document.location.href='./modify_depart_page.php?id='+id;
}
</script>
<?php
include './parameter/mysql/DataOperat.php';
include './parameter/class/depart.php';
$mydb=new DataOperat();
$re=$mydb->fetch_depart_info();
$num=count($re);
$counter=array();
?>
</head>
<body>
<div class="container">
<div class="page-header">
<h3><strong>更多操作</strong></h3>
</div>
<table class="table table-striped">
<caption> 部门信息一览</caption>
<tr>
<th>部门名称</th>
<th>部门编码</th>
<th>部门人数</th>
<th>相关操作</th>
</tr>
<?php
$row=new depart();
for($i=0;$i<$num;$i++)
{
$row->initDepart($re[$i]);
?>
<tr>
<td><?php echo $row->getName(); ?></td>
<td><?php echo $row->getId(); ?></td>
<td><?php
$counter[$i]= $mydb->fetch_depart_num($row->getId());
echo $counter[$i];
?></td>
<td><label class="btn btn-primary" onclick="tips(<?php echo $counter[$i].",".$row->getId(); ?>)"> 删除</label>
<label class="btn btn-primary" onclick="modify(<?php echo $row->getId(); ?>)"> 修改</label>
</td>
</tr>
<?php
}
?>
</table>
</div>
</body>
</html>