-
Notifications
You must be signed in to change notification settings - Fork 0
/
weekly_report.php
47 lines (46 loc) · 1.05 KB
/
weekly_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
<?php
include("common.php");
head();
$stmt;
$mysqli_connection;
if (!empty($_GET['week'])) {
$mysqli_connection = new MySQLi($server, $user, $pass, $table, $port);
$week = $_GET['week'];
if (mysqli_connect_errno() == 0) { ?>
<div>
<h1>Weekly Report</h1>
<table class="table table-hover table-custom">
<tr>
<th>Name</th>
<th>PC</th>
<th>Check-ins Required</th>
<th><?php echo $week ?></th>
</tr>
<?php
if ($result = $mysqli_connection->query("SELECT name, pc, checkins, " . $week . " FROM " . $quarter)) {
while ($row = $result->fetch_row()) { ?>
<tr>
<?php for ($i = 0; $i < 4; $i++) { ?>
<td><?php echo $row[$i] ?></td>
<?php } ?>
</tr>
<?php }
} ?>
</table>
</div>
<?php } else { ?>
<div><p>Something went wrong...</p></div>
<?php }
} else {
?>
<div>
<h1>Choose a Week:</h1>
<?php week_dropdown("2"); ?>
<form id="form_submit" action="weekly_report.php" method="get">
<input type="submit" value="Go" />
</form>
</div>
<?php
}
foot();
?>