89 |
$sql = "UPDATE course SET campus_id = NULL WHERE campus_id = " |
$sql = "UPDATE course SET campus_id = NULL WHERE campus_id = " |
90 |
. $campus_id; |
. $campus_id; |
91 |
|
|
92 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
93 |
$problem = 1; |
$problem = 1; |
94 |
sql_err($sql); |
sql_err($sql); |
95 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
96 |
bailout(); |
bailout(); |
97 |
} |
} |
98 |
else { |
else { |
99 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
100 |
printf("Campus purged from assignments to course pages.<BR>\n"); |
printf("Campus purged from assignments to course pages.<BR>\n"); |
101 |
} |
} |
102 |
|
|
104 |
if ($problem == 0) { |
if ($problem == 0) { |
105 |
$sql = "UPDATE coursesub SET campus_id = 1 WHERE campus_id =" . $campus_id; |
$sql = "UPDATE coursesub SET campus_id = 1 WHERE campus_id =" . $campus_id; |
106 |
|
|
107 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
108 |
$problem = 1; |
$problem = 1; |
109 |
sql_err($sql); |
sql_err($sql); |
110 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
111 |
bailout(); |
bailout(); |
112 |
} |
} |
113 |
else { |
else { |
114 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
115 |
printf("Removed from affected Course Subjects.<BR>\n"); |
printf("Removed from affected Course Subjects.<BR>\n"); |
116 |
} |
} |
117 |
} |
} |
120 |
if ($problem == 0) { |
if ($problem == 0) { |
121 |
$sql = "DELETE FROM campus WHERE campus_id =" . $campus_id; |
$sql = "DELETE FROM campus WHERE campus_id =" . $campus_id; |
122 |
|
|
123 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
124 |
$problem = 1; |
$problem = 1; |
125 |
sql_err($sql); |
sql_err($sql); |
126 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
127 |
bailout(); |
bailout(); |
128 |
} |
} |
129 |
else { |
else { |
130 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
131 |
printf("Removed this campus successfully.<BR><BR>\n"); |
printf("Removed this campus successfully.<BR><BR>\n"); |
132 |
} |
} |
133 |
} |
} |
228 |
// Delete from the sub_coursesub table |
// Delete from the sub_coursesub table |
229 |
$sql = "DELETE FROM sub_coursesub WHERE coursesub_id = " . $coursesub_id; |
$sql = "DELETE FROM sub_coursesub WHERE coursesub_id = " . $coursesub_id; |
230 |
|
|
231 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
232 |
$problem = 0; |
$problem = 0; |
233 |
sql_err($sql); |
sql_err($sql); |
234 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
235 |
bailout(); |
bailout(); |
236 |
} |
} |
237 |
else { |
else { |
238 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
239 |
printf("Subject-Course Subject assignments removed.<BR>\n"); |
printf("Subject-Course Subject assignments removed.<BR>\n"); |
240 |
|
|
241 |
} |
} |
245 |
|
|
246 |
$sql = "DELETE FROM coursesub WHERE coursesub_id =" . $coursesub_id; |
$sql = "DELETE FROM coursesub WHERE coursesub_id =" . $coursesub_id; |
247 |
|
|
248 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
249 |
sql_err($sql); |
sql_err($sql); |
250 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
251 |
bailout(); |
bailout(); |
252 |
} |
} |
253 |
else { |
else { |
254 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
255 |
printf("Removed this Course Subject successfully.<BR><BR>\n"); |
printf("Removed this Course Subject successfully.<BR><BR>\n"); |
256 |
} |
} |
257 |
|
|
366 |
$sql = "DELETE FROM course_personnel WHERE faculty_id = " |
$sql = "DELETE FROM course_personnel WHERE faculty_id = " |
367 |
. $faculty_id; |
. $faculty_id; |
368 |
|
|
369 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
370 |
$problem = 1; |
$problem = 1; |
371 |
sql_err($sql); |
sql_err($sql); |
372 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
373 |
bailout(); |
bailout(); |
374 |
} |
} |
375 |
else { |
else { |
376 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
377 |
printf("Faculty person purged from assignments to course pages.<BR>\n"); |
printf("Faculty person purged from assignments to course pages.<BR>\n"); |
378 |
} |
} |
379 |
|
|
381 |
if ($problem == 0) { |
if ($problem == 0) { |
382 |
$sql = "DELETE FROM faculty WHERE faculty_id =" . $faculty_id; |
$sql = "DELETE FROM faculty WHERE faculty_id =" . $faculty_id; |
383 |
|
|
384 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
385 |
$problem = 1; |
$problem = 1; |
386 |
sql_err($sql); |
sql_err($sql); |
387 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
388 |
bailout(); |
bailout(); |
389 |
} |
} |
390 |
else { |
else { |
391 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
392 |
printf("Removed this faculty person successfully.<BR><BR>\n"); |
printf("Removed this faculty person successfully.<BR><BR>\n"); |
393 |
} |
} |
394 |
} |
} |
478 |
// Delete all resource_feature assignments |
// Delete all resource_feature assignments |
479 |
$sql = "DELETE from res_feature WHERE feature_id =" . $feature_id; |
$sql = "DELETE from res_feature WHERE feature_id =" . $feature_id; |
480 |
|
|
481 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
482 |
$problem = 1; |
$problem = 1; |
483 |
sql_err($sql); |
sql_err($sql); |
484 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
485 |
bailout(); |
bailout(); |
486 |
} |
} |
487 |
else { |
else { |
488 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
489 |
printf("Removed resource-feature associations.<BR>\n"); |
printf("Removed resource-feature associations.<BR>\n"); |
490 |
|
|
491 |
if ($problem == 0) { |
if ($problem == 0) { |
493 |
// Delete from feature table |
// Delete from feature table |
494 |
$sql = "DELETE FROM feature WHERE feature_id =" . $feature_id; |
$sql = "DELETE FROM feature WHERE feature_id =" . $feature_id; |
495 |
|
|
496 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
497 |
$problem = 1; |
$problem = 1; |
498 |
sql_err($sql); |
sql_err($sql); |
499 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
500 |
bailout(); |
bailout(); |
501 |
} |
} |
502 |
else { |
else { |
503 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
504 |
printf("Removed feature successfully.<BR><BR>\n"); |
printf("Removed feature successfully.<BR><BR>\n"); |
505 |
} |
} |
506 |
} |
} |
592 |
// Delete all res_sub_infotype assignments |
// Delete all res_sub_infotype assignments |
593 |
$sql = "DELETE from res_sub_infotype WHERE infotype_id =" . $infotype_id; |
$sql = "DELETE from res_sub_infotype WHERE infotype_id =" . $infotype_id; |
594 |
|
|
595 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
596 |
$problem = 1; |
$problem = 1; |
597 |
sql_err($sql); |
sql_err($sql); |
598 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
599 |
bailout(); |
bailout(); |
600 |
} |
} |
601 |
else { |
else { |
602 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
603 |
printf("Removed resource-subject-infotype associations.<BR>\n"); |
printf("Removed resource-subject-infotype associations.<BR>\n"); |
604 |
|
|
605 |
|
|
608 |
// Set (N/A) type in resource table |
// Set (N/A) type in resource table |
609 |
$sql = "UPDATE resource SET infotype_id = 1 WHERE infotype_id =" . $infotype_id; |
$sql = "UPDATE resource SET infotype_id = 1 WHERE infotype_id =" . $infotype_id; |
610 |
|
|
611 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
612 |
$problem = 1; |
$problem = 1; |
613 |
sql_err($sql); |
sql_err($sql); |
614 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
615 |
bailout(); |
bailout(); |
616 |
} |
} |
617 |
else { |
else { |
618 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
619 |
printf("Set default information types for affects resources to (N/A).<BR>\n"); |
printf("Set default information types for affects resources to (N/A).<BR>\n"); |
620 |
} |
} |
621 |
} |
} |
626 |
// Delete from infotype table |
// Delete from infotype table |
627 |
$sql = "DELETE FROM infotype WHERE infotype_id =" . $infotype_id; |
$sql = "DELETE FROM infotype WHERE infotype_id =" . $infotype_id; |
628 |
|
|
629 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
630 |
$problem = 1; |
$problem = 1; |
631 |
sql_err($sql); |
sql_err($sql); |
632 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
633 |
bailout(); |
bailout(); |
634 |
} |
} |
635 |
else { |
else { |
636 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
637 |
printf("Removed this information type successfully.<BR><BR>\n"); |
printf("Removed this information type successfully.<BR><BR>\n"); |
638 |
} |
} |
639 |
} |
} |
731 |
// First delete from res_loc |
// First delete from res_loc |
732 |
$sql = "DELETE FROM res_loc WHERE location_id = " . $location_id; |
$sql = "DELETE FROM res_loc WHERE location_id = " . $location_id; |
733 |
|
|
734 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
735 |
$problem = 1; |
$problem = 1; |
736 |
sql_err($sql); |
sql_err($sql); |
737 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
738 |
bailout(); |
bailout(); |
739 |
} |
} |
740 |
else { |
else { |
741 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
742 |
printf("Affected resource-location assignments removed.<BR>\n"); |
printf("Affected resource-location assignments removed.<BR>\n"); |
743 |
} |
} |
744 |
|
|
746 |
if ($problem == 0) { |
if ($problem == 0) { |
747 |
$sql = "DELETE FROM sub_loc WHERE location_id =" . $location_id; |
$sql = "DELETE FROM sub_loc WHERE location_id =" . $location_id; |
748 |
|
|
749 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
750 |
$problem = 1; |
$problem = 1; |
751 |
sql_err($sql); |
sql_err($sql); |
752 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
753 |
bailout(); |
bailout(); |
754 |
} |
} |
755 |
else { |
else { |
756 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
757 |
printf("Affected subject-location assignments removed.<BR>\n"); |
printf("Affected subject-location assignments removed.<BR>\n"); |
758 |
} |
} |
759 |
} |
} |
762 |
if ($problem == 0) { |
if ($problem == 0) { |
763 |
$sql = "UPDATE subject SET sublocation_id = NULL WHERE sublocation_id =" . $location_id; |
$sql = "UPDATE subject SET sublocation_id = NULL WHERE sublocation_id =" . $location_id; |
764 |
|
|
765 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
766 |
$problem = 1; |
$problem = 1; |
767 |
sql_err($sql); |
sql_err($sql); |
768 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
769 |
bailout(); |
bailout(); |
770 |
} |
} |
771 |
else { |
else { |
772 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
773 |
printf("Affected primary subject locations set to NULL.<BR>\n"); |
printf("Affected primary subject locations set to NULL.<BR>\n"); |
774 |
} |
} |
775 |
} |
} |
778 |
if ($problem == 0) { |
if ($problem == 0) { |
779 |
$sql = "DELETE FROM serv_loc WHERE location_id =" . $location_id; |
$sql = "DELETE FROM serv_loc WHERE location_id =" . $location_id; |
780 |
|
|
781 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
782 |
$problem = 1; |
$problem = 1; |
783 |
sql_err($sql); |
sql_err($sql); |
784 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
785 |
bailout(); |
bailout(); |
786 |
} |
} |
787 |
else { |
else { |
788 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
789 |
printf("Affected service-location assignments removed.<BR>\n"); |
printf("Affected service-location assignments removed.<BR>\n"); |
790 |
} |
} |
791 |
} |
} |
796 |
// First, get the default location description and title |
// First, get the default location description and title |
797 |
$sql = "SELECT location, location_descr FROM location WHERE location_id = " |
$sql = "SELECT location, location_descr FROM location WHERE location_id = " |
798 |
. $location_id; |
. $location_id; |
799 |
$rs = mysql_query($sql, $con); |
$rs = xx_query($sql, $con); |
800 |
$row = mysql_fetch_array ($rs); |
$row = xx_fetch_array ($rs); |
801 |
$location = $row["location"]; |
$location = $row["location"]; |
802 |
$location_descr = $row["location_descr"]; |
$location_descr = $row["location_descr"]; |
803 |
|
|
818 |
. "'), location_id = NULL WHERE location_id =" . $location_id |
. "'), location_id = NULL WHERE location_id =" . $location_id |
819 |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
820 |
|
|
821 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
822 |
$problem = 1; |
$problem = 1; |
823 |
sql_err($sql); |
sql_err($sql); |
824 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
825 |
bailout(); |
bailout(); |
826 |
} |
} |
827 |
else { |
else { |
828 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
829 |
printf("Added delete message to custom PageScribe descriptions.<BR>\n"); |
printf("Added delete message to custom PageScribe descriptions.<BR>\n"); |
830 |
} |
} |
831 |
|
|
838 |
. "', location_id = NULL WHERE location_id =" . $location_id |
. "', location_id = NULL WHERE location_id =" . $location_id |
839 |
. " AND (element_descr IS NULL OR element_descr = '')"; |
. " AND (element_descr IS NULL OR element_descr = '')"; |
840 |
|
|
841 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
842 |
$problem = 1; |
$problem = 1; |
843 |
sql_err($sql); |
sql_err($sql); |
844 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
845 |
bailout(); |
bailout(); |
846 |
} |
} |
847 |
else { |
else { |
848 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
849 |
printf("Added delete message to default PageScribe descriptions.<BR>\n"); |
printf("Added delete message to default PageScribe descriptions.<BR>\n"); |
850 |
} |
} |
851 |
|
|
864 |
. "'), location_id = NULL WHERE location_id =" . $location_id |
. "'), location_id = NULL WHERE location_id =" . $location_id |
865 |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
866 |
|
|
867 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
868 |
$problem = 1; |
$problem = 1; |
869 |
sql_err($sql); |
sql_err($sql); |
870 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
871 |
bailout(); |
bailout(); |
872 |
} |
} |
873 |
else { |
else { |
874 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
875 |
printf("Added delete message to custom PageScribe descriptions (buffers).<BR>\n"); |
printf("Added delete message to custom PageScribe descriptions (buffers).<BR>\n"); |
876 |
} |
} |
877 |
|
|
884 |
. "', location_id = NULL WHERE location_id =" . $location_id |
. "', location_id = NULL WHERE location_id =" . $location_id |
885 |
. " AND (element_descr IS NULL OR element_descr = '')"; |
. " AND (element_descr IS NULL OR element_descr = '')"; |
886 |
|
|
887 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
888 |
$problem = 1; |
$problem = 1; |
889 |
sql_err($sql); |
sql_err($sql); |
890 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
891 |
bailout(); |
bailout(); |
892 |
} |
} |
893 |
else { |
else { |
894 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
895 |
printf("Added delete message to default PageScribe descriptions (buffers).<BR>\n"); |
printf("Added delete message to default PageScribe descriptions (buffers).<BR>\n"); |
896 |
} |
} |
897 |
|
|
902 |
if ($problem == 0) { |
if ($problem == 0) { |
903 |
$sql = "DELETE FROM location WHERE location_id =" . $location_id; |
$sql = "DELETE FROM location WHERE location_id =" . $location_id; |
904 |
|
|
905 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
906 |
$problem = 1; |
$problem = 1; |
907 |
sql_err($sql); |
sql_err($sql); |
908 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
909 |
bailout(); |
bailout(); |
910 |
} |
} |
911 |
else { |
else { |
912 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
913 |
printf("Location successfully removed.<BR><BR>\n"); |
printf("Location successfully removed.<BR><BR>\n"); |
914 |
} |
} |
915 |
} |
} |
1018 |
. $masterinfotype_id; |
. $masterinfotype_id; |
1019 |
|
|
1020 |
// Fetch the values |
// Fetch the values |
1021 |
$rs = mysql_query($sql, $con); |
$rs = xx_query($sql, $con); |
1022 |
while ($row = mysql_fetch_array ($rs)) { |
while ($row = xx_fetch_array ($rs)) { |
1023 |
$infotype_id = $row["infotype_id"]; |
$infotype_id = $row["infotype_id"]; |
1024 |
$infotype = $row["infotype"]; |
$infotype = $row["infotype"]; |
1025 |
|
|
1029 |
// Delete all res_sub_infotype assignments |
// Delete all res_sub_infotype assignments |
1030 |
$sql = "DELETE from res_sub_infotype WHERE infotype_id =" . $infotype_id; |
$sql = "DELETE from res_sub_infotype WHERE infotype_id =" . $infotype_id; |
1031 |
|
|
1032 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1033 |
$problem = 1; |
$problem = 1; |
1034 |
sql_err($sql); |
sql_err($sql); |
1035 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1036 |
bailout(); |
bailout(); |
1037 |
} |
} |
1038 |
else { |
else { |
1039 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1040 |
printf("Removed resource-subject-infotype associations.<BR>\n"); |
printf("Removed resource-subject-infotype associations.<BR>\n"); |
1041 |
|
|
1042 |
|
|
1045 |
// Set (N/A) type in resource table |
// Set (N/A) type in resource table |
1046 |
$sql = "UPDATE resource SET infotype_id = 1 WHERE infotype_id =" . $infotype_id; |
$sql = "UPDATE resource SET infotype_id = 1 WHERE infotype_id =" . $infotype_id; |
1047 |
|
|
1048 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1049 |
$problem = 1; |
$problem = 1; |
1050 |
sql_err($sql); |
sql_err($sql); |
1051 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1052 |
bailout(); |
bailout(); |
1053 |
} |
} |
1054 |
else { |
else { |
1055 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1056 |
printf("Set default information types for affects resources to (N/A).<BR>\n"); |
printf("Set default information types for affects resources to (N/A).<BR>\n"); |
1057 |
} |
} |
1058 |
} |
} |
1063 |
// Delete from infotype table |
// Delete from infotype table |
1064 |
$sql = "DELETE FROM infotype WHERE infotype_id =" . $infotype_id; |
$sql = "DELETE FROM infotype WHERE infotype_id =" . $infotype_id; |
1065 |
|
|
1066 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1067 |
$problem = 1; |
$problem = 1; |
1068 |
sql_err($sql); |
sql_err($sql); |
1069 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1070 |
bailout(); |
bailout(); |
1071 |
} |
} |
1072 |
else { |
else { |
1073 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1074 |
printf("Removed affected specific information types.<BR>\n"); |
printf("Removed affected specific information types.<BR>\n"); |
1075 |
} |
} |
1076 |
} // successful delete of a specific information type |
} // successful delete of a specific information type |
1086 |
// Delete from masterinfotype table |
// Delete from masterinfotype table |
1087 |
$sql = "DELETE FROM masterinfotype WHERE masterinfotype_id =" . $masterinfotype_id; |
$sql = "DELETE FROM masterinfotype WHERE masterinfotype_id =" . $masterinfotype_id; |
1088 |
|
|
1089 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1090 |
$problem = 1; |
$problem = 1; |
1091 |
sql_err($sql); |
sql_err($sql); |
1092 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1093 |
bailout(); |
bailout(); |
1094 |
} |
} |
1095 |
else { |
else { |
1096 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1097 |
printf("Removed Master Information Type successfully.<BR><BR>\n"); |
printf("Removed Master Information Type successfully.<BR><BR>\n"); |
1098 |
} |
} |
1099 |
} // delete masterinfotype itself |
} // delete masterinfotype itself |
1197 |
if ($problem == 0) { |
if ($problem == 0) { |
1198 |
$sql = "DELETE FROM sub_mastersubject WHERE mastersubject_id =" . $mastersubject_id; |
$sql = "DELETE FROM sub_mastersubject WHERE mastersubject_id =" . $mastersubject_id; |
1199 |
|
|
1200 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1201 |
$problem = 1; |
$problem = 1; |
1202 |
sql_err($sql); |
sql_err($sql); |
1203 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1204 |
bailout(); |
bailout(); |
1205 |
} |
} |
1206 |
else { |
else { |
1207 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1208 |
printf("Affected subject-mastersubject assignments removed.<BR>\n"); |
printf("Affected subject-mastersubject assignments removed.<BR>\n"); |
1209 |
} |
} |
1210 |
} |
} |
1213 |
if ($problem == 0) { |
if ($problem == 0) { |
1214 |
$sql = "DELETE FROM res_mastersubject WHERE mastersubject_id =" . $mastersubject_id; |
$sql = "DELETE FROM res_mastersubject WHERE mastersubject_id =" . $mastersubject_id; |
1215 |
|
|
1216 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1217 |
$problem = 1; |
$problem = 1; |
1218 |
sql_err($sql); |
sql_err($sql); |
1219 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1220 |
bailout(); |
bailout(); |
1221 |
} |
} |
1222 |
else { |
else { |
1223 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1224 |
printf("Affected resource-mastersubject assignments removed.<BR>\n"); |
printf("Affected resource-mastersubject assignments removed.<BR>\n"); |
1225 |
} |
} |
1226 |
} |
} |
1229 |
if ($problem == 0) { |
if ($problem == 0) { |
1230 |
$sql = "DELETE FROM mastersubject WHERE mastersubject_id =" . $mastersubject_id; |
$sql = "DELETE FROM mastersubject WHERE mastersubject_id =" . $mastersubject_id; |
1231 |
|
|
1232 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1233 |
$problem = 1; |
$problem = 1; |
1234 |
sql_err($sql); |
sql_err($sql); |
1235 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1236 |
bailout(); |
bailout(); |
1237 |
} |
} |
1238 |
else { |
else { |
1239 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1240 |
printf("Removed Master Subject successfully.<BR><BR>\n"); |
printf("Removed Master Subject successfully.<BR><BR>\n"); |
1241 |
} |
} |
1242 |
} |
} |
1289 |
// Check subjects |
// Check subjects |
1290 |
$sql = "SELECT COUNT(sm.subject_id) as num_subjects FROM sub_mastersubject sm WHERE sm.mastersubject_id =" |
$sql = "SELECT COUNT(sm.subject_id) as num_subjects FROM sub_mastersubject sm WHERE sm.mastersubject_id =" |
1291 |
. $mastersubject_id; |
. $mastersubject_id; |
1292 |
$rs = mysql_query($sql, $con); |
$rs = xx_query($sql, $con); |
1293 |
$row = mysql_fetch_array ($rs); |
$row = xx_fetch_array ($rs); |
1294 |
$num_subjects = $row["num_subjects"]; |
$num_subjects = $row["num_subjects"]; |
1295 |
if ($num_subjects > 0) $problem = 1; |
if ($num_subjects > 0) $problem = 1; |
1296 |
|
|
1299 |
// Check resources |
// Check resources |
1300 |
$sql = "SELECT COUNT(rm.resource_id) as num_resources FROM res_mastersubject rm WHERE rm.mastersubject_id = " |
$sql = "SELECT COUNT(rm.resource_id) as num_resources FROM res_mastersubject rm WHERE rm.mastersubject_id = " |
1301 |
. $mastersubject_id; |
. $mastersubject_id; |
1302 |
$rs = mysql_query($sql, $con); |
$rs = xx_query($sql, $con); |
1303 |
$row = mysql_fetch_array ($rs); |
$row = xx_fetch_array ($rs); |
1304 |
$num_resources = $row["num_resources"]; |
$num_resources = $row["num_resources"]; |
1305 |
|
|
1306 |
if ($num_resources > 1) $problem = 1; |
if ($num_resources > 1) $problem = 1; |
1361 |
. $key_list_array[$element]; |
. $key_list_array[$element]; |
1362 |
|
|
1363 |
// Failed |
// Failed |
1364 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1365 |
sql_err($sql); |
sql_err($sql); |
1366 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1367 |
bailout(); |
bailout(); |
1368 |
} |
} |
1369 |
|
|
1370 |
// Succeeded |
// Succeeded |
1371 |
else { |
else { |
1372 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1373 |
} |
} |
1374 |
} |
} |
1375 |
// Call the resource form back |
// Call the resource form back |
1396 |
. $key_list_array[$element]; |
. $key_list_array[$element]; |
1397 |
|
|
1398 |
// Failed |
// Failed |
1399 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1400 |
sql_err($sql); |
sql_err($sql); |
1401 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1402 |
bailout(); |
bailout(); |
1403 |
} |
} |
1404 |
|
|
1405 |
// Succeeded |
// Succeeded |
1406 |
else { |
else { |
1407 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1408 |
} |
} |
1409 |
} |
} |
1410 |
// Call the resource form back |
// Call the resource form back |
1432 |
. $key_list_array[$element]; |
. $key_list_array[$element]; |
1433 |
|
|
1434 |
// Failed |
// Failed |
1435 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1436 |
sql_err($sql); |
sql_err($sql); |
1437 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1438 |
bailout(); |
bailout(); |
1439 |
} |
} |
1440 |
|
|
1441 |
// Succeeded |
// Succeeded |
1442 |
else { |
else { |
1443 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1444 |
} |
} |
1445 |
} |
} |
1446 |
// Call the resource form back |
// Call the resource form back |
1481 |
// First delete all related rows in res_sub_infotype |
// First delete all related rows in res_sub_infotype |
1482 |
$sql = "DELETE FROM res_sub_infotype WHERE resource_id = " . $resource_id; |
$sql = "DELETE FROM res_sub_infotype WHERE resource_id = " . $resource_id; |
1483 |
|
|
1484 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1485 |
$problem = 1; |
$problem = 1; |
1486 |
sql_err($sql); |
sql_err($sql); |
1487 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1488 |
bailout(); |
bailout(); |
1489 |
} |
} |
1490 |
|
|
1491 |
else { |
else { |
1492 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1493 |
printf("Resource removed from all resource-subject-infotype assignments.<BR>\n"); |
printf("Resource removed from all resource-subject-infotype assignments.<BR>\n"); |
1494 |
|
|
1495 |
} |
} |
1498 |
if ($problem == 0) { |
if ($problem == 0) { |
1499 |
$sql = "DELETE FROM res_loc WHERE resource_id =" . $resource_id; |
$sql = "DELETE FROM res_loc WHERE resource_id =" . $resource_id; |
1500 |
|
|
1501 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1502 |
$problem = 1; |
$problem = 1; |
1503 |
sql_err($sql); |
sql_err($sql); |
1504 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1505 |
bailout(); |
bailout(); |
1506 |
} |
} |
1507 |
else { |
else { |
1508 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1509 |
printf("Removed from resource-location table.<BR>\n"); |
printf("Removed from resource-location table.<BR>\n"); |
1510 |
} |
} |
1511 |
} |
} |
1515 |
|
|
1516 |
$sql = "DELETE FROM res_mastersubject WHERE resource_id =" . $resource_id; |
$sql = "DELETE FROM res_mastersubject WHERE resource_id =" . $resource_id; |
1517 |
|
|
1518 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1519 |
$problem = 1; |
$problem = 1; |
1520 |
sql_err($sql); |
sql_err($sql); |
1521 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1522 |
bailout(); |
bailout(); |
1523 |
} |
} |
1524 |
else { |
else { |
1525 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1526 |
printf("Removed from resource-mastersubject table.<BR>\n"); |
printf("Removed from resource-mastersubject table.<BR>\n"); |
1527 |
} |
} |
1528 |
} |
} |
1532 |
|
|
1533 |
$sql = "DELETE FROM res_feature WHERE resource_id =" . $resource_id; |
$sql = "DELETE FROM res_feature WHERE resource_id =" . $resource_id; |
1534 |
|
|
1535 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1536 |
$problem = 1; |
$problem = 1; |
1537 |
sql_err($sql); |
sql_err($sql); |
1538 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1539 |
bailout(); |
bailout(); |
1540 |
} |
} |
1541 |
else { |
else { |
1542 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1543 |
printf("Removed from resource-feature table.<BR>\n"); |
printf("Removed from resource-feature table.<BR>\n"); |
1544 |
} |
} |
1545 |
} |
} |
1550 |
// First, get the default resource description and title |
// First, get the default resource description and title |
1551 |
$sql = "SELECT annotation, title FROM resource WHERE resource_id = " |
$sql = "SELECT annotation, title FROM resource WHERE resource_id = " |
1552 |
. $resource_id; |
. $resource_id; |
1553 |
$rs = mysql_query($sql, $con); |
$rs = xx_query($sql, $con); |
1554 |
$row = mysql_fetch_array ($rs); |
$row = xx_fetch_array ($rs); |
1555 |
$annotation = $row["annotation"]; |
$annotation = $row["annotation"]; |
1556 |
$title = $row["title"]; |
$title = $row["title"]; |
1557 |
|
|
1572 |
. "'), resource_id = NULL WHERE resource_id =" . $resource_id |
. "'), resource_id = NULL WHERE resource_id =" . $resource_id |
1573 |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
1574 |
|
|
1575 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1576 |
$problem = 1; |
$problem = 1; |
1577 |
sql_err($sql); |
sql_err($sql); |
1578 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1579 |
bailout(); |
bailout(); |
1580 |
} |
} |
1581 |
else { |
else { |
1582 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1583 |
printf("Added delete message to custom PageScribe descriptions.<BR>\n"); |
printf("Added delete message to custom PageScribe descriptions.<BR>\n"); |
1584 |
} |
} |
1585 |
|
|
1592 |
. "', resource_id = NULL WHERE resource_id =" . $resource_id |
. "', resource_id = NULL WHERE resource_id =" . $resource_id |
1593 |
. " AND (element_descr IS NULL OR element_descr = '')"; |
. " AND (element_descr IS NULL OR element_descr = '')"; |
1594 |
|
|
1595 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1596 |
$problem = 1; |
$problem = 1; |
1597 |
sql_err($sql); |
sql_err($sql); |
1598 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1599 |
bailout(); |
bailout(); |
1600 |
} |
} |
1601 |
else { |
else { |
1602 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1603 |
printf("Added delete message to default PageScribe descriptions.<BR>\n"); |
printf("Added delete message to default PageScribe descriptions.<BR>\n"); |
1604 |
} |
} |
1605 |
|
|
1618 |
. "'), resource_id = NULL WHERE resource_id =" . $resource_id |
. "'), resource_id = NULL WHERE resource_id =" . $resource_id |
1619 |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
1620 |
|
|
1621 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1622 |
$problem = 1; |
$problem = 1; |
1623 |
sql_err($sql); |
sql_err($sql); |
1624 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1625 |
bailout(); |
bailout(); |
1626 |
} |
} |
1627 |
else { |
else { |
1628 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1629 |
printf("Added delete message to custom PageScribe descriptions (buffers).<BR>\n"); |
printf("Added delete message to custom PageScribe descriptions (buffers).<BR>\n"); |
1630 |
} |
} |
1631 |
|
|
1638 |
. "', resource_id = NULL WHERE resource_id =" . $resource_id |
. "', resource_id = NULL WHERE resource_id =" . $resource_id |
1639 |
. " AND (element_descr IS NULL OR element_descr = '')"; |
. " AND (element_descr IS NULL OR element_descr = '')"; |
1640 |
|
|
1641 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1642 |
$problem = 1; |
$problem = 1; |
1643 |
sql_err($sql); |
sql_err($sql); |
1644 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1645 |
bailout(); |
bailout(); |
1646 |
} |
} |
1647 |
else { |
else { |
1648 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1649 |
printf("Added delete message to default PageScribe descriptions (buffers).<BR>\n"); |
printf("Added delete message to default PageScribe descriptions (buffers).<BR>\n"); |
1650 |
} |
} |
1651 |
|
|
1658 |
|
|
1659 |
$sql = "DELETE FROM resource WHERE resource_id =" . $resource_id; |
$sql = "DELETE FROM resource WHERE resource_id =" . $resource_id; |
1660 |
|
|
1661 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1662 |
$problem = 1; |
$problem = 1; |
1663 |
sql_err($sql); |
sql_err($sql); |
1664 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1665 |
bailout(); |
bailout(); |
1666 |
} |
} |
1667 |
|
|
1668 |
else { |
else { |
1669 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1670 |
} |
} |
1671 |
} |
} |
1672 |
|
|
1776 |
// First delete all related rows in serv_servtype |
// First delete all related rows in serv_servtype |
1777 |
$sql = "DELETE FROM serv_servtype WHERE service_id = " . $service_id; |
$sql = "DELETE FROM serv_servtype WHERE service_id = " . $service_id; |
1778 |
|
|
1779 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1780 |
$problem = 1; |
$problem = 1; |
1781 |
sql_err($sql); |
sql_err($sql); |
1782 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1783 |
bailout(); |
bailout(); |
1784 |
} |
} |
1785 |
|
|
1786 |
else { |
else { |
1787 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1788 |
printf("Service removed from all service-servicetype assignments.<BR>\n"); |
printf("Service removed from all service-servicetype assignments.<BR>\n"); |
1789 |
|
|
1790 |
} |
} |
1793 |
if ($problem == 0) { |
if ($problem == 0) { |
1794 |
$sql = "DELETE FROM serv_loc WHERE service_id =" . $service_id; |
$sql = "DELETE FROM serv_loc WHERE service_id =" . $service_id; |
1795 |
|
|
1796 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1797 |
$problem = 1; |
$problem = 1; |
1798 |
sql_err($sql); |
sql_err($sql); |
1799 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1800 |
bailout(); |
bailout(); |
1801 |
} |
} |
1802 |
else { |
else { |
1803 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1804 |
printf("Removed from service-location table.<BR>\n"); |
printf("Removed from service-location table.<BR>\n"); |
1805 |
} |
} |
1806 |
} |
} |
1812 |
// First, get the default service description and title |
// First, get the default service description and title |
1813 |
$sql = "SELECT service, serviceDescr FROM service WHERE service_id = " |
$sql = "SELECT service, serviceDescr FROM service WHERE service_id = " |
1814 |
. $service_id; |
. $service_id; |
1815 |
$rs = mysql_query($sql, $con); |
$rs = xx_query($sql, $con); |
1816 |
$row = mysql_fetch_array ($rs); |
$row = xx_fetch_array ($rs); |
1817 |
$service = $row["service"]; |
$service = $row["service"]; |
1818 |
$serviceDescr = $row["serviceDescr"]; |
$serviceDescr = $row["serviceDescr"]; |
1819 |
|
|
1834 |
. "'), service_id = NULL WHERE service_id =" . $service_id |
. "'), service_id = NULL WHERE service_id =" . $service_id |
1835 |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
1836 |
|
|
1837 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1838 |
$problem = 1; |
$problem = 1; |
1839 |
sql_err($sql); |
sql_err($sql); |
1840 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1841 |
bailout(); |
bailout(); |
1842 |
} |
} |
1843 |
else { |
else { |
1844 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1845 |
printf("Added delete message to custom PageScribe descriptions.<BR>\n"); |
printf("Added delete message to custom PageScribe descriptions.<BR>\n"); |
1846 |
} |
} |
1847 |
|
|
1854 |
. "', service_id = NULL WHERE service_id =" . $service_id |
. "', service_id = NULL WHERE service_id =" . $service_id |
1855 |
. " AND (element_descr IS NULL OR element_descr = '')"; |
. " AND (element_descr IS NULL OR element_descr = '')"; |
1856 |
|
|
1857 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1858 |
$problem = 1; |
$problem = 1; |
1859 |
sql_err($sql); |
sql_err($sql); |
1860 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1861 |
bailout(); |
bailout(); |
1862 |
} |
} |
1863 |
else { |
else { |
1864 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1865 |
printf("Added delete message to default PageScribe descriptions.<BR>\n"); |
printf("Added delete message to default PageScribe descriptions.<BR>\n"); |
1866 |
} |
} |
1867 |
|
|
1880 |
. "'), service_id = NULL WHERE service_id =" . $service_id |
. "'), service_id = NULL WHERE service_id =" . $service_id |
1881 |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
1882 |
|
|
1883 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1884 |
$problem = 1; |
$problem = 1; |
1885 |
sql_err($sql); |
sql_err($sql); |
1886 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1887 |
bailout(); |
bailout(); |
1888 |
} |
} |
1889 |
else { |
else { |
1890 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1891 |
printf("Added delete message to custom PageScribe descriptions (buffers).<BR>\n"); |
printf("Added delete message to custom PageScribe descriptions (buffers).<BR>\n"); |
1892 |
} |
} |
1893 |
|
|
1900 |
. "', service_id = NULL WHERE service_id =" . $service_id |
. "', service_id = NULL WHERE service_id =" . $service_id |
1901 |
. " AND (element_descr IS NULL OR element_descr = '')"; |
. " AND (element_descr IS NULL OR element_descr = '')"; |
1902 |
|
|
1903 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1904 |
$problem = 1; |
$problem = 1; |
1905 |
sql_err($sql); |
sql_err($sql); |
1906 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1907 |
bailout(); |
bailout(); |
1908 |
} |
} |
1909 |
else { |
else { |
1910 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1911 |
printf("Added delete message to default PageScribe descriptions (buffers).<BR>\n"); |
printf("Added delete message to default PageScribe descriptions (buffers).<BR>\n"); |
1912 |
} |
} |
1913 |
|
|
1920 |
|
|
1921 |
$sql = "DELETE FROM service WHERE service_id =" . $service_id; |
$sql = "DELETE FROM service WHERE service_id =" . $service_id; |
1922 |
|
|
1923 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
1924 |
$problem = 1; |
$problem = 1; |
1925 |
sql_err($sql); |
sql_err($sql); |
1926 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1927 |
bailout(); |
bailout(); |
1928 |
} |
} |
1929 |
|
|
1930 |
else { |
else { |
1931 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
1932 |
} |
} |
1933 |
} |
} |
1934 |
|
|
2027 |
// Delete from servicetype table |
// Delete from servicetype table |
2028 |
$sql = "DELETE FROM servicetype WHERE servicetype_id =" . $servicetype_id; |
$sql = "DELETE FROM servicetype WHERE servicetype_id =" . $servicetype_id; |
2029 |
|
|
2030 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2031 |
$problem = 1; |
$problem = 1; |
2032 |
sql_err($sql); |
sql_err($sql); |
2033 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2034 |
bailout(); |
bailout(); |
2035 |
} |
} |
2036 |
else { |
else { |
2037 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2038 |
printf("Removed Service Type successfully.<BR><BR>\n"); |
printf("Removed Service Type successfully.<BR><BR>\n"); |
2039 |
} |
} |
2040 |
|
|
2125 |
. $key_list_array[$element]; |
. $key_list_array[$element]; |
2126 |
|
|
2127 |
// Failed |
// Failed |
2128 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2129 |
sql_err($sql); |
sql_err($sql); |
2130 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2131 |
bailout(); |
bailout(); |
2132 |
} |
} |
2133 |
|
|
2134 |
// Succeeded |
// Succeeded |
2135 |
else { |
else { |
2136 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2137 |
} |
} |
2138 |
} |
} |
2139 |
// Call the service form back |
// Call the service form back |
2161 |
. $key_list_array[$element]; |
. $key_list_array[$element]; |
2162 |
|
|
2163 |
// Failed |
// Failed |
2164 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2165 |
sql_err($sql); |
sql_err($sql); |
2166 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2167 |
bailout(); |
bailout(); |
2168 |
} |
} |
2169 |
|
|
2170 |
// Succeeded |
// Succeeded |
2171 |
else { |
else { |
2172 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2173 |
} |
} |
2174 |
} |
} |
2175 |
// Call the service form back |
// Call the service form back |
2198 |
. $key_list_array[$element]; |
. $key_list_array[$element]; |
2199 |
|
|
2200 |
// Failed |
// Failed |
2201 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2202 |
sql_err($sql); |
sql_err($sql); |
2203 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2204 |
bailout(); |
bailout(); |
2205 |
} |
} |
2206 |
|
|
2207 |
// Succeeded |
// Succeeded |
2208 |
else { |
else { |
2209 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2210 |
} |
} |
2211 |
} |
} |
2212 |
// Call the subject form back |
// Call the subject form back |
2243 |
// First delete all related rows in res_sub_infotype |
// First delete all related rows in res_sub_infotype |
2244 |
$sql = "DELETE FROM res_sub_infotype WHERE subject_id = " . $subject_id; |
$sql = "DELETE FROM res_sub_infotype WHERE subject_id = " . $subject_id; |
2245 |
|
|
2246 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2247 |
$problem = 1; |
$problem = 1; |
2248 |
sql_err($sql); |
sql_err($sql); |
2249 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2250 |
bailout(); |
bailout(); |
2251 |
} |
} |
2252 |
else { |
else { |
2253 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2254 |
printf("Resource-subject-information type associations removed.<BR>\n"); |
printf("Resource-subject-information type associations removed.<BR>\n"); |
2255 |
} |
} |
2256 |
|
|
2258 |
if ($problem == 0) { |
if ($problem == 0) { |
2259 |
$sql = "DELETE FROM sub_loc WHERE subject_id =" . $subject_id; |
$sql = "DELETE FROM sub_loc WHERE subject_id =" . $subject_id; |
2260 |
|
|
2261 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2262 |
$problem = 1; |
$problem = 1; |
2263 |
sql_err($sql); |
sql_err($sql); |
2264 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2265 |
bailout(); |
bailout(); |
2266 |
} |
} |
2267 |
else { |
else { |
2268 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2269 |
printf("Subject-location associations removed.<BR>\n"); |
printf("Subject-location associations removed.<BR>\n"); |
2270 |
} |
} |
2271 |
} |
} |
2274 |
if ($problem == 0) { |
if ($problem == 0) { |
2275 |
$sql = "DELETE FROM sub_mastersubject WHERE subject_id =" . $subject_id; |
$sql = "DELETE FROM sub_mastersubject WHERE subject_id =" . $subject_id; |
2276 |
|
|
2277 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2278 |
$problem = 1; |
$problem = 1; |
2279 |
sql_err($sql); |
sql_err($sql); |
2280 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2281 |
bailout(); |
bailout(); |
2282 |
} |
} |
2283 |
else { |
else { |
2284 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2285 |
printf("Subject-mastersubject associations removed.<BR>\n"); |
printf("Subject-mastersubject associations removed.<BR>\n"); |
2286 |
|
|
2287 |
} |
} |
2291 |
if ($problem == 0) { |
if ($problem == 0) { |
2292 |
$sql = "DELETE FROM sub_staff WHERE subject_id =" . $subject_id; |
$sql = "DELETE FROM sub_staff WHERE subject_id =" . $subject_id; |
2293 |
|
|
2294 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2295 |
$problem = 1; |
$problem = 1; |
2296 |
sql_err($sql); |
sql_err($sql); |
2297 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2298 |
bailout(); |
bailout(); |
2299 |
} |
} |
2300 |
else { |
else { |
2301 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2302 |
printf("Subject-staff assignments removed.<BR>\n"); |
printf("Subject-staff assignments removed.<BR>\n"); |
2303 |
|
|
2304 |
} |
} |
2308 |
if ($problem == 0) { |
if ($problem == 0) { |
2309 |
$sql = "DELETE FROM sub_coursesub WHERE subject_id =" . $subject_id; |
$sql = "DELETE FROM sub_coursesub WHERE subject_id =" . $subject_id; |
2310 |
|
|
2311 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2312 |
$problem = 1; |
$problem = 1; |
2313 |
sql_err($sql); |
sql_err($sql); |
2314 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2315 |
bailout(); |
bailout(); |
2316 |
} |
} |
2317 |
else { |
else { |
2318 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2319 |
printf("Subject-Course Subject assignments removed.<BR>\n"); |
printf("Subject-Course Subject assignments removed.<BR>\n"); |
2320 |
|
|
2321 |
} |
} |
2325 |
if ($problem == 0) { |
if ($problem == 0) { |
2326 |
$sql = "DELETE FROM sub_page WHERE subject_id =" . $subject_id; |
$sql = "DELETE FROM sub_page WHERE subject_id =" . $subject_id; |
2327 |
|
|
2328 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2329 |
$problem = 1; |
$problem = 1; |
2330 |
sql_err($sql); |
sql_err($sql); |
2331 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2332 |
bailout(); |
bailout(); |
2333 |
} |
} |
2334 |
else { |
else { |
2335 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2336 |
printf("Subject-Page assignments removed.<BR>\n"); |
printf("Subject-Page assignments removed.<BR>\n"); |
2337 |
|
|
2338 |
} |
} |
2345 |
. " OR subject_id = " |
. " OR subject_id = " |
2346 |
. $subject_id; |
. $subject_id; |
2347 |
|
|
2348 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2349 |
$problem = 1; |
$problem = 1; |
2350 |
sql_err($sql); |
sql_err($sql); |
2351 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2352 |
bailout(); |
bailout(); |
2353 |
} |
} |
2354 |
else { |
else { |
2355 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2356 |
printf("Subject-Other Subject assignments removed.<BR>\n"); |
printf("Subject-Other Subject assignments removed.<BR>\n"); |
2357 |
|
|
2358 |
} |
} |
2364 |
// First, get the default subject description and title |
// First, get the default subject description and title |
2365 |
$sql = "SELECT subject, subject_descr FROM subject WHERE subject_id = " |
$sql = "SELECT subject, subject_descr FROM subject WHERE subject_id = " |
2366 |
. $subject_id; |
. $subject_id; |
2367 |
$rs = mysql_query($sql, $con); |
$rs = xx_query($sql, $con); |
2368 |
$row = mysql_fetch_array ($rs); |
$row = xx_fetch_array ($rs); |
2369 |
$subject = $row["subject"]; |
$subject = $row["subject"]; |
2370 |
$subject_descr = $row["subject_descr"]; |
$subject_descr = $row["subject_descr"]; |
2371 |
|
|
2386 |
. "'), subject_id = NULL WHERE subject_id =" . $subject_id |
. "'), subject_id = NULL WHERE subject_id =" . $subject_id |
2387 |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
2388 |
|
|
2389 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2390 |
$problem = 1; |
$problem = 1; |
2391 |
sql_err($sql); |
sql_err($sql); |
2392 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2393 |
bailout(); |
bailout(); |
2394 |
} |
} |
2395 |
else { |
else { |
2396 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2397 |
printf("Added delete message to custom PageScribe descriptions.<BR>\n"); |
printf("Added delete message to custom PageScribe descriptions.<BR>\n"); |
2398 |
} |
} |
2399 |
|
|
2406 |
. "', subject_id = NULL WHERE subject_id =" . $subject_id |
. "', subject_id = NULL WHERE subject_id =" . $subject_id |
2407 |
. " AND (element_descr IS NULL OR element_descr = '')"; |
. " AND (element_descr IS NULL OR element_descr = '')"; |
2408 |
|
|
2409 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2410 |
$problem = 1; |
$problem = 1; |
2411 |
sql_err($sql); |
sql_err($sql); |
2412 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2413 |
bailout(); |
bailout(); |
2414 |
} |
} |
2415 |
else { |
else { |
2416 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2417 |
printf("Added delete message to default PageScribe descriptions.<BR>\n"); |
printf("Added delete message to default PageScribe descriptions.<BR>\n"); |
2418 |
} |
} |
2419 |
|
|
2432 |
. "'), subject_id = NULL WHERE subject_id =" . $subject_id |
. "'), subject_id = NULL WHERE subject_id =" . $subject_id |
2433 |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
. " AND (element_descr IS NOT NULL OR element_descr != '')"; |
2434 |
|
|
2435 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2436 |
$problem = 1; |
$problem = 1; |
2437 |
sql_err($sql); |
sql_err($sql); |
2438 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2439 |
bailout(); |
bailout(); |
2440 |
} |
} |
2441 |
else { |
else { |
2442 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2443 |
printf("Added delete message to custom PageScribe descriptions (buffers).<BR>\n"); |
printf("Added delete message to custom PageScribe descriptions (buffers).<BR>\n"); |
2444 |
} |
} |
2445 |
|
|
2452 |
. "', subject_id = NULL WHERE subject_id =" . $subject_id |
. "', subject_id = NULL WHERE subject_id =" . $subject_id |
2453 |
. " AND (element_descr IS NULL OR element_descr = '')"; |
. " AND (element_descr IS NULL OR element_descr = '')"; |
2454 |
|
|
2455 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2456 |
$problem = 1; |
$problem = 1; |
2457 |
sql_err($sql); |
sql_err($sql); |
2458 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2459 |
bailout(); |
bailout(); |
2460 |
} |
} |
2461 |
else { |
else { |
2462 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2463 |
printf("Added delete message to default PageScribe descriptions (buffers).<BR>\n"); |
printf("Added delete message to default PageScribe descriptions (buffers).<BR>\n"); |
2464 |
} |
} |
2465 |
|
|
2470 |
if ($problem == 0) { |
if ($problem == 0) { |
2471 |
$sql = "DELETE FROM subject WHERE subject_id =" . $subject_id; |
$sql = "DELETE FROM subject WHERE subject_id =" . $subject_id; |
2472 |
|
|
2473 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2474 |
$problem = 1; |
$problem = 1; |
2475 |
sql_err($sql); |
sql_err($sql); |
2476 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2477 |
bailout(); |
bailout(); |
2478 |
} |
} |
2479 |
else { |
else { |
2480 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2481 |
printf("Successfully removed this subject from the system.<BR><BR>\n"); |
printf("Successfully removed this subject from the system.<BR><BR>\n"); |
2482 |
|
|
2483 |
} |
} |
2566 |
. $key_list_array[$element]; |
. $key_list_array[$element]; |
2567 |
|
|
2568 |
// Failed |
// Failed |
2569 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2570 |
sql_err($sql); |
sql_err($sql); |
2571 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2572 |
bailout(); |
bailout(); |
2573 |
} |
} |
2574 |
|
|
2575 |
// Succeeded |
// Succeeded |
2576 |
else { |
else { |
2577 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2578 |
} |
} |
2579 |
} |
} |
2580 |
// Call the subject form back |
// Call the subject form back |
2603 |
. $key_list_array[$element]; |
. $key_list_array[$element]; |
2604 |
|
|
2605 |
// Failed |
// Failed |
2606 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2607 |
sql_err($sql); |
sql_err($sql); |
2608 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2609 |
bailout(); |
bailout(); |
2610 |
} |
} |
2611 |
|
|
2612 |
// Succeeded |
// Succeeded |
2613 |
else { |
else { |
2614 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2615 |
} |
} |
2616 |
} |
} |
2617 |
// Call the subject form back |
// Call the subject form back |
2639 |
. $key_list_array[$element]; |
. $key_list_array[$element]; |
2640 |
|
|
2641 |
// Failed |
// Failed |
2642 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2643 |
sql_err($sql); |
sql_err($sql); |
2644 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2645 |
bailout(); |
bailout(); |
2646 |
} |
} |
2647 |
|
|
2648 |
// Succeeded |
// Succeeded |
2649 |
else { |
else { |
2650 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2651 |
} |
} |
2652 |
} |
} |
2653 |
// Call the subject form back |
// Call the subject form back |
2681 |
if ($libunit_id > 1) { |
if ($libunit_id > 1) { |
2682 |
$sql = "DELETE FROM libunit_staff WHERE libunit_id = " . $libunit_id; |
$sql = "DELETE FROM libunit_staff WHERE libunit_id = " . $libunit_id; |
2683 |
|
|
2684 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2685 |
$problem = 1; |
$problem = 1; |
2686 |
sql_err($sql); |
sql_err($sql); |
2687 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2688 |
bailout(); |
bailout(); |
2689 |
} |
} |
2690 |
else { |
else { |
2691 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2692 |
printf("Deleted all Library Unit staff assignments.<BR>\n"); |
printf("Deleted all Library Unit staff assignments.<BR>\n"); |
2693 |
} |
} |
2694 |
|
|
2696 |
if ($problem == 0) { |
if ($problem == 0) { |
2697 |
$sql = "DELETE FROM libunit WHERE libunit_id =" . $libunit_id; |
$sql = "DELETE FROM libunit WHERE libunit_id =" . $libunit_id; |
2698 |
|
|
2699 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2700 |
$problem = 1; |
$problem = 1; |
2701 |
sql_err($sql); |
sql_err($sql); |
2702 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2703 |
bailout(); |
bailout(); |
2704 |
} |
} |
2705 |
else { |
else { |
2706 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2707 |
printf("Removed this Library Unit successfully.<BR><BR>\n"); |
printf("Removed this Library Unit successfully.<BR><BR>\n"); |
2708 |
} |
} |
2709 |
} |
} |
2783 |
. $key_list_array[$element]; |
. $key_list_array[$element]; |
2784 |
|
|
2785 |
// Failed |
// Failed |
2786 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2787 |
sql_err($sql); |
sql_err($sql); |
2788 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2789 |
bailout(); |
bailout(); |
2790 |
} |
} |
2791 |
|
|
2792 |
// Succeeded |
// Succeeded |
2793 |
else { |
else { |
2794 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2795 |
} |
} |
2796 |
} |
} |
2797 |
// Call the libunit form back |
// Call the libunit form back |
2831 |
|
|
2832 |
$sql = "DELETE FROM sub_staff WHERE staff_id = " . $staff_id; |
$sql = "DELETE FROM sub_staff WHERE staff_id = " . $staff_id; |
2833 |
|
|
2834 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2835 |
$problem = 1; |
$problem = 1; |
2836 |
sql_err($sql); |
sql_err($sql); |
2837 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2838 |
bailout(); |
bailout(); |
2839 |
} |
} |
2840 |
else { |
else { |
2841 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2842 |
printf("All subject-staff assignments for this staff person removed.<BR>\n"); |
printf("All subject-staff assignments for this staff person removed.<BR>\n"); |
2843 |
} |
} |
2844 |
} |
} |
2847 |
if ($problem == 0) { |
if ($problem == 0) { |
2848 |
$sql = "DELETE FROM course_personnel WHERE staff_id =" . $staff_id; |
$sql = "DELETE FROM course_personnel WHERE staff_id =" . $staff_id; |
2849 |
|
|
2850 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2851 |
$problem = 1; |
$problem = 1; |
2852 |
sql_err($sql); |
sql_err($sql); |
2853 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2854 |
bailout(); |
bailout(); |
2855 |
} |
} |
2856 |
else { |
else { |
2857 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2858 |
printf("Removed this staff person from course personnel tables.<BR>\n"); |
printf("Removed this staff person from course personnel tables.<BR>\n"); |
2859 |
} |
} |
2860 |
} // delete from course_personnel table |
} // delete from course_personnel table |
2864 |
|
|
2865 |
$sql = "DELETE FROM page_staff WHERE staff_id = " . $staff_id; |
$sql = "DELETE FROM page_staff WHERE staff_id = " . $staff_id; |
2866 |
|
|
2867 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2868 |
$problem = 1; |
$problem = 1; |
2869 |
sql_err($sql); |
sql_err($sql); |
2870 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2871 |
bailout(); |
bailout(); |
2872 |
} |
} |
2873 |
else { |
else { |
2874 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2875 |
printf("All page-staff assignments for this staff person removed.<BR>\n"); |
printf("All page-staff assignments for this staff person removed.<BR>\n"); |
2876 |
} |
} |
2877 |
} |
} |
2882 |
// First, get the staff fields |
// First, get the staff fields |
2883 |
$sql = "SELECT first_name, last_name FROM staff WHERE staff_id = " |
$sql = "SELECT first_name, last_name FROM staff WHERE staff_id = " |
2884 |
. $staff_id; |
. $staff_id; |
2885 |
$rs = mysql_query($sql, $con); |
$rs = xx_query($sql, $con); |
2886 |
$row = mysql_fetch_array ($rs); |
$row = xx_fetch_array ($rs); |
2887 |
$first_name = $row["first_name"]; |
$first_name = $row["first_name"]; |
2888 |
$last_name = $row["last_name"]; |
$last_name = $row["last_name"]; |
2889 |
|
|
2904 |
. "'), staff_id = NULL WHERE staff_id =" . $staff_id |
. "'), staff_id = NULL WHERE staff_id =" . $staff_id |
2905 |
. " AND element_descr IS NOT NULL AND element_descr <> ''"; |
. " AND element_descr IS NOT NULL AND element_descr <> ''"; |
2906 |
|
|
2907 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2908 |
$problem = 1; |
$problem = 1; |
2909 |
sql_err($sql); |
sql_err($sql); |
2910 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2911 |
bailout(); |
bailout(); |
2912 |
} |
} |
2913 |
else { |
else { |
2914 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2915 |
printf("Added delete message to custom PageScribe descriptions.<BR>\n"); |
printf("Added delete message to custom PageScribe descriptions.<BR>\n"); |
2916 |
} |
} |
2917 |
} |
} |
2926 |
. "', staff_id = NULL WHERE staff_id =" . $staff_id |
. "', staff_id = NULL WHERE staff_id =" . $staff_id |
2927 |
. " AND (element_descr IS NULL OR element_descr = '')"; |
. " AND (element_descr IS NULL OR element_descr = '')"; |
2928 |
|
|
2929 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2930 |
$problem = 1; |
$problem = 1; |
2931 |
sql_err($sql); |
sql_err($sql); |
2932 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2933 |
bailout(); |
bailout(); |
2934 |
} |
} |
2935 |
else { |
else { |
2936 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2937 |
printf("Added delete message to blank PageScribe descriptions.<BR>\n"); |
printf("Added delete message to blank PageScribe descriptions.<BR>\n"); |
2938 |
} |
} |
2939 |
|
|
2950 |
. "'), staff_id = NULL WHERE staff_id =" . $staff_id |
. "'), staff_id = NULL WHERE staff_id =" . $staff_id |
2951 |
. " AND element_descr IS NOT NULL AND element_descr <> ''"; |
. " AND element_descr IS NOT NULL AND element_descr <> ''"; |
2952 |
|
|
2953 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2954 |
$problem = 1; |
$problem = 1; |
2955 |
sql_err($sql); |
sql_err($sql); |
2956 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2957 |
bailout(); |
bailout(); |
2958 |
} |
} |
2959 |
else { |
else { |
2960 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2961 |
printf("Added delete message to custom PageScribe descriptions.<BR>\n"); |
printf("Added delete message to custom PageScribe descriptions.<BR>\n"); |
2962 |
} |
} |
2963 |
} |
} |
2972 |
. "', staff_id = NULL WHERE staff_id =" . $staff_id |
. "', staff_id = NULL WHERE staff_id =" . $staff_id |
2973 |
. " AND (element_descr IS NULL OR element_descr = '')"; |
. " AND (element_descr IS NULL OR element_descr = '')"; |
2974 |
|
|
2975 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2976 |
$problem = 1; |
$problem = 1; |
2977 |
sql_err($sql); |
sql_err($sql); |
2978 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2979 |
bailout(); |
bailout(); |
2980 |
} |
} |
2981 |
else { |
else { |
2982 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2983 |
printf("Added delete message to blank PageScribe descriptions.<BR>\n"); |
printf("Added delete message to blank PageScribe descriptions.<BR>\n"); |
2984 |
} |
} |
2985 |
|
|
2989 |
if ($problem == 0) { |
if ($problem == 0) { |
2990 |
$sql = "DELETE FROM staff WHERE staff_id =" . $staff_id; |
$sql = "DELETE FROM staff WHERE staff_id =" . $staff_id; |
2991 |
|
|
2992 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
2993 |
$problem = 1; |
$problem = 1; |
2994 |
sql_err($sql); |
sql_err($sql); |
2995 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
2996 |
bailout(); |
bailout(); |
2997 |
} |
} |
2998 |
else { |
else { |
2999 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3000 |
printf("Removed this staff person successfully.<BR><BR>\n"); |
printf("Removed this staff person successfully.<BR><BR>\n"); |
3001 |
} |
} |
3002 |
} // delete from staff table |
} // delete from staff table |
3099 |
. $key_list_array[$element]; |
. $key_list_array[$element]; |
3100 |
|
|
3101 |
// Failed |
// Failed |
3102 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
3103 |
sql_err($sql); |
sql_err($sql); |
3104 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3105 |
bailout(); |
bailout(); |
3106 |
} |
} |
3107 |
|
|
3108 |
// Succeeded |
// Succeeded |
3109 |
else { |
else { |
3110 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3111 |
} |
} |
3112 |
} |
} |
3113 |
// Call the staff form back |
// Call the staff form back |
3138 |
. $key_list_array[$element]; |
. $key_list_array[$element]; |
3139 |
|
|
3140 |
// Failed |
// Failed |
3141 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
3142 |
sql_err($sql); |
sql_err($sql); |
3143 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3144 |
bailout(); |
bailout(); |
3145 |
} |
} |
3146 |
|
|
3147 |
// Succeeded |
// Succeeded |
3148 |
else { |
else { |
3149 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3150 |
} |
} |
3151 |
} |
} |
3152 |
// Call the staff form back |
// Call the staff form back |
3180 |
if ($stafftitle_id > 1) { |
if ($stafftitle_id > 1) { |
3181 |
$sql = "UPDATE staff SET stafftitle_id = 1 WHERE stafftitle_id = " . $stafftitle_id; |
$sql = "UPDATE staff SET stafftitle_id = 1 WHERE stafftitle_id = " . $stafftitle_id; |
3182 |
|
|
3183 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
3184 |
$problem = 1; |
$problem = 1; |
3185 |
sql_err($sql); |
sql_err($sql); |
3186 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3187 |
bailout(); |
bailout(); |
3188 |
} |
} |
3189 |
else { |
else { |
3190 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3191 |
printf("Successfully set affected staff person job titles to (N/A).<BR>\n"); |
printf("Successfully set affected staff person job titles to (N/A).<BR>\n"); |
3192 |
} |
} |
3193 |
|
|
3195 |
if ($problem == 0) { |
if ($problem == 0) { |
3196 |
$sql = "DELETE FROM stafftitle WHERE stafftitle_id =" . $stafftitle_id; |
$sql = "DELETE FROM stafftitle WHERE stafftitle_id =" . $stafftitle_id; |
3197 |
|
|
3198 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
3199 |
$problem = 1; |
$problem = 1; |
3200 |
sql_err($sql); |
sql_err($sql); |
3201 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3202 |
bailout(); |
bailout(); |
3203 |
} |
} |
3204 |
else { |
else { |
3205 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3206 |
printf("Removed this job title successfully.<BR><BR>\n"); |
printf("Removed this job title successfully.<BR><BR>\n"); |
3207 |
} |
} |
3208 |
} |
} |
3292 |
if ($style_id > 2) { |
if ($style_id > 2) { |
3293 |
$sql = "UPDATE page SET style_id = 1 WHERE style_id = " . $style_id; |
$sql = "UPDATE page SET style_id = 1 WHERE style_id = " . $style_id; |
3294 |
|
|
3295 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
3296 |
$problem = 1; |
$problem = 1; |
3297 |
sql_err($sql); |
sql_err($sql); |
3298 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3299 |
bailout(); |
bailout(); |
3300 |
} |
} |
3301 |
else { |
else { |
3302 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3303 |
printf("Successfully set affected page styles to (N/A).<BR>\n"); |
printf("Successfully set affected page styles to (N/A).<BR>\n"); |
3304 |
} |
} |
3305 |
|
|
3307 |
if ($problem == 0) { |
if ($problem == 0) { |
3308 |
$sql = "DELETE FROM style WHERE style_id =" . $style_id; |
$sql = "DELETE FROM style WHERE style_id =" . $style_id; |
3309 |
|
|
3310 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
3311 |
$problem = 1; |
$problem = 1; |
3312 |
sql_err($sql); |
sql_err($sql); |
3313 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3314 |
bailout(); |
bailout(); |
3315 |
} |
} |
3316 |
else { |
else { |
3317 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3318 |
printf("Removed this style successfully.<BR><BR>\n"); |
printf("Removed this style successfully.<BR><BR>\n"); |
3319 |
} |
} |
3320 |
} |
} |
3413 |
// Delete all course term assignments |
// Delete all course term assignments |
3414 |
$sql = "UPDATE course SET term_id = NULL WHERE term_id =" . $term_id; |
$sql = "UPDATE course SET term_id = NULL WHERE term_id =" . $term_id; |
3415 |
|
|
3416 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
3417 |
$problem = 1; |
$problem = 1; |
3418 |
sql_err($sql); |
sql_err($sql); |
3419 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3420 |
bailout(); |
bailout(); |
3421 |
} |
} |
3422 |
else { |
else { |
3423 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3424 |
printf("Removed this term from affected course pages.<BR>\n"); |
printf("Removed this term from affected course pages.<BR>\n"); |
3425 |
} |
} |
3426 |
|
|
3430 |
// Delete from term table |
// Delete from term table |
3431 |
$sql = "DELETE FROM term WHERE term_id =" . $term_id; |
$sql = "DELETE FROM term WHERE term_id =" . $term_id; |
3432 |
|
|
3433 |
if (!mysql_query ($sql, $con)){ |
if (!xx_query ($sql, $con)){ |
3434 |
$problem = 1; |
$problem = 1; |
3435 |
sql_err($sql); |
sql_err($sql); |
3436 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3437 |
bailout(); |
bailout(); |
3438 |
} |
} |
3439 |
else { |
else { |
3440 |
mysql_query ("UNLOCK TABLES", $con); |
xx_query ("UNLOCK TABLES", $con); |
3441 |
printf("Removed term successfully.<BR><BR>\n"); |
printf("Removed term successfully.<BR><BR>\n"); |
3442 |
} |
} |
3443 |
} |
} |