-
Notifications
You must be signed in to change notification settings - Fork 0
/
add_department.html
451 lines (391 loc) · 21.9 KB
/
add_department.html
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
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
<!DOCTYPE html>
<html>
<head>
<title>CourseMate | iarasoft</title>
<link rel="stylesheet" type="text/css" href="flatly/css/flatly.min.css" class="uib-framework-theme">
<link rel="stylesheet" type="text/css" href="css/add_department_main.less.css" class="main-less">
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0">
<script src="intelxdk.js"></script>
<script src="cordova.js"></script>
<script src="js/jquery.min.js"></script>
<script src="js/doAuth.js"></script>
<script>
$(function(){
//Defining some static variables
$country = $("#country")
$institution = $("#institution")
$inst = $("#inst")
//Upon country selection
$country.change(function(e) {
//POST A REQUEST FOR ALL INSTITUTIONS WITHIN THAT COUNTRY
$.ajax({
url : $__url_,
data: { method:"getInstitution", country:$country.val() },
dataType:'jsonp',
success: function(ro){
//STORE THE RESULTANT OBJECT WITHIN A VARIABLE
$inst_arr = ro['data']['message'];
$ira = "<option value='' selected> Pick An Institution</option>";
//MANIPULATE THE OBJECT TO POPULATE THE INSTITUTION SELECT BOX WITH THE RETREIVED INSTITUTION NAMES
for($inst in $inst_arr){
$ira += '<option value="'+ $inst_arr[$inst]["id"] +'">'+ $inst_arr[$inst]["inst_name"] +'</option>';
}
$goOut = '<label class="narrow-control label-top-left">Institution</label><select class="wide-control form-control" name="institution" id="institution">' + $ira + '</select>';
//PRINT OUT THE LIST OF INSTITUTIONS AND PREPARE THE OBJECT FOR SELECTION
$("#inst").html($goOut);
$institution = $("#institution");
//UPON SELECTION OF AN INSTITUTION, POST A REQUEST FOR ALL THE SCHOOLS IN IT
$institution.change(function(e) {
$.ajax({
url : $__url_,
data: { method:"getSchools", institution:$institution.val() },
dataType:'jsonp',
success: function(resp){
$chool_arr = resp['data']['message'];
$ira = "<option value='' selected> Pick A School</option>";
//MANIPULATE THE OBJECT TO POPULATE THE SCHOOL SELECT BOX WITH THE RETREIVED INSTITUTION NAMES
for($chool in $chool_arr){
$ira += '<option value="'+ $chool_arr[$chool]["id"] +'">'+ $chool_arr[$chool]["scho_name"] +'</option>';
}
$goOut= '<label class="narrow-control label-top-left">School / Faculty</label><select class="wide-control form-control" name="school" id="school"><option value="">PICK A SCHOOL</option>'+ $ira + '</select>';
//$goOut = '<select name="school" id="school" >' + $ira + '</select>';
//PRINT OUT THE LIST OF SCHOOLS AND PREPARE THE OBJECT FOR SELECTION
$("#scho").html($goOut);
$school = $("#school");
//UPON SELECTION OF A SCHOOL, AVAIL A DEPARTMENT TEXTBOX TO THE USER FOR USE.
$school.change(function(){
$("#nom, #addDepartment").show();
});
}
});
});
$("#addDepartment").click(function(e) {
//alert("Institution: " + $institution.val() + "\nCountry: " + $country.val() + "\nSchool: " + $("#nom").val() );
if($institution.val() != "" && $("#school").val() != "" && $("#nom").val() != ""){
$.ajax({
url : $__url_,
data: { method:"addDepartment", nom:$("#nom").val(), institution:$institution.val(), school: $("#school").val() },
dataType:'jsonp',
success: function(resp){
if(resp["response"] == "SUCCESS"){
$_res = "'#result'";$__result.html('<div class="panel widget uib_w_8 d-margins panel-success" data-uib="twitter%20bootstrap/panel" data-ver="0" id="result" style="border-bottom:3px solid #999; max-width:95%; margin:0 auto;"><div class="panel-heading" align="right"><p style="text-align:right;"><a style="color:red; text-decoration:none;" href="javascript:+$('+$_res+').fadeOut()"><div style="border:1px solid #000; font-weight:bold; float:right; padding:1px; border-radius:5px;">X</div></a></p><p style="text-align:center;">' + resp['data']['message'] + '</p> </div></div>');
$__command.html("<script> " + resp['data']['command'] + "<//script>");
}else if(resp["response"] == "ERROR"){
$_res = "'#result'";$__result.html('<div class="panel widget uib_w_8 d-margins panel-danger" data-uib="twitter%20bootstrap/panel" data-ver="0" id="result" style="border-bottom:3px solid #999; max-width:95%; margin:0 auto;"><div class="panel-heading" align="right"><p style="text-align:right;"><a style="color:red; text-decoration:none;" href="javascript:+$('+$_res+').fadeOut()"><div style="border:1px solid #000; font-weight:bold; float:right; padding:1px; border-radius:5px;">X</div></a></p><p style="text-align:center;">' + resp['data']['message'] + '</p> </div></div>');
$__command.html("<script>" + resp['data']['command'] + "<//script>"); }else{
$__result.html("UNDEFINED RESPONSE MESSAGE.");
}
}
});
}
});
}
});
});
});
</script>
<script type="application/javascript" src="bootstrap/js/bootstrap.min.js"></script>
<script type="application/javascript" src="modal/js/modal.js"></script>
</head>
<body style="background: rgb(55,53,191); /* Old browsers */
background: -moz-radial-gradient(center, ellipse cover, rgba(55,53,191,1) 0%, rgba(35,34,122,1) 100%); /* FF3.6+ */
background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,rgba(55,53,191,1)), color-stop(100%,rgba(35,34,122,1))); /* Chrome,Safari4+ */
background: -webkit-radial-gradient(center, ellipse cover, rgba(55,53,191,1) 0%,rgba(35,34,122,1) 100%); /* Chrome10+,Safari5.1+ */
background: -o-radial-gradient(center, ellipse cover, rgba(55,53,191,1) 0%,rgba(35,34,122,1) 100%); /* Opera 12+ */
background: -ms-radial-gradient(center, ellipse cover, rgba(55,53,191,1) 0%,rgba(35,34,122,1) 100%); /* IE10+ */
background: radial-gradient(ellipse at center, rgba(55,53,191,1) 0%,rgba(35,34,122,1) 100%); /* W3C */
filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#3735bf', endColorstr='#23227a',GradientType=1 ); /* IE6-9 fallback on horizontal gradient */ color:#FFF;">
<div class="uwrap">
<div class="upage" id="mainpage">
<div class="upage-outer">
<div class="upage-content" id="mainsub">
<div class="grid grid-pad urow uib_row_1 row-height-1" data-uib="layout/row" data-ver="0">
<div class="col uib_col_1 col-0_12-12" data-uib="layout/col" data-ver="0">
<div class="widget-container content-area vertical-col center">
<div class="table-thing widget uib_w_1 d-margins" data-uib="twitter%20bootstrap/select" data-ver="0">
<label class="narrow-control label-top-left">Country</label>
<select class="wide-control form-control" name="country" id="country">
<option value="" selected="">Country</option>
<option value="1">Afghanistan</option>
<option value="2">Albania</option>
<option value="3">Algeria</option>
<option value="4">American Samoa</option>
<option value="5">Andorra</option>
<option value="6">Angola</option>
<option value="7">Anguilla</option>
<option value="8">Antarctica</option>
<option value="9">Antigua and Barbuda</option>
<option value="10">Argentina</option>
<option value="11">Armenia</option>
<option value="12">Aruba</option>
<option value="13">Australia</option>
<option value="14">Austria</option>
<option value="15">Azerbaijan</option>
<option value="16">Bahamas</option>
<option value="17">Bahrain</option>
<option value="18">Bangladesh</option>
<option value="19">Barbados</option>
<option value="20">Belarus</option>
<option value="21">Belgium</option>
<option value="22">Belize</option>
<option value="23">Benin</option>
<option value="24">Bermuda</option>
<option value="25">Bhutan</option>
<option value="26">Bolivia</option>
<option value="27">Bosnia and Herzegowina</option>
<option value="28">Botswana</option>
<option value="29">Bouvet Island</option>
<option value="30">Brazil</option>
<option value="31">British Indian Ocean Territory</option>
<option value="32">Brunei Darussalam</option>
<option value="33">Bulgaria</option>
<option value="34">Burkina Faso</option>
<option value="35">Burundi</option>
<option value="36">Cambodia</option>
<option value="37">Cameroon</option>
<option value="38">Canada</option>
<option value="39">Cape Verde</option>
<option value="40">Cayman Islands</option>
<option value="41">Central African Republic</option>
<option value="42">Chad</option>
<option value="43">Chile</option>
<option value="44">China</option>
<option value="45">Christmas Island</option>
<option value="46">Cocos (Keeling) Islands</option>
<option value="47">Colombia</option>
<option value="48">Comoros</option>
<option value="49">Congo</option>
<option value="50">Congo, the Democratic Republic of the</option>
<option value="51">Cook Islands</option>
<option value="52">Costa Rica</option>
<option value="53">Cote d'Ivoire</option>
<option value="54">Croatia (Hrvatska)</option>
<option value="55">Cuba</option>
<option value="56">Cyprus</option>
<option value="57">Czech Republic</option>
<option value="58">Denmark</option>
<option value="59">Djibouti</option>
<option value="60">Dominica</option>
<option value="61">Dominican Republic</option>
<option value="62">East Timor</option>
<option value="63">Ecuador</option>
<option value="64">Egypt</option>
<option value="65">El Salvador</option>
<option value="66">Equatorial Guinea</option>
<option value="67">Eritrea</option>
<option value="68">Estonia</option>
<option value="69">Ethiopia</option>
<option value="70">Falkland Islands (Malvinas)</option>
<option value="71">Faroe Islands</option>
<option value="72">Fiji</option>
<option value="73">Finland</option>
<option value="74">France</option>
<option value="75">France Metropolitan</option>
<option value="76">French Guiana</option>
<option value="77">French Polynesia</option>
<option value="78">French Southern Territories</option>
<option value="79">Gabon</option>
<option value="80">Gambia</option>
<option value="81">Georgia</option>
<option value="82">Germany</option>
<option value="83">Ghana</option>
<option value="84">Gibraltar</option>
<option value="85">Greece</option>
<option value="86">Greenland</option>
<option value="87">Grenada</option>
<option value="88">Guadeloupe</option>
<option value="89">Guam</option>
<option value="90">Guatemala</option>
<option value="91">Guinea</option>
<option value="92">Guinea-Bissau</option>
<option value="93">Guyana</option>
<option value="94">Haiti</option>
<option value="95">Heard and Mc Donald Islands</option>
<option value="96">Holy See (Vatican City State)</option>
<option value="97">Honduras</option>
<option value="98">Hong Kong</option>
<option value="99">Hungary</option>
<option value="100">Iceland</option>
<option value="101">India</option>
<option value="102">Indonesia</option>
<option value="103">Iran (Islamic Republic of)</option>
<option value="104">Iraq</option>
<option value="105">Ireland</option>
<option value="106">Israel</option>
<option value="107">Italy</option>
<option value="108">Jamaica</option>
<option value="109">Japan</option>
<option value="110">Jordan</option>
<option value="111">Kazakhstan</option>
<option value="112">Kenya</option>
<option value="113">Kiribati</option>
<option value="114">Korea, Democratic People's Republic of</option>
<option value="115">Korea, Republic of</option>
<option value="116">Kuwait</option>
<option value="117">Kyrgyzstan</option>
<option value="118">Lao, People's Democratic Republic</option>
<option value="119">Latvia</option>
<option value="120">Lebanon</option>
<option value="121">Lesotho</option>
<option value="122">Liberia</option>
<option value="123">Libyan Arab Jamahiriya</option>
<option value="124">Liechtenstein</option>
<option value="125">Lithuania</option>
<option value="126">Luxembourg</option>
<option value="127">Macau</option>
<option value="128">Macedonia, The Former Yugoslav Republic of</option>
<option value="129">Madagascar</option>
<option value="130">Malawi</option>
<option value="131">Malaysia</option>
<option value="132">Maldives</option>
<option value="133">Mali</option>
<option value="134">Malta</option>
<option value="135">Marshall Islands</option>
<option value="136">Martinique</option>
<option value="137">Mauritania</option>
<option value="138">Mauritius</option>
<option value="139">Mayotte</option>
<option value="140">Mexico</option>
<option value="141">Micronesia, Federated States of</option>
<option value="142">Moldova, Republic of</option>
<option value="143">Monaco</option>
<option value="144">Mongolia</option>
<option value="145">Montserrat</option>
<option value="146">Morocco</option>
<option value="147">Mozambique</option>
<option value="148">Myanmar</option>
<option value="149">Namibia</option>
<option value="150">Nauru</option>
<option value="151">Nepal</option>
<option value="152">Netherlands</option>
<option value="153">Netherlands Antilles</option>
<option value="154">New Caledonia</option>
<option value="155">New Zealand</option>
<option value="156">Nicaragua</option>
<option value="157">Niger</option>
<option value="158">Nigeria</option>
<option value="159">Niue</option>
<option value="160">Norfolk Island</option>
<option value="161">Northern Mariana Islands</option>
<option value="162">Norway</option>
<option value="163">Oman</option>
<option value="164">Pakistan</option>
<option value="165">Palau</option>
<option value="166">Panama</option>
<option value="167">Papua New Guinea</option>
<option value="168">Paraguay</option>
<option value="169">Peru</option>
<option value="170">Philippines</option>
<option value="171">Pitcairn</option>
<option value="172">Poland</option>
<option value="173">Portugal</option>
<option value="174">Puerto Rico</option>
<option value="175">Qatar</option>
<option value="176">Reunion</option>
<option value="177">Romania</option>
<option value="178">Russian Federation</option>
<option value="179">Rwanda</option>
<option value="180">Saint Kitts and Nevis</option>
<option value="181">Saint Lucia</option>
<option value="182">Saint Vincent and the Grenadines</option>
<option value="183">Samoa</option>
<option value="184">San Marino</option>
<option value="185">Sao Tome and Principe</option>
<option value="186">Saudi Arabia</option>
<option value="187">Senegal</option>
<option value="188">Seychelles</option>
<option value="189">Sierra Leone</option>
<option value="190">Singapore</option>
<option value="191">Slovakia (Slovak Republic)</option>
<option value="192">Slovenia</option>
<option value="193">Solomon Islands</option>
<option value="194">Somalia</option>
<option value="195">South Africa</option>
<option value="196">South Georgia and the South Sandwich Islands</option>
<option value="197">South Sudan</option>
<option value="198">Spain</option>
<option value="199">Sri Lanka</option>
<option value="200">St. Helena</option>
<option value="201">St. Pierre and Miquelon</option>
<option value="202">Sudan</option>
<option value="203">Suriname</option>
<option value="204">Svalbard and Jan Mayen Islands</option>
<option value="205">Swaziland</option>
<option value="206">Sweden</option>
<option value="207">Switzerland</option>
<option value="208">Syrian Arab Republic</option>
<option value="209">Taiwan, Province of China</option>
<option value="210">Tajikistan</option>
<option value="211">Tanzania, United Republic of</option>
<option value="212">Thailand</option>
<option value="213">Togo</option>
<option value="214">Tokelau</option>
<option value="215">Tonga</option>
<option value="216">Trinidad and Tobago</option>
<option value="217">Tunisia</option>
<option value="218">Turkey</option>
<option value="219">Turkmenistan</option>
<option value="220">Turks and Caicos Islands</option>
<option value="221">Tuvalu</option>
<option value="222">Uganda</option>
<option value="223">Ukraine</option>
<option value="224">United Arab Emirates</option>
<option value="225">United Kingdom</option>
<option value="226">United States</option>
<option value="227">United States Minor Outlying Islands</option>
<option value="228">Uruguay</option>
<option value="229">Uzbekistan</option>
<option value="230">Vanuatu</option>
<option value="231">Venezuela</option>
<option value="232">Vietnam</option>
<option value="233">Virgin Islands (British)</option>
<option value="234">Virgin Islands (U.S.)</option>
<option value="235">Wallis and Futuna Islands</option>
<option value="236">Western Sahara</option>
<option value="237">Yemen</option>
<option value="238">Yugoslavia</option>
<option value="239">Zambia</option>
<option value="240">Zimbabwe</option>
</select>
</div>
<div class="grid grid-pad urow uib_row_2 row-height-2" data-uib="layout/row" data-ver="0">
<div class="col uib_col_2 col-1_12-12" data-uib="layout/col" data-ver="0">
<div class="widget-container content-area vertical-col left">
<div class="table-thing widget uib_w_2 d-margins" data-uib="twitter%20bootstrap/select" data-ver="0" id="inst">
</div><span class="uib_shim"></span>
</div>
</div>
<span class="uib_shim"></span>
</div>
<div class="grid grid-pad urow uib_row_3 row-height-3" data-uib="layout/row" data-ver="0">
<div class="col uib_col_3 col-1_12-12" data-uib="layout/col" data-ver="0">
<div class="widget-container content-area vertical-col">
<div class="table-thing widget uib_w_3 d-margins" data-uib="twitter%20bootstrap/select" data-ver="0" id="scho">
</div>
<span class="uib_shim"></span>
</div>
</div>
<span class="uib_shim"></span>
</div>
<div class="table-thing widget uib_w_4 d-margins" data-uib="twitter%20bootstrap/input" data-ver="0">
<label class="narrow-control label-top-left">Department Name</label>
<input class="wide-control form-control" type="text" placeholder="Information Systems And Computing" id="nom" style="display:none;">
</div>
<button type="button" class="btn widget uib_w_5 d-margins btn-default" data-uib="twitter%20bootstrap/button" data-ver="0" id="addDepartment" style="display:none;">Add Department<i class="glyphicon"></i>
</button>
<span class="uib_shim"></span>
<div id="rr">
</div>
</div>
<span class="uib_shim"></span>
</div>
</div>
<!-- /upage-content -->
</div>
</div>
<!-- /uwrap -->
</div>
</body>
<div id="command"></div>
</html>