-
Notifications
You must be signed in to change notification settings - Fork 0
/
interventions.php
238 lines (223 loc) · 5.99 KB
/
interventions.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
<?php
$page_title = 'Intervention Dashboard';
$page_access = 'All';
include('header.php');
//include other scripts needed here
echo '<link rel="stylesheet" href="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.css">';
echo '<script src="//cdn.jsdelivr.net/chartist.js/latest/chartist.min.js"></script>';
echo '<script src="js/intervention_scripts.js"></script>';
echo '<link rel="stylesheet" href="css/intervention_styles.css">';
//end header
echo '</head>';
//start body
echo '<body>';
//include nav bar
include('navbar-teachers.php');
?>
<?php
require_once('appfunctions.php');
require_once('connectvars.php');
$dbc = mysqli_connect(DB_HOST, DB_USER, DB_PASSWORD, DB_NAME);
?>
<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>
<?php
if (isset($_GET['id'])) {
$student_id = $_GET['id'];
echo '<input type="hidden" id="student_id" value="' . $student_id . '">';
$query = "SELECT firstname, lastname, grade, flags, refs, iss, oss, beh_plan, iss_days, oss_days, ela_pl, math_pl FROM student_interventions WHERE student_id = $student_id";
$result = mysqli_query($dbc, $query);
$row = mysqli_fetch_array($result);
?>
<div class="container mt-3 mb-3">
<div class="row">
<div class="col 12">
<h1>
Intervention Dashboard - <?php echo $row['firstname'] . ' ' . $row['lastname'] . ' (Gr ' . $row['grade'] . ')'; ?>
</h1>
<p class="text-danger">
MTSS Flags: <?php echo $row['flags']; ?>
</p>
<div class="row">
<div class="col-sm-6">
<h3>
Absences
</h3>
<div class="ct-chart ct-golden-section" id="chart-att"></div>
</div>
<div class="col-sm-6">
<h3>
Behavior
</h3>
<p>
Number of Referrals: <?php echo $row['refs']; ?><br>
Number of ISS: <?php echo $row['iss'] . ' ('. $row['iss_days'] . ' days)'; ?><br>
Number of Suspensions: <?php echo $row['oss'] . ' ('. $row['oss_days'] . ' days)'; ?><br>
Behavior Plan: <?php echo '<a href="' . $row['beh_plan'] . '" download>' . substr($row['beh_plan'], 6) . '</a>'; ?>
</p>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<h3>
ELA Scores
</h3>
<div class="ct-chart ct-golden-section" id="chart-ela"></div>
</div>
<div class="col-sm-6">
<h3>
Math Scores
</h3>
<div class="ct-chart ct-golden-section" id="chart-math"></div>
</div>
</div>
<div class="row">
<div class="col-sm-6">
<h3>
State Tests
</h3>
<div class="ct-chart ct-golden-section" id="chart-state"></div>
<p class="text-center">
<span class="text-primary">Math</span>
<span class="text-success">ELA</span>
</p>
</div>
<div class="col-sm-6">
<table class="table table-sm table-striped">
<thead>
<tr>
<th>Numeric</th>
<th>2014 PL</th>
<th>2015 - 2017 PL</th>
</tr>
</thead>
<tbody>
<tr>
<td>8</td>
<td>Advanced</td>
<td>Advanced</td>
</tr>
<tr>
<td>7</td>
<td>Proficient</td>
<td>Proficient</td>
</tr>
<tr>
<td>6</td>
<td></td>
<td>High Pass</td>
</tr>
<tr>
<td>5</td>
<td>Pass</td>
<td>Low Pass</td>
</tr>
<tr>
<td>4</td>
<td></td>
<td>High Basic</td>
</tr>
<tr>
<td>3</td>
<td>Basic</td>
<td>Low Basic</td>
</tr>
<tr>
<td>2</td>
<td></td>
<td>High Minimal</td>
</tr>
<tr>
<td>1</td>
<td>Minimal</td>
<td>Low Minimal</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="row">
<div class="col-12">
<h3>
Interventions
</h3>
<table class="table table-sm table-striped">
<thead>
<tr>
<th>Date</th>
<th>Staff Member</th>
<th>Intervention</th>
<th>Notes</th>
</tr>
</thead>
<tbody>
<?php
$query = "SELECT date, intervention, notes, firstname, lastname FROM interventions LEFT JOIN staff_list USING (username) WHERE student_id = $student_id ORDER BY date DESC";
$result = mysqli_query($dbc, $query);
if (mysqli_num_rows($result) > 0) {
while ($line = mysqli_fetch_array($result)) {
echo '<tr>';
echo '<td>' . makeDateAmerican($line['date']) . '</td>';
echo '<td>' . $line['firstname'] . ' ' . $line['lastname'] . '</td>';
echo '<td>' . $line['intervention'] . '</td>';
echo '<td>' . $line['notes'] . '</td>';
echo '</tr>';
}
}
?>
</tbody>
</table>
</div>
</div>
<p>
<a class="btn btn-primary" href="edit_mtss.php?id=<?php echo $student_id; ?>">Edit/Add Data</a>
<a class="btn btn-success" href="add_intervention.php">Add Intervention</a>
</p>
</div>
</div>
</div>
<?php
}
else {
?>
<div class="container mt-3 mb-3">
<div class="row">
<div class="col 12">
<h1>
Intervention Dashboard
</h1>
<p>
Select a student to see his/her dashboard.
</p>
<div class="form-group">
<label for="course_search">Select a student</label>
<select id="course_search" class="form-control">
<option disabled selected></option>
<?php
$query = "SELECT student_id, firstname, lastname FROM student_interventions ORDER BY lastname, firstname";
$result = mysqli_query($dbc, $query);
while ($row = mysqli_fetch_array($result)) {
echo '<option value="' . $row['student_id'] . '">' . $row['lastname'] . ', ' . $row['firstname'] . '</option>';
}
?>
</select>
</div>
</div>
</div>
</div>
<?php
}
mysqli_close($dbc);
//end body
echo '</body>';
//include footer
include('footer.php');
?>