-
Notifications
You must be signed in to change notification settings - Fork 0
/
forms_act.php
92 lines (80 loc) · 2.4 KB
/
forms_act.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
<?php
require_once('connectvars.php');
require_once('appfunctions.php');
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
$page_title = 'Activity Requests Report';
$page_access = 'Dept Head Admin Principal Superintendent Designee';
include('header.php');
//include other scripts needed here
echo '<script src="https://cdn.datatables.net/1.10.16/js/jquery.dataTables.min.js"></script>';
echo '<script src="https://cdn.datatables.net/1.10.16/js/dataTables.bootstrap4.min.js"></script>';
echo '<script src="js/datatables_scripts.js"></script>';
echo '<script src="js/formsreports_scripts.js"></script>';
//end header
echo '</head>';
//start body
echo '<body>';
//include nav bar
include('navbar-district.php');
?>
<div class="bd-pageheader bg-primary text-white pt-4 pb-4">
<div class="container">
<h1>
District Forms
</h1>
<p class="lead">
Add, edit, and manage forms
</p>
</div>
</div>
<div class="container mt-5 mb-5">
<div class="row">
<div class="col-12">
<h1>
Activity Requests
</h1>
<input type="hidden" id="form_type" value="activity">
<p class="lead">
In the table below you will see all approved bus requests.
</p>
<p>
Click on a form to view and/or print it.
</p>
<?php
$query = "SELECT * FROM forms AS f LEFT JOIN staff_list AS sl ON (f.employee = sl.username) LEFT JOIN forms_activity AS fa ON (f.form_id = fa.formId) WHERE f.status = 'Approved' AND type = 'Activity' ORDER BY date DESC";
$result = mysqli_query($dbc, $query);
if (mysqli_num_rows($result) > 0) {
?>
<table class="table table-hover clickable dataTbl" id="tblApprove">
<thead>
<tr>
<th>Form ID</th>
<th>School</th>
<th>Employee</th>
<th>Location</th>
<th>Date</th>
</tr>
</thead>
<tbody>
<?php
while ($row = mysqli_fetch_array($result)) {
echo '<tr style="cursor: pointer;" id="form-' . $row['form_id'] . '"><td>' . $row['form_id'] . '</td><td>' . $row['school'] . '</td><td>' . $row['firstname'] . ' ' . $row['lastname'] . '</td><td>' . $row['location'] . '</td><td>' . makeDateAmerican($row['date']) . '</td></tr>';
}
?>
</tbody>
</table>
<?php
}
else {
echo '<p>No forms of this type have been approved as of yet.</p>';
}
?>
</div>
</div>
</div>
<?php
mysqli_close($dbc);
//include footer
include('footer.php');
?>