-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathviewall.php
93 lines (90 loc) · 2.03 KB
/
viewall.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
<!DOCTYPE html>
<html>
<head>
<style>
.mess{
font-size:30px;
font-style:oblique;
text-transform: capitalize;
}
#table{
margin-top:30px;
}
</style>
</head>
<?php
ob_start();
session_start();
if(!isset($_SESSION["username"])||!isset($_SESSION["password"])){
header('Refresh: 0; URL = http://localhost/project/login.php');
}
$total=0;
@require "out_menu.php";
require 'connect.php';
?>
<body>
<div id='table'><br>
<table style="width:99.9%"border="5">
<?php
include 'connect.php';
$sql = "SELECT * FROM `employee` WHERE 1";
$result = $conn->query($sql);
if ($result->num_rows > 0) {
echo '<tr>';
echo '<th>Employee-code</th>';
echo '<th>Name</th>';
echo '<th>Email</th>';
echo '<th>Gender</th>';
echo '<th>HRA</th>';
echo '<th>DA</th>';
echo '<th>TA</th>';
echo '<th>Loan</th>';
echo '<th>no.of days absent</th>';
echo '<th>Date of joining</th>';
echo '<th>Address</th>';
echo '<th>Bonus</th>';
echo '<th>Salary</th>';
echo '</tr>';
// output data of each row
while($row = $result->fetch_assoc()) {
$emp_code = $row['emp-code'];
$emp_name = $row['emp-name'];
$email = $row['email'];
$gender = $row['gender'];
$HRA = $row['HRA'];
$DA = $row['DA'];
$TA = $row['TA'];
$loan = $row['loan'];
$ab_days = $row['ab-days'];
$date_joining = $row['date-joining'];
$address = $row['address'];
$bonus = $row['bonus'];
$salary = $row['salary'];
$total+=$row['salary'];
echo '<tr>';
echo "<td>$emp_code</td>";
echo "<td>$emp_name</td>";
echo "<td>$email</td>";
echo "<td>$gender</td>";
echo "<td>$HRA</td>";
echo "<td>$DA</td>";
echo "<td>$TA</td>";
echo "<td>$loan</td>";
echo "<td>$ab_days</td>";
echo "<td>$date_joining</td>";
echo "<td>$address</td>";
echo "<td>$bonus</td>";
echo "<td>$salary</td>";
echo '</tr>';
}
} else {
echo "empty record";
}
echo '<span class="mess">Total amount of basic pay paid by our company to the employees = </span>';
echo "<span class='mess'>$total</span>";
$conn->close();
?>
</table>
</div>
</body>
</html>