Exemplo n.º 1
0
 /**
  * Gets responses to tickets by a User ID. This would be good to do to see
  * someone's progress with tickets
  * 
  * @param type $uid
  * @return boolean
  */
 public function getTicketResponseByUid($uid)
 {
     $q = 'SELECT ' . $this->fields . ' FROM ticketResponses WHERE uid = :uid';
     $this->stmt = $this->db->prepare($q);
     $this->stmt->bindParam(':uid', $uid, \PDO::PARAM_INT);
     $this->stmt->execute();
     $data = $this->stmt->fetch(\PDO::FETCH_ASSOC);
     if ($this->stmt->rowCount() > 0) {
         parent::setData($data);
         return true;
     } else {
         return false;
     }
 }
Exemplo n.º 2
0
 /**
  * Retrieves all of a user's ticket.
  * 
  * @param int $uid ID of the user
  * @return bool
  */
 public function getTicketRootByUid($uid)
 {
     $q = 'SELECT * FROM ticketRoot WHERE uid = :uid and status != -1 LIMIT 1';
     $this->stmt = $this->db->prepare($q);
     $this->stmt->bindParam(':uid', $uid, \PDO::PARAM_INT);
     $this->stmt->execute();
     $data = $this->stmt->fetch(\PDO::FETCH_ASSOC);
     if ($this->stmt->rowCount() > 0) {
         parent::setData($data);
         return true;
     } else {
         return false;
     }
 }