示例#1
0
 /**
  * sets pvausearchterms for user ID
  *
  *@throws MySQLConnectionException if a problem with MySQL happened
  */
 function SetSearchterms($uid, $searchterms)
 {
     $searchterms = str_replace('"', '\'', $searchterms);
     if (isset($uid)) {
         if ($this->existsEntry("ID", $uid)) {
             parent::alterEntry($uid, 'searchterms', sql_prev_inj($searchterms));
         } else {
             $this->addEntry("ID", $uid, "searchterms", sql_prev_inj($searchterms));
             return false;
         }
     }
 }
示例#2
0
 public function setColor($pc_ID, $color)
 {
     try {
         $ids = TableManager::getTableData(sprintf("pc_ID=%s", $pc_ID));
         foreach ($ids as &$id) {
             TableManager::alterEntry($id['ID'], 'color', $color);
         }
     } catch (Exception $e) {
         echo "Error getting priceclass: " . $e->getMessage();
         die;
     }
 }
示例#3
0
 /**
  * edit a book entry by given id
  */
 function editBook($id, $subjectId, $class, $title, $author, $publisher, $isbn, $price, $bundle)
 {
     parent::alterEntry($id, 'subjectId', $subjectId, 'class', $class, 'title', $title, 'author', $author, 'publisher', $publisher, 'isbn', $isbn, 'price', $price, 'bundle', $bundle);
 }
示例#4
0
 /**
  * Alters the Userdata of a given User
  * Enter description here ...
  * @param unknown_type $old_id The "old" ID, the ID of the user he has before the change
  * @param unknown_type $id The new ID
  * @param unknown_type $name The new Name
  * @param unknown_type $forename
  * @param unknown_type $username
  * @param unknown_type $passwd The (already hashed!) password
  * @param unknown_type $birthday The birthday (format YYYY-MM-DD)
  * @param unknown_type $credit
  * @param unknown_type $GID
  * @param unknown_type $locked
  */
 function alterUser($old_id, $id, $name, $forename, $username, $passwd, $birthday, $credit, $GID, $locked, $soli, $class)
 {
     if (isset($passwd) && $passwd != "d41d8cd98f00b204e9800998ecf8427e") {
         parent::alterEntry($old_id, 'ID', $id, 'forename', $forename, 'name', $name, 'username', $username, 'password', $passwd, 'birthday', $birthday, 'credit', $credit, 'GID', $GID, 'locked', $locked, 'soli', $soli, 'class', $class);
     } else {
         parent::alterEntry($old_id, 'ID', $id, 'forename', $forename, 'name', $name, 'username', $username, 'birthday', $birthday, 'credit', $credit, 'GID', $GID, 'locked', $locked, 'soli', $soli, 'class', $class);
     }
 }
示例#5
0
 /**
  * If CardID was changed, this function adds 1 to changed_cardID on the MySQL-Server
  * Enter description here ...
  *
  * @param $ID The ID of the object in the cards-table, which cardnumber was changed
  */
 function addCardIdChange($ID)
 {
     $card = parent::getEntryData($ID);
     if ($card != NULL) {
         try {
             parent::alterEntry($ID, 'changed_cardID', $card['changed_cardID'] + 1);
         } catch (Exception $e) {
             throw new Exception('could not alter the card-entry:' . $e->getMessage());
         }
     } else {
         throw new Exception('could not get the card!');
     }
 }
示例#6
0
 /**
  * sets fits
  *
  *@throws MySQLConnectionException if a problem with MySQL happened
  */
 function SetFits($uid, $hasFits, $fitsYear)
 {
     if (isset($uid)) {
         parent::alterEntry($uid, 'passedTest', $hasFits, 'schoolyear', $fitsYear);
     }
 }
示例#7
0
 function changePriceClass($old_ID, $name, $GID, $price, $ID)
 {
     TableManager::alterEntry($old_ID, 'name', $name, 'GID', $GID, 'price', $price, 'ID', $ID);
 }