23
23
serviceapp = 'userservice';
25
function create(offeringid)
27
/* TODO: Write this function */
30
/* Displays the selected group in the group adminsitration area
32
function manage_subject()
34
/* Get the subject id from the select box */
35
var subject_select = document.getElementById("subject_select");
36
var subject_div = document.getElementById("subject_div");
37
var subjectid = parseInt(subject_select.value);
39
/* List active offerings */
40
dom_removechildren(subject_div);
41
var p = dom_make_text_elem("h2", "Active Offerings");
42
subject_div.appendChild(p);
43
var callback = function(xhr)
45
var offerings = JSON.parse(xhr.responseText);
46
for (var i=0; i<offerings.length; i++)
48
var offering = offerings[i];
49
var text = offering.subj_name + ", Semester " + offering.semester + " " + offering.year;
50
var h3 = dom_make_text_elem("h3", text);
51
subject_div.appendChild(h3);
52
var div = document.createElement("div");
53
subject_div.appendChild(div);
54
manage_subject_offering(offering['offeringid'], div);
57
ajax_call(callback, serviceapp, 'get_active_offerings', {'subjectid': subjectid}, 'GET');
60
25
/* Manages the display of a single offerings groups
61
26
* Takes a offeringid and element to attach the results to