-
Notifications
You must be signed in to change notification settings - Fork 0
/
user_select.php
executable file
·161 lines (145 loc) · 6.53 KB
/
user_select.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
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
<?php session_start();?>
<html lang="en">
<!-- checking illegal access -->
<?php include 'check_access.php'; ?>
<!--CheckUserType-->
<?php
include 'check_user_type.php';
CheckUserType('manager');
?>
<!-- accessing database -->
<?php
require_once 'connectvars.php';
$dbc = mysqli_connect(DB_HOST,DB_USER,DB_PASSWORD,DB_NAME);
$user_id = mysqli_real_escape_string($dbc,trim($_SESSION['user_id']));
$query = "SELECT * FROM user_info WHERE user_id = '$user_id'";
$data = mysqli_query($dbc,$query);
?>
<!-- include head file-->
<head>
<?php include 'header.php'; ?>
<script type="text/javascript" src="js/user.js"></script>
</head>
<body>
<div id="wrap">
<!-- Fixed navbar -->
<?php include 'navigation.php'; ?>
<!-- Begin page content -->
<div class="container">
<div class="page-header">
<h1> User Query <small></small></h1>
</div>
<div class="panel panel-default">
<div class="panel-heading">
<p></p>
<!-- Warn Modal -->
<div class="modal fade" id="warnModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="warnModalLabel">Delete</h4>
</div>
<div class="modal-body">
Are you sure to delete?
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal" id="closeBTN">Close</button>
<button type="button" class="btn btn-default btn-danger" data-dismiss="modal" id="deleteBTN" data-toggle='modal' data-target="#successModal">Delete</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- success Modal -->
<div class="modal fade" id="successModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="successModalLabel">Success</h4>
</div>
<div class="modal-body">
You have deleted user successfully!
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<!-- Fail Modal -->
<div class="modal fade" id="failModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
<div class="modal-dialog">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>
<h4 class="modal-title" id="failModalLabel">Failed</h4>
</div>
<div class="modal-body">
Delete falied! Please try agian!
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Close</button>
</div>
</div><!-- /.modal-content -->
</div><!-- /.modal-dialog -->
</div><!-- /.modal -->
<form>
<div class="input-group">
<span class="input-group-addon">Query Criteria
<select name="seltype" class="selectpicker" id="seltype">
<option value="user_id">User ID</option>
<option value="username">User Name</option>
<option value="gender">Gender</option>
<option value="enroll_time">Enroll Time</option>
<option value="phone">Phone</option>
<option value="email">Email</option>
</select>
</span>
<span class="input-group-addon">Order By
<select name="order" id='order'>
<option value="user_id">User ID</option>
<option value="username">User Name</option>
<option value="gender">Gender</option>
<option value="enroll_time">Enroll Time</option>
<option value="phone">Phone</option>
<option value="email">Email</option>
</select>
</span>
<span>
<input type="text" id="userKeyword" placeholder="Typing keyword here to start search" class="form-control" name="keyword">
</span>
</div>
</form>
</div>
<div id="res" style="display: none">
<h4 align="center">Search Results</h4>
<p id="prompt" align="center"></p>
<table class="table table-striped" id="table">
<tr id="tableHead">
<td align='center'><small> User ID </small></td>
<td align='center'><small> User Name </small></td>
<td align='center'><small> Department </small></td>
<td align='center'><small> Gender </small></td>
<td align='center'><small> Birthday </small></td>
<td align='center'><small> Enroll Time </small></td>
<td align='center'><small> Phone </small></td>
<td align='center'><small> Email </small></td>
<td align='center'><small> Description </small></td>
<td align='center'colspan='3'><small> Action </small></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<!-- clear user_info Session -->
<!-- page footer -->
<?php include"footer.php"; ?>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="http://cdn.bootcss.com/jquery/1.10.2/jquery.min.js"></script>
<script src="../../dist/js/bootstrap.min.js"></script>
</body>
</html>