/[libdata]/trunk/admin/include/subject_builder.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/subject_builder.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 44  function assignSubOtherSub($con, $subjec Line 44  function assignSubOtherSub($con, $subjec
44                          . " AND othersub_id = "                          . " AND othersub_id = "
45                          . $subject_id_array[$subscript];                          . $subject_id_array[$subscript];
46    
47                  $rs = mysql_query($sql);                  $rs = xx_query($sql);
48                  if (mysql_num_rows($rs) == 0) {                  if (xx_num_rows($rs) == 0) {
49    
50                          $sql = "INSERT INTO sub_othersub (subject_id, othersub_id) VALUES ("                          $sql = "INSERT INTO sub_othersub (subject_id, othersub_id) VALUES ("
51                                  . $subject_id                                  . $subject_id
# Line 53  function assignSubOtherSub($con, $subjec Line 53  function assignSubOtherSub($con, $subjec
53                                  . $subject_id_array[$subscript]                                  . $subject_id_array[$subscript]
54                                  . ")";                                  . ")";
55    
56                          if (!mysql_query($sql, $con)){                          if (!xx_query($sql, $con)){
57                                  sql_err($con);                                  sql_err($con);
58                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
59                                  bailout();                                  bailout();
60                          } // bad write                          } // bad write
61                          else {                          else {
62                                  mysql_query("UNLOCK TABLES", $con);                                  xx_query("UNLOCK TABLES", $con);
63                                                    
64                          } // good write of sub_othersub                          } // good write of sub_othersub
65                                                    
# Line 92  function assignSubPage($con, $page_id_ar Line 92  function assignSubPage($con, $page_id_ar
92                          . " AND page_id = "                          . " AND page_id = "
93                          . $page_id_array[$subscript];                          . $page_id_array[$subscript];
94    
95                  $rs = mysql_query($sql);                  $rs = xx_query($sql);
96                  if (mysql_num_rows($rs) == 0) {                  if (xx_num_rows($rs) == 0) {
97    
98                          $sql = "INSERT INTO sub_page (subject_id, page_id) VALUES ("                          $sql = "INSERT INTO sub_page (subject_id, page_id) VALUES ("
99                                  . $subject_id                                  . $subject_id
# Line 101  function assignSubPage($con, $page_id_ar Line 101  function assignSubPage($con, $page_id_ar
101                                  . $page_id_array[$subscript]                                  . $page_id_array[$subscript]
102                                  . ")";                                  . ")";
103    
104                          if (!mysql_query($sql, $con)){                          if (!xx_query($sql, $con)){
105                                  sql_err($con);                                  sql_err($con);
106                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
107                                  bailout();                                  bailout();
108                          } // bad write                          } // bad write
109                          else {                          else {
110                                  mysql_query("UNLOCK TABLES", $con);                                  xx_query("UNLOCK TABLES", $con);
111                                                    
112                          } // good write of sub_page                          } // good write of sub_page
113                                                    
# Line 139  function deleteSubjectBuilder($con, $inf Line 139  function deleteSubjectBuilder($con, $inf
139                  . $subject_id . " AND infotype_id = "                  . $subject_id . " AND infotype_id = "
140                  . $infotype_id;                  . $infotype_id;
141    
142          if (!mysql_query ($sql, $con)){          if (!xx_query ($sql, $con)){
143                  sql_err($sql);                  sql_err($sql);
144                  mysql_query ("UNLOCK TABLES", $con);                  xx_query ("UNLOCK TABLES", $con);
145                  bailout();                  bailout();
146          }          }
147          else {          else {
148                  mysql_query ("UNLOCK TABLES", $con);                  xx_query ("UNLOCK TABLES", $con);
149          }          }
150    
151          header("Location: subject_builder.phtml?subject_id=" . $subject_id);          header("Location: subject_builder.phtml?subject_id=" . $subject_id);
# Line 174  function deleteSubOtherSub($con, $key_li Line 174  function deleteSubOtherSub($con, $key_li
174                          . $key_list_array[$element];                          . $key_list_array[$element];
175    
176                  // Failed                                                // Failed                              
177                  if (!mysql_query ($sql, $con)){                  if (!xx_query ($sql, $con)){
178                          sql_err($sql);                          sql_err($sql);
179                          mysql_query ("UNLOCK TABLES", $con);                          xx_query ("UNLOCK TABLES", $con);
180                          bailout();                          bailout();
181                  }                  }
182                                    
183                  // Succeeded                  // Succeeded
184                  else {                  else {
185                          mysql_query ("UNLOCK TABLES", $con);                          xx_query ("UNLOCK TABLES", $con);
186                  }                  }
187          }          }
188                    
# Line 211  function deleteSubPage($con, $key_list_a Line 211  function deleteSubPage($con, $key_list_a
211                          . $key_list_array[$element];                          . $key_list_array[$element];
212    
213                  // Failed                                                // Failed                              
214                  if (!mysql_query ($sql, $con)){                  if (!xx_query ($sql, $con)){
215                          sql_err($sql);                          sql_err($sql);
216                          mysql_query ("UNLOCK TABLES", $con);                          xx_query ("UNLOCK TABLES", $con);
217                          bailout();                          bailout();
218                  }                  }
219                                    
220                  // Succeeded                  // Succeeded
221                  else {                  else {
222                          mysql_query ("UNLOCK TABLES", $con);                          xx_query ("UNLOCK TABLES", $con);
223                  }                  }
224          }          }
225                    
# Line 252  function insertSubjectBuilder($con, $hig Line 252  function insertSubjectBuilder($con, $hig
252    
253                  // Find the default information type for this resource                  // Find the default information type for this resource
254                  $sql = "SELECT infotype_id FROM resource WHERE resource_id = " . $resource_id;                  $sql = "SELECT infotype_id FROM resource WHERE resource_id = " . $resource_id;
255                  $rs = mysql_query($sql, $con);                  $rs = xx_query($sql, $con);
256                  $row = mysql_fetch_array ($rs);                  $row = xx_fetch_array ($rs);
257                  $infotype_id = $row["infotype_id"];                  $infotype_id = $row["infotype_id"];
258    
259                  // Check to see if it's already there.                  // Check to see if it's already there.
# Line 293  function insertSubjectBuilder($con, $hig Line 293  function insertSubjectBuilder($con, $hig
293                          // Debugging                          // Debugging
294                          // printf("sql was: %s<BR>", $sql);                          // printf("sql was: %s<BR>", $sql);
295    
296                          if (!mysql_query ($sql, $con)){                          if (!xx_query ($sql, $con)){
297                                  sql_err($sql);                                  sql_err($sql);
298                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
299                                  bailout();                                  bailout();
300                          }                          }
301                          else {                          else {
302                                  mysql_query ("UNLOCK TABLES", $con);                                  xx_query ("UNLOCK TABLES", $con);
303                          }                          }
304    
305                  }                  }
# Line 325  function rqsPublish($con, $subject_id){ Line 325  function rqsPublish($con, $subject_id){
325                  . $subject_id;                  . $subject_id;
326    
327          // Failed                                        // Failed                              
328          if (!mysql_query ($sql, $con)){          if (!xx_query ($sql, $con)){
329                  sql_err($sql);                  sql_err($sql);
330                  mysql_query ("UNLOCK TABLES", $con);                  xx_query ("UNLOCK TABLES", $con);
331                  bailout();                  bailout();
332          }          }
333    
334          // Succeeded          // Succeeded
335          else {          else {
336                  mysql_query ("UNLOCK TABLES", $con);                  xx_query ("UNLOCK TABLES", $con);
337          }          }
338    
339          header("Location: subject_builder.phtml?subject_id=" . $subject_id);          header("Location: subject_builder.phtml?subject_id=" . $subject_id);
# Line 354  function rqsUnpublish($con, $subject_id) Line 354  function rqsUnpublish($con, $subject_id)
354                  . $subject_id;                  . $subject_id;
355    
356          // Failed                                        // Failed                              
357          if (!mysql_query ($sql, $con)){          if (!xx_query ($sql, $con)){
358                  sql_err($sql);                  sql_err($sql);
359                  mysql_query ("UNLOCK TABLES", $con);                  xx_query ("UNLOCK TABLES", $con);
360                  bailout();                  bailout();
361          }          }
362    
363          // Succeeded          // Succeeded
364          else {          else {
365                  mysql_query ("UNLOCK TABLES", $con);                  xx_query ("UNLOCK TABLES", $con);
366          }          }
367    
368          header("Location: subject_builder.phtml?subject_id=" . $subject_id);          header("Location: subject_builder.phtml?subject_id=" . $subject_id);
# Line 385  function updateRQSUpdate($con, $sess_sta Line 385  function updateRQSUpdate($con, $sess_sta
385                  . $subject_id;                  . $subject_id;
386    
387          // Failed                                        // Failed                              
388          if (!mysql_query ($sql, $con)){          if (!xx_query ($sql, $con)){
389                  sql_err($sql);                  sql_err($sql);
390                  mysql_query ("UNLOCK TABLES", $con);                  xx_query ("UNLOCK TABLES", $con);
391                  bailout();                  bailout();
392          }          }
393    
394          // Succeeded          // Succeeded
395          else {          else {
396                  mysql_query ("UNLOCK TABLES", $con);                  xx_query ("UNLOCK TABLES", $con);
397          }          }
398  }  }
399    
# Line 425  function updateSubjectBuilder($con, $des Line 425  function updateSubjectBuilder($con, $des
425                  . $infotype_id                  . $infotype_id
426                  . ")";                  . ")";
427                    
428          if (!mysql_query ($sql, $con)){          if (!xx_query ($sql, $con)){
429                  sql_err($sql);                  sql_err($sql);
430                  mysql_query ("UNLOCK TABLES", $con);                  xx_query ("UNLOCK TABLES", $con);
431                  bailout();                  bailout();
432          }          }
433          else {          else {
434                  mysql_query ("UNLOCK TABLES", $con);                  xx_query ("UNLOCK TABLES", $con);
435          }          }
436                                    
437          // If the user opted for default resource description, void out the incoming $description;          // If the user opted for default resource description, void out the incoming $description;
# Line 461  function updateSubjectBuilder($con, $des Line 461  function updateSubjectBuilder($con, $des
461                          . $description                          . $description
462                          . "')";                          . "')";
463                    
464          if (!mysql_query ($sql, $con)){          if (!xx_query ($sql, $con)){
465                  sql_err($sql);                  sql_err($sql);
466                  mysql_query ("UNLOCK TABLES", $con);                  xx_query ("UNLOCK TABLES", $con);
467                  bailout();                  bailout();
468          }          }
469          else {          else {
470                  mysql_query ("UNLOCK TABLES", $con);                  xx_query ("UNLOCK TABLES", $con);
471          }          }
472    
473          header("Location: subject_builder.phtml?subject_id=" . $subject_id . "#" . $resource_id);          header("Location: subject_builder.phtml?subject_id=" . $subject_id . "#" . $resource_id);

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

  ViewVC Help
Powered by ViewVC 1.1.26