-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathmanager_view_emp_leave.php
107 lines (85 loc) · 3.83 KB
/
manager_view_emp_leave.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Update employee details</title>
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto|Varela+Round">
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="libs\css\applied_leave.css">
<link rel="stylesheet" href="libs\css\profile_card.css">
.
</head>
<body>
<?php session_start();
$_SESSION['username']='e000100003';
if (!isset($_SESSION['username'])){
header("location: access_restricted.php");
exit();
}
?>
<div class="container">
<div class="table-wrapper">
<div class="table-title">
<div class="row">
<div class="col-sm-6">
<h2><b>View Employee Leave Count</b></h2>
</div>
</div>
</div>
<?php
include 'config\database.php';
include 'objects\employee.php';
$db=new Database();
$user=new Employee($_SESSION['username'],$db->getConnection());
if ((($user->role)==2)){
header("location: access_restricted.php");
exit();
}
$stmt = $user->employeeDetailsForLeave();
$num = $stmt->rowCount();
if($num>0){
?>
<?php
//display error / success mesages
if (isset($_SESSION['message'])){
echo $_SESSION['message'];
unset($_SESSION['message']);
}
?>
<table class='table table-hover table-responsive table-bordered'>
<tr>
<th>Employee Id</th>
<th>Name</th>
<th>Department</th>
<th>Action</th>
</tr>
<?php while ($row = $stmt->fetch(PDO::FETCH_ASSOC)){
extract($row);?>
<tr>
<td ><?php echo $row['emp_id']?></td>
<td ><?php echo ucwords (strtolower($row['name']))?></td>
<td><?php echo ucwords (strtolower( $row['dept_name']))?></td>
<td>
<a href='assets/manager_view_emp_leave.inc.php?emp_id=<?php echo $row['emp_id']?>' data-toggle='modal' id="<?php echo $row['emp_id']; ?>" class='btn btn-primary left-margin '>
<span class='glyphicon glyphicon-eye-open'></span> View
</a>
</td>
</tr>
<?php } ?>
</table>
<?php
}
else{
echo "<div class='alert alert-info'>No Employees were found.</div>";
}
?>
</div>
</div>
</body>
</html>