-
Notifications
You must be signed in to change notification settings - Fork 0
/
report.php
61 lines (53 loc) · 1.36 KB
/
report.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
session_start();
if(isset($_SESSION["userid"])) {
include_once "database/dbconnect.php";
echo '<!DOCTYPE html>
<html>
<head>
<title> Splitter </title>
<style>
table {
font-family: arial, sans-serif;
border-collapse: collapse;
width: 100%;
}
td, th {
border: 1px solid #dddddd;
text-align: left;
padding: 8px;
}
tr:nth-child(even) {
background-color: #dddddd;
}
</style>
</head>
<body>
<h1> SPLITTER </h1>
<table>
<tr>
<th>Receipt#</th>
<th>Name</th>
<th>Expense</th>
<th>Date</th>
<th>Amount</th>
</tr>';
$sql = "SELECT * FROM expenditure INNER JOIN users ON expenditure.userid = users.userid";
$result = mysqli_query($conn, $sql);
$resultCheck = mysqli_num_rows($result);
if ($resultCheck >= 1) {
while ($row = mysqli_fetch_assoc($result)) {
echo '<tr>
<td>'.$row["receiptid"].'</td>
<td>'.$row["firstname"].' '.$row["lastname"]. '</td>
<td>'.$row["reason"].'</td>
<td>'.$row["date"].'</td>
<td>$'.$row["amount"].'</td>
</tr>';
}
}
echo '</table>
</body>
</html>';
}
else header("Location: index.php?redirect");