Beispiel #1
0
 function catchError($balErr, $authErr = '')
 {
     $mssg = $balErr . $authErr;
     if ($this->record_id and $mssg) {
         $sql = "UPDATE records SET status=-1 WHERE record_id={$this->record_id}";
         $rowCount = DBquery::update($sql);
         if (!$rowCount) {
             Error::http(403, "Affected rows=0.");
         }
     }
     if ($mssg) {
         Error::http(403, $mssg);
     }
 }
Beispiel #2
0
 function verifyCartMatch($toBrandID)
 {
     $mssg = "";
     $sql = "SELECT user_id, brand_id, price FROM carts WHERE cart_id=?";
     $row = DBquery::get($sql, array($this->cart_id));
     if ($row[0]['brand_id'] != $toBrandID) {
         $mssg = "The to-account brand must match the cart brand_id.";
     }
     if (!$mssg and !$row[0]['user_id']) {
         $sql = "UPDATE carts SET user_id={$this->from_user} WHERE cart_id=?";
         $mssg = DBquery::update($sql, array($this->cart_id));
         return $mssg;
     } else {
         if ($row[0]['user_id'] != $this->from_user) {
             $mssg .= "The cart user must match the from_user id. ";
         }
     }
     $this->cart = $row[0];
     return $mssg;
 }