-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathenterCurrentOutcomes.php
executable file
·127 lines (81 loc) · 4.93 KB
/
enterCurrentOutcomes.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
<?php
include('control/connectionVars.php');
include('classes/InstructionSession.php');
require_once('control/startSession.php');
// Insert the page header
$page_title = 'Enter Outcomes Taught';
include('includes/header.php');
if (isset($_POST['submitOTCT'])) {
$currentSessions= array();
$outcomesNeeded = $_POST['outcomesNeeded'];
// echo "<h1>".count($outcomesNeeded)."</h1>";
$count=count($outcomesNeeded);
for($x=0; $x<$count; $x++)
{
$currentSessions[$x] = new InstructionSession();
$currentSessions[$x]->loadSession($outcomesNeeded[$x]);
// echo $currentSessions[$x]->toString();
}
$_SESSION['currentSessions']=$currentSessions;
} else if (isset($_GET['session'])) {
$currentSessions = array();
$currentSessions[0] = new InstructionSession();
$currentSessions[0]->loadSession($_GET['session']);
$_SESSION['currentSessions'] = $currentSessions;
}
$currentSessions=$_SESSION['currentSessions'];
$coursePrefix = $currentSessions[0]->getCoursePrefix();
$coursePrefixID = $currentSessions[0]->getCoursePrefixID();
$courseNumber = $currentSessions[0]->getCourseNumber();
$courseTitle = $currentSessions[0]->getCourseTitle();
$sessionCount = count($currentSessions);
$courseHeaderString = 'You are selecting outcomes taught for <span class="sessionCountSpan">'.$sessionCount.'</span> section(s) of this course';
$submitButtonString = 'Associate outcomes with these sessions';
?>
<?php
echo "<h2>$coursePrefix $courseNumber: $courseTitle</h2><p>$courseHeaderString</p>";
?>
<form id="outcomesTaughtForm" method="post" action="submitOutcomes.php">
<?php //include('includes/selectSessionsNoOutcomes.php');
include("control/connection.php");
$query='select oh.otchID as headingID, oh.otchName as headingName, od.otcdID as outcomeID, od.otcdName as outcomeName
from outcomedetail od
left join outcomeheading oh on oh.otchID = od.otcdotchID
order by oh.otchID, od.otcdName';
$currentOutcomeHeading='first';
$result = mysqli_query($dbc, $query) or die('dammit- query issues. <br /><h4>'.$query.'</h4');
if(!$result){echo "this is an outrage: ".mysqli_error($dbc)."\n";}
echo '<div class="outcomesBox">';
//$letters='abcdefghijklmnopqrstuvwxyz';
//$countByLetterIndex=0;
while ( $row = mysqli_fetch_assoc( $result) )
{
$headingID= $row['headingID'];
$headingName=$row['headingName'];
// $subheadingName=$row['subheadingName'];
$outcomeID = $row['outcomeID'];
$outcomeName = $row['outcomeName'];
if ($headingName!=$currentOutcomeHeading)
{
if($currentOutcomeHeading!='first'){echo '</div>'; /*close previous heading div*/}
$currentOutcomeHeading = $headingName;
// $countByLetterIndex=0;
echo '<h4 class="xxx outcomesBox outcomeHeading outcomeDiv" id="outcomeDiv'.$headingID.'"><span class="explode"> + </span>'.$headingID.'. '.$headingName.'</h4>';
// if ($subheadingName ==''){echo '<h5 class="outcomesBox outcomeSubheading">'.$subheadingName.'</h5>';}
// else {echo '<h5 class="outcomesBox outcomeSubheading">'.$coursePrefix.': '.$subheadingName.'</h5>';}
echo '<div class="hidden outcomeHeadingDiv outcomeDiv'.$headingID.'">';
}
echo '<input class="xxx outcomesBox mustHaveBox" title="Outcomes" type="checkbox" name="outcomesTaught[]" value="'.$outcomeID.'" /> <span class="xxx outcomesBox">'.$headingID.$outcomeName.'</span><br class="xxx outcomesBox" /><br />';
// $countByLetterIndex++;
}
echo '</div>'; /*close final heading div*/
echo'<br /><br /> <input id="OTCTsubmit" type="submit" value="'.$submitButtonString.'" name="submit" disabled="disabled" />';
echo '</div>';
mysqli_free_result($result);
mysqli_close($dbc);
?>
</form>
<br />
<?php
include('includes/footer.php');
?>