41 |
// Check to make sure that the staff isn't already assigned |
// Check to make sure that the staff isn't already assigned |
42 |
$sql = "SELECT * FROM libunit_staff WHERE libunit_id = " . $libunit_id . |
$sql = "SELECT * FROM libunit_staff WHERE libunit_id = " . $libunit_id . |
43 |
" AND staff_id = " . $staff_id_array[$subscript]; |
" AND staff_id = " . $staff_id_array[$subscript]; |
44 |
$rs = mysql_tryquery($sql); |
$rs = xx_tryquery($sql); |
45 |
if (mysql_num_rows($rs) == 0) { |
if (xx_num_rows($rs) == 0) { |
46 |
|
|
47 |
$sql = "INSERT INTO libunit_staff (libunit_id, staff_id) VALUES (" |
$sql = "INSERT INTO libunit_staff (libunit_id, staff_id) VALUES (" |
48 |
. $libunit_id |
. $libunit_id |
50 |
. $staff_id_array[$subscript] |
. $staff_id_array[$subscript] |
51 |
. ")"; |
. ")"; |
52 |
|
|
53 |
mysql_tryquery($sql); |
xx_tryquery($sql); |
54 |
|
|
55 |
} // staff not already assigned |
} // staff not already assigned |
56 |
|
|
82 |
. " AND feature_id = " |
. " AND feature_id = " |
83 |
. $feature_id_array[$subscript]; |
. $feature_id_array[$subscript]; |
84 |
|
|
85 |
$rs = mysql_tryquery($sql); |
$rs = xx_tryquery($sql); |
86 |
if (mysql_num_rows($rs) == 0) { |
if (xx_num_rows($rs) == 0) { |
87 |
|
|
88 |
$sql = "INSERT INTO res_feature (resource_id, feature_id) VALUES (" |
$sql = "INSERT INTO res_feature (resource_id, feature_id) VALUES (" |
89 |
. $resource_id |
. $resource_id |
91 |
. $feature_id_array[$subscript] |
. $feature_id_array[$subscript] |
92 |
. ")"; |
. ")"; |
93 |
|
|
94 |
mysql_tryquery($sql); |
xx_tryquery($sql); |
95 |
|
|
96 |
} // feature not already assigned |
} // feature not already assigned |
97 |
|
|
123 |
. " AND location_id = " |
. " AND location_id = " |
124 |
. $location_id_array[$subscript]; |
. $location_id_array[$subscript]; |
125 |
|
|
126 |
$rs = mysql_tryquery($sql); |
$rs = xx_tryquery($sql); |
127 |
if (mysql_num_rows($rs) == 0) { |
if (xx_num_rows($rs) == 0) { |
128 |
|
|
129 |
$sql = "INSERT INTO res_loc (resource_id, location_id) VALUES (" |
$sql = "INSERT INTO res_loc (resource_id, location_id) VALUES (" |
130 |
. $resource_id |
. $resource_id |
132 |
. $location_id_array[$subscript] |
. $location_id_array[$subscript] |
133 |
. ")"; |
. ")"; |
134 |
|
|
135 |
mysql_tryquery($sql); |
xx_tryquery($sql); |
136 |
|
|
137 |
} // location not already assigned |
} // location not already assigned |
138 |
|
|
164 |
. " AND mastersubject_id = " |
. " AND mastersubject_id = " |
165 |
. $mastersubject_id_array[$subscript]; |
. $mastersubject_id_array[$subscript]; |
166 |
|
|
167 |
$rs = mysql_tryquery($sql); |
$rs = xx_tryquery($sql); |
168 |
if (mysql_num_rows($rs) == 0) { |
if (xx_num_rows($rs) == 0) { |
169 |
|
|
170 |
$sql = "INSERT INTO res_mastersubject (resource_id, mastersubject_id) VALUES (" |
$sql = "INSERT INTO res_mastersubject (resource_id, mastersubject_id) VALUES (" |
171 |
. $resource_id |
. $resource_id |
173 |
. $mastersubject_id_array[$subscript] |
. $mastersubject_id_array[$subscript] |
174 |
. ")"; |
. ")"; |
175 |
|
|
176 |
mysql_tryquery($sql); |
xx_tryquery($sql); |
177 |
|
|
178 |
} // mastersubject not already assigned |
} // mastersubject not already assigned |
179 |
|
|
205 |
. " AND location_id = " |
. " AND location_id = " |
206 |
. $location_id_array[$subscript]; |
. $location_id_array[$subscript]; |
207 |
|
|
208 |
$rs = mysql_tryquery($sql); |
$rs = xx_tryquery($sql); |
209 |
if (mysql_num_rows($rs) == 0) { |
if (xx_num_rows($rs) == 0) { |
210 |
|
|
211 |
$sql = "INSERT INTO serv_loc (service_id, location_id) VALUES (" |
$sql = "INSERT INTO serv_loc (service_id, location_id) VALUES (" |
212 |
. $service_id |
. $service_id |
214 |
. $location_id_array[$subscript] |
. $location_id_array[$subscript] |
215 |
. ")"; |
. ")"; |
216 |
|
|
217 |
mysql_tryquery($sql); |
xx_tryquery($sql); |
218 |
|
|
219 |
} // location not already assigned |
} // location not already assigned |
220 |
|
|
246 |
. " AND servicetype_id = " |
. " AND servicetype_id = " |
247 |
. $servicetype_id_array[$subscript]; |
. $servicetype_id_array[$subscript]; |
248 |
|
|
249 |
$rs = mysql_tryquery($sql); |
$rs = xx_tryquery($sql); |
250 |
if (mysql_num_rows($rs) == 0) { |
if (xx_num_rows($rs) == 0) { |
251 |
|
|
252 |
$sql = "INSERT INTO serv_servtype (service_id, servicetype_id) VALUES (" |
$sql = "INSERT INTO serv_servtype (service_id, servicetype_id) VALUES (" |
253 |
. $service_id |
. $service_id |
255 |
. $servicetype_id_array[$subscript] |
. $servicetype_id_array[$subscript] |
256 |
. ")"; |
. ")"; |
257 |
|
|
258 |
mysql_tryquery($sql); |
xx_tryquery($sql); |
259 |
|
|
260 |
} // servicetype not already assigned |
} // servicetype not already assigned |
261 |
|
|
289 |
. " AND libunit_id = " |
. " AND libunit_id = " |
290 |
. $libunit_id_array[$subscript]; |
. $libunit_id_array[$subscript]; |
291 |
|
|
292 |
$rs = mysql_tryquery($sql); |
$rs = xx_tryquery($sql); |
293 |
if (mysql_num_rows($rs) == 0) { |
if (xx_num_rows($rs) == 0) { |
294 |
|
|
295 |
$sql = "INSERT INTO libunit_staff (libunit_id, staff_id) VALUES (" |
$sql = "INSERT INTO libunit_staff (libunit_id, staff_id) VALUES (" |
296 |
. $libunit_id_array[$subscript] |
. $libunit_id_array[$subscript] |
298 |
. $staff_id |
. $staff_id |
299 |
. ")"; |
. ")"; |
300 |
|
|
301 |
mysql_tryquery($sql); |
xx_tryquery($sql); |
302 |
|
|
303 |
} // assignment didn't already exist |
} // assignment didn't already exist |
304 |
|
|
330 |
. " AND subject_id = " |
. " AND subject_id = " |
331 |
. $subject_id_array[$subscript]; |
. $subject_id_array[$subscript]; |
332 |
|
|
333 |
$rs = mysql_tryquery($sql); |
$rs = xx_tryquery($sql); |
334 |
if (mysql_num_rows($rs) == 0) { |
if (xx_num_rows($rs) == 0) { |
335 |
|
|
336 |
$sql = "INSERT INTO sub_staff (subject_id, staff_id) VALUES (" |
$sql = "INSERT INTO sub_staff (subject_id, staff_id) VALUES (" |
337 |
. $subject_id_array[$subscript] |
. $subject_id_array[$subscript] |
339 |
. $staff_id |
. $staff_id |
340 |
. ")"; |
. ")"; |
341 |
|
|
342 |
mysql_tryquery($sql); |
xx_tryquery($sql); |
343 |
|
|
344 |
} // assignment didn't already exist |
} // assignment didn't already exist |
345 |
|
|
371 |
. " AND coursesub_id = " |
. " AND coursesub_id = " |
372 |
. $coursesub_id_array[$subscript]; |
. $coursesub_id_array[$subscript]; |
373 |
|
|
374 |
$rs = mysql_tryquery($sql); |
$rs = xx_tryquery($sql); |
375 |
if (mysql_num_rows($rs) == 0) { |
if (xx_num_rows($rs) == 0) { |
376 |
|
|
377 |
$sql = "INSERT INTO sub_coursesub (subject_id, coursesub_id) VALUES (" |
$sql = "INSERT INTO sub_coursesub (subject_id, coursesub_id) VALUES (" |
378 |
. $subject_id |
. $subject_id |
380 |
. $coursesub_id_array[$subscript] |
. $coursesub_id_array[$subscript] |
381 |
. ")"; |
. ")"; |
382 |
|
|
383 |
mysql_tryquery($sql); |
xx_tryquery($sql); |
384 |
|
|
385 |
} // coursesub not already assigned |
} // coursesub not already assigned |
386 |
|
|
412 |
. " AND location_id = " |
. " AND location_id = " |
413 |
. $location_id_array[$subscript]; |
. $location_id_array[$subscript]; |
414 |
|
|
415 |
$rs = mysql_tryquery($sql); |
$rs = xx_tryquery($sql); |
416 |
if (mysql_num_rows($rs) == 0) { |
if (xx_num_rows($rs) == 0) { |
417 |
|
|
418 |
$sql = "INSERT INTO sub_loc (subject_id, location_id) VALUES (" |
$sql = "INSERT INTO sub_loc (subject_id, location_id) VALUES (" |
419 |
. $subject_id |
. $subject_id |
421 |
. $location_id_array[$subscript] |
. $location_id_array[$subscript] |
422 |
. ")"; |
. ")"; |
423 |
|
|
424 |
mysql_tryquery($sql); |
xx_tryquery($sql); |
425 |
|
|
426 |
} // location not already assigned |
} // location not already assigned |
427 |
|
|
453 |
. " AND mastersubject_id = " |
. " AND mastersubject_id = " |
454 |
. $mastersubject_id_array[$subscript]; |
. $mastersubject_id_array[$subscript]; |
455 |
|
|
456 |
$rs = mysql_tryquery($sql); |
$rs = xx_tryquery($sql); |
457 |
if (mysql_num_rows($rs) == 0) { |
if (xx_num_rows($rs) == 0) { |
458 |
|
|
459 |
$sql = "INSERT INTO sub_mastersubject (subject_id, mastersubject_id) VALUES (" |
$sql = "INSERT INTO sub_mastersubject (subject_id, mastersubject_id) VALUES (" |
460 |
. $subject_id |
. $subject_id |
462 |
. $mastersubject_id_array[$subscript] |
. $mastersubject_id_array[$subscript] |
463 |
. ")"; |
. ")"; |
464 |
|
|
465 |
mysql_tryquery($sql); |
xx_tryquery($sql); |
466 |
|
|
467 |
} // location not already assigned |
} // location not already assigned |
468 |
|
|
494 |
. " AND staff_id = " |
. " AND staff_id = " |
495 |
. $staff_id_array[$subscript]; |
. $staff_id_array[$subscript]; |
496 |
|
|
497 |
$rs = mysql_tryquery($sql); |
$rs = xx_tryquery($sql); |
498 |
if (mysql_num_rows($rs) == 0) { |
if (xx_num_rows($rs) == 0) { |
499 |
|
|
500 |
$sql = "INSERT INTO sub_staff (subject_id, staff_id) VALUES (" |
$sql = "INSERT INTO sub_staff (subject_id, staff_id) VALUES (" |
501 |
. $subject_id |
. $subject_id |
503 |
. $staff_id_array[$subscript] |
. $staff_id_array[$subscript] |
504 |
. ")"; |
. ")"; |
505 |
|
|
506 |
mysql_tryquery($sql); |
xx_tryquery($sql); |
507 |
} |
} |
508 |
|
|
509 |
} // array of staff id's |
} // array of staff id's |