-
Notifications
You must be signed in to change notification settings - Fork 1
/
home_employee.php
275 lines (246 loc) · 11.5 KB
/
home_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
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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
<?php
include("auth.php"); //include auth.php file on all secure pages
include("add_employee.php");
$sql = mysql_query("SELECT * from deductions WHERE deduction_id='1'");
while($row = mysql_fetch_array($sql))
{
$phil = $row['philhealth'];
$bir = $row['bir'];
$gsis = $row['gsis'];
$love = $row['pag_ibig'];
$loans = $row['loans'];
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Meta, title, CSS, favicons, etc. -->
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Bootstrap, a sleek, intuitive, and powerful mobile first front-end framework for faster and easier web development.">
<meta name="keywords" content="HTML, CSS, JS, JavaScript, framework, bootstrap, front-end, frontend, web development">
<meta name="author" content="Aryan and Isshita">
<title></title>
<script>
<!--
var ScrollMsg= "Employee Management Information System "
var CharacterPosition=0;
function StartScrolling() {
document.title=ScrollMsg.substring(CharacterPosition,ScrollMsg.length)+
ScrollMsg.substring(0, CharacterPosition);
CharacterPosition++;
if(CharacterPosition > ScrollMsg.length) CharacterPosition=0;
window.setTimeout("StartScrolling()",150); }
StartScrolling();
// -->
</script>
<link href="assets/must.png" rel="shortcut icon">
<link href="assets/css/justified-nav.css" rel="stylesheet">
<link href="assets/css/bootstrap.min.css" rel="stylesheet">
<!-- <link href="data:text/css;charset=utf-8," data-href="assets/css/bootstrap-theme.min.css" rel="stylesheet" id="bs-theme-stylesheet"> -->
<!-- <link href="assets/css/docs.min.css" rel="stylesheet"> -->
<link href="assets/css/search.css" rel="stylesheet">
<!-- <link rel="stylesheet" href="assets/css/styles.css" /> -->
<link rel="stylesheet" type="text/css" href="assets/css/dataTables.min.css">
</head>
<body>
<div class="container">
<div class="masthead">
<h3>
<b><a href="index.php"> Employee Management Information System 📖</a></b>
<a data-toggle="modal" href="#colins" class="pull-right"><b><?php echo $_SESSION['username']; ?> 🎓 </b></a>
</h3>
<nav>
<ul class="nav nav-justified">
<li class="active">
<a href="">Employee</a>
</li>
<li>
<a href="home_deductions.php">Deduction/s</a>
</li>
<li>
<a href="home_salary.php">Income</a>
</li>
</ul>
</nav>
</div>
<br>
<div class="well bs-component">
<form class="form-horizontal">
<fieldset>
<button type="button" data-toggle="modal" data-target="#addEmployee" class="btn btn-success">Add New</button>
<p align="center"><big><b>List of Employees</b></big></p>
<div class="table-responsive">
<form method="post" action="" >
<table class="table table-bordered table-hover table-condensed" id="myTable">
<!-- <h3><b>Ordinance</b></h3> -->
<thead>
<tr class="info">
<th><p align="center">Name🖍</p></th>
<th><p align="center">Gender♀♂</p></th>
<th><p align="center">Employee Type👨</p></th>
<th><p align="center">Department🏢</p></th>
<th><p align="center">Action</p></th>
</tr>
</thead>
<tbody>
<?php
$conn = mysql_connect('localhost', 'root', '');
if (!$conn)
{
die("Database Connection Failed" . mysql_error());
}
$select_db = mysql_select_db('payroll');
if (!$select_db)
{
die("Database Selection Failed" . mysql_error());
}
$query=mysql_query("select * from employee ORDER BY emp_id asc")or die(mysql_error());
while($row=mysql_fetch_array($query))
{
$id =$row['emp_id'];
$lname =$row['lname'];
$fname =$row['fname'];
$type =$row['emp_type'];
$deduction =$row['deduction'];
$overtime =$row['overtime'];
$bonus =$row['bonus'];
?>
<tr>
<td align="center"><a href="view_employee.php?emp_id=<?php echo $row["emp_id"]; ?>" title="Update"><?php echo $row['lname'] ?>, <?php echo $row['fname'] ?></a></td>
<td align="center"><a href="view_employee.php?emp_id=<?php echo $row["emp_id"]; ?>" title="Update"><?php echo $row['gender'] ?></a></td>
<td align="center"><a href="view_employee.php?emp_id=<?php echo $row["emp_id"]; ?>" title="Update"><?php echo $row['emp_type'] ?></a></td>
<td align="center"><a href="view_employee.php?emp_id=<?php echo $row["emp_id"]; ?>" title="Update"><?php echo $row['division'] ?></a></td>
<td align="center">
<a class="btn btn-primary" href="view_account.php?emp_id=<?php echo $row["emp_id"]; ?>">Account</a>
<a class="btn btn-danger" href="delete.php?emp_id=<?php echo $row["emp_id"]; ?>">Delete</a>
</td>
</tr>
<?php } ?>
</tbody>
</table>
</form>
</div>
</fieldset>
</form>
</div>
<!-- this modal is for ADDING an EMPLOYEE -->
<div class="modal fade" id="addEmployee" role="dialog">
<div class="modal-dialog">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header" style="padding:20px 50px;">
<button type="button" class="close" data-dismiss="modal" title="Close">×</button>
<h3 align="center"><b>Add Employee</b></h3>
</div>
<div class="modal-body" style="padding:40px 50px;">
<form class="form-horizontal" action="#" name="form" method="post">
<div class="form-group">
<label class="col-sm-4 control-label">Lastname</label>
<div class="col-sm-8">
<input type="text" name="lname" class="form-control" placeholder="Lastname" required="required">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Firstname</label>
<div class="col-sm-8">
<input type="text" name="fname" class="form-control" placeholder="Firstname" required="required">
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Gender</label>
<div class="col-sm-8">
<select name="gender" class="form-control" placeholder="Gender" required>
<option value="">Gender</option>
<option value="Male">Male</option>
<option value="Female">Female</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Employee Type</label>
<div class="col-sm-8">
<select name="emp_type" class="form-control" placeholder="Employee Type" required>
<option value="">Employee Type</option>
<option value="Job Order">Job Order</option>
<option value="Regular">Regular</option>
<option value="Casual">Casual</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label">Division</label>
<div class="col-sm-8">
<select name="division" class="form-control" placeholder="Division" required>
<option value="">Division</option>
<option value="Admin">Admin</option>
<option value="Human Resource">Human Resource</option>
<option value="Accounting">Accounting</option>
<option value="Engineering">Engineering</option>
<option value="MIS">MIS</option>
<option value="Supply">Supply</option>
<option value="Maintenance">Maintenance</option>
<option value="Control">Control</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-sm-4 control-label"></label>
<div class="col-sm-8">
<input type="submit" name="submit" class="btn btn-success" value="Submit">
<input type="reset" name="" class="btn btn-danger" value="Clear Fields">
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<!-- this modal is for my Colins -->
<div class="modal fade" id="colins" role="dialog">
<div class="modal-dialog modal-sm">
<!-- Modal content-->
<div class="modal-content">
<div class="modal-header" style="padding:20px 50px;">
<button type="button" class="close" data-dismiss="modal" title="Close">×</button>
<h3 align="center">You are logged in as <b><?php echo $_SESSION['username']; ?></b></h3>
</div>
<div class="modal-body" style="padding:40px 50px;">
<div align="center">
<a href="logout.php" class="btn btn-block btn-danger">Logout</a>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- Bootstrap core JavaScript
================================================== -->
<!-- Placed at the end of the document so the pages load faster -->
<script src="assets/js/jquery.min.js"></script>
<script src="assets/js/bootstrap.min.js"></script>
<!-- <script src="assets/js/docs.min.js"></script> -->
<script src="assets/js/search.js"></script>
<script type="text/javascript" charset="utf-8" language="javascript" src="assets/js/dataTables.min.js"></script>
<!-- FOR DataTable -->
<script>
{
$(document).ready(function()
{
$('#myTable').DataTable();
});
}
</script>
<!-- this function is for modal -->
<script>
$(document).ready(function()
{
$("#myBtn").click(function()
{
$("#myModal").modal();
});
});
</script>
</body>
</html>