-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathusers.php
More file actions
186 lines (147 loc) · 4.77 KB
/
users.php
File metadata and controls
186 lines (147 loc) · 4.77 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
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
<?php
include("connection.php");
include("sessionlock.php");
include("pagination.php");
$sql1="SELECT * FROM users";
//CHECK FOR SUCCESS
$query3=mysql_query($sql1);
?>
<html lang="en">
<head>
<title>|home</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>
<script src="jquery.min.js"></script>
<script type="text/javascript">
function deleteConfirm(){
var result = confirm("Are you sure to delete users?");
if(result){
return true;
}else{
return false;
}
}
$(document).ready(function(){
$('#select_all').on('click',function(){
if(this.checked){
$('.checkbox').each(function(){
this.checked = true;
});
}else{
$('.checkbox').each(function(){
this.checked = false;
});
}
});
$('.checkbox').on('click',function(){
if($('.checkbox:checked').length == $('.checkbox').length){
$('#select_all').prop('checked',true);
}else{
$('#select_all').prop('checked',false);
}
});
});
</script>
</head>
<body>
<div class="container">
<!-- navbar-fixed-top for fixed top -->
<nav class="navbar navbar-inverse ">
<div class="container-fluid" style = "background-color: #005200">
<ul class="nav navbar-nav" style ="color: white">
<li><a href="index.php">Dashboard</a></li>
<li><a href="ViewAssets.php">Assets</a></li>
<li><a href="HomeTask.php">Task</a></li>
<li><a href="ViewUser.php">User</a></li>
<li><a href="ViewReport.php">Report</a></li>
<li><a href="#">settings</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="#"><?php echo "".$fullname."";?></a></li>
<li><a href="logout.php"> Log out</a></li>
</ul>
</div>
</nav>
<div class="row">
<div class="col-md-12">
<marquee> <h4>tanesco assets management system</h4></marquee>
</div>
<div class="col-md-12">
<nav class="navbar navbar-default">
<div class="container-fluid">
<ul class="nav navbar-nav">
<li><a href="#">Profile</a></li>
<li><a href="#">Add asset</a></li>
<li><a href="#">View assets</a></li>
<li><a href="#">Assets category</a></li>
<li><a href="#">Assets report</a></li>
<li><a href="#">tasks on demand</a></li>
<li><a href="#">done task</a></li>
<li><a href="#">engineering task</a></li>
<li><a href="#">technical task</a></li>
</ul>
</div>
</nav>
</div>
<div class="col-md-12" style="height:500px">
<h5>Users</h5>
<form name="bulk_action_form" action="deleteusers.php" method="post" onsubmit="return deleteConfirm();"/>
<table class="table">
<thead>
<tr>
<th>No</th>
<th>Full name</th>
<th>User Id</th>
<th>Department</th>
<th>Role</th>
<th>Date Added</th>
<th>Email</th>
<th>Address</th>
<th><input type="checkbox" name="select_all" id="select_all" value=""/></th>
</tr>
</thead>
<?php
if(mysql_num_rows($query3) > 0){
while ($row=mysql_fetch_array($query3)){
$f1=$row['Id'];
$f2=$row['FullName'];
$f3=$row['UserId'];
$f4=$row['Department'];
$f5=$row['Role'];
$f6=$row['DateAdded'];
$f7=$row['Email'];
$f8=$row['Address'];
?><tr>
<td><?php echo $f1 ?></td>
<td><?php echo $f2 ?></td>
<td><?php echo $f3 ?></td>
<td><?php echo $f4 ?></td>
<td><?php echo $f5 ?></td>
<td><?php echo $f6 ?></td>
<td><?php echo $f7 ?></td>
<td><?php echo $f8 ?></td>
<td align="center"><input type="checkbox" name="checked_id[]" class="checkbox" value="<?php echo $row['Id']; ?>"/></td>
</tr>
<?php
}}else{
?>
<tr><td colspan="5">No records found.</td></tr>
<?php } ?>
</table>
</div>
<center><nav>
<ul class="pagination">
<li><a href="#"><?php echo $pagination ;?></a></li>
<li><input type="submit" class="btn btn-danger" name="bulk_delete_submit" value="Delete"/></li>
</ul>
</nav></center></form>
</div>
<div class="col-md-12" style = "background-color: #005200; color: white">
<center> <p>Tanesco | ICT | FTP | 2015 </p></center>
</div>
</div>
</body>
</html>