/[libdata]/trunk/admin/include/assign.php
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /trunk/admin/include/assign.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 41 by dpavlin, Fri Dec 5 18:34:18 2003 UTC revision 42 by dpavlin, Thu Mar 4 22:43:50 2004 UTC
# Line 51  function assignResFeature($con, $feature Line 51  function assignResFeature($con, $feature
51                          . " AND feature_id = "                          . " AND feature_id = "
52                          . $feature_id_array[$subscript];                          . $feature_id_array[$subscript];
53    
54                  $rs = mysql_query($sql);                  $rs = xx_query($sql);
55                  if (mysql_num_rows($rs) == 0) {                  if (xx_num_rows($rs) == 0) {
56                    
57                          $sql = "INSERT INTO res_feature (resource_id, feature_id) VALUES ("                          $sql = "INSERT INTO res_feature (resource_id, feature_id) VALUES ("
58                                  . $resource_id                                  . $resource_id
# Line 60  function assignResFeature($con, $feature Line 60  function assignResFeature($con, $feature
60                                  . $feature_id_array[$subscript]                                  . $feature_id_array[$subscript]
61                                  . ")";                                  . ")";
62    
63                          if (!mysql_query($sql, $con)){                          if (!xx_query($sql, $con)){
64                                  sql_err($con);                                  sql_err($con);
65                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
66                                  bailout();                                  bailout();
67                          } // bad write                          } // bad write
68                          else {                          else {
69                                  mysql_query("UNLOCK TABLES", $con);                                  xx_query("UNLOCK TABLES", $con);
70    
71                          } // good write of res_feature                          } // good write of res_feature
72                                                    
# Line 100  function assignResLoc($con, $location_id Line 100  function assignResLoc($con, $location_id
100                          . " AND location_id = "                          . " AND location_id = "
101                          . $location_id_array[$subscript];                          . $location_id_array[$subscript];
102    
103                  $rs = mysql_query($sql);                  $rs = xx_query($sql);
104                  if (mysql_num_rows($rs) == 0) {                  if (xx_num_rows($rs) == 0) {
105    
106                          $sql = "INSERT INTO res_loc (resource_id, location_id) VALUES ("                          $sql = "INSERT INTO res_loc (resource_id, location_id) VALUES ("
107                                  . $resource_id                                  . $resource_id
# Line 109  function assignResLoc($con, $location_id Line 109  function assignResLoc($con, $location_id
109                                  . $location_id_array[$subscript]                                  . $location_id_array[$subscript]
110                                  . ")";                                  . ")";
111    
112                          if (!mysql_query($sql, $con)){                          if (!xx_query($sql, $con)){
113                                  sql_err($con);                                  sql_err($con);
114                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
115                                  bailout();                                  bailout();
116                          } // bad write                          } // bad write
117                                    
118                          else {                          else {
119                                  mysql_query("UNLOCK TABLES", $con);                                  xx_query("UNLOCK TABLES", $con);
120                                                    
121                          } // good write of res_loc                          } // good write of res_loc
122                  } // location not already assigned                  } // location not already assigned
# Line 149  function assignResMastersubject($con, $m Line 149  function assignResMastersubject($con, $m
149                          . " AND mastersubject_id = "                          . " AND mastersubject_id = "
150                          . $mastersubject_id_array[$subscript];                          . $mastersubject_id_array[$subscript];
151                                    
152                  $rs = mysql_query($sql);                  $rs = xx_query($sql);
153                  if (mysql_num_rows($rs) == 0) {                  if (xx_num_rows($rs) == 0) {
154    
155                          $sql = "INSERT INTO res_mastersubject (resource_id, mastersubject_id) VALUES ("                          $sql = "INSERT INTO res_mastersubject (resource_id, mastersubject_id) VALUES ("
156                                  . $resource_id                                  . $resource_id
# Line 158  function assignResMastersubject($con, $m Line 158  function assignResMastersubject($con, $m
158                                  . $mastersubject_id_array[$subscript]                                  . $mastersubject_id_array[$subscript]
159                                  . ")";                                  . ")";
160                    
161                          if (!mysql_query($sql, $con)){                          if (!xx_query($sql, $con)){
162                                  sql_err($con);                                  sql_err($con);
163                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
164                                  bailout();                                  bailout();
165                          } // bad write                          } // bad write
166                                    
167                          else {                          else {
168                                  mysql_query("UNLOCK TABLES", $con);                                  xx_query("UNLOCK TABLES", $con);
169                                                    
170                          } // good write of res_mastersubject                          } // good write of res_mastersubject
171                  } // mastersubject not already assigned                  } // mastersubject not already assigned
# Line 198  function assignServLoc($con, $location_i Line 198  function assignServLoc($con, $location_i
198                          . " AND location_id = "                          . " AND location_id = "
199                          . $location_id_array[$subscript];                          . $location_id_array[$subscript];
200    
201                  $rs = mysql_query($sql);                  $rs = xx_query($sql);
202                  if (mysql_num_rows($rs) == 0) {                  if (xx_num_rows($rs) == 0) {
203                    
204                          $sql = "INSERT INTO serv_loc (service_id, location_id) VALUES ("                          $sql = "INSERT INTO serv_loc (service_id, location_id) VALUES ("
205                                  . $service_id                                  . $service_id
# Line 207  function assignServLoc($con, $location_i Line 207  function assignServLoc($con, $location_i
207                                  . $location_id_array[$subscript]                                  . $location_id_array[$subscript]
208                                  . ")";                                  . ")";
209    
210                          if (!mysql_query($sql, $con)){                          if (!xx_query($sql, $con)){
211                                  sql_err($con);                                  sql_err($con);
212                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
213                                  bailout();                                  bailout();
214                          } // bad write                          } // bad write
215                          else {                          else {
216                                  mysql_query("UNLOCK TABLES", $con);                                  xx_query("UNLOCK TABLES", $con);
217                                                    
218                          } // good write of serv_loc                          } // good write of serv_loc
219                                                    
# Line 247  function assignServServtype($con, $servi Line 247  function assignServServtype($con, $servi
247                          . " AND servicetype_id = "                          . " AND servicetype_id = "
248                          . $servicetype_id_array[$subscript];                          . $servicetype_id_array[$subscript];
249    
250                  $rs = mysql_query($sql);                  $rs = xx_query($sql);
251                  if (mysql_num_rows($rs) == 0) {                  if (xx_num_rows($rs) == 0) {
252    
253                          $sql = "INSERT INTO serv_servtype (service_id, servicetype_id) VALUES ("                          $sql = "INSERT INTO serv_servtype (service_id, servicetype_id) VALUES ("
254                                  . $service_id                                  . $service_id
# Line 256  function assignServServtype($con, $servi Line 256  function assignServServtype($con, $servi
256                                  . $servicetype_id_array[$subscript]                                  . $servicetype_id_array[$subscript]
257                                  . ")";                                  . ")";
258    
259                          if (!mysql_query($sql, $con)){                          if (!xx_query($sql, $con)){
260                                  sql_err($con);                                  sql_err($con);
261                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
262                                  bailout();                                  bailout();
263                          } // bad write                          } // bad write
264                          else {                          else {
265                                  mysql_query("UNLOCK TABLES", $con);                                  xx_query("UNLOCK TABLES", $con);
266                                                    
267                          } // good write of serv_servtype                          } // good write of serv_servtype
268                                                    
# Line 296  function assignSubCoursesub($con, $cours Line 296  function assignSubCoursesub($con, $cours
296                          . " AND coursesub_id = "                          . " AND coursesub_id = "
297                          . $coursesub_id_array[$subscript];                          . $coursesub_id_array[$subscript];
298    
299                  $rs = mysql_query($sql);                  $rs = xx_query($sql);
300                  if (mysql_num_rows($rs) == 0) {                  if (xx_num_rows($rs) == 0) {
301    
302                          $sql = "INSERT INTO sub_coursesub (subject_id, coursesub_id) VALUES ("                          $sql = "INSERT INTO sub_coursesub (subject_id, coursesub_id) VALUES ("
303                                  . $subject_id                                  . $subject_id
# Line 305  function assignSubCoursesub($con, $cours Line 305  function assignSubCoursesub($con, $cours
305                                  . $coursesub_id_array[$subscript]                                  . $coursesub_id_array[$subscript]
306                                  . ")";                                  . ")";
307    
308                          if (!mysql_query($sql, $con)){                          if (!xx_query($sql, $con)){
309                                  sql_err($con);                                  sql_err($con);
310                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
311                                  bailout();                                  bailout();
312                          } // bad write                          } // bad write
313                          else {                          else {
314                                  mysql_query("UNLOCK TABLES", $con);                                  xx_query("UNLOCK TABLES", $con);
315                                                    
316                          } // good write of sub_coursesub                          } // good write of sub_coursesub
317                                                    
# Line 345  function assignSubLoc($con, $location_id Line 345  function assignSubLoc($con, $location_id
345                          . " AND location_id = "                          . " AND location_id = "
346                          . $location_id_array[$subscript];                          . $location_id_array[$subscript];
347    
348                  $rs = mysql_query($sql);                  $rs = xx_query($sql);
349                  if (mysql_num_rows($rs) == 0) {                  if (xx_num_rows($rs) == 0) {
350    
351                          $sql = "INSERT INTO sub_loc (subject_id, location_id) VALUES ("                          $sql = "INSERT INTO sub_loc (subject_id, location_id) VALUES ("
352                                  . $subject_id                                  . $subject_id
# Line 354  function assignSubLoc($con, $location_id Line 354  function assignSubLoc($con, $location_id
354                                  . $location_id_array[$subscript]                                  . $location_id_array[$subscript]
355                                  . ")";                                  . ")";
356    
357                          if (!mysql_query($sql, $con)){                          if (!xx_query($sql, $con)){
358                                  sql_err($con);                                  sql_err($con);
359                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
360                                  bailout();                                  bailout();
361                          } // bad write                          } // bad write
362                          else {                          else {
363                                  mysql_query("UNLOCK TABLES", $con);                                  xx_query("UNLOCK TABLES", $con);
364                                                    
365                          } // good write of sub_loc                          } // good write of sub_loc
366                                                    
# Line 394  function assignSubMaster($con, $mastersu Line 394  function assignSubMaster($con, $mastersu
394                          . " AND mastersubject_id = "                          . " AND mastersubject_id = "
395                          . $mastersubject_id_array[$subscript];                          . $mastersubject_id_array[$subscript];
396    
397                  $rs = mysql_query($sql);                  $rs = xx_query($sql);
398                  if (mysql_num_rows($rs) == 0) {                  if (xx_num_rows($rs) == 0) {
399    
400                          $sql = "INSERT INTO sub_mastersubject (subject_id, mastersubject_id) VALUES ("                          $sql = "INSERT INTO sub_mastersubject (subject_id, mastersubject_id) VALUES ("
401                                  . $subject_id                                  . $subject_id
# Line 403  function assignSubMaster($con, $mastersu Line 403  function assignSubMaster($con, $mastersu
403                                  . $mastersubject_id_array[$subscript]                                  . $mastersubject_id_array[$subscript]
404                                  . ")";                                  . ")";
405    
406                          if (!mysql_query($sql, $con)){                          if (!xx_query($sql, $con)){
407                                  sql_err($con);                                  sql_err($con);
408                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
409                                  bailout();                                  bailout();
410                          } // bad write                          } // bad write
411                          else {                          else {
412                                  mysql_query("UNLOCK TABLES", $con);                                  xx_query("UNLOCK TABLES", $con);
413                                                    
414                          } // good write of sub_mastersubject                          } // good write of sub_mastersubject
415                                                    
# Line 443  function assignSubStaff($con, $staff_id_ Line 443  function assignSubStaff($con, $staff_id_
443                          . " AND staff_id = "                          . " AND staff_id = "
444                          . $staff_id_array[$subscript];                          . $staff_id_array[$subscript];
445    
446                  $rs = mysql_query($sql);                  $rs = xx_query($sql);
447                  if (mysql_num_rows($rs) == 0) {                  if (xx_num_rows($rs) == 0) {
448    
449                          $sql = "INSERT INTO sub_staff (subject_id, staff_id) VALUES ("                          $sql = "INSERT INTO sub_staff (subject_id, staff_id) VALUES ("
450                                  . $subject_id                                  . $subject_id
# Line 452  function assignSubStaff($con, $staff_id_ Line 452  function assignSubStaff($con, $staff_id_
452                                  . $staff_id_array[$subscript]                                  . $staff_id_array[$subscript]
453                                  . ")";                                  . ")";
454    
455                          //mysql_query ("LOCK TABLE sub_staff WRITE", $con);                          //xx_query ("LOCK TABLE sub_staff WRITE", $con);
456                          if (!mysql_query($sql, $con)){                          if (!xx_query($sql, $con)){
457                                  sql_err($con);                                  sql_err($con);
458                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
459                                  bailout();                                  bailout();
460                          } // bad write                          } // bad write
461                          else {                          else {
462                                  mysql_query("UNLOCK TABLES", $con);                                  xx_query("UNLOCK TABLES", $con);
463                          } // good write of sub_staff                          } // good write of sub_staff
464                  }                  }
465    
# Line 493  function assignLibunitStaff($con, $staff Line 493  function assignLibunitStaff($con, $staff
493                  // Check to make sure that the staff isn't already assigned                  // Check to make sure that the staff isn't already assigned
494                  $sql = "SELECT * FROM libunit_staff WHERE libunit_id = " . $libunit_id .                  $sql = "SELECT * FROM libunit_staff WHERE libunit_id = " . $libunit_id .
495                  " AND staff_id = " . $staff_id_array[$subscript];                  " AND staff_id = " . $staff_id_array[$subscript];
496                  $rs = mysql_query($sql);                  $rs = xx_query($sql);
497                  if (mysql_num_rows($rs) == 0) {                  if (xx_num_rows($rs) == 0) {
498                    
499                          $sql = "INSERT INTO libunit_staff (libunit_id, staff_id) VALUES ("                          $sql = "INSERT INTO libunit_staff (libunit_id, staff_id) VALUES ("
500                                  . $libunit_id                                  . $libunit_id
# Line 502  function assignLibunitStaff($con, $staff Line 502  function assignLibunitStaff($con, $staff
502                                  . $staff_id_array[$subscript]                                  . $staff_id_array[$subscript]
503                                  . ")";                                  . ")";
504                    
505                          if (!mysql_query($sql, $con)){                          if (!xx_query($sql, $con)){
506                                  sql_err($con);                                  sql_err($con);
507                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
508                                  bailout();                                  bailout();
509                          } // bad write                          } // bad write
510                          else {                          else {
511                                  mysql_query("UNLOCK TABLES", $con);                                  xx_query("UNLOCK TABLES", $con);
512    
513                          } // good write of libunit_staff                          } // good write of libunit_staff
514                                                    
# Line 544  function assignStaffLibunit($con, $libun Line 544  function assignStaffLibunit($con, $libun
544                          . " AND libunit_id = "                          . " AND libunit_id = "
545                          . $libunit_id_array[$subscript];                          . $libunit_id_array[$subscript];
546    
547                  $rs = mysql_query($sql);                  $rs = xx_query($sql);
548                  if (mysql_num_rows($rs) == 0) {                  if (xx_num_rows($rs) == 0) {
549    
550                          $sql = "INSERT INTO libunit_staff (libunit_id, staff_id) VALUES ("                          $sql = "INSERT INTO libunit_staff (libunit_id, staff_id) VALUES ("
551                                  . $libunit_id_array[$subscript]                                  . $libunit_id_array[$subscript]
# Line 553  function assignStaffLibunit($con, $libun Line 553  function assignStaffLibunit($con, $libun
553                                  . $staff_id                                  . $staff_id
554                                  . ")";                                  . ")";
555                    
556                          if (!mysql_query($sql, $con)){                          if (!xx_query($sql, $con)){
557                                  sql_err($con);                                  sql_err($con);
558                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
559                                  bailout();                                  bailout();
560                          } // bad write                          } // bad write
561                          else {                          else {
562                                  mysql_query("UNLOCK TABLES", $con);                                  xx_query("UNLOCK TABLES", $con);
563                                                    
564                          } // good write of libunit_staff                          } // good write of libunit_staff
565                                                    
# Line 593  function assignStaffSub($con, $staff_id, Line 593  function assignStaffSub($con, $staff_id,
593                          . " AND subject_id = "                          . " AND subject_id = "
594                          . $subject_id_array[$subscript];                          . $subject_id_array[$subscript];
595    
596                  $rs = mysql_query($sql);                  $rs = xx_query($sql);
597                  if (mysql_num_rows($rs) == 0) {                  if (xx_num_rows($rs) == 0) {
598    
599                          $sql = "INSERT INTO sub_staff (subject_id, staff_id) VALUES ("                          $sql = "INSERT INTO sub_staff (subject_id, staff_id) VALUES ("
600                                  . $subject_id_array[$subscript]                                  . $subject_id_array[$subscript]
# Line 602  function assignStaffSub($con, $staff_id, Line 602  function assignStaffSub($con, $staff_id,
602                                  . $staff_id                                  . $staff_id
603                                  . ")";                                  . ")";
604    
605                          if (!mysql_query($sql, $con)){                          if (!xx_query($sql, $con)){
606                                  sql_err($con);                                  sql_err($con);
607                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
608                                  bailout();                                  bailout();
609                          } // bad write                          } // bad write
610                          else {                          else {
611                                  mysql_query("UNLOCK TABLES", $con);                                  xx_query("UNLOCK TABLES", $con);
612                                                    
613                          } // good write of sub_staff                          } // good write of sub_staff
614                                                    

Legend:
Removed from v.41  
changed lines
  Added in v.42

  ViewVC Help
Powered by ViewVC 1.1.26