-
Notifications
You must be signed in to change notification settings - Fork 0
/
headcount.php
61 lines (58 loc) · 1.77 KB
/
headcount.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
<?php
require_once('includes/NewDB.php');
$query = "SELECT * FROM `vw_headcount`";
$search_result = filterTable($query,$conn);
function filterTable($query,$conn){
$filter_Result = mysqli_query($conn, $query);
return $filter_Result;
}
?>
<!DOCTYPE html>
<html>
<head>
<title>Headcount</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" type="text/css" href="assets/css/headcount_style.css"/>
</head>
<body onload="window.print()">
<?php
$sql = "SELECT COUNT('Employee No.') AS num FROM vw_headcount";
$result = mysqli_query($conn, $sql);
$values = mysqli_fetch_assoc($result);
$num_rows = $values['num'];
?>
<div class="logo"></div>
<h1>Universidad De Manila</h1>
<p>(formerly City College of Manila)</p>
<p>A.J. Villegas cor. C.M. Palma St., Mehan Gardens, Ermita, Manila</p>
<br>
<br>
<?php echo "<h2>Date: " .date("F d, Y"). "</h2>";?>
<?php echo "<h2>Number of Employees: " .$num_rows. "</h2>";?>
<table>
<tr>
<th>Employee No.</th>
<th>Last Name</th>
<th>First Name</th>
<th>Middle Name</th>
<th>Gender</th>
<th>Position</th>
<th>Employment Status</th>
<th>Salary Grade</th>
</tr>
<?php while($row = mysqli_fetch_array($search_result)):?>
<tr>
<td><?php echo $row['Employee No.'];?></td>
<td><?php echo $row['Last Name'];?></td>
<td><?php echo $row['First Name'];?></td>
<td><?php echo $row['Middle Name'];?></td>
<td><?php echo $row['Gender'];?></td>
<td><?php echo $row['Position'];?></td>
<td><?php echo $row['Employment Status'];?></td>
<td><?php echo $row['Salary Grade'];?></td>
</tr>
<?php endwhile;?>
</table>
</body>
</html>