Exemplo n.º 1
2
 public function loadpage($obj, $c)
 {
     // load constructor
     $s2 = $obj->url("segment", 2);
     $file = $obj->url_last();
     // select page types
     $type_obj = new page_type();
     $page_type = $type_obj->get_page_type($c);
     $get_ip = new get_ip();
     $ip = $get_ip->ip;
     if ($c['website.mode'] == "UnderDeveloper" && !in_array($ip, $c['allowes.ips'])) {
         // if under developer
         $controller = "controller/under.php";
         if (file_exists($controller)) {
             $controller = new under($c);
         } else {
             $controller = new error_page();
         }
     } else {
         if ($file == 'cron') {
             //insertemail
             // if under developer
             $controller = "controller/cron.php";
             if (file_exists($controller)) {
                 $controller = new cron($c);
             } else {
                 $controller = new error_page();
             }
         } else {
             if ($file == 'ajax') {
                 //insertemail
                 // if under developer
                 $controller = "controller/ajax.php";
                 if (file_exists($controller)) {
                     $controller = new ajax($c);
                 } else {
                     $controller = new error_page();
                 }
             } else {
                 if ($file == 'sendemail') {
                     //
                     // if under developer
                     $controller = "controller/sendemail.php";
                     if (file_exists($controller)) {
                         $controller = new sendemail();
                     } else {
                         $controller = new error_page();
                     }
                 } else {
                     if ($file == 'insertemail') {
                         //
                         // if under developer
                         $controller = "controller/insertemail.php";
                         if (file_exists($controller)) {
                             $controller = new insertemail($c);
                         } else {
                             $controller = new error_page();
                         }
                     } else {
                         if ($obj->url("segment", 1) == 'unsubscribe') {
                             // if under developer
                             $controller = "controller/unsubscribe.php";
                             if (file_exists($controller)) {
                                 $encr = $obj->url("segment", 2);
                                 $controller = new unsubscribe($c, $encr);
                             } else {
                                 $controller = new error_page();
                             }
                         } else {
                             if ($file == $c['admin.slug']) {
                                 // administrator page
                                 $controller = "controller/admin.php";
                                 if (file_exists($controller)) {
                                     $controller = new admin($obj, $c);
                                 } else {
                                     $controller = new error_page();
                                 }
                             } else {
                                 if ($file == "session_timeout") {
                                     $controller_sessiontime = 'controller/session_timeout.php';
                                     if (file_exists($controller_sessiontime)) {
                                         $controller = new session_timeout();
                                     }
                                 } else {
                                     if ($file == "ajaxloadoptions") {
                                         $controller_ajaxloadoptions = 'controller/ajaxloadoptions.php';
                                         if (file_exists($controller_ajaxloadoptions)) {
                                             $controller = new ajaxloadoptions();
                                         }
                                     } else {
                                         if ($s2 == "gallery") {
                                             $controller_gallery = 'controller/gallery.php';
                                             if (file_exists($controller_gallery)) {
                                                 $controller = new gallery();
                                             }
                                         } else {
                                             if ($file == "invoices") {
                                                 $controller_ajaxloadoptions = 'controller/invoices.php';
                                                 if (file_exists($controller_ajaxloadoptions)) {
                                                     $controller = new invoices($obj, $c);
                                                 }
                                             } else {
                                                 if ($file == "ajaxmoveimage") {
                                                     $controller_ajaxmoveimage = 'controller/ajaxmoveimage.php';
                                                     if (file_exists($controller_ajaxmoveimage)) {
                                                         $controller = new ajaxmoveimage();
                                                     }
                                                 } else {
                                                     if ($file == "ajaxupload") {
                                                         $controller_ajaxupload = 'controller/ajaxupload.php';
                                                         if (file_exists($controller_ajaxupload)) {
                                                             $controller = new ajaxupload();
                                                         }
                                                     } else {
                                                         if ($file == "image") {
                                                             $controller_image = 'controller/image.php';
                                                             if (file_exists($controller_image)) {
                                                                 $controller = new image();
                                                             }
                                                         } else {
                                                             $get_slug_from_url = new get_slug_from_url();
                                                             $slug = $get_slug_from_url->slug();
                                                             $slug_ = str_replace(array("/", "\\"), array("", ""), strip_tags(urlencode($slug)));
                                                             $id = (int) Input::method("GET", "id");
                                                             $v = (int) Input::method("GET", "v");
                                                             $pn = (int) Input::method("GET", "pn");
                                                             $cache_file = "_cache/" . $type . $slug_ . $id . $v . $pn . LANG_ID . ".html";
                                                             //select page types
                                                             $get_page_type = new get_page_type();
                                                             $page_type = $get_page_type->type_page($c);
                                                             if (file_exists($cache_file) && $page_type != "eventpage") {
                                                                 @(include $cache_file);
                                                             } else {
                                                                 ob_start();
                                                                 if ($file != "admin") {
                                                                     // load pages
                                                                     // text pages
                                                                     $controller_text = "controller/text.php";
                                                                     // home page
                                                                     $controller_home = "controller/homepage.php";
                                                                     // photo gallery page
                                                                     $controller_photo_gallery = "controller/photogallery.php";
                                                                     // video gallery page
                                                                     $contoller_video_gallery = "controller/videogallery.php";
                                                                     // catalog page
                                                                     $controller_catalog = "controller/catalog.php";
                                                                     // custom page
                                                                     $cust = str_replace("-", "", $file);
                                                                     $controller_custom = "controller/custom/" . $cust . ".php";
                                                                     //event page
                                                                     $controller_event = "controller/events.php";
                                                                     //eventsinside page
                                                                     $controller_eventsinside = "controller/eventsinside.php";
                                                                     //news page
                                                                     $controller_news = "controller/news.php";
                                                                     //news inside page
                                                                     $controller_news_inside = "controller/news_inside.php";
                                                                     // event inside page
                                                                     $controller_events_inside = "controller/eventinside.php";
                                                                     //publication page
                                                                     $controller_publication = "controller/publication.php";
                                                                     // team page
                                                                     $controller_team = "controller/team.php";
                                                                     // administrator pages
                                                                     $controller = "controller/" . $file . ".php";
                                                                     // session timeout
                                                                     $controller_sessiontime = "controller/session_timeout.php";
                                                                     //product page
                                                                     $controller_product = "controller/product.php";
                                                                     // error page
                                                                     $controller_errorpage = "controller/error_page.php";
                                                                     if (empty($page_type) || $page_type == "error_page") {
                                                                         if (file_exists($controller_home)) {
                                                                             $controller = new $c["welcome.page.class"]($c);
                                                                         }
                                                                     } else {
                                                                         //echo $page_type;
                                                                         switch ($page_type) {
                                                                             case 'homepage':
                                                                                 if (file_exists($controller_home)) {
                                                                                     $controller = new homepage($c);
                                                                                 }
                                                                                 break;
                                                                             case 'session_timeout':
                                                                                 if (file_exists($controller_sessiontime)) {
                                                                                     $controller = new session_timeout();
                                                                                 }
                                                                                 break;
                                                                             case 'textpage':
                                                                                 if (file_exists($controller_text)) {
                                                                                     $controller = new text($c);
                                                                                 }
                                                                                 break;
                                                                             case 'photogallerypage':
                                                                                 if (file_exists($controller_photo_gallery)) {
                                                                                     $controller = new photogallery($c);
                                                                                 }
                                                                                 break;
                                                                             case 'videogallerypage':
                                                                                 if (file_exists($contoller_video_gallery)) {
                                                                                     $controller = new videogallery($c);
                                                                                 }
                                                                                 break;
                                                                             case 'catalogpage':
                                                                                 if (file_exists($controller_catalog)) {
                                                                                     $controller = new catalog($c);
                                                                                 }
                                                                                 break;
                                                                             case 'custompage':
                                                                                 if (file_exists($controller_custom)) {
                                                                                     $controller = new $cust($c);
                                                                                 }
                                                                                 break;
                                                                             case 'eventpage':
                                                                                 if (file_exists($controller_event)) {
                                                                                     $controller = new events($c);
                                                                                 }
                                                                                 break;
                                                                             case 'eventsinside':
                                                                                 if (file_exists($controller_eventsinside)) {
                                                                                     $controller = new eventsinside($c);
                                                                                 }
                                                                                 break;
                                                                             case 'newspage':
                                                                                 if (file_exists($controller_news)) {
                                                                                     $controller = new news($c);
                                                                                 }
                                                                                 break;
                                                                             case 'newsinside':
                                                                                 if (file_exists($controller_news_inside)) {
                                                                                     $controller = new news_inside($c);
                                                                                 }
                                                                                 break;
                                                                             case 'publicationpage':
                                                                                 if (file_exists($controller_publication)) {
                                                                                     $controller = new publication($c);
                                                                                 }
                                                                                 break;
                                                                             case 'teampage':
                                                                                 if (file_exists($controller_team)) {
                                                                                     $controller = new team($c);
                                                                                 }
                                                                                 break;
                                                                             case 'product':
                                                                                 if (file_exists($controller_product)) {
                                                                                     $controller = new product($c);
                                                                                 }
                                                                                 break;
                                                                             case 'error_page':
                                                                                 if (file_exists($controller_errorpage)) {
                                                                                     $controller = new error_page();
                                                                                 }
                                                                                 break;
                                                                             default:
                                                                                 if (file_exists($controller)) {
                                                                                     $controller = new $file($obj, $c);
                                                                                 }
                                                                                 break;
                                                                         }
                                                                     }
                                                                 } else {
                                                                     $controller = new error_page();
                                                                 }
                                                                 $content = ob_get_contents();
                                                                 ob_clean();
                                                                 $fh = @fopen($cache_file, 'w') or die("Error opening output file");
                                                                 @fwrite($fh, $content);
                                                                 @fclose($fh);
                                                                 @(include $cache_file);
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     }
 }
 public function left($menu_array)
 {
     $get_slug_from_url = new get_slug_from_url();
     $slug = $get_slug_from_url->slug();
     $o = '';
     $obj = new url_controll();
     $third_segment = $obj->url("segment", 2) . "/" . $obj->url("segment", 3);
     if (is_array($menu_array)) {
         foreach ($menu_array as $val) {
             $active = $val->slug == $third_segment ? 'active' : '';
             if ($val->redirectlink != "false" && !empty($val->redirectlink)) {
                 $gotoUrl = $val->redirectlink;
             } else {
                 $gotoUrl = MAIN_DIR . $val->slug;
             }
             $o .= '<li class="' . $active . '"><a href="' . $gotoUrl . '">' . $val->title . '</a></li>';
         }
     }
     return $o;
 }
Exemplo n.º 3
0
    public function recreate_cache($c, $type, $cache_file)
    {
        $conn = $this->conn($c);
        switch ($type) {
            case "homepage_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                //$slug = "welcome";
                $sql = 'SELECT * FROM `studio404_pages` WHERE `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "select_form":
                $cid = Input::method("GET", "parent");
                $select_form = new select_form();
                $fetch = $select_form->form($c, $cid, LANG_ID);
                break;
            case "catalog_table_columns":
                $sql = 'SHOW COLUMNS FROM `studio404_module_item`';
                $prepare = $conn->prepare($sql);
                $prepare->execute();
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "catalog_table_list":
                $sql = 'SELECT `attach_column`,`label` FROM `studio404_forms` WHERE `cid`=:cid AND `list`="yes" AND `lang`=:lang ORDER BY `id` ASC';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":cid" => Input::method("GET", "idx"), ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "catalogitems":
                $offset = Input::method("GET", "pn") ? Input::method("GET", "pn") - 1 : 0;
                $sw = Input::method("GET", "sw") && is_numeric(Input::method("GET", "sw")) ? Input::method("GET", "sw") : 10;
                if (!Input::method("GET", "pn") || !is_numeric(Input::method("GET", "pn"))) {
                    $offset = 0;
                }
                $sql = 'SELECT 
			`studio404_module_item`.*
			FROM `studio404_module_item` WHERE 
			FIND_IN_SET(' . Input::method("GET", "idx") . ', `studio404_module_item`.`cataloglist`) AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status ORDER BY `id` DESC LIMIT ' . $offset . ', ' . $sw;
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "catalogitemsnovisiable":
                $offset = Input::method("GET", "pn") ? Input::method("GET", "pn") - 1 : 0;
                $sw = Input::method("GET", "sw") && is_numeric(Input::method("GET", "sw")) ? Input::method("GET", "sw") : 10;
                if (!Input::method("GET", "pn") || !is_numeric(Input::method("GET", "pn"))) {
                    $offset = 0;
                }
                $sql = 'SELECT 
			`studio404_module_item`.*
			FROM `studio404_module_item` WHERE 
			`module_idx`=25 AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`=:visibility AND 
			`studio404_module_item`.`status`!=:status ORDER BY `id` DESC LIMIT ' . $offset . ', ' . $sw;
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "form":
                $sql = 'SELECT * FROM `studio404_forms` WHERE `cid`=:cid AND `lang`=:lang ORDER BY `id` ASC';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":cid" => Input::method("GET", "parent"), ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "welcomepage_categories":
                $sql = 'SELECT `idx`,`title`,`slug` FROM `studio404_pages` WHERE `cid`=:cid AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status ORDER BY `position` ASC';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":cid" => 4, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = array();
                if ($prepare->rowCount() > 0) {
                    $tt = $prepare->fetchAll(PDO::FETCH_ASSOC);
                    foreach ($tt as $value) {
                        $sql2 = 'SELECT `idx`,`cid`,`title`,`slug` FROM `studio404_pages` WHERE `cid`=:cid AND `lang`=:lang AND `visibility`!=:one AND `status`!=:one ORDER BY `position` ASC';
                        $prepare2 = $conn->prepare($sql2);
                        $prepare2->execute(array(":cid" => $value['idx'], ":lang" => LANG_ID, ":one" => 1));
                        $fetch["item"]['idx'][] = $value['idx'];
                        $fetch["item"]['title'][] = $value['title'];
                        $fetch["item"]['slug'][] = $value['slug'];
                        if ($prepare2->rowCount() > 0) {
                            $fetch2 = $prepare2->fetchAll(PDO::FETCH_ASSOC);
                            foreach ($fetch2 as $value2) {
                                $fetch["item"]['sub'][$value['idx']]['idx'][] = $value2['idx'];
                                $fetch["item"]['sub'][$value['idx']]['cid'][] = $value2['cid'];
                                $fetch["item"]['sub'][$value['idx']]['title'][] = $value2['title'];
                                $fetch["item"]['sub'][$value['idx']]['slug'][] = $value2['slug'];
                            }
                        }
                    }
                }
                break;
            case "text_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_pages` WHERE `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "userlist":
                $sql = 'SELECT `id`,`username`,`namelname`,`email`,`user_type`,`picture` FROM `studio404_users` WHERE `user_type`!="administrator" AND `status`!=1 ORDER BY `id` DESC';
                $prepare = $conn->prepare($sql);
                $prepare->execute();
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "team_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_pages` WHERE `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "cataloglist":
                $sql = 'SELECT `idx`,`cid`,`title`,`slug`,`position` FROM `studio404_pages` WHERE `cid`=:cid AND `lang`=:lang AND `status`!=1 ORDER BY `position` ASC';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":cid" => 4, ":lang" => LANG_ID));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                break;
            case "catalog_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_pages` WHERE `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "publication_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_pages` WHERE `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "news_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			( 
				SELECT `studio404_gallery_file`.`file` FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1 
			) AS pic 
			FROM `studio404_module_item` WHERE 
			`studio404_module_item`.`slug`=:slug AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status ';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'newspage', ":media_type" => 'photo', ":slug" => $slug, ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "news_list":
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			( 
				SELECT `studio404_gallery_file`.`file` FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1 
			) AS pic 
			FROM 
			`studio404_pages`,`studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`page_type`=:pagetype AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` DESC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'newspage', ":media_type" => 'photo', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "event_list":
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			( 
				SELECT `studio404_gallery_file`.`file` FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1 
			) AS pic 
			FROM 
			`studio404_pages`,`studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`page_type`=:pagetype AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` DESC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'eventpage', ":media_type" => 'photo', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "team_list":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.`idx` AS smi_idx, 
			`studio404_module_item`.`title` AS namelname 
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item`  
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":media_type" => 'photo', ":media_type_doc" => 'document', ":pagetype" => 'teampage', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                // $fetch = $prepare->fetchAll(PDO::FETCH_CLASS,'db_team');
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "catalog_list":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			(
				SELECT 
				`studio404_gallery_file`.`file` 
				FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS pic, 
			(
				SELECT 
				`studio404_gallery_file`.`file` 
				FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type_doc AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS doc  
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item`  
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'catalogpage', ":media_type" => 'photo', ":media_type_doc" => 'document', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "catalog_info_comments_list":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.`idx` AS smi_idx,  
			`studio404_module_item`.`uid` AS smi_uid,  
			`studio404_module_item`.`date` AS smi_date,  
			`studio404_module_item`.`module_idx` AS smi_module_idx,  
			`studio404_module_item`.`title` AS smi_title,  
			`studio404_module_item`.`short_description` AS smi_short_description,  
			`studio404_module_item`.`long_description` AS smi_long_description,  
			`studio404_module_item`.`tags` AS smi_tags,  
			`studio404_module_item`.`slug` AS smi_slug   
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item`  
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'catalogpage', ":media_type" => 'photo', ":media_type_doc" => 'document', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_CLASS, "db_catalog");
                break;
            case "publication_list":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			(
				SELECT 
				`studio404_gallery_file`.`file` 
				FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS pic, 
			(
				SELECT 
				`studio404_gallery_file`.`file` 
				FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type_doc AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS doc   
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item`  
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'publicationpage', ":media_type" => 'photo', ":media_type_doc" => 'document', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "homepage_files":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_gallery_file`.*
			FROM 
			`studio404_pages`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":media_type" => 'photo', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "text_files":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_pages`.`idx` as midx, 
			`studio404_gallery_file`.*
			FROM 
			`studio404_pages`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_pages`.`page_type`=`studio404_gallery_attachment`.`pagetype` AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":media_type" => 'photo', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "last_news_files":
                $sql = 'SELECT 
			`studio404_module_item`.* 
			FROM 
			`studio404_pages`,`studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`page_type`=:pagetype AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` DESC LIMIT 1
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'newspage', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $f = $prepare->fetchAll(PDO::FETCH_ASSOC);
                $slug = $f[0]["slug"];
                $sql = 'SELECT 
			`studio404_gallery_file`.*
			FROM 
			`studio404_module_item`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_module_item`.`slug`=:slug AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status AND 
			`studio404_module_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`pagetype`="newspage" AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":media_type" => 'photo', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "news_files":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_gallery_file`.*
			FROM 
			`studio404_module_item`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_module_item`.`slug`=:slug AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status AND 
			`studio404_module_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`pagetype`="newspage" AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":media_type" => 'photo', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "text_documents":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_pages`.`idx` as midx, 
			`studio404_gallery_file`.*
			FROM 
			`studio404_pages`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_pages`.`page_type`=`studio404_gallery_attachment`.`pagetype` AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":media_type" => 'document', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "news_documents":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_gallery_file`.*
			FROM 
			`studio404_module_item`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_module_item`.`slug`=:slug AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status AND 
			`studio404_module_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`pagetype`="newspage" AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":media_type" => 'document', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "components":
                $sql = 'SELECT 
			`studio404_components`.`name` AS com_name,  
			`studio404_components_inside`.* 
			FROM 
			`studio404_components`,`studio404_components_inside`
			WHERE 
			`studio404_components`.`status`!=:status AND 
			`studio404_components`.`id`=`studio404_components_inside`.`cid` AND  
			`studio404_components_inside`.`lang`=:lang AND  
			`studio404_components_inside`.`status`!=:status 
			ORDER BY `studio404_components_inside`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "languages":
                $sql = 'SELECT * FROM `studio404_language` WHERE `status`=:status AND `variable`=:false';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":false" => 'false'));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "language_data":
                $sql = 'SELECT * FROM `studio404_language` WHERE `status`!=:status AND `variable`!=:false AND `langs`=:lang';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":false" => 'false', ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "main_menu":
                $sql = 'SELECT * FROM `studio404_pages` WHERE `status`!=:status AND `menu_type`!=:super AND `lang`=:lang AND `visibility`!=:visibility AND `cid`=:cid ORDER BY `position` ASC';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":super" => 'super', ":lang" => LANG_ID, ":visibility" => 1, ":cid" => 1));
                $f = $prepare->fetchAll(PDO::FETCH_ASSOC);
                $fetch = $this->sub_menu($c, $f);
                break;
            case "structure":
                $sql = 'SELECT `idx`,`title`,`shorttitle` FROM `studio404_pages` WHERE `status`!=:status AND `menu_type`!=:super AND `lang`=:lang AND `visibility`!=:visibility AND `cid`=:cid ORDER BY `position` ASC';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":super" => 'super', ":lang" => LANG_ID, ":visibility" => 1, ":cid" => 46));
                $fetch = $prepare->fetchAll(PDO::FETCH_CLASS, "db_structure");
                break;
            case "left_menu":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT `idx`,`cid` FROM `studio404_pages` WHERE `slug`=:slug AND `status`!=:status AND `menu_type`!=:super AND `lang`=:lang AND `visibility`!=:visibility ORDER BY `position` ASC ';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":super" => 'super', ":lang" => LANG_ID, ":visibility" => 1, ":slug" => $slug));
                $f = $prepare->fetch(PDO::FETCH_ASSOC);
                if ($prepare->rowCount() <= 0) {
                    $sql3 = 'SELECT 
				`studio404_pages`.`cid` AS cid
				FROM 
				`studio404_module_item`, `studio404_module`, `studio404_module_attachment`, `studio404_pages` 
				WHERE 
				`studio404_module_item`.`slug`=:slug AND 
				`studio404_module_item`.`lang`=:lang AND 
				`studio404_module_item`.`visibility`!=:visibility AND 
				`studio404_module_item`.`status`!=:status AND 
				`studio404_module_item`.`module_idx`=`studio404_module`.`idx` AND 
				`studio404_module`.`lang`=:lang AND 
				`studio404_module`.`status`!=:status AND  
				`studio404_module`.`idx`=`studio404_module_attachment`.`idx` AND  
				`studio404_module_attachment`.`lang`=:lang AND  
				`studio404_module_attachment`.`status`!=:status AND  
				`studio404_module_attachment`.`connect_idx`=`studio404_pages`.`idx` AND  
				`studio404_pages`.`lang`=:lang AND  
				`studio404_pages`.`visibility`!=:visibility AND  
				`studio404_pages`.`status`!=:status 
				';
                    $prepare3 = $conn->prepare($sql3);
                    $prepare3->execute(array(":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1));
                    $f = $prepare3->fetchAll(PDO::FETCH_ASSOC);
                    $f = $f[0];
                }
                $sql2 = 'SELECT * FROM `studio404_pages` WHERE `cid`=:cid AND `status`!=:status AND `menu_type`!=:super AND `lang`=:lang AND `visibility`!=:visibility ORDER BY `position` ASC';
                $prepare2 = $conn->prepare($sql2);
                $prepare2->execute(array(":status" => 1, ":super" => 'super', ":lang" => LANG_ID, ":visibility" => 1, ":cid" => $f['idx']));
                $fetch = $prepare2->fetchAll(PDO::FETCH_ASSOC);
                if ($prepare2->rowCount() <= 0) {
                    $sql3 = 'SELECT * FROM `studio404_pages` WHERE `cid`=:cid AND `status`!=:status AND `menu_type`!=:super AND `lang`=:lang AND `visibility`!=:visibility ORDER BY `position` ASC';
                    $prepare3 = $conn->prepare($sql3);
                    $prepare3->execute(array(":status" => 1, ":super" => 'super', ":lang" => LANG_ID, ":visibility" => 1, ":cid" => $f['cid']));
                    $fetch = $prepare3->fetchAll(PDO::FETCH_ASSOC);
                }
                break;
            case "multimedia":
                $sql = 'SELECT 
			`studio404_gallery_file`.*, `studio404_gallery_file`.`gallery_idx` as x
			FROM 
			`studio404_pages`,`studio404_media_attachment`,`studio404_media`,`studio404_media_item`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_pages`.`page_type`=:videogallery AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_media_attachment`.`connect_idx` AND 
			`studio404_media_attachment`.`lang`=:lang AND 
			`studio404_media_attachment`.`status`!=:status AND 
			`studio404_media_attachment`.`idx`=`studio404_media`.`idx` AND 
			`studio404_media`.`lang`=:lang AND 
			`studio404_media`.`status`!=:status AND 
			`studio404_media`.`idx`=`studio404_media_item`.`media_idx` AND 
			`studio404_media_item`.`lang`=:lang AND 
			`studio404_media_item`.`visibility`!=:visibility AND 
			`studio404_media_item`.`status`!=:status AND 
			`studio404_media_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`pagetype`=:videogallery AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 2
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":videogallery" => 'videogallerypage', ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "news":
                $sql = 'SELECT 
			`studio404_module_item`.*
			FROM 
			`studio404_pages`,`studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`page_type`=:pagetype AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` DESC LIMIT 15 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'newspage', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "events":
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			( 
				SELECT `studio404_gallery_file`.`file` FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS pic 
			FROM 
			`studio404_pages`,`studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`page_type`=:pagetype AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` DESC LIMIT 15 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'eventpage', ":media_type" => 'photo', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "events_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.* 
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:page_type AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status ORDER BY `studio404_module_item`.`date` DESC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'eventpage', ":media_type" => 'photo', ":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1, ":page_type" => 'eventpage'));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "eventsinside_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT `studio404_module_item`.*,
			( 
				SELECT `studio404_gallery_file`.`file` FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS pic 
			FROM `studio404_module_item` WHERE 
			`studio404_module_item`.`slug`=:slug AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'eventpage', ":media_type" => 'photo', ":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "photo_gallery_list":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_gallery_attachment`.`idx` AS smi_idx, 
			`studio404_media_item`.`slug` AS smi_slug, 
			`studio404_media_item`.`title` AS sg_title, 
			(
				SELECT 
				`studio404_gallery_file`.`file` 
				FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_media_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:page_type AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS pic 
			FROM 
			`studio404_pages`, `studio404_media_attachment`, `studio404_media`, `studio404_media_item`, `studio404_gallery_attachment`, `studio404_gallery` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_media_attachment`.`connect_idx` AND 
			`studio404_media_attachment`.`page_type`=:page_type AND 
			`studio404_media_attachment`.`lang`=:lang AND 
			`studio404_media_attachment`.`status`!=:status AND 
			`studio404_media_attachment`.`idx`=`studio404_media`.`idx` AND 
			`studio404_media`.`lang`=:lang AND 
			`studio404_media`.`status`!=:status AND 
			`studio404_media`.`idx`=`studio404_media_item`.`media_idx` AND 
			`studio404_media_item`.`lang`=:lang AND 
			`studio404_media_item`.`visibility`!=:visibility AND 
			`studio404_media_item`.`status`!=:status AND 
			`studio404_media_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`pagetype`=:page_type AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status ORDER BY `studio404_media_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1, ":page_type" => 'photogallerypage', ":media_type" => 'photo'));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "files_":
                // $get_slug_from_url = new get_slug_from_url();
                // $slug = $get_slug_from_url->slug();
                if (Input::method("GET", "slug")) {
                    $slug = Input::method("GET", "slug");
                } else {
                    $cache = new cache();
                    $photo_gallery_list = $cache->index($c, "photo_gallery_list");
                    $data["photo_gallery_list"] = json_decode($photo_gallery_list);
                    $slug = $data["photo_gallery_list"][0]->smi_slug;
                }
                $sql = 'SELECT 
			`studio404_gallery_file`.* 
			FROM 
			`studio404_media_item`, `studio404_gallery_attachment`, `studio404_gallery`, `studio404_gallery_file` 
			WHERE 
			`studio404_media_item`.`slug`=:slug AND 
			`studio404_media_item`.`lang`=:lang AND 
			`studio404_media_item`.`visibility`!=:visibility AND 
			`studio404_media_item`.`status`!=:status AND 
			`studio404_media_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND  
			`studio404_gallery_attachment`.`pagetype`=:pagetype AND  
			`studio404_gallery_attachment`.`lang`=:lang AND  
			`studio404_gallery_attachment`.`status`!=:status AND  
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND   
			`studio404_gallery`.`lang`=:lang AND   
			`studio404_gallery`.`status`!=:status AND   
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND   
			`studio404_gallery_file`.`media_type`=:media_type AND   
			`studio404_gallery_file`.`lang`=:lang AND   
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC   
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1, ":pagetype" => 'photogallerypage', ":media_type" => 'photo'));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "videogallery_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_gallery_file`.* 
			FROM 
			`studio404_pages`,`studio404_media_attachment`,`studio404_media`,`studio404_media_item`,`studio404_gallery_attachment`, `studio404_gallery`, `studio404_gallery_file` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND  
			`studio404_pages`.`visibility`!=:visibility AND  
			`studio404_pages`.`status`!=:status AND  
			`studio404_pages`.`idx`=`studio404_media_attachment`.`connect_idx` AND  
			`studio404_media_attachment`.`lang`=:lang AND  
			`studio404_media_attachment`.`status`!=:status AND  
			`studio404_media_attachment`.`idx`=`studio404_media`.`idx` AND  
			`studio404_media`.`lang`=:lang AND  
			`studio404_media`.`status`!=:status AND   
			`studio404_media`.`idx`=`studio404_media_item`.`media_idx` AND   
			`studio404_media_item`.`lang`=:lang AND 
			`studio404_media_item`.`visibility`!=:visibility AND 
			`studio404_media_item`.`status`!=:status AND 
			`studio404_media_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND  
			`studio404_gallery_attachment`.`pagetype`=:pagetype AND  
			`studio404_gallery_attachment`.`lang`=:lang AND  
			`studio404_gallery_attachment`.`status`!=:status AND  
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND   
			`studio404_gallery`.`lang`=:lang AND   
			`studio404_gallery`.`status`!=:status AND   
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND   
			`studio404_gallery_file`.`media_type`=:media_type AND   
			`studio404_gallery_file`.`lang`=:lang AND   
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC   
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1, ":pagetype" => 'videogallerypage', ":media_type" => 'video'));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "breadcrups":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $fetch = $this->breakcrups($c, $slug);
                break;
            case "sector":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->sectors($c);
                break;
            case "subsector":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->subsector($c);
                break;
            case "products":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->products($c);
                break;
            case "countries":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->countries($c);
                break;
            case "certificates":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->certificates($c);
                break;
            case "companysize":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->companysize($c);
                break;
            case "hidden_team_list":
                $sql = 'SELECT 
			`studio404_module_item`.`idx` AS smi_idx, 
			`studio404_module_item`.`title` AS namelname 
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item`  
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":media_type" => 'photo', ":media_type_doc" => 'document', ":pagetype" => 'catalogpage', ":slug" => 'team', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "productinside":
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			(SELECT `studio404_users`.`company_type` FROM `studio404_users` WHERE `studio404_users`.`id`=`studio404_module_item`.`insert_admin`) AS com_type, 
			(SELECT `studio404_users`.`namelname` FROM `studio404_users` WHERE `studio404_users`.`id`=`studio404_module_item`.`insert_admin`) AS com_name, 
			(SELECT `studio404_pages`.`title` FROM `studio404_pages` WHERE `studio404_pages`.`idx`=`studio404_module_item`.`hscode`) AS hscode_title 
			FROM 
			 `studio404_module_item`
			 WHERE 
			 `studio404_module_item`.`insert_admin`=' . (int) Input::method("GET", "i") . ' AND 
			 `studio404_module_item`.`id`=' . (int) Input::method("GET", "p") . ' AND 
			 `studio404_module_item`.`status`!=:one
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":one" => 1));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
                    //$picture = ($fetch["picture"]) ? WEBSITE.'image?f='.WEBSITE.'files/usersproducts/'.$fetch["picture"].'&w=175&h=175' : '';
                }
                break;
        }
        if (count($fetch)) {
            $fh = @fopen($cache_file, 'w') or die("Error opening output file");
            @fwrite($fh, json_encode($fetch, JSON_UNESCAPED_UNICODE));
            @fclose($fh);
        }
    }
    public function recreate_cache($c, $type, $cache_file)
    {
        $conn = $this->conn($c);
        switch ($type) {
            case "homepage_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_pages` WHERE `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "text_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_pages` WHERE `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "team_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_pages` WHERE `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "catalog_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_pages` WHERE `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "publication_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_pages` WHERE `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "news_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			( 
				SELECT `studio404_gallery_file`.`file` FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1 
			) AS pic 
			FROM `studio404_module_item` WHERE 
			`studio404_module_item`.`slug`=:slug AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status ';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'newspage', ":media_type" => 'photo', ":slug" => $slug, ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "news_list":
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			( 
				SELECT `studio404_gallery_file`.`file` FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1 
			) AS pic 
			FROM 
			`studio404_pages`,`studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`page_type`=:pagetype AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` DESC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'newspage', ":media_type" => 'photo', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "event_list":
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			( 
				SELECT `studio404_gallery_file`.`file` FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1 
			) AS pic 
			FROM 
			`studio404_pages`,`studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`page_type`=:pagetype AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` DESC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'eventpage', ":media_type" => 'photo', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "team_list":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.`idx` AS smi_idx, 
			`studio404_module_item`.`title` AS namelname 
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item`  
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":media_type" => 'photo', ":media_type_doc" => 'document', ":pagetype" => 'teampage', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                // $fetch = $prepare->fetchAll(PDO::FETCH_CLASS,'db_team');
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "catalog_list":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			(
				SELECT 
				`studio404_gallery_file`.`file` 
				FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS pic, 
			(
				SELECT 
				`studio404_gallery_file`.`file` 
				FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type_doc AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS doc  
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item`  
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'catalogpage', ":media_type" => 'photo', ":media_type_doc" => 'document', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "catalog_info_comments_list":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.`idx` AS smi_idx,  
			`studio404_module_item`.`uid` AS smi_uid,  
			`studio404_module_item`.`date` AS smi_date,  
			`studio404_module_item`.`module_idx` AS smi_module_idx,  
			`studio404_module_item`.`title` AS smi_title,  
			`studio404_module_item`.`short_description` AS smi_short_description,  
			`studio404_module_item`.`long_description` AS smi_long_description,  
			`studio404_module_item`.`tags` AS smi_tags,  
			`studio404_module_item`.`slug` AS smi_slug   
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item`  
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'catalogpage', ":media_type" => 'photo', ":media_type_doc" => 'document', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_CLASS, "db_catalog");
                break;
            case "publication_list":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			(
				SELECT 
				`studio404_gallery_file`.`file` 
				FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS pic, 
			(
				SELECT 
				`studio404_gallery_file`.`file` 
				FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type_doc AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS doc   
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item`  
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'publicationpage', ":media_type" => 'photo', ":media_type_doc" => 'document', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "homepage_files":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_gallery_file`.*
			FROM 
			`studio404_pages`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":media_type" => 'photo', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "text_files":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_pages`.`idx` as midx, 
			`studio404_gallery_file`.*
			FROM 
			`studio404_pages`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_pages`.`page_type`=`studio404_gallery_attachment`.`pagetype` AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":media_type" => 'photo', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "last_news_files":
                $sql = 'SELECT 
			`studio404_module_item`.* 
			FROM 
			`studio404_pages`,`studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`page_type`=:pagetype AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` DESC LIMIT 1
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'newspage', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $f = $prepare->fetchAll(PDO::FETCH_ASSOC);
                $slug = $f[0]["slug"];
                $sql = 'SELECT 
			`studio404_gallery_file`.*
			FROM 
			`studio404_module_item`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_module_item`.`slug`=:slug AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status AND 
			`studio404_module_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`pagetype`="newspage" AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":media_type" => 'photo', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "news_files":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_gallery_file`.*
			FROM 
			`studio404_module_item`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_module_item`.`slug`=:slug AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status AND 
			`studio404_module_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`pagetype`="newspage" AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":media_type" => 'photo', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "text_documents":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_pages`.`idx` as midx, 
			`studio404_gallery_file`.*
			FROM 
			`studio404_pages`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_pages`.`page_type`=`studio404_gallery_attachment`.`pagetype` AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":media_type" => 'document', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "news_documents":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_gallery_file`.*
			FROM 
			`studio404_module_item`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_module_item`.`slug`=:slug AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status AND 
			`studio404_module_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`pagetype`="newspage" AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":media_type" => 'document', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "components":
                $sql = 'SELECT 
			`studio404_components`.`name` AS com_name,  
			`studio404_components_inside`.* 
			FROM 
			`studio404_components`,`studio404_components_inside`
			WHERE 
			`studio404_components`.`status`!=:status AND 
			`studio404_components`.`id`=`studio404_components_inside`.`cid` AND  
			`studio404_components_inside`.`lang`=:lang AND  
			`studio404_components_inside`.`status`!=:status 
			ORDER BY `studio404_components_inside`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "languages":
                $sql = 'SELECT * FROM `studio404_language` WHERE `status`=:status AND `variable`=:false';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":false" => 'false'));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "language_data":
                $sql = 'SELECT * FROM `studio404_language` WHERE `status`!=:status AND `variable`!=:false AND `langs`=:lang';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":false" => 'false', ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "main_menu":
                $sql = 'SELECT * FROM `studio404_pages` WHERE `status`!=:status AND `menu_type`!=:super AND `lang`=:lang AND `visibility`!=:visibility AND `cid`=:cid ORDER BY `position` ASC';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":super" => 'super', ":lang" => LANG_ID, ":visibility" => 1, ":cid" => 1));
                $f = $prepare->fetchAll(PDO::FETCH_ASSOC);
                $fetch = $this->sub_menu($c, $f);
                break;
            case "structure":
                $sql = 'SELECT `idx`,`title`,`shorttitle` FROM `studio404_pages` WHERE `status`!=:status AND `menu_type`!=:super AND `lang`=:lang AND `visibility`!=:visibility AND `cid`=:cid ORDER BY `position` ASC';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":super" => 'super', ":lang" => LANG_ID, ":visibility" => 1, ":cid" => 46));
                $fetch = $prepare->fetchAll(PDO::FETCH_CLASS, "db_structure");
                break;
            case "left_menu":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT `idx`,`cid` FROM `studio404_pages` WHERE `slug`=:slug AND `status`!=:status AND `menu_type`!=:super AND `lang`=:lang AND `visibility`!=:visibility ORDER BY `position` ASC ';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":super" => 'super', ":lang" => LANG_ID, ":visibility" => 1, ":slug" => $slug));
                $f = $prepare->fetch(PDO::FETCH_ASSOC);
                if ($prepare->rowCount() <= 0) {
                    $sql3 = 'SELECT 
				`studio404_pages`.`cid` AS cid
				FROM 
				`studio404_module_item`, `studio404_module`, `studio404_module_attachment`, `studio404_pages` 
				WHERE 
				`studio404_module_item`.`slug`=:slug AND 
				`studio404_module_item`.`lang`=:lang AND 
				`studio404_module_item`.`visibility`!=:visibility AND 
				`studio404_module_item`.`status`!=:status AND 
				`studio404_module_item`.`module_idx`=`studio404_module`.`idx` AND 
				`studio404_module`.`lang`=:lang AND 
				`studio404_module`.`status`!=:status AND  
				`studio404_module`.`idx`=`studio404_module_attachment`.`idx` AND  
				`studio404_module_attachment`.`lang`=:lang AND  
				`studio404_module_attachment`.`status`!=:status AND  
				`studio404_module_attachment`.`connect_idx`=`studio404_pages`.`idx` AND  
				`studio404_pages`.`lang`=:lang AND  
				`studio404_pages`.`visibility`!=:visibility AND  
				`studio404_pages`.`status`!=:status 
				';
                    $prepare3 = $conn->prepare($sql3);
                    $prepare3->execute(array(":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1));
                    $f = $prepare3->fetchAll(PDO::FETCH_ASSOC);
                    $f = $f[0];
                }
                $sql2 = 'SELECT * FROM `studio404_pages` WHERE `cid`=:cid AND `status`!=:status AND `menu_type`!=:super AND `lang`=:lang AND `visibility`!=:visibility ORDER BY `position` ASC';
                $prepare2 = $conn->prepare($sql2);
                $prepare2->execute(array(":status" => 1, ":super" => 'super', ":lang" => LANG_ID, ":visibility" => 1, ":cid" => $f['idx']));
                $fetch = $prepare2->fetchAll(PDO::FETCH_ASSOC);
                if ($prepare2->rowCount() <= 0) {
                    $sql3 = 'SELECT * FROM `studio404_pages` WHERE `cid`=:cid AND `status`!=:status AND `menu_type`!=:super AND `lang`=:lang AND `visibility`!=:visibility ORDER BY `position` ASC';
                    $prepare3 = $conn->prepare($sql3);
                    $prepare3->execute(array(":status" => 1, ":super" => 'super', ":lang" => LANG_ID, ":visibility" => 1, ":cid" => $f['cid']));
                    $fetch = $prepare3->fetchAll(PDO::FETCH_ASSOC);
                }
                break;
            case "multimedia":
                $sql = 'SELECT 
			`studio404_gallery_file`.*, `studio404_gallery_file`.`gallery_idx` as x
			FROM 
			`studio404_pages`,`studio404_media_attachment`,`studio404_media`,`studio404_media_item`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_pages`.`page_type`=:videogallery AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_media_attachment`.`connect_idx` AND 
			`studio404_media_attachment`.`lang`=:lang AND 
			`studio404_media_attachment`.`status`!=:status AND 
			`studio404_media_attachment`.`idx`=`studio404_media`.`idx` AND 
			`studio404_media`.`lang`=:lang AND 
			`studio404_media`.`status`!=:status AND 
			`studio404_media`.`idx`=`studio404_media_item`.`media_idx` AND 
			`studio404_media_item`.`lang`=:lang AND 
			`studio404_media_item`.`visibility`!=:visibility AND 
			`studio404_media_item`.`status`!=:status AND 
			`studio404_media_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`pagetype`=:videogallery AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 2
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":videogallery" => 'videogallerypage', ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "news":
                $sql = 'SELECT 
			`studio404_module_item`.*
			FROM 
			`studio404_pages`,`studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`page_type`=:pagetype AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` DESC LIMIT 15 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'newspage', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "events":
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			( 
				SELECT `studio404_gallery_file`.`file` FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS pic 
			FROM 
			`studio404_pages`,`studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`page_type`=:pagetype AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` DESC LIMIT 15 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'eventpage', ":media_type" => 'photo', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "events_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.* 
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:page_type AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status ORDER BY `studio404_module_item`.`date` DESC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'eventpage', ":media_type" => 'photo', ":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1, ":page_type" => 'eventpage'));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "eventsinside_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT `studio404_module_item`.*,
			( 
				SELECT `studio404_gallery_file`.`file` FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS pic 
			FROM `studio404_module_item` WHERE 
			`studio404_module_item`.`slug`=:slug AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'eventpage', ":media_type" => 'photo', ":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "photo_gallery_list":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_media_item`.`slug` AS smi_slug, 
			`studio404_gallery`.`title` AS sg_title, 
			(
				SELECT 
				`studio404_gallery_file`.`file` 
				FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_media_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:page_type AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS pic 
			FROM 
			`studio404_pages`, `studio404_media_attachment`, `studio404_media`, `studio404_media_item`, `studio404_gallery_attachment`, `studio404_gallery` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_media_attachment`.`connect_idx` AND 
			`studio404_media_attachment`.`page_type`=:page_type AND 
			`studio404_media_attachment`.`lang`=:lang AND 
			`studio404_media_attachment`.`status`!=:status AND 
			`studio404_media_attachment`.`idx`=`studio404_media`.`idx` AND 
			`studio404_media`.`lang`=:lang AND 
			`studio404_media`.`status`!=:status AND 
			`studio404_media`.`idx`=`studio404_media_item`.`media_idx` AND 
			`studio404_media_item`.`lang`=:lang AND 
			`studio404_media_item`.`visibility`!=:visibility AND 
			`studio404_media_item`.`status`!=:status AND 
			`studio404_media_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`pagetype`=:page_type AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status ORDER BY `studio404_media_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1, ":page_type" => 'photogallerypage', ":media_type" => 'photo'));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "files_":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_gallery_file`.* 
			FROM 
			`studio404_media_item`, `studio404_gallery_attachment`, `studio404_gallery`, `studio404_gallery_file` 
			WHERE 
			`studio404_media_item`.`slug`=:slug AND 
			`studio404_media_item`.`lang`=:lang AND 
			`studio404_media_item`.`visibility`!=:visibility AND 
			`studio404_media_item`.`status`!=:status AND 
			`studio404_media_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND  
			`studio404_gallery_attachment`.`pagetype`=:pagetype AND  
			`studio404_gallery_attachment`.`lang`=:lang AND  
			`studio404_gallery_attachment`.`status`!=:status AND  
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND   
			`studio404_gallery`.`lang`=:lang AND   
			`studio404_gallery`.`status`!=:status AND   
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND   
			`studio404_gallery_file`.`media_type`=:media_type AND   
			`studio404_gallery_file`.`lang`=:lang AND   
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC   
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1, ":pagetype" => 'photogallerypage', ":media_type" => 'photo'));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "videogallery_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_gallery_file`.* 
			FROM 
			`studio404_pages`,`studio404_media_attachment`,`studio404_media`,`studio404_media_item`,`studio404_gallery_attachment`, `studio404_gallery`, `studio404_gallery_file` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND  
			`studio404_pages`.`visibility`!=:visibility AND  
			`studio404_pages`.`status`!=:status AND  
			`studio404_pages`.`idx`=`studio404_media_attachment`.`connect_idx` AND  
			`studio404_media_attachment`.`lang`=:lang AND  
			`studio404_media_attachment`.`status`!=:status AND  
			`studio404_media_attachment`.`idx`=`studio404_media`.`idx` AND  
			`studio404_media`.`lang`=:lang AND  
			`studio404_media`.`status`!=:status AND   
			`studio404_media`.`idx`=`studio404_media_item`.`media_idx` AND   
			`studio404_media_item`.`lang`=:lang AND 
			`studio404_media_item`.`visibility`!=:visibility AND 
			`studio404_media_item`.`status`!=:status AND 
			`studio404_media_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND  
			`studio404_gallery_attachment`.`pagetype`=:pagetype AND  
			`studio404_gallery_attachment`.`lang`=:lang AND  
			`studio404_gallery_attachment`.`status`!=:status AND  
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND   
			`studio404_gallery`.`lang`=:lang AND   
			`studio404_gallery`.`status`!=:status AND   
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND   
			`studio404_gallery_file`.`media_type`=:media_type AND   
			`studio404_gallery_file`.`lang`=:lang AND   
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC   
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1, ":pagetype" => 'videogallerypage', ":media_type" => 'video'));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "breadcrups":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $fetch = $this->breakcrups($c, $slug);
                break;
            case "sector":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->sectors($c);
                break;
            case "subsector":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->subsector($c);
                break;
            case "products":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->products($c);
                break;
            case "countries":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->countries($c);
                break;
            case "certificates":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->certificates($c);
                break;
            case "companysize":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->companysize($c);
                break;
            case "hidden_team_list":
                $sql = 'SELECT 
			`studio404_module_item`.`idx` AS smi_idx, 
			`studio404_module_item`.`title` AS namelname 
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item`  
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":media_type" => 'photo', ":media_type_doc" => 'document', ":pagetype" => 'catalogpage', ":slug" => 'team', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
        }
        if (count($fetch)) {
            $fh = @fopen($cache_file, 'w') or die("Error opening output file");
            @fwrite($fh, json_encode($fetch, JSON_UNESCAPED_UNICODE));
            @fclose($fh);
        }
    }
Exemplo n.º 5
0
 public function gnav($menu_array, $type)
 {
     // echo "<pre>";
     // print_r($menu_array);
     // echo "</pre>";
     $get_slug_from_url = new get_slug_from_url();
     $slug = $get_slug_from_url->slug();
     if ($type == "header") {
         $o = '<div class="gmenu g' . LANG . '"><ul>';
         for ($x = 0; $x < count($menu_array->date); $x++) {
             $active = $menu_array->slug[$x] == $slug ? 'gactive' : '';
             if ($menu_array->sub[$x]) {
                 $o .= '<li class="ghas">';
                 // '.MAIN_DIR.$menu_array->slug[$x].'
                 $o .= '<a href="javascript:;" class="' . $active . '">' . $menu_array->title[$x] . '</a>';
                 $o .= $this->gsub($menu_array->sub[$x], $slug, "header");
                 $o .= '</li>';
             } else {
                 $o .= '<li><a href="' . MAIN_DIR . $menu_array->slug[$x] . '?v=' . $menu_array->idx[$x] . '" class="' . $active . '">' . $menu_array->title[$x] . '</a></li>';
             }
         }
         $o .= '</ul>';
     }
     return $o;
 }
Exemplo n.º 6
0
    public function recreate_cache($c, $type, $cache_file)
    {
        $conn = $this->conn($c);
        switch ($type) {
            case "contact_page_data":
                $sql = 'SELECT * FROM `studio404_users` WHERE `id`=:id AND `user_type`=:user_type';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":id" => 1, ":user_type" => "administrator"));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "homepage_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_pages` WHERE `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "text_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_pages` WHERE `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "team_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_pages` WHERE `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "catalog_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_pages` WHERE `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "footernavigation":
                $sql = 'SELECT `idx`,`title` FROM `studio404_pages` WHERE `cid`=1 AND `footermenu`=1 AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status ORDER BY `position` ASC';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "publication_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_pages` WHERE `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "news_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			( 
				SELECT `studio404_gallery_file`.`file` FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1 
			) AS pic 
			FROM `studio404_module_item` WHERE 
			`studio404_module_item`.`slug`=:slug AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status ';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'newspage', ":media_type" => 'photo', ":slug" => $slug, ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "news_list":
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			( 
				SELECT `studio404_gallery_file`.`file` FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1 
			) AS pic 
			FROM 
			`studio404_pages`,`studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`page_type`=:pagetype AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` DESC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'newspage', ":media_type" => 'photo', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "event_list":
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			( 
				SELECT `studio404_gallery_file`.`file` FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1 
			) AS pic 
			FROM 
			`studio404_pages`,`studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`page_type`=:pagetype AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` DESC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'eventpage', ":media_type" => 'photo', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "team_list":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.`idx` AS smi_idx, 
			`studio404_module_item`.`title` AS namelname 
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item`  
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":media_type" => 'photo', ":media_type_doc" => 'document', ":pagetype" => 'teampage', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                // $fetch = $prepare->fetchAll(PDO::FETCH_CLASS,'db_team');
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "catalog_list":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			(
				SELECT 
				`studio404_gallery_file`.`file` 
				FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS pic, 
			(
				SELECT 
				`studio404_gallery_file`.`file` 
				FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type_doc AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS doc  
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item`  
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'catalogpage', ":media_type" => 'photo', ":media_type_doc" => 'document', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "catalog_info_comments_list":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.`idx` AS smi_idx,  
			`studio404_module_item`.`uid` AS smi_uid,  
			`studio404_module_item`.`date` AS smi_date,  
			`studio404_module_item`.`module_idx` AS smi_module_idx,  
			`studio404_module_item`.`title` AS smi_title,  
			`studio404_module_item`.`short_description` AS smi_short_description,  
			`studio404_module_item`.`long_description` AS smi_long_description,  
			`studio404_module_item`.`tags` AS smi_tags,  
			`studio404_module_item`.`slug` AS smi_slug   
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item`  
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'catalogpage', ":media_type" => 'photo', ":media_type_doc" => 'document', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_CLASS, "db_catalog");
                break;
            case "publication_list":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			(
				SELECT 
				`studio404_gallery_file`.`file` 
				FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS pic, 
			(
				SELECT 
				`studio404_gallery_file`.`file` 
				FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type_doc AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS doc   
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item`  
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'publicationpage', ":media_type" => 'photo', ":media_type_doc" => 'document', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "homepage_files":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_gallery_file`.*
			FROM 
			`studio404_pages`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":media_type" => 'photo', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "text_files":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_pages`.`idx` as midx, 
			`studio404_gallery_file`.*
			FROM 
			`studio404_pages`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_pages`.`page_type`=`studio404_gallery_attachment`.`pagetype` AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":media_type" => 'photo', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "last_news_files":
                $sql = 'SELECT 
			`studio404_module_item`.* 
			FROM 
			`studio404_pages`,`studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`page_type`=:pagetype AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` DESC LIMIT 1
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'newspage', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $f = $prepare->fetchAll(PDO::FETCH_ASSOC);
                $slug = $f[0]["slug"];
                $sql = 'SELECT 
			`studio404_gallery_file`.*
			FROM 
			`studio404_module_item`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_module_item`.`slug`=:slug AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status AND 
			`studio404_module_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`pagetype`="newspage" AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":media_type" => 'photo', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "news_files":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_gallery_file`.*
			FROM 
			`studio404_module_item`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_module_item`.`slug`=:slug AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status AND 
			`studio404_module_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`pagetype`="newspage" AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":media_type" => 'photo', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "text_documents":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_pages`.`idx` as midx, 
			`studio404_gallery_file`.*
			FROM 
			`studio404_pages`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_pages`.`page_type`=`studio404_gallery_attachment`.`pagetype` AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":media_type" => 'document', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "news_documents":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_gallery_file`.*
			FROM 
			`studio404_module_item`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_module_item`.`slug`=:slug AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status AND 
			`studio404_module_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`pagetype`="newspage" AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`media_type`=:media_type AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":media_type" => 'document', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "components":
                $sql = 'SELECT 
			`studio404_components`.`name` AS com_name,  
			`studio404_components_inside`.* 
			FROM 
			`studio404_components`,`studio404_components_inside`
			WHERE 
			`studio404_components`.`status`!=:status AND 
			`studio404_components`.`id`=`studio404_components_inside`.`cid` AND  
			`studio404_components_inside`.`lang`=:lang AND  
			`studio404_components_inside`.`status`!=:status 
			ORDER BY `studio404_components_inside`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "languages":
                $sql = 'SELECT * FROM `studio404_language` WHERE `status`=:status AND `variable`=:false';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":false" => 'false'));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "language_data":
                $sql = 'SELECT * FROM `studio404_language` WHERE `status`!=:status AND `variable`!=:false AND `langs`=:lang';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":false" => 'false', ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "main_menu":
                $sql = 'SELECT * FROM `studio404_pages` WHERE `status`!=:status AND `menu_type`!=:super AND `lang`=:lang AND `visibility`!=:visibility AND `cid`=:cid ORDER BY `position` ASC';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":super" => 'super', ":lang" => LANG_ID, ":visibility" => 1, ":cid" => 1));
                $f = $prepare->fetchAll(PDO::FETCH_ASSOC);
                $fetch = $this->sub_menu($c, $f);
                break;
            case "structure":
                $sql = 'SELECT `idx`,`title`,`shorttitle` FROM `studio404_pages` WHERE `status`!=:status AND `menu_type`!=:super AND `lang`=:lang AND `visibility`!=:visibility AND `cid`=:cid ORDER BY `position` ASC';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":super" => 'super', ":lang" => LANG_ID, ":visibility" => 1, ":cid" => 46));
                $fetch = $prepare->fetchAll(PDO::FETCH_CLASS, "db_structure");
                break;
            case "left_menu":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT `idx`,`cid` FROM `studio404_pages` WHERE `slug`=:slug AND `status`!=:status AND `menu_type`!=:super AND `lang`=:lang AND `visibility`!=:visibility ORDER BY `position` ASC ';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":status" => 1, ":super" => 'super', ":lang" => LANG_ID, ":visibility" => 1, ":slug" => $slug));
                $f = $prepare->fetch(PDO::FETCH_ASSOC);
                if ($prepare->rowCount() <= 0) {
                    $sql3 = 'SELECT 
				`studio404_pages`.`cid` AS cid
				FROM 
				`studio404_module_item`, `studio404_module`, `studio404_module_attachment`, `studio404_pages` 
				WHERE 
				`studio404_module_item`.`slug`=:slug AND 
				`studio404_module_item`.`lang`=:lang AND 
				`studio404_module_item`.`visibility`!=:visibility AND 
				`studio404_module_item`.`status`!=:status AND 
				`studio404_module_item`.`module_idx`=`studio404_module`.`idx` AND 
				`studio404_module`.`lang`=:lang AND 
				`studio404_module`.`status`!=:status AND  
				`studio404_module`.`idx`=`studio404_module_attachment`.`idx` AND  
				`studio404_module_attachment`.`lang`=:lang AND  
				`studio404_module_attachment`.`status`!=:status AND  
				`studio404_module_attachment`.`connect_idx`=`studio404_pages`.`idx` AND  
				`studio404_pages`.`lang`=:lang AND  
				`studio404_pages`.`visibility`!=:visibility AND  
				`studio404_pages`.`status`!=:status 
				';
                    $prepare3 = $conn->prepare($sql3);
                    $prepare3->execute(array(":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1));
                    $f = $prepare3->fetchAll(PDO::FETCH_ASSOC);
                    $f = $f[0];
                }
                $f['idx'] = !empty($f['idx']) ? $f['idx'] : 0;
                $sql2 = 'SELECT * FROM `studio404_pages` WHERE `cid`=:cid AND `status`!=:status AND `menu_type`!=:super AND `lang`=:lang AND `visibility`!=:visibility ORDER BY `position` ASC';
                $prepare2 = $conn->prepare($sql2);
                $prepare2->execute(array(":status" => 1, ":super" => 'super', ":lang" => LANG_ID, ":visibility" => 1, ":cid" => $f['idx']));
                $fetch = $prepare2->fetchAll(PDO::FETCH_ASSOC);
                if ($prepare2->rowCount() <= 0) {
                    $sql3 = 'SELECT * FROM `studio404_pages` WHERE `cid`=:cid AND `status`!=:status AND `menu_type`!=:super AND `lang`=:lang AND `visibility`!=:visibility ORDER BY `position` ASC';
                    $prepare3 = $conn->prepare($sql3);
                    $prepare3->execute(array(":status" => 1, ":super" => 'super', ":lang" => LANG_ID, ":visibility" => 1, ":cid" => $f['cid']));
                    $fetch = $prepare3->fetchAll(PDO::FETCH_ASSOC);
                }
                break;
            case "multimedia":
                $sql = 'SELECT 
			`studio404_gallery_file`.*, `studio404_gallery_file`.`gallery_idx` as x
			FROM 
			`studio404_pages`,`studio404_media_attachment`,`studio404_media`,`studio404_media_item`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_pages`.`page_type`=:videogallery AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_media_attachment`.`connect_idx` AND 
			`studio404_media_attachment`.`lang`=:lang AND 
			`studio404_media_attachment`.`status`!=:status AND 
			`studio404_media_attachment`.`idx`=`studio404_media`.`idx` AND 
			`studio404_media`.`lang`=:lang AND 
			`studio404_media`.`status`!=:status AND 
			`studio404_media`.`idx`=`studio404_media_item`.`media_idx` AND 
			`studio404_media_item`.`lang`=:lang AND 
			`studio404_media_item`.`visibility`!=:visibility AND 
			`studio404_media_item`.`status`!=:status AND 
			`studio404_media_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`pagetype`=:videogallery AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status AND 
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
			`studio404_gallery_file`.`lang`=:lang AND 
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 2
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":videogallery" => 'videogallerypage', ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "news":
                $sql = 'SELECT 
			`studio404_module_item`.*
			FROM 
			`studio404_pages`,`studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`page_type`=:pagetype AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` DESC LIMIT 15 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'newspage', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "events":
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			( 
				SELECT `studio404_gallery_file`.`file` FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS pic 
			FROM 
			`studio404_pages`,`studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`page_type`=:pagetype AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` DESC LIMIT 15 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'eventpage', ":media_type" => 'photo', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "events_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_module_item`.* 
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:page_type AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status ORDER BY `studio404_module_item`.`date` DESC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'eventpage', ":media_type" => 'photo', ":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1, ":page_type" => 'eventpage'));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "eventsinside_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT `studio404_module_item`.*,
			( 
				SELECT `studio404_gallery_file`.`file` FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_module_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:pagetype AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS pic 
			FROM `studio404_module_item` WHERE 
			`studio404_module_item`.`slug`=:slug AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'eventpage', ":media_type" => 'photo', ":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "photo_gallery_list":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_media_item`.`slug` AS smi_slug, 
			`studio404_gallery`.`title` AS sg_title, 
			(
				SELECT 
				`studio404_gallery_file`.`file` 
				FROM 
				`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
				WHERE 
				`studio404_gallery_attachment`.`connect_idx`=`studio404_media_item`.`idx` AND 
				`studio404_gallery_attachment`.`pagetype`=:page_type AND 
				`studio404_gallery_attachment`.`lang`=:lang AND 
				`studio404_gallery_attachment`.`status`!=:status AND 
				`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
				`studio404_gallery`.`lang`=:lang AND 
				`studio404_gallery`.`status`!=:status AND 
				`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND 
				`studio404_gallery_file`.`media_type`=:media_type AND 
				`studio404_gallery_file`.`lang`=:lang AND 
				`studio404_gallery_file`.`status`!=:status 
				ORDER BY `studio404_gallery_file`.`position` ASC LIMIT 1
			) AS pic 
			FROM 
			`studio404_pages`, `studio404_media_attachment`, `studio404_media`, `studio404_media_item`, `studio404_gallery_attachment`, `studio404_gallery` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_media_attachment`.`connect_idx` AND 
			`studio404_media_attachment`.`page_type`=:page_type AND 
			`studio404_media_attachment`.`lang`=:lang AND 
			`studio404_media_attachment`.`status`!=:status AND 
			`studio404_media_attachment`.`idx`=`studio404_media`.`idx` AND 
			`studio404_media`.`lang`=:lang AND 
			`studio404_media`.`status`!=:status AND 
			`studio404_media`.`idx`=`studio404_media_item`.`media_idx` AND 
			`studio404_media_item`.`lang`=:lang AND 
			`studio404_media_item`.`visibility`!=:visibility AND 
			`studio404_media_item`.`status`!=:status AND 
			`studio404_media_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND 
			`studio404_gallery_attachment`.`pagetype`=:page_type AND 
			`studio404_gallery_attachment`.`lang`=:lang AND 
			`studio404_gallery_attachment`.`status`!=:status AND 
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND 
			`studio404_gallery`.`lang`=:lang AND 
			`studio404_gallery`.`status`!=:status ORDER BY `studio404_media_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1, ":page_type" => 'photogallerypage', ":media_type" => 'photo'));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "files_":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_gallery_file`.* 
			FROM 
			`studio404_media_item`, `studio404_gallery_attachment`, `studio404_gallery`, `studio404_gallery_file` 
			WHERE 
			`studio404_media_item`.`slug`=:slug AND 
			`studio404_media_item`.`lang`=:lang AND 
			`studio404_media_item`.`visibility`!=:visibility AND 
			`studio404_media_item`.`status`!=:status AND 
			`studio404_media_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND  
			`studio404_gallery_attachment`.`pagetype`=:pagetype AND  
			`studio404_gallery_attachment`.`lang`=:lang AND  
			`studio404_gallery_attachment`.`status`!=:status AND  
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND   
			`studio404_gallery`.`lang`=:lang AND   
			`studio404_gallery`.`status`!=:status AND   
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND   
			`studio404_gallery_file`.`media_type`=:media_type AND   
			`studio404_gallery_file`.`lang`=:lang AND   
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC   
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1, ":pagetype" => 'photogallerypage', ":media_type" => 'photo'));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "videogallery_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT 
			`studio404_gallery_file`.* 
			FROM 
			`studio404_pages`,`studio404_media_attachment`,`studio404_media`,`studio404_media_item`,`studio404_gallery_attachment`, `studio404_gallery`, `studio404_gallery_file` 
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND  
			`studio404_pages`.`visibility`!=:visibility AND  
			`studio404_pages`.`status`!=:status AND  
			`studio404_pages`.`idx`=`studio404_media_attachment`.`connect_idx` AND  
			`studio404_media_attachment`.`lang`=:lang AND  
			`studio404_media_attachment`.`status`!=:status AND  
			`studio404_media_attachment`.`idx`=`studio404_media`.`idx` AND  
			`studio404_media`.`lang`=:lang AND  
			`studio404_media`.`status`!=:status AND   
			`studio404_media`.`idx`=`studio404_media_item`.`media_idx` AND   
			`studio404_media_item`.`lang`=:lang AND 
			`studio404_media_item`.`visibility`!=:visibility AND 
			`studio404_media_item`.`status`!=:status AND 
			`studio404_media_item`.`idx`=`studio404_gallery_attachment`.`connect_idx` AND  
			`studio404_gallery_attachment`.`pagetype`=:pagetype AND  
			`studio404_gallery_attachment`.`lang`=:lang AND  
			`studio404_gallery_attachment`.`status`!=:status AND  
			`studio404_gallery_attachment`.`idx`=`studio404_gallery`.`idx` AND   
			`studio404_gallery`.`lang`=:lang AND   
			`studio404_gallery`.`status`!=:status AND   
			`studio404_gallery`.`idx`=`studio404_gallery_file`.`gallery_idx` AND   
			`studio404_gallery_file`.`media_type`=:media_type AND   
			`studio404_gallery_file`.`lang`=:lang AND   
			`studio404_gallery_file`.`status`!=:status 
			ORDER BY `studio404_gallery_file`.`position` ASC   
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1, ":pagetype" => 'videogallerypage', ":media_type" => 'video'));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "breadcrups":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $fetch = $this->breakcrups($c, $slug);
                break;
            case "sector":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->sectors($c);
                break;
            case "subsector":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->subsector($c);
                break;
            case "products":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->products($c);
                break;
            case "countries":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->countries($c);
                break;
            case "certificates":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->certificates($c);
                break;
            case "companysize":
                $sectors_subsectors_products = new sectors_subsectors_products();
                $fetch = $sectors_subsectors_products->companysize($c);
                break;
            case "hidden_team_list":
                $sql = 'SELECT 
			`studio404_module_item`.`idx` AS smi_idx, 
			`studio404_module_item`.`title` AS namelname 
			FROM 
			`studio404_pages`, `studio404_module_attachment`, `studio404_module`, `studio404_module_item`  
			WHERE 
			`studio404_pages`.`slug`=:slug AND 
			`studio404_pages`.`lang`=:lang AND 
			`studio404_pages`.`visibility`!=:visibility AND 
			`studio404_pages`.`status`!=:status AND 
			`studio404_pages`.`idx`=`studio404_module_attachment`.`connect_idx` AND 
			`studio404_module_attachment`.`page_type`=:pagetype AND 
			`studio404_module_attachment`.`lang`=:lang AND 
			`studio404_module_attachment`.`status`!=:status AND 
			`studio404_module_attachment`.`idx`=`studio404_module`.`idx` AND 
			`studio404_module`.`lang`=:lang AND 
			`studio404_module`.`status`!=:status AND 
			`studio404_module`.`idx`=`studio404_module_item`.`module_idx` AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`position` ASC 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":media_type" => 'photo', ":media_type_doc" => 'document', ":pagetype" => 'catalogpage', ":slug" => 'team', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                break;
            case "productinside":
                $sql = 'SELECT 
			`studio404_module_item`.*, 
			(SELECT `studio404_users`.`company_type` FROM `studio404_users` WHERE `studio404_users`.`id`=`studio404_module_item`.`insert_admin`) AS com_type, 
			(SELECT `studio404_users`.`namelname` FROM `studio404_users` WHERE `studio404_users`.`id`=`studio404_module_item`.`insert_admin`) AS com_name, 
			(SELECT `studio404_pages`.`title` FROM `studio404_pages` WHERE `studio404_pages`.`idx`=`studio404_module_item`.`hscode`) AS hscode_title 
			FROM 
			 `studio404_module_item`
			 WHERE 
			 `studio404_module_item`.`insert_admin`=' . (int) Input::method("GET", "i") . ' AND 
			 `studio404_module_item`.`id`=' . (int) Input::method("GET", "p") . ' AND 
			 `studio404_module_item`.`status`!=:one
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":one" => 1));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
                    //$picture = ($fetch["picture"]) ? WEBSITE.'image?f='.WEBSITE.'files/usersproducts/'.$fetch["picture"].'&w=175&h=175' : '';
                }
                break;
            case "vectormap_new":
                // $sql = 'SELECT * FROM `vectormap_new`';
                // $prepare = $conn->prepare($sql);
                // $prepare->execute();
                // if($prepare->rowCount()>0){
                // 	$fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                // }else{
                // 	$fetch = array();
                // }
                $sql = 'SELECT `idx` AS id, `title` AS code, `text` AS title, `shorttitle` AS data, `keywords` AS color  FROM `studio404_pages` WHERE `cid`=6335 AND `status`!=1 AND `visibility`!=1';
                $prepare = $conn->prepare($sql);
                $prepare->execute();
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                break;
            case "mapfilter":
                $sql = 'SELECT (SELECT `title` FROM `studio404_pages` WHERE `idx`=:cid) AS mainTitle, `idx`,`title` FROM `studio404_pages` WHERE `cid`=:cid AND `visibility`!=:one AND `status`!=:one';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":cid" => 6318, ":one" => 1));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                break;
        }
        if (!empty($fetch) && count($fetch)) {
            $fh = @fopen($cache_file, 'w') or die("Error opening output file");
            @fwrite($fh, json_encode($fetch, JSON_UNESCAPED_UNICODE));
            @fclose($fh);
        }
    }