Exemplo n.º 1
0
 /**
  * Gets last news
  *
  * @access public
  * @return array Result
  */
 public function getLast()
 {
     $query = 'SELECT distinct(kla_posts.id), title, content, date, author, name as photo, post_id, description
         FROM kla_posts 
         LEFT JOIN kla_photos ON kla_posts.id = kla_photos.post_id
         ORDER BY id DESC LIMIT 2';
     $result = $this->db->fetchAll($query);
     return !$result ? array() : $result;
 }
Exemplo n.º 2
0
 /**
  * Gets all events
  *
  * @access public
  * @return array Result
  */
 public function getAll()
 {
     $query = 'SELECT kla_events.id, kla_events.name, kla_events.date, kla_events.price, kla_events.info,
         kla_places.name as place, kla_places.name as meeting,
         kla_types.name as type
         FROM kla_events
         LEFT JOIN kla_places ON kla_places.id = kla_events.place OR kla_places.id = kla_events.meeting
         JOIN kla_types ON kla_types.id = kla_events.type_id
         ORDER BY kla_events.id;';
     $result = $this->db->fetchAll($query);
     return !$result ? array() : $result;
 }
Exemplo n.º 3
0
 /**
  * Gets all images.
  *
  * @access public
  * @return array Result
  */
 public function getAllImages()
 {
     $query = '
     SELECT
         images.id, images.name, images.title
     FROM
         images
     ORDER BY
        images.date DESC;
     ';
     $result = $this->db->fetchAll($query);
     return !$result ? array() : $result;
 }
Exemplo n.º 4
0
 /**
  * Gets all albums.
  *
  * @access public
  * @return array Result
  */
 public function getAll()
 {
     $query = '
     SELECT
         comments.id, comments.comment, comments.user_id, users.login
     FROM
         comments
     INNER JOIN
       users
     ON
         comments.user_id=users.id
     ORDER BY
         comments.data DESC;
     ';
     $result = $this->db->fetchAll($query);
     return !$result ? array() : $result;
 }