forked from skalia11/driving-school
-
Notifications
You must be signed in to change notification settings - Fork 0
/
employee.php
159 lines (127 loc) · 5.15 KB
/
employee.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
<!--*****************************************************
* Project Name: Driving School System
* Version: 1.0
* Developer: Saransh Kalia & Emad Zamout
* Course: CPSC 3660
*****************************************************-->
<?php
session_start();
if(!isset($_SESSION['user'])){
header('Location:index.php');
}
include 'includes/dashboard_header.php';
include 'includes/dashboard_header.php';
?>
<link rel="stylesheet" href="css/jquery-nicemodal.css">
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
<script src="js/jquery-nicemodal.js"></script>
</head>
<body>
<div id="header">
<div class="inHeader">
<div class="mosAdmin">
Hello, <?php echo ucfirst($_SESSION['user']);
?><br>
| <a href="includes/logout.php">Logout</a>
</div>
<div class="clear"></div>
</div>
</div>
<div id="wrapper">
<div id="leftBar">
<ul>
<?php
include'includes/dashboard_menu.php'
?>
</ul>
</div>
<div id="rightContent">
<h3>Employees</h3>
<hr />
<div id="smallCenter"><a href="create-receptionist.php"><br><h3><div align="center" class="btn">Add a New Receptionist</div></h3></a></div>
<table class="data">
<tr class="data">
<th class="data">First Name</th>
<th class="data">Last Name</th>
<th class="data">Gender</th>
<th class="data">Phone Number</th>
<th class="data">address</th>
<th class="data">Username</th>
<th class="data">Password</th>
<th class="data" width="75px"></th>
</tr>
<tr class="data">
<?php
include 'includes/connect.php';
$sqls= mysqli_query($dbhandle,"SELECT * FROM people inner join receptionist where people.sincard = receptionist.sincard");
$sqlr= mysqli_num_rows($sqls);
while($sqlf=mysqli_fetch_assoc($sqls)){ ?>
<td class="data" width="30px"><center><?php echo $sqlf['first_name']; ?></center></td>
<td class="data"><center><?php echo $sqlf['last_name']; ?></center></td>
<td class="data"><center><?php echo $sqlf['gender']; ?></center></td>
<td class="data"><center><?php echo $sqlf['phone_num']; ?></center></td>
<td class="data"><center><?php echo $sqlf['address']; ?></center></td>
<td class="data"><center><?php echo $sqlf['username']; ?></center></td>
<td class="data"><center><?php echo $sqlf['password']; ?></center></td>
<td class="data" width="75px">
<center>
<?php $sqlres=$sqlf['sincard']; ?>
<button> <a href="edit-receptionist.php?sincard=<?php echo $sqlres;?>"><img src="css/img/edit.png"></a></button>
<button name="delete" id="demo" formmethod="post" data-url="delete-receptionist.php?sincard=<?php echo $sqlres;?>"> <img src="css/img/delete.png"></button>
</center>
</td>
</tr><?php } ?>
</table>
<div id="smallCenter"><a href="create-instructor.php"><br><h3><div align="center" class="btn">Add a New Instructor</div></h3></a></div>
<table class="data">
<tr class="data">
<th class="data">First Name</th>
<th class="data">Last Name</th>
<th class="data">Gender</th>
<th class="data">Phone Number</th>
<th class="data">address</th>
<th class="data">Driving License Number</th>
<th class="data" width="75px"></th>
</tr>
<tr class="data">
<?php
include 'includes/connect.php';
$sqls= mysqli_query($dbhandle,"SELECT * FROM people inner join instructor where people.sincard = instructor.sincard");
$sqlr= mysqli_num_rows($sqls);
while($sqlf=mysqli_fetch_assoc($sqls)){ ?>
<td class="data" width="30px"><center><?php echo $sqlf['first_name']; ?></center></td>
<td class="data"><center><?php echo $sqlf['last_name']; ?></center></td>
<td class="data"><center><?php echo $sqlf['gender']; ?></center></td>
<td class="data"><center><?php echo $sqlf['phone_num']; ?></center></td>
<td class="data"><center><?php echo $sqlf['address']; ?></center></td>
<td class="data"><center><?php echo $sqlf['dl_number']; ?></center></td>
<td class="data" width="75px">
<center>
<?php $sqlres=$sqlf['sincard']; ?>
<button name="views" formmethod="post" data-url="view-instructor.php?sincard=<?php echo $sqlres;?>" id="demo"><img src="css/img/detail.png"></button>
<button> <a href="edit-instructor.php?sincard=<?php echo $sqlres;?>"><img src="css/img/edit.png"></a></button>
<button name="delete" id="demo" formmethod="post" data-url="delete-instructor.php?sincard=<?php echo $sqlres;?>"> <img src="css/img/delete.png"></button>
</center>
</td>
</tr><?php } ?>
</table>
</div>
<script>
$(function(){
$('button#demo').nicemodal({
width: '500px',
keyCodeToClose: 27,
defaultCloseButton: true,
idToClose: '#close-nicemodal',
closeOnClickOverlay: true,
closeOnDblClickOverlay: false,
//onCloseModal: function(){
// alert('Reload Page to see the effect !');
// window.location.href='student.php';
//}
});
});
</script>
<?php
include 'includes/dashboard_footer.php'
?>