Esempio n. 1
0
 public static function section($slug)
 {
     $db = \helpers\database::get();
     try {
         return $db->select("SELECT * FROM category WHERE category_slug = :slug", array('slug' => $slug));
     } catch (Exception $e) {
         return null;
     }
 }
Esempio n. 2
0
 public static function findSlug($title)
 {
     $db = \helpers\database::get();
     try {
         $record = $db->select("SELECT * FROM album WHERE album_name = :name ", array('name' => $title));
         return $record->album_id;
     } catch (Exception $e) {
         return null;
     }
 }
Esempio n. 3
0
 public function __construct()
 {
     //connect to PDO here.
     $this->_db = \helpers\database::get();
 }
Esempio n. 4
0
 public static function otherMenu($page_id)
 {
     $db = \helpers\database::get();
     return $db->select("SELECT * FROM page \r\n        \tLEFT JOIN page_content ON page_content.page_content_page_id = page.page_id\r\n        \tLEFT JOIN category ON category.category_id = page.page_category_id\r\n        \tWHERE category.category_title = :sectn \r\n\t\t\tAND category.category_slug = :group \r\n        \tAND page_content.page_content_subto = :subto \r\n        \tAND page_content.page_content_header_menu = :header \r\n        \tORDER BY page.page_sort_order ASC", array('sectn' => 'sub-link', 'group' => 'page', 'subto' => $page_id, 'header' => 1));
 }
Esempio n. 5
0
 public function savedb()
 {
     $db_helper = \helpers\database::get();
     $data = $db_helper->dump();
     $save_path = BASE_PATH . DS . 'app' . DS . 'templates' . DS . 'push';
     $openfile = fopen($save_path . DS . 'push.sql', "w");
     fwrite($openfile, $data);
     fclose($openfile);
 }