-
Notifications
You must be signed in to change notification settings - Fork 0
/
mtg.php
152 lines (128 loc) · 5.56 KB
/
mtg.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
<?php
/**
* Created by JetBrains PhpStorm.
* User: DATTWOOD
* Date: 02/08/11
* Time: 13:31
* Grab the existing MTG and formats it for view by the student and editing by the tutor
*/
if (isset($_POST['submitMTG'])) {
// use replace based on the unqie index on the learner number to stop having to run a check query
$query = "REPLACE INTO mtg (student_id, mtg, tutor_mtg) VALUES ('" . $student_number . "','" . strtoupper($_POST['mtg']) . "','" . strtoupper($_POST['tutormtg']) . "' )";
// echo $query;
$mysqli->query($query);
}
//display the mtg block
// get the mtg
$query = "SELECT * FROM mtg WHERE student_id='" . $student_number . "'";
$result = $mysqli->query($query);
while ($row = $result->fetch_object()) {
$MTG = $row->mtg;
$tutorMTG = $row->tutor_mtg;
}
// Show only the manual mtg when viewed by a student and other sections have been filled in
if (($MTG != 'Manual MTG not set') && (!has_capability('block/ilp_student_info:viewclass', $context))) {
echo '<table style="text-align: center; font-size: 25px; color: #70a02b; margin-left: auto; margin-right: auto; width: 100%;"><tr><td>Minimum Target Grade</td></tr>';
echo '<tr><td style="text-align: center; color: teal; font-size: 30px;"><font color=#26B1E0>' . ucwords($MTG) . '</font></td></tr>';
echo '</table>';
} else {
echo '<br/>';
echo '<table width="100%" style="text-align: center;">';
echo '<tr class="darkblue"><th>Tutor MTG</th><th>Personal Best</th><th>MTG from MIS</th></tr>';
echo '<tr class="lightblue"><td>', $tutorMTG, '</td><td>', $MTG, '</td><td>', substr($mtg_grade, 1), '</td></tr>';
echo '<tr><th class="darkblue">Primary Qual type</th><td class="yellow" colspan="2">';
foreach ($resultStudent as $item) {
echo $item['Qual_type'] .'<br/>';
}
echo '</td></tr>';
echo '<tr>';
echo '<th class="darkblue">QCA Points</th><td class="yellow" colspan="2">';
if (empty($qca)) {
echo 'QCA points from MIS not available';
} else {
echo $qca;
}
echo '</td>';
echo '</tr>';
echo '</tr></table>';
}
if (has_capability('block/ilp_student_info:viewclass', $context)) {
// clear down the sessions from the edit forms
?>
<a href="<?php echo $CFG->wwwroot; ?>/blocks/ilp/templates/custom/Flight_Plan_Prior_Attainment_Calculator.xlsm"><img
src="<?php $CFG->wwwroot; ?>/blocks/ilp/templates/custom/pix/download_icon.png" width="25" height="25">Download
the Prior Attainment Calculator Spread Sheet</a><br/>
<a href="<?php echo $CFG->wwwroot; ?>/blocks/ilp/templates/custom/Guide_to_setting_MTGs.xlsx"><img
src="<?php $CFG->wwwroot; ?>/blocks/ilp/templates/custom/pix/download_icon.png" width="25" height="25">Download
the Guide to setting the MTG</a>
<br/>
<b></b><a href="https://gateway.lsc.gov.uk/VADT/AttainmentCalculator.aspx"><img
src="<?php $CFG->wwwroot; ?>/blocks/ilp/templates/custom/pix/link.png" width="25" height="25">Online prior
calculator</a></b><br/>
username: isp\College Account <br/>
password: MidKent2011
<br/>
<div id="MTGHeaderDivImg">
<a id="imageDivLink2"
href="javascript:toggle5('MTGContentDivImg', 'imageDivLink2', 'Add or Amend Personal Best/ Tutor set MTG');"><img
src="/blocks/ilp/templates/custom/pix/plus.png"><b>Add or Amend Personal Best/ Tutor set MTG</b></a>
</div>
<div id="MTGContentDivImg" style="display: none;">
<h2>Add/ Alter the Personal Best/ Tutor set MTG</h2>
<?php
echo 'The above MIS MTG is calculated based on:<br/>';
foreach ($resultStudent as $item) {
echo $item['Qual_Title'] . ' - ' . $item['Qual_type'] .'<br/>';
}
?>
<table>
<tr>
<td style="width:200px;">
<form method="post" action="<?php echo $_SELF; ?>">
<b>Tutor set MTG</b>
<input type="text" name="tutormtg" id="mtg" value="<?php echo $tutorMTG; ?>"/>
<b>Personal Best</b>
<input type="text" name="mtg" id="mtg" value="<?php echo $MTG; ?>"/>
</td>
<td style="width:2px;">
<input type="hidden" id="studentnum" name="studentnum" value="<?php echo $student_number; ?>">
<input id="submitMTG" type="submit" name="submitMTG" value="submit_change"/>
</form>
</td>
</tr>
<tr>
<th>Help</th>
</tr>
<tr>
<td>
<b>Tutor Set MTG:</b> For use when the MIS generated MTG is not available. Tutors/students should use
the prior attainment calculator to establish their average points score (APS) from their prior
qualifications. The APS is then used to establish the MTG using the ‘guide to setting the MTG’.
<br/><b>Personal Best:</b> This is the ‘aspirational’ target which should be agreed between tutor and
student at the first student review.
</td>
</tr>
</table>
</div>
<?php
}
?>
<!--Script to run the submit button graphic - doesn't work when added to the main js script files-->
<script type="text/javascript">
$(document).ready(function() {
$('#submitMTG').hover(function() {
$(this).addClass('mhover')
}, function() {
$(this).removeClass('mhover');
});
});
</script>
<script type="text/javascript">
$(document).ready(function() {
$('#submitTutorMTG').hover(function() {
$(this).addClass('mhover')
}, function() {
$(this).removeClass('mhover');
});
});
</script>