Exemplo n.º 1
0
 public function updateRecord()
 {
     /////////////////////
     // update faq table
     /////////////////////
     $db = new Querier();
     $qUpFAQ = "UPDATE faq SET question = " . $db->quote(scrubData($this->_question, "text")) . ",\n\t  answer = " . $db->quote(scrubData($this->_answer, 'richtext')) . ",\n\t  keywords = " . $db->quote(scrubData($this->_keywords, 'text')) . "\n          WHERE faq_id = " . scrubData($this->_faq_id, 'integer');
     $rUpFAQ = $db->query($qUpFAQ);
     $this->_debug = "<p>1. update faq: {$qUpFAQ}</p>";
     /////////////////////
     // clear faq_subject
     /////////////////////
     $qClearSubs = "DELETE FROM faq_subject WHERE faq_id = " . $this->_faq_id;
     $rClearSubs = $db->query($qClearSubs);
     $this->_debug .= "<p>2. clear rank: {$qClearSubs}</p>";
     if ($rClearSubs === FALSE) {
         echo blunDer("We have a problem with the clear faq-subs query: {$qClearSubs}");
     }
     /////////////////////
     // insert into subject
     ////////////////////
     self::modifySubjects();
     // wipe entry from intervening table
     $qClearColls = "DELETE FROM faq_faqpage WHERE faq_id = " . scrubData($this->_faq_id, "integer");
     $rClearColls = $db->query($qClearColls);
     $this->_debug .= "<p>4. wipe faq_faqpage: {$qClearColls}</p>";
     if ($rClearColls === FALSE) {
         echo blunDer("We have a problem with the clear locations query: {$qClearColls}");
     }
     /////////////////////
     // insert/update collections
     ////////////////////
     self::modifyCollections();
     // /////////////////////
     // Alter chchchanges table
     // table, flag, item_id, title, staff_id
     ////////////////////
     $updateChangeTable = changeMe("faq", "update", $this->_faq_id, $this->_question, $_SESSION['staff_id']);
     // message
     $this->_message = _("Thy Will Be Done.  Updated.");
 }
Exemplo n.º 2
0
 public function updateBio($new_bio)
 {
     $db = new Querier();
     $q = "UPDATE staff SET bio = " . $db->quote(scrubData($new_bio, "richtext")) . " WHERE staff_id = " . $this->_staff_id;
     $this->_debug = "<p class=\"debug\">Bio Update query: {$q}</p>";
     $r = $db->exec($q);
     // now our detailed version
     $q2 = "UPDATE staff SET bio = " . $db->quote(scrubData($new_bio, "richtext")) . " WHERE staff_id = " . $this->_staff_id;
     $this->_debug .= "<p class=\"debug\">Bio Update query: {$q2}</p>";
     $r2 = $db->query($q2);
     if ($r) {
         $updateChangeTable = changeMe("staff", "update", $this->_staff_id, "bio update", $_SESSION['staff_id']);
         return TRUE;
     }
 }
Exemplo n.º 3
0
 public function updateRecord()
 {
     global $use_disciplines;
     // Check to make sure the title or shortform haven't been changed to create dupes
     $is_dupe = self::dupeCheck();
     if ($is_dupe == TRUE) {
         $this->_message = _("There is already a guide with this SHORTFORM.  The shortform must be unique.");
         return;
     }
     //print_r($_POST);
     //////////////////
     // Encode our extra as json
     /////////////////
     $json_extra = json_encode($this->_extra);
     /////////////////////
     // update subject table
     /////////////////////
     $db = new Querier();
     $qUpSubject = "UPDATE subject SET subject = " . $db->quote(scrubData($this->_subject, "text")) . ",\n        shortform = " . $db->quote(scrubData($this->_shortform, "text")) . ",\n        description = " . $db->quote(scrubData($this->_description, "text")) . ",\n        keywords = " . $db->quote(scrubData($this->_keywords, "text")) . ",\n        redirect_url = " . $db->quote(scrubData($this->_redirect_url, "text")) . ",\n        active = " . $db->quote(scrubData($this->_active, "integer")) . ",\n        type = " . $db->quote(scrubData($this->_type, "text")) . ",\n        header = " . $db->quote(scrubData($this->_header, "text")) . ",\n        extra = " . $db->quote($json_extra) . "\n        WHERE subject_id = " . scrubData($this->_subject_id, "integer");
     $rUpSubject = $db->exec($qUpSubject);
     /////////////////////
     // clear staff_subject
     /////////////////////
     $qClearSS = "DELETE FROM staff_subject WHERE subject_id = " . $this->_subject_id;
     $rClearSS = $db->exec($qClearSS);
     $this->_debug .= "<p>2. clear staff_subject: {$qClearSS}</p>";
     /////////////////////
     // insert into staff_subject
     ////////////////////
     self::modifySS();
     /////////////////////
     // clear subject_subject -- for parent-child relationships
     /////////////////////
     $qClearSubS = "DELETE FROM subject_subject WHERE subject_child = " . $this->_subject_id;
     $rClearSubS = $db->exec($qClearSubS);
     $this->_debug .= "<p>2. clear subject_subject: {$qClearSubS}</p>";
     /////////////////////
     // insert into subject_subject
     ////////////////////
     self::modifySubSub();
     /////////////////////
     // clear subject_discipline
     /////////////////////
     if ($use_disciplines == TRUE) {
         $qClearSD = "DELETE FROM subject_discipline WHERE subject_id = " . $this->_subject_id;
         $rClearSD = $db->query($qClearSD);
         $this->_debug .= "<p>2. clear subject_discipline: {$qClearSD}</p>";
         /////////////////////
         // insert into subject_discipline
         ////////////////////
         self::modifySD();
     }
     // /////////////////////
     // Alter chchchanges table
     // table, flag, item_id, title, staff_id
     ////////////////////
     $updateChangeTable = changeMe("guide", "update", $this->_subject_id, $this->_subject, $_SESSION['staff_id']);
     if (isset($_REQUEST["wintype"]) && $_REQUEST["wintype"] == "pop") {
         $this->_message = _("Thy Will Be Done.  Guide updated.");
     } else {
         $this->_message = _("Thy Will Be Done.") . " <a href=\"guide.php?subject_id=" . $this->_subject_id . "\">" . _("Add Content To Your New Guide") . "</a>";
     }
 }
Exemplo n.º 4
0
 public function updateRecord($notrack = 0)
 {
     $db = new Querier();
     // dupe check
     /////////////////////
     // update title table
     /////////////////////
     $db = new Querier();
     $our_title = $db->quote(scrubData($this->_title));
     $our_alternate_title = $db->quote(scrubData($this->_alternate_title));
     $our_prefix = $db->quote(scrubData($this->_prefix));
     $qUpTitle = "UPDATE title SET title = " . $our_title . ", alternate_title = " . $our_alternate_title . ", description = " . $db->quote(scrubData($this->_description, "richtext")) . ", pre = " . $our_prefix . " WHERE title_id = " . scrubData($this->_title_id, "integer");
     $rUpTitle = $db->exec($qUpTitle);
     /////////////////////
     // clear rank
     /////////////////////
     $qClearRank = "DELETE FROM rank WHERE title_id = " . $this->_title_id;
     $rClearRank = $db->exec($qClearRank);
     $this->_debug .= "<p>2. clear rank: {$qClearRank}</p>";
     if ($rClearRank === FALSE) {
         echo blunDer("We have a problem with the clear rank query: {$qClearRank}");
     }
     /////////////////////
     // insert into rank
     ////////////////////
     self::modifyRank();
     // wipe entry from intervening table, location_title
     $qClearLoc = "DELETE FROM location_title WHERE title_id = " . scrubData($this->_title_id, "integer");
     $rClearLoc = $db->exec($qClearLoc);
     $this->_debug .= "<p>4. wipe location_title: {$qClearLoc}</p>";
     if ($rClearLoc === FALSE) {
         echo blunDer("We have a problem with the clear locations query: {$qClearLoc}");
     }
     /////////////////////
     // insert/update locations
     ////////////////////
     self::modifyLocation();
     // /////////////////////
     // Alter chchchanges table
     // table, flag, item_id, title, staff_id
     ////////////////////
     if ($notrack != 1) {
         $updateChangeTable = changeMe("record", "update", $this->_title_id, $our_title, $_SESSION['staff_id']);
     }
     // message
     $this->_message = _("Thy Will Be Done.  Record updated.");
 }
Exemplo n.º 5
0
 public function updateRecord()
 {
     /////////////////////
     // update talkback table
     /////////////////////
     $db = new Querier();
     $qUpTB = "UPDATE talkback SET question = " . $db->quote(scrubData($this->_question, 'text')) . ",\n\t  q_from = " . $db->quote(scrubData($this->_q_from, 'text')) . ",\n\t  answer = " . $db->quote(scrubData($this->_answer, 'richtext')) . ",";
     if ($this->_a_from == '') {
         $qUpTB .= "a_from = NULL,";
     } else {
         $qUpTB .= "a_from = " . $db->quote(scrubData($this->_a_from, 'text')) . ",";
     }
     $qUpTB .= "display = " . $db->quote(scrubData($this->_display, 'integer')) . ",\n      \n      tbtags = " . $db->quote(scrubData($this->_tbtags, 'text')) . ",\n      cattags = " . $db->quote(scrubData($this->_cattags, 'text')) . "\n      \n      WHERE talkback_id = " . scrubData($this->_talkback_id, 'integer');
     //print $qUpTB;
     $rUpTB = $db->exec($qUpTB);
     // /////////////////////
     // Alter chchchanges table
     // table, flag, item_id, title, staff_id
     ////////////////////
     $updateChangeTable = changeMe("talkback", "update", $this->_talkback_id, $this->_question, $_SESSION['staff_id']);
     // message
     $this->_message = _("Thy Will Be Done.  Updated.");
 }
Exemplo n.º 6
0
 public function updateBio($new_bio)
 {
     $q = "UPDATE staff SET bio = '" . $db->quote(scrubData($new_bio, "richtext")) . "' WHERE staff_id = " . $this->_staff_id;
     $this->_debug = "<p class=\"debug\">Bio Update query: {$q}</p>";
     $r = $db->query($q);
     if ($r) {
         $updateChangeTable = changeMe("staff", "update", $this->_staff_id, "bio update", $_SESSION['staff_id']);
         return TRUE;
     }
 }
Exemplo n.º 7
0
 public function updateRecord()
 {
     $db = new Querier();
     /////////////////////
     // update video table
     /////////////////////
     //   print "UPDATE RECORD!!!";
     $qUpVid = "UPDATE video SET title = " . $db->quote($this->_title) . ", description = " . $db->quote(scrubData($this->_description, 'text')) . "," . "source = " . $db->quote($this->_source) . "," . "foreign_id = " . $db->quote($this->_foreign_id) . "," . "duration = " . $db->quote($this->_duration) . "," . "date =  " . $db->quote($this->_date) . "," . "display = " . $db->quote($this->_display) . "," . "vtags =  " . $db->quote($this->_vtags) . "WHERE video_id = " . $db->quote($this->_video_id);
     //print $qUpVid;
     $rUpVid = $db->exec($qUpVid);
     // /////////////////////
     // Alter chchchanges table
     // table, flag, item_id, title, staff_id
     ////////////////////
     $updateChangeTable = changeMe("video", "update", $this->_video_id, $this->_title, $_SESSION['staff_id']);
     // message
     $this->_message = _("Thy Will Be Done.  Updated.");
 }