-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcompleted_referrals.php
119 lines (107 loc) · 3.04 KB
/
completed_referrals.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
<?php
require_once('connectvars.php');
require_once('appfunctions.php');
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
$page_title = 'Referrals';
$page_access = 'All';
include('header.php');
//include other scripts needed here
echo '<link rel="stylesheet" href="https://cdn.datatables.net/1.10.16/css/dataTables.bootstrap4.min.css"/>';
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>';
//end header
echo '</head>';
//start body
echo '<body>';
//include nav bar
include('navbar-students.php');
?>
<div class="bd-pageheader bg-primary text-white pt-4 pb-4">
<div class="container">
<h1>
Students
</h1>
<p class="lead">
Manage students and interventions
</p>
</div>
</div>
<div class="container mt-5 mb-5">
<div class="row">
<div class="col-12">
<h1>
Assigned Referrals
</h1>
<p class="lead">
In the table below you will see all active referrals.
</p>
<p>
Click on a referral to view and/or resolve it.
</p>
<p>
<a class="btn btn-primary" href="addreferral.php">Add Referral</a>
<a class="btn btn-secondary" href="referrals.php">Unassigned Referrals</a>
</p>
<?php
if ($_SESSION['school'] != 'District Office') {
$school = $_SESSION['school'];
$query = "SELECT firstname, lastname, rowid, teacher, time, behavior, status, action, grade FROM referrals LEFT JOIN student_list USING (student_id) WHERE school = '$school' AND status = 2";
}
else {
$query = "SELECT firstname, lastname, rowid, teacher, time, behavior, status, action, grade FROM referrals LEFT JOIN student_list USING (student_id) WHERE status = 2";
}
$result = mysqli_query($dbc, $query);
if (mysqli_num_rows($result) > 0) {
?>
<table class="table table-striped" id="tblApprove">
<thead>
<tr>
<th></th>
<th>Student</th>
<th>Grade</th>
<th>Teacher</th>
<th>Date/Time</th>
<th>Behavior</th>
<th>Action</th>
</tr>
</thead>
<tbody>
<?php
while ($row = mysqli_fetch_array($result)) {
echo '<tr>';
echo '<td><a class="btn btn-secondary" href="print_referral.php?id=' . $row['rowid'] .'">View</a></td>';
echo '<td>' . $row['firstname'] . ' ' . $row['lastname'] . '</td>';
echo '<td>' . $row['grade'] . '</td>';
echo '<td>' . $row['teacher'] . '</td>';
echo '<td>' . parseRefDT($row['time']) . '</td>';
echo '<td>' . $row['behavior'] . '</td>';
echo '<td>' . $row['action'] . '</td>';
echo '</tr>';
}
?>
</tbody>
</table>
<?php
}
else {
echo '<p>No referrals have been completed as of yet.</p>';
}
?>
</div>
</div>
</div>
<script>
$(document).ready(function() {
$('table').dataTable({
"order": [[4, 'dsc']],
"pageLength": 50
});
});
</script>
<?php
mysqli_close($dbc);
//include footer
include('footer.php');
?>