Ejemplo n.º 1
0
 public function template($c, $page)
 {
     $conn = $this->conn($c);
     $cache = new cache();
     $text_general = $cache->index($c, "text_general");
     $data["text_general"] = json_decode($text_general, true);
     $welcomepage_categories = $cache->index($c, "welcomepage_categories");
     $data["welcomepage_categories"] = json_decode($welcomepage_categories, true);
     /* language variables */
     $language_data = $cache->index($c, "language_data");
     $language_data = json_decode($language_data);
     $model_template_makevars = new model_template_makevars();
     $data["language_data"] = $model_template_makevars->vars($language_data);
     $sql = 'SELECT `namelname`,`picture` FROM `studio404_users` WHERE `id`=:id';
     $prepare = $conn->prepare($sql);
     $prepare->execute(array(":id" => $_SESSION["batumi_id"]));
     if ($prepare->rowCount() > 0) {
         $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
         $data["userdata"] = $fetch;
     } else {
         redirect::url(WEBSITE);
     }
     /* catalog list */
     $userlist = $cache->index($c, "userlist");
     $data['userlist'] = json_decode($userlist, true);
     $include = WEB_DIR . "/momxmareblismarTva.php";
     if (file_exists($include)) {
         @(include $include);
     } else {
         $controller = new error_page();
     }
 }
 function __construct($c)
 {
     if (isset($_SESSION["tradewithgeorgia_username"]) || !isset($_GET["rl"]) || !isset($_GET['ui']) || !is_numeric($_GET['ui'])) {
         redirect::url(WEBSITE);
     }
     $this->template($c);
 }
Ejemplo n.º 3
0
 public function template($c, $page)
 {
     $conn = $this->conn($c);
     $idx = Input::method("GET", "id");
     if (!isset($_SESSION["greek_id"])) {
         redirect::url(WEBSITE . LANG . "/userspage?docid=" . $idx);
     }
     $sql = 'SELECT `document` FROM `studio404_components_inside` WHERE `idx`=:idx AND `lang`=:lang';
     $prepare = $conn->prepare($sql);
     $prepare->execute(array(":idx" => $idx, ":lang" => LANG_ID));
     if ($prepare->rowCount() > 0) {
         $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
         $file = $fetch["document"];
         if (file_exists($file)) {
             $content = file_get_contents($file);
             $name = time() . ".pdf";
             header('Content-Type: application/pdf');
             header('Content-Length: ' . strlen($content));
             header('Content-disposition: inline; filename="' . $name . '"');
             header('Cache-Control: public, must-revalidate, max-age=0');
             header('Pragma: public');
             header('Expires: Sat, 26 Jul 1997 05:00:00 GMT');
             header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT');
             // output content
             echo $content;
         } else {
             redirect::url(WEBSITE . LANG . "/page404");
         }
     } else {
         redirect::url(WEBSITE . LANG . "/page404");
     }
 }
Ejemplo n.º 4
0
 function __construct($c)
 {
     if (!Input::method("GET", "id") || !is_numeric(Input::method("GET", "id"))) {
         redirect::url(WEBSITE);
     }
     $this->newsfetch($c);
 }
Ejemplo n.º 5
0
 public function template($c, $page)
 {
     $conn = $this->conn($c);
     $cache = new cache();
     $text_general = $cache->index($c, "text_general");
     $data["text_general"] = json_decode($text_general, true);
     $welcomepage_categories = $cache->index($c, "welcomepage_categories");
     $data["welcomepage_categories"] = json_decode($welcomepage_categories, true);
     /* language variables */
     $language_data = $cache->index($c, "language_data");
     $language_data = json_decode($language_data);
     $model_template_makevars = new model_template_makevars();
     $data["language_data"] = $model_template_makevars->vars($language_data);
     /* Upload Users profile picture */
     if (isset($_FILES["profileimage"]["name"])) {
         $model_template_upload_user_logo = new model_template_upload_user_logo();
         $upload = $model_template_upload_user_logo->upload($c);
     }
     $sql = 'SELECT `username`,`user_type`,`namelname`,`dob`,`email`,`mobile`,`address`,`picture` FROM `studio404_users` WHERE `id`=:id';
     $prepare = $conn->prepare($sql);
     $prepare->execute(array(":id" => $_SESSION["batumi_id"]));
     if ($prepare->rowCount() > 0) {
         $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
         $data["userdata"] = $fetch;
     } else {
         redirect::url(WEBSITE);
     }
     $include = WEB_DIR . "/profilisredaqtireba.php";
     if (file_exists($include)) {
         @(include $include);
     } else {
         $controller = new error_page();
     }
 }
Ejemplo n.º 6
0
 public function template($c, $page)
 {
     $conn = $this->conn($c);
     $cache = new cache();
     $text_general = $cache->index($c, "text_general");
     $data["text_general"] = json_decode($text_general, true);
     /* categories list */
     $welcomepage_categories = $cache->index($c, "welcomepage_categories");
     $data["welcomepage_categories"] = json_decode($welcomepage_categories, true);
     /* all columns catalog table */
     $catalog_table_columns = $cache->index($c, "catalog_table_columns");
     $data["catalog_table_columns"] = json_decode($catalog_table_columns, true);
     /* all columns catalog table */
     // $select_form = $cache->index($c,"select_form");
     // $data["select_form"] = json_decode($select_form,true);
     $cid = Input::method("GET", "parent");
     $select_form = new select_form();
     $data["select_form"] = $select_form->form($c, $cid, LANG_ID);
     /* language variables */
     $language_data = $cache->index($c, "language_data");
     $language_data = json_decode($language_data);
     $model_template_makevars = new model_template_makevars();
     $data["language_data"] = $model_template_makevars->vars($language_data);
     $sql = 'SELECT `namelname`,`picture` FROM `studio404_users` WHERE `id`=:id';
     $prepare = $conn->prepare($sql);
     $prepare->execute(array(":id" => $_SESSION["batumi_id"]));
     if ($prepare->rowCount() > 0) {
         $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
         $data["userdata"] = $fetch;
     } else {
         redirect::url(WEBSITE);
     }
     if (Input::method("GET", "parent") != "") {
         $parent = 'SELECT `idx`,`title` FROM `studio404_pages` WHERE `idx`=:idx AND `cid`=4 AND `status`!=1 AND `lang`=:lang';
         $prepareParent = $conn->prepare($parent);
         $prepareParent->execute(array(":idx" => Input::method("GET", "parent"), ":lang" => LANG_ID));
         if ($prepareParent->rowCount() > 0) {
             $parent_fetch = $prepareParent->fetch(PDO::FETCH_ASSOC);
             $data["parent_idx"] = $parent_fetch["idx"];
             $data["parent_title"] = $parent_fetch["title"];
         } else {
             redirect::url(WEBSITE . LANG . "/katalogis-marTva");
         }
     } else {
         redirect::url(WEBSITE . LANG . "/katalogis-marTva");
     }
     $include = WEB_DIR . "/formismarTva.php";
     if (file_exists($include)) {
         @(include $include);
     } else {
         $controller = new error_page();
     }
 }
Ejemplo n.º 7
0
    public function template($c, $page)
    {
        $conn = $this->conn($c);
        // connection
        $cache = new cache();
        $welcomepage_categories = $cache->index($c, "welcomepage_categories");
        $data["welcomepage_categories"] = json_decode($welcomepage_categories, true);
        /* language variables */
        $language_data = $cache->index($c, "language_data");
        $language_data = json_decode($language_data);
        $model_template_makevars = new model_template_makevars();
        $data["language_data"] = $model_template_makevars->vars($language_data);
        $sql = 'SELECT `namelname`,`picture` FROM `studio404_users` WHERE `id`=:id';
        $prepare = $conn->prepare($sql);
        $prepare->execute(array(":id" => $_SESSION["batumi_id"]));
        if ($prepare->rowCount() > 0) {
            $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
            $data["userdata"] = $fetch;
        } else {
            redirect::url(WEBSITE);
        }
        $sql2 = 'SELECT 
		`studio404_messages`.*, 
		`studio404_users`.`namelname` AS fromusername 
		FROM 
		`studio404_messages`, `studio404_users`
		WHERE 
		`studio404_messages`.`fromuser`="' . $_SESSION["batumi_id"] . '" AND 
		`studio404_messages`.`draft`=1 AND 
		NOT FIND_IN_SET("' . $_SESSION["batumi_id"] . '",`studio404_messages`.`status`) AND 
		`studio404_messages`.`tousers`=`studio404_users`.`id` 
		ORDER BY `studio404_messages`.`date` DESC LIMIT 20';
        $prepare2 = $conn->prepare($sql2);
        $prepare2->execute();
        if ($prepare2->rowCount() > 0) {
            $fetch2 = $prepare2->fetchAll(PDO::FETCH_ASSOC);
            $data["messages"] = $fetch2;
        } else {
            $data["messages"] = array();
        }
        $catalog_general = $cache->index($c, "catalog_general");
        $data["catalog_general"] = json_decode($catalog_general, true);
        $catalogitemsnovisiable = $cache->index($c, "catalogitemsnovisiable");
        $data["catalogitems"] = json_decode($catalogitemsnovisiable, true);
        $include = WEB_DIR . "/draft.php";
        if (file_exists($include)) {
            @(include $include);
        } else {
            $controller = new error_page();
        }
    }
Ejemplo n.º 8
0
 public function template($c, $page)
 {
     $conn = $this->conn($c);
     $cache = new cache();
     $text_general = $cache->index($c, "text_general");
     $data["text_general"] = json_decode($text_general, true);
     $welcomepage_categories = $cache->index($c, "welcomepage_categories");
     $data["welcomepage_categories"] = json_decode($welcomepage_categories, true);
     /* language variables */
     $language_data = $cache->index($c, "language_data");
     $language_data = json_decode($language_data);
     $model_template_makevars = new model_template_makevars();
     $data["language_data"] = $model_template_makevars->vars($language_data);
     /* Upload Users profile picture */
     if (isset($_FILES["profileimage"]["name"])) {
         $model_template_upload_user_logo = new model_template_upload_user_logo();
         $upload = $model_template_upload_user_logo->upload($c);
     }
     $sql = 'SELECT `namelname`,`picture` FROM `studio404_users` WHERE `id`=:id';
     $prepare = $conn->prepare($sql);
     $prepare->execute(array(":id" => $_SESSION["batumi_id"]));
     if ($prepare->rowCount() > 0) {
         $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
         $data["userdata"] = $fetch;
     } else {
         redirect::url(WEBSITE);
     }
     if (Input::method("GET", "parent") != "") {
         $parent = 'SELECT `idx`,`title` FROM `studio404_pages` WHERE `idx`=:idx AND `cid`=4 AND `status`!=1 AND `lang`=:lang';
         $prepareParent = $conn->prepare($parent);
         $prepareParent->execute(array(":idx" => Input::method("GET", "parent"), ":lang" => LANG_ID));
         if ($prepareParent->rowCount() > 0) {
             $parent_fetch = $prepareParent->fetch(PDO::FETCH_ASSOC);
             $data["parent_idx"] = $parent_fetch["idx"];
             $data["parent_title"] = $parent_fetch["title"];
         } else {
             redirect::url(WEBSITE . LANG . "/katalogis-marTva/damateba");
         }
     }
     $include = WEB_DIR . "/damateba.php";
     if (file_exists($include)) {
         @(include $include);
     } else {
         $controller = new error_page();
     }
 }
Ejemplo n.º 9
0
    public function template($c, $page)
    {
        $conn = $this->conn($c);
        // connection
        $cache = new cache();
        $welcomepage_categories = $cache->index($c, "welcomepage_categories");
        $data["welcomepage_categories"] = json_decode($welcomepage_categories, true);
        /* language variables */
        $language_data = $cache->index($c, "language_data");
        $language_data = json_decode($language_data);
        $model_template_makevars = new model_template_makevars();
        $data["language_data"] = $model_template_makevars->vars($language_data);
        $sql = 'SELECT `namelname`,`picture` FROM `studio404_users` WHERE `id`=:id';
        $prepare = $conn->prepare($sql);
        $prepare->execute(array(":id" => $_SESSION["batumi_id"]));
        if ($prepare->rowCount() > 0) {
            $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
            $data["userdata"] = $fetch;
        } else {
            redirect::url(WEBSITE);
        }
        $data["cataloglist_names"] = new cataloglist_names();
        $data["getusername"] = new getusername();
        $labellists = new labellists();
        $data["labellists"] = $labellists->loadlabels($c);
        $sql2 = 'SELECT 
		`studio404_module_item`.* 
		FROM `studio404_module_item` WHERE 
		`module_idx`=25 AND 
		`studio404_module_item`.`idx`=:idx AND 
		`studio404_module_item`.`lang`=:lang AND 
		`studio404_module_item`.`status`!=:status';
        $prepare2 = $conn->prepare($sql2);
        $prepare2->execute(array(":idx" => Input::method("GET", "view"), ":lang" => LANG_ID, ":status" => 1));
        if ($prepare2->rowCount() > 0) {
            $data["fetch"] = $prepare2->fetch(PDO::FETCH_ASSOC);
        } else {
            redirect::url(WEBSITE . LANG . "/welcomesystem");
        }
        $include = WEB_DIR . "/monacemisnaxva.php";
        if (file_exists($include)) {
            @(include $include);
        } else {
            $controller = new error_page();
        }
    }
Ejemplo n.º 10
0
    public function template($c)
    {
        $conn = $this->conn($c);
        // connection
        if (empty(Input::method("GET", "idx"))) {
            redirect::url(WEBSITE . LANG . "/welcomesystem");
        }
        $cache = new cache();
        $welcomepage_categories = $cache->index($c, "welcomepage_categories");
        $data["welcomepage_categories"] = json_decode($welcomepage_categories, true);
        /* language variables */
        $language_data = $cache->index($c, "language_data");
        $language_data = json_decode($language_data);
        $model_template_makevars = new model_template_makevars();
        $data["language_data"] = $model_template_makevars->vars($language_data);
        $sql = 'SELECT `namelname`,`picture` FROM `studio404_users` WHERE `id`=:id';
        $prepare = $conn->prepare($sql);
        $prepare->execute(array(":id" => $_SESSION["batumi_id"]));
        if ($prepare->rowCount() > 0) {
            $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
            $data["userdata"] = $fetch;
        } else {
            redirect::url(WEBSITE);
        }
        $catalog_general = $cache->index($c, "catalog_general");
        $data["catalog_general"] = json_decode($catalog_general, true);
        $catalog_table_list = $cache->index($c, "catalog_table_list");
        $data["catalog_table_list"] = json_decode($catalog_table_list, true);
        $catalogitems = $cache->index($c, "catalogitems");
        $data["catalogitems"] = json_decode($catalogitems, true);
        $sql2 = 'SELECT 
		COUNT(`studio404_module_item`.`idx`) AS allitems
		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';
        $prepare2 = $conn->prepare($sql2);
        $prepare2->execute(array(":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
        $data["fetch"] = $prepare2->fetch(PDO::FETCH_ASSOC);
        @(include $c["website.directory"] . "/catalog.php");
    }
 public function change($c)
 {
     $conn = $this->conn($c);
     $sql = 'SELECT `id` FROM `studio404_users` WHERE `recover`=:recover AND `id`=:id';
     $prepare = $conn->prepare($sql);
     $prepare->execute(array(":recover" => Input::method("GET", "rl"), ":id" => (int) Input::method("GET", "ui")));
     if ($prepare->rowCount() > 0) {
         if (Input::method("POST", "npassword") && Input::method("POST", "npassword") === Input::method("POST", "cpassword")) {
             $update = 'UPDATE `studio404_users` SET `password`=:password, `recover`=:newrecover WHERE `recover`=:recover AND `id`=:id';
             $prepare2 = $conn->prepare($update);
             $prepare2->execute(array(":password" => md5(Input::method("POST", "npassword")), ":recover" => Input::method("GET", "rl"), ":id" => Input::method("GET", "ui"), ":newrecover" => ''));
             return "Password recovered !";
         } else {
             return "Error";
         }
     } else {
         redirect::url(WEBSITE);
         return false;
     }
 }
Ejemplo n.º 12
0
    public function template($c, $page)
    {
        $conn = $this->conn($c);
        // connection
        $cache = new cache();
        $welcomepage_categories = $cache->index($c, "welcomepage_categories");
        $data["welcomepage_categories"] = json_decode($welcomepage_categories, true);
        /* language variables */
        $language_data = $cache->index($c, "language_data");
        $language_data = json_decode($language_data);
        $model_template_makevars = new model_template_makevars();
        $data["language_data"] = $model_template_makevars->vars($language_data);
        $sql = 'SELECT `namelname`,`picture` FROM `studio404_users` WHERE `id`=:id';
        $prepare = $conn->prepare($sql);
        $prepare->execute(array(":id" => $_SESSION["batumi_id"]));
        if ($prepare->rowCount() > 0) {
            $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
            $data["userdata"] = $fetch;
        } else {
            redirect::url(WEBSITE);
        }
        $catalog_general = $cache->index($c, "catalog_general");
        $data["catalog_general"] = json_decode($catalog_general, true);
        $catalogitemsnovisiable = $cache->index($c, "catalogitemsnovisiable");
        $data["catalogitems"] = json_decode($catalogitemsnovisiable, true);
        $sql2 = 'SELECT 
		COUNT(`studio404_module_item`.`idx`) AS allitems
		FROM `studio404_module_item` WHERE 
		`studio404_module_item`.`lang`=:lang AND 
		`studio404_module_item`.`visibility`=:visibility AND 
		`studio404_module_item`.`status`!=:status';
        $prepare2 = $conn->prepare($sql2);
        $prepare2->execute(array(":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
        $data["fetch"] = $prepare2->fetch(PDO::FETCH_ASSOC);
        $include = WEB_DIR . "/nebarTvismicema.php";
        if (file_exists($include)) {
            @(include $include);
        } else {
            $controller = new error_page();
        }
    }
Ejemplo n.º 13
0
 public function select_sub($c)
 {
     $out = array();
     $conn = $this->conn($c);
     if (isset($_GET['footermenu'], $_GET['id']) && is_numeric($_GET['id'])) {
         if ($_GET['footermenu'] == "off") {
             $sqlUpdateFooter = 'UPDATE `studio404_pages` SET `footermenu`=0 WHERE `idx`=:idx';
         } else {
             if ($_GET['footermenu'] == "on") {
                 $sqlUpdateFooter = 'UPDATE `studio404_pages` SET `footermenu`=1 WHERE `idx`=:idx';
             }
         }
         $prepareUpdate = $conn->prepare($sqlUpdateFooter);
         $prepareUpdate->execute(array(":idx" => $_GET['id']));
         $files = glob(DIR . "_cache/*");
         array_map('unlink', $files);
         redirect::url(WEBSITE . LANG . "/" . $c['admin.slug'] . "?action=" . $_GET['action'] . "&super=" . $_GET['super']);
     }
     $sqlCount = 'SELECT COUNT(`id`) AS cc FROM `studio404_pages` WHERE `menu_type`!=:menu_type AND `cid`=:cid AND `status`!=:status AND `lang`=:lang';
     $prepare = $conn->prepare($sqlCount);
     $prepare->execute(array(":cid" => $_GET['super'], ":menu_type" => "super", ":status" => 1, ":lang" => LANG_ID));
     $fetchCount = $prepare->fetch(PDO::FETCH_ASSOC);
     if ($fetchCount["cc"] < 250) {
         $sql = 'SELECT * FROM `studio404_pages` WHERE `menu_type`!=:menu_type AND `cid`=:cid AND `status`!=:status AND `lang`=:lang ORDER BY `position` ASC';
         $exe_array = array(":cid" => $_GET['super'], ":menu_type" => "super", ":status" => 1, ":lang" => LANG_ID);
         $out['table'] = $this->table_sub($c, $sql, $exe_array);
         $out['pager'] = '';
     } else {
         $o = '<div class="TooManyDataElement">';
         $o .= '<div class="row"><span class="cell">Too Many Data To Load ..</span></div>';
         $o .= '</div>';
         $out['table'] = $o;
         $out['pager'] = '';
     }
     $out['count'] = $fetchCount["cc"];
     return $out;
 }
Ejemplo n.º 14
0
    public function get_users($c)
    {
        if (isset($_GET['visibilitychnage'], $_GET['load'], $_GET["allow"], $_GET['username'])) {
            $conn = $this->conn($c);
            if ($_GET['username'] != "") {
                $replaceUserAt = str_replace("xXx", "@", $_GET['username']);
                $sql = 'UPDATE `studio404_users` SET `allow`=:allow WHERE `username`=:username';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":allow" => (int) $_GET["allow"], ":username" => $replaceUserAt));
                $pn = isset($_GET['pn']) ? $_GET['pn'] : 1;
                redirect::url(WEBSITE . LANG . "/tadmin?action=fusersstat&load=users&pn=" . $pn);
            }
        }
        $out = array();
        $search2 = "";
        if (isset($_GET['search']) && !empty($_GET['search'])) {
            $search = '%' . $_GET['search'] . '%';
            $search2 = $_GET['search'];
            $search_in = ' AND (`studio404_users`.`id`=:search2 OR `studio404_users`.`username` LIKE :search ) ';
        } else {
            $search = 'a';
            $search_in = ' AND `studio404_users`.`id`!=:search AND `studio404_users`.`id`!=:search2';
        }
        /*
        if($rows['company_type']=="manufacturer"){
        			$tocomplete["tocomplete"] = $rows['tocomplete']." ";
        			$typename = "Product";
        		}else if($rows['company_type']=="serviceprovider"){
        */
        $sql = 'SELECT 
			`studio404_users`.*
			FROM 
			`studio404_users`
			WHERE 
			(`studio404_users`.`company_type`=:manufacturer OR `studio404_users`.`company_type`=:serviceprovider) AND 
			`studio404_users`.`user_type`=:website AND 
			`studio404_users`.`status`!=:status ' . $search_in . '
			ORDER BY 
			`studio404_users`.`id` DESC
			';
        $exe_array = array(":manufacturer" => "manufacturer", ":serviceprovider" => "serviceprovider", ":website" => "website", ":status" => 1, ":search" => $search, ":search2" => (int) $search2);
        $path = '?action=fusersstat&load=users&pn=';
        $itemsPerPage = 15;
        $pager = new pager();
        $pager = $pager->action($c, $sql, $exe_array, $path, $itemsPerPage);
        $out['table'] = $this->table($c, $pager[0], $exe_array);
        $out['pager'] = $pager[1];
        return $out;
    }
Ejemplo n.º 15
0
    public function type_page($c)
    {
        $conn = $this->conn($c);
        //get slug
        $url_controll = new url_controll();
        $slug = $url_controll->slugs();
        try {
            $sql = 'SELECT `page_type` FROM `studio404_pages` WHERE `slug`=:slug AND `status`!=:status';
            $prepare = $conn->prepare($sql);
            $prepare->execute(array(":slug" => $slug, ":status" => 1));
            $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
            $out = $fetch['page_type'];
        } catch (Exception $e) {
            $out = "";
        }
        if (empty($out)) {
            $explode = explode("/", $slug);
            if (is_array($explode)) {
                switch ($explode[0]) {
                    case $c["product.view.pre.slug"]:
                        $out = "product";
                        break;
                    case $c["gallery.view.pre.slug"]:
                        $out = "galleryfolder";
                        break;
                    default:
                        try {
                            $sql = 'SELECT 
						`studio404_module_attachment`.`page_type` AS pgtype 
						FROM 
						`studio404_module_item`, `studio404_module`, `studio404_module_attachment` 
						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 
						';
                            $prepare = $conn->prepare($sql);
                            $prepare->execute(array(":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1));
                            if ($slug != "" && $prepare->rowCount() <= 0) {
                                redirect::url(WEBSITE . LANG . "/page404");
                            } else {
                                $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
                                $pgtype = $fetch['pgtype'];
                                if ($pgtype == "newspage") {
                                    $out = "newsinside";
                                } else {
                                    if ($pgtype == "eventpage") {
                                        $out = "eventsinside";
                                    }
                                }
                            }
                        } catch (Exception $e) {
                            redirect::url(WEBSITE . LANG . "/page404");
                        }
                        break;
                }
            } else {
                redirect::url(WEBSITE . LANG . "/page404");
            }
        }
        return $out;
    }
Ejemplo n.º 16
0
    public function template($c, $page)
    {
        $conn = $this->conn($c);
        // connection
        $cache = new cache();
        $welcomepage_categories = $cache->index($c, "welcomepage_categories");
        $data["welcomepage_categories"] = json_decode($welcomepage_categories, true);
        /* language variables */
        $language_data = $cache->index($c, "language_data");
        $language_data = json_decode($language_data);
        $model_template_makevars = new model_template_makevars();
        $data["language_data"] = $model_template_makevars->vars($language_data);
        $sql = 'SELECT `namelname`,`picture` FROM `studio404_users` WHERE `id`=:id';
        $prepare = $conn->prepare($sql);
        $prepare->execute(array(":id" => $_SESSION["batumi_id"]));
        if ($prepare->rowCount() > 0) {
            $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
            $data["userdata"] = $fetch;
        } else {
            redirect::url(WEBSITE);
        }
        $sql2 = 'SELECT 
		`studio404_messages`.*, 
		`studio404_users`.`id` AS fromid, 
		`studio404_users`.`namelname` AS fromusername  
		FROM 
		`studio404_messages`, `studio404_users`
		WHERE 
		`studio404_messages`.`id`=:id AND 
		`studio404_messages`.`fromuser`=`studio404_users`.`id`';
        $prepare2 = $conn->prepare($sql2);
        $prepare2->execute(array(":id" => Input::method("GET", "id")));
        if ($prepare2->rowCount() > 0) {
            $fetch2 = $prepare2->fetchAll(PDO::FETCH_ASSOC);
            $data["messages"] = $fetch2;
        } else {
            redirect::url(WEBSITE . LANG . "/mailbox/inbox");
        }
        $explode = explode(",", $data["messages"][0]["read"]);
        if (!in_array($_SESSION["batumi_id"], $explode)) {
            $sel = 'SELECT `read` FROM `studio404_messages` WHERE `id`=:id';
            $prel = $conn->prepare($sel);
            $prel->execute(array(":id" => Input::method("GET", "id")));
            if ($prel->rowCount() > 0) {
                $fetl = $prel->fetch(PDO::FETCH_ASSOC);
                $old_read = $fetl['read'];
                if ($old_read != 0) {
                    $new_read = $fetl['read'] . ", " . $_SESSION["batumi_id"];
                } else {
                    $new_read = $_SESSION["batumi_id"];
                }
                $readed = 'UPDATE `studio404_messages` SET `read`=:read WHERE `id`=:id';
                $readed_prepare = $conn->prepare($readed);
                $readed_prepare->execute(array(":read" => $new_read, ":id" => Input::method("GET", "id")));
            }
        }
        if ($data["messages"][0]["attchment"]) {
            $sq = 'SELECT * FROM `studio404_messages_attachments` WHERE `msg_id`=:msg_id AND `status`!=1';
            $prepare3 = $conn->prepare($sq);
            $prepare3->execute(array(":msg_id" => Input::method("GET", "id")));
            if ($prepare3->rowCount() > 0) {
                $data["messages_attachs"] = $prepare3->fetchAll(PDO::FETCH_ASSOC);
            }
        }
        $catalog_general = $cache->index($c, "catalog_general");
        $data["catalog_general"] = json_decode($catalog_general, true);
        // $fetch2
        $catalogitemsnovisiable = $cache->index($c, "catalogitemsnovisiable");
        $data["catalogitems"] = json_decode($catalogitemsnovisiable, true);
        $include = WEB_DIR . "/readmail.php";
        if (file_exists($include)) {
            @(include $include);
        } else {
            $controller = new error_page();
        }
    }
Ejemplo n.º 17
0
 public function template($c, $page)
 {
     $conn = $this->conn($c);
     // connection
     $cache = new cache();
     $welcomepage_categories = $cache->index($c, "welcomepage_categories");
     $data["welcomepage_categories"] = json_decode($welcomepage_categories, true);
     /* language variables */
     $language_data = $cache->index($c, "language_data");
     $language_data = json_decode($language_data);
     $model_template_makevars = new model_template_makevars();
     $data["language_data"] = $model_template_makevars->vars($language_data);
     $sql = 'SELECT `namelname`,`picture` FROM `studio404_users` WHERE `id`=:id';
     $prepare = $conn->prepare($sql);
     $prepare->execute(array(":id" => $_SESSION["batumi_id"]));
     if ($prepare->rowCount() > 0) {
         $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
         $data["userdata"] = $fetch;
     } else {
         redirect::url(WEBSITE);
     }
     $catalog_general = $cache->index($c, "catalog_general");
     $data["catalog_general"] = json_decode($catalog_general, true);
     $userlist = $cache->index($c, "userlist");
     $data["userlist"] = json_decode($userlist, true);
     if (Input::method("POST", "attach") == "true" && isset($_FILES["attachment"]["name"])) {
         $x = 0;
         $data["upload_status"] = array();
         foreach ($_FILES["attachment"]["name"] as $value) {
             $ext = explode(".", $_FILES["attachment"]["name"][$x]);
             $ext = strtolower(end($ext));
             $newFilename = $x . md5(time()) . "." . $ext;
             $target_dir = DIR . "files/attachments/";
             $target_file = $target_dir . $newFilename;
             // Allow certain file formats
             if ($ext != "jpg" && $ext != "png" && $ext != "jpeg" && $ext != "gif" && $ext != "doc" && $ext != "docx" && $ext != "pdf" && $ext != "xls" && $ext != "xlsx" && $ext != "zip" && $ext != "rar") {
                 $data["upload_status"]["filename"][] = $_FILES["attachment"]["name"][$x];
                 $data["upload_status"]["error"][] = true;
             } else {
                 if (move_uploaded_file($_FILES["attachment"]["tmp_name"][$x], $target_file)) {
                     $insert = 'INSERT INTO `studio404_messages_attachments` SET `msg_id`=:msg_id, `file`=:file, `ext`=:ext, `size`=:size';
                     $prepare = $conn->prepare($insert);
                     $prepare->execute(array(":msg_id" => Input::method("POST", "insert_id"), ":file" => $newFilename, ":ext" => $ext, ":size" => $_FILES["attachment"]["size"][$x]));
                     $data["upload_status"]["filename"][] = $_FILES["attachment"]["name"][$x];
                     $data["upload_status"]["error"][] = false;
                 } else {
                     $data["upload_status"]["filename"][] = $_FILES["attachment"]["name"][$x];
                     $data["upload_status"]["error"][] = true;
                 }
             }
             $x++;
         }
     }
     if (Input::method("GET", "draft_id") && is_numeric(Input::method("GET", "draft_id"))) {
         $sql = 'SELECT * FROM `studio404_messages` WHERE `id`=:draft_id AND `fromuser`=:fromuser AND `draft`=1 AND `status`!=1';
         $prepare = $conn->prepare($sql);
         $prepare->execute(array(":draft_id" => Input::method("GET", "draft_id"), ":fromuser" => $_SESSION["batumi_id"]));
         if ($prepare->rowCount()) {
             $data["selected_draft"] = $prepare->fetch(PDO::FETCH_ASSOC);
         } else {
             $data["selected_draft"] = false;
         }
     } else {
         $data["selected_draft"] = false;
     }
     $catalogitemsnovisiable = $cache->index($c, "catalogitemsnovisiable");
     $data["catalogitems"] = json_decode($catalogitemsnovisiable, true);
     $include = WEB_DIR . "/compose.php";
     if (file_exists($include)) {
         @(include $include);
     } else {
         $controller = new error_page();
     }
 }
Ejemplo n.º 18
0
// if($LANG==$c['admin.slug']){
// 	redirect::url(WEBSITE.$c['main.language']."/".$c['admin.slug']);
// }
if (empty($LANG)) {
    // just domain name
    $redirect = new redirect();
    $redirect->go(WEBSITE . $c['main.language'] . "/" . $c["welcome.page.slug"]);
} else {
    if (!in_array($LANG, $c['languages.array']) && $LANG != "image" && $LANG != $c['admin.slug']) {
        $welcome_class = $c["welcome.page.slug"];
        $main_language = $c['main.language'];
        $redirect = new redirect();
        $redirect->go(WEBSITE . $main_language . "/" . $welcome_class);
    } else {
        if ($LANG == $c['admin.slug']) {
            redirect::url(WEBSITE . $c['main.language'] . "/" . $c['admin.slug']);
        }
    }
}
$get_ip = new get_ip();
$ip = $get_ip->ip;
if (empty($LANG)) {
    // just domain name
    $redirect = new redirect();
    $redirect->go(WEBSITE . $c['main.language'] . "/" . $c["welcome.page.slug"]);
}
/*
insert log
*/
// $file_manipulate = new file_manipulate();
// $file_manipulate->insertLog("[".$ip."][".date("d-m-Y G:m:s")."] - ".WEBSITE_.$actual_link);
Ejemplo n.º 19
0
     }
     if (file_exists('model/' . $class_name . '.php')) {
         @(include 'model/' . $class_name . '.php');
         $class_load = true;
     }
     if (!$class_load) {
         echo "Class: <b>" . $class_name . "</b> can't load..";
         exit;
     }
 }
 $actual_link = "{$_SERVER['REQUEST_URI']}";
 $findme = array('\'', '~', '!', '@', '$', '^', '*', '(', ')', '{', '}', '[', ']', '|', ';', '<', '>', '\\', '..');
 foreach ($findme as $f) {
     $pos = strpos($actual_link, $f);
     if ($pos !== false) {
         redirect::url(WEBSITE);
     }
 }
 $obj = new url_controll();
 $LANG = $obj->url("segment", 1);
 $get_ip = new get_ip();
 $ip = $get_ip->ip;
 if (empty($LANG)) {
     // just domain name
     $LANG = $c['main.language'];
 } else {
     if (!in_array($LANG, $c['languages.array']) && $LANG != "image" && $LANG != $c['admin.slug']) {
         $welcome_class = $c["welcome.page.slug"];
         $main_language = $c['main.language'];
         $redirect = new redirect();
         $redirect->go(WEBSITE . $main_language . "/" . $welcome_class);
Ejemplo n.º 20
0
    public function template($c, $page)
    {
        $conn = $this->conn($c);
        // connection
        $cache = new cache();
        $welcomepage_categories = $cache->index($c, "welcomepage_categories");
        $data["welcomepage_categories"] = json_decode($welcomepage_categories, true);
        /* language variables */
        $language_data = $cache->index($c, "language_data");
        $language_data = json_decode($language_data);
        $model_template_makevars = new model_template_makevars();
        $data["language_data"] = $model_template_makevars->vars($language_data);
        $sql = 'SELECT `namelname`,`picture` FROM `studio404_users` WHERE `id`=:id';
        $prepare = $conn->prepare($sql);
        $prepare->execute(array(":id" => $_SESSION["batumi_id"]));
        if ($prepare->rowCount() > 0) {
            $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
            $data["userdata"] = $fetch;
        } else {
            redirect::url(WEBSITE);
        }
        $form = $cache->index($c, "form");
        $data["form"] = json_decode($form, true);
        if (Input::method("POST", "file")) {
            $model_admin_selectLanguage = new model_admin_selectLanguage();
            $lang_query = $model_admin_selectLanguage->select_languages($c);
            for ($input_file_count = 0; $input_file_count < count($_FILES["file"]["name"]); $input_file_count++) {
                foreach ($_FILES["file"]["name"][$input_file_count] as $key => $value) {
                    if ($value != "") {
                        $gallery_idx = Input::method("POST", "gallery_idx_post");
                        $insert_admin = $_SESSION["batumi_id"];
                        $filenumber = $_POST['filenumber'];
                        $filenumber = $filenumber[$input_file_count];
                        $inputname = Input::method("POST", "form-name-" . $filenumber);
                        $attach = Input::method("POST", "form-attach-" . $filenumber);
                        $important = Input::method("POST", "form-important-" . $filenumber);
                        $multiple = Input::method("POST", "form-multiple-" . $filenumber);
                        $format = explode(",", Input::method("POST", "form-format-" . $filenumber));
                        //$format = end($format);
                        $filename = $_FILES["file"]["name"][$input_file_count][$key];
                        $filesize = $_FILES["file"]["size"][$input_file_count][$key];
                        $filetype_arr = explode(".", $filename);
                        $filetype = end($filetype_arr);
                        if (in_array($filetype, $format)) {
                            $sqlm = 'SELECT MAX(`idx`)+1 AS maxid FROM `studio404_gallery_file`';
                            $querym = $conn->query($sqlm);
                            $rowm = $querym->fetch(PDO::FETCH_ASSOC);
                            $max_idx = $rowm['maxid'] ? $rowm['maxid'] : 1;
                            $sql_max_posm = 'SELECT MAX(`position`)+1 AS maxpos FROM `studio404_gallery_file` WHERE `status`!=:status';
                            $preparem = $conn->prepare($sql_max_posm);
                            $preparem->execute(array(":status" => 1));
                            $row2m = $preparem->fetch(PDO::FETCH_ASSOC);
                            $max_pos = $row2m['maxpos'] ? $row2m['maxpos'] : 1;
                            $filename_new = $filetype_arr[0] . md5(sha1(time())) . "." . $filetype;
                            $target_file = DIR . "files/document/" . $filename_new;
                            if (move_uploaded_file($_FILES["file"]["tmp_name"][$input_file_count][$key], $target_file)) {
                                foreach ($lang_query as $lang_row) {
                                    $insert_into_gallery = 'INSERT INTO `studio404_gallery_file` SET 
									`idx`=:idx, 
									`date`=:date, 
									`gallery_idx`=:gallery_idx, 
									`file`=:file, 
									`fileinputname`=:fileinputname, 
									`media_type`=:media_type, 
									`title`=:title, 
									`description`=:description, 
									`filesize`=:filesize, 
									`insert_admin`=:insert_admin, 
									`position`=:position, 
									`lang`=:lang';
                                    $prepare_insert = $conn->prepare($insert_into_gallery);
                                    $prepare_insert->execute(array(":idx" => $max_idx, ":date" => time(), ":gallery_idx" => $gallery_idx, ":file" => $filename_new, ":fileinputname" => $inputname, ":media_type" => $filetype, ":title" => "Not Defined", ":description" => "Not Defined", ":filesize" => $filesize, ":insert_admin" => $insert_admin, ":position" => $max_pos, ":lang" => $lang_row["id"]));
                                }
                            }
                        }
                    }
                }
            }
        }
        if (Input::method("POST", "close_after_add")) {
            $parent = Input::method("GET", "parent");
            $back = Input::method("GET", "back");
            redirect::url(WEBSITE . LANG . "/" . $back . "?idx=" . $parent);
        }
        $include = WEB_DIR . "/monacemisdamateba.php";
        if (file_exists($include)) {
            @(include $include);
        } else {
            $controller = new error_page();
        }
    }
Ejemplo n.º 21
0
 public function template($c, $page)
 {
     $conn = $this->conn($c);
     // connection
     $cache = new cache();
     $homepage_general = $cache->index($c, "homepage_general");
     $data["homepage_general"] = json_decode($homepage_general);
     $data["homepage_files"] = $cache->index($c, "homepage_files");
     /* languages */
     $languages = $cache->index($c, "languages");
     $data["languages"] = json_decode($languages);
     /* language variables */
     $language_data = $cache->index($c, "language_data");
     $language_data = json_decode($language_data);
     $model_template_makevars = new model_template_makevars();
     $data["language_data"] = $model_template_makevars->vars($language_data);
     /* website menu header & footer */
     $menu_array = $cache->index($c, "main_menu");
     $menu_array = json_decode($menu_array);
     if ($menu_array) {
         $model_template_main_menu = new model_template_main_menu();
         $data["main_menu"] = $model_template_main_menu->nav($menu_array, "header");
         $data["footer_menu"] = $model_template_main_menu->nav($menu_array, "footer");
     }
     /* components */
     $components = $cache->index($c, "components");
     $data["components"] = json_decode($components);
     $select = 'SELECT * FROM `studio404_users_pass_recover` WHERE `hash`=:hash AND `status`!=1';
     $prepare = $conn->prepare($select);
     $prepare->execute(array(":hash" => Input::method("GET", "token")));
     if ($prepare->rowCount() > 0) {
         $fetchme = $prepare->fetch(PDO::FETCH_ASSOC);
         $data["recover_id"] = $fetchme["id"];
         $data["recover_username"] = $fetchme["usersemail"];
         $data["newpassword"] = $fetchme["temp"];
         $data["newpassword_md5"] = md5($fetchme["temp"]);
         //update password
         $update = 'UPDATE `studio404_users` SET `password`=:newpassword WHERE `username`=:username AND `status`!=1';
         $pre_update = $conn->prepare($update);
         $pre_update->execute(array(":newpassword" => $data["newpassword_md5"], ":username" => $data["recover_username"]));
         // update recover
         $update2 = 'UPDATE `studio404_users_pass_recover` SET `status`=1 WHERE `id`=:id';
         $pre_update2 = $conn->prepare($update2);
         $pre_update2->execute(array(":id" => $data["recover_id"]));
         if (LANG == "ge") {
             $data["users_message"] = '<strong>მომხმარებლის სახელი: </strong> ' . $data["recover_username"] . '<br />';
             $data["users_message"] .= '<strong>დროებითი პაროლი: </strong> ' . $data["newpassword"] . '<br />';
         } else {
             $data["users_message"] = '<strong>Username: </strong> ' . $data["recover_username"] . '<br />';
             $data["users_message"] .= '<strong>Temporary Password: </strong> ' . $data["newpassword"] . '<br />';
         }
     } else {
         redirect::url(WEBSITE . LANG . "/page404");
     }
     $include = WEB_DIR . "/temporarypassword.php";
     if (file_exists($include)) {
         @(include $include);
     } else {
         $controller = new error_page();
     }
 }
Ejemplo n.º 22
0
 function __construct($c)
 {
     redirect::url(WEBSITE . $c['main.language'] . "/mailbox/inbox");
     // $this->template($c,"mailbox");
 }
Ejemplo n.º 23
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();
                $sql = 'SELECT * FROM `studio404_pages` WHERE `idx`=:idx AND `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":idx" => (int) Input::method("GET", "v"), ":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 `idx`=:idx AND `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":idx" => (int) Input::method("GET", "v"), ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    redirect::url(WEBSITE);
                }
                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 `idx`=:idx AND `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":idx" => (int) Input::method("GET", "v"), ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    redirect::url(WEBSITE);
                }
                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 `idx`=:idx AND `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":idx" => (int) Input::method("GET", "v"), ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    redirect::url(WEBSITE);
                }
                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 `idx`=:idx AND `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":idx" => (int) Input::method("GET", "v"), ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    redirect::url(WEBSITE);
                }
                break;
            case "news_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_module_item` WHERE `idx`=:idx AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status ';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":idx" => (int) Input::method("GET", "id"), ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    redirect::url(WEBSITE);
                }
                break;
            case "news_list":
                $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`.`long_description`!="" 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 10
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":pagetype" => 'newspage', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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`.`idx`=:idx AND 
			`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(":idx" => (int) Input::method("GET", "v"), ":media_type" => 'photo', ":media_type_doc" => 'document', ":pagetype" => 'teampage', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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`.`idx`=:idx AND 
			`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(":idx" => (int) Input::method("GET", "v"), ":pagetype" => 'catalogpage', ":media_type" => 'photo', ":media_type_doc" => 'document', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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`.`idx`=:idx AND 
			`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(":idx" => (int) Input::method("GET", "v"), ":pagetype" => 'catalogpage', ":media_type" => 'photo', ":media_type_doc" => 'document', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_CLASS, "db_catalog");
                } else {
                    $fetch = array();
                }
                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`.`idx`=:idx AND 
			`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(":idx" => (int) Input::method("GET", "v"), ":pagetype" => 'publicationpage', ":media_type" => 'photo', ":media_type_doc" => 'document', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    redirect::url(WEBSITE);
                }
                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`.`idx`=:idx AND 
			`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(":idx" => (int) Input::method("GET", "v"), ":media_type" => 'photo', ":slug" => $slug, ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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`.`idx`=:idx AND 
			`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(":idx" => (int) Input::method("GET", "v"), ":slug" => $slug, ":media_type" => 'photo', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                break;
            case "last_news_files":
                $sql = 'SELECT 
			`studio404_module_item`.`idx`
			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`.`long_description`!="" 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);
                $idx = $f[0]["idx"];
                $sql = 'SELECT 
			`studio404_gallery_file`.*
			FROM 
			`studio404_module_item`,`studio404_gallery_attachment`,`studio404_gallery`,`studio404_gallery_file` 
			WHERE 
			`studio404_module_item`.`idx`=:idx 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(":idx" => $idx, ":media_type" => 'photo', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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`.`idx`=:idx 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(":idx" => (int) Input::method("GET", "id"), ":media_type" => 'photo', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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`.`idx`=:idx AND 
			`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(":idx" => (int) Input::method("GET", "v"), ":slug" => $slug, ":media_type" => 'document', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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`.`idx`=:idx 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(":idx" => (int) Input::method("GET", "id"), ":media_type" => 'document', ":status" => 1, ":visibility" => 1, ":lang" => LANG_ID));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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'));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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" => 2));
                $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));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_CLASS, "db_structure");
                } else {
                    $fetch = array();
                }
                break;
            case "left_menu":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT `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['cid']));
                $fetch = $prepare2->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));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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`.`long_description`!="" 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));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                break;
            case "events":
                $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`.`date`>:nowdate AND 
			`studio404_module_item`.`lang`=:lang AND 
			`studio404_module_item`.`visibility`!=:visibility AND 
			`studio404_module_item`.`status`!=:status 
			ORDER BY `studio404_module_item`.`date` ASC LIMIT 15 
			';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":nowdate" => time(), ":pagetype" => 'eventpage', ":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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`.`idx`=:idx AND 
			`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(":idx" => (int) Input::method("GET", "v"), ":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1, ":page_type" => 'eventpage'));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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`.`idx`=:idx AND 
			`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', ":idx" => (int) Input::method("GET", "id"), ":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    redirect::url(WEBSITE);
                }
                break;
            case "eventsinside_general":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $sql = 'SELECT * FROM `studio404_module_item` WHERE `idx`=:idx AND `slug`=:slug AND `lang`=:lang AND `visibility`!=:visibility AND `status`!=:status';
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":idx" => (int) Input::method("GET", "id"), ":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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_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`.`idx`=:idx AND 
			`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(":idx" => (int) Input::method("GET", "v"), ":slug" => $slug, ":lang" => LANG_ID, ":visibility" => 1, ":status" => 1, ":page_type" => 'photogallerypage', ":media_type" => 'photo'));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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'));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                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'));
                if ($prepare->rowCount() > 0) {
                    $fetch = $prepare->fetchAll(PDO::FETCH_ASSOC);
                } else {
                    $fetch = array();
                }
                break;
            case "breadcrups":
                $get_slug_from_url = new get_slug_from_url();
                $slug = $get_slug_from_url->slug();
                $fetch = $this->breakcrups($c, $slug);
                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 view($obj, $c)
 {
     // post and get request handler
     $model_admin_requests = new model_admin_requests();
     $data = $model_admin_requests->requestx($c);
     // select page managed menu
     $model_admin_selectManagedMenu = new model_admin_selectManagedMenu();
     $data["managed_pages"] = $model_admin_selectManagedMenu->select($c);
     $data["managed_pages2"] = $model_admin_selectManagedMenu->select($c, true);
     // breadcrups module
     $model_admin_breadcrups = new model_admin_breadcrups();
     $data["breadcrups"] = $model_admin_breadcrups->get($c);
     // get componemt menu
     $model_admin_components = new model_admin_components();
     $data["components"] = $model_admin_components->select_components_menu($c);
     $action = filter_input(INPUT_GET, "action");
     if (isset($_SESSION["user404"]) && !empty($_SESSION["user404"])) {
         if (isset($action) && $action == "mainMenu") {
             $data["website_title"] = "Welcome / Admin Panel - v: " . $c['cmsversion'];
             @(include "view/view_admin_mainmenu.php");
         } else {
             if (isset($action) && $action == "addAdmin") {
                 $data["website_title"] = "Add admin / Admin Panel - v: " . $c['cmsversion'];
                 $model_admin_select_admintypes = new model_admin_select_admintypes();
                 $data["admin_types"] = $model_admin_select_admintypes->select($c);
                 @(include "view/view_admin_addAdmin.php");
             } else {
                 if (isset($action) && $action == "userList") {
                     $data["website_title"] = "Admin users / Admin Panel - v: " . $c['cmsversion'];
                     $model_admin_select = new model_admin_select();
                     $admin_list = $model_admin_select->select_admins($c);
                     $data['table'] = $admin_list['table'];
                     $data['pager'] = $admin_list['pager'];
                     @(include "view/view_admin_userlist.php");
                 } else {
                     if (isset($action) && $action == "wuserList") {
                         $data["website_title"] = "Website users / Admin Panel - v: " . $c['cmsversion'];
                         $model_admin_select = new model_admin_select();
                         $admin_list = $model_admin_select->select_websiteusers($c);
                         $data['table'] = $admin_list['table'];
                         $data['pager'] = $admin_list['pager'];
                         @(include "view/view_admin_wuserlist.php");
                     } else {
                         if (isset($action) && $action == "waddUser") {
                             $data["website_title"] = "Add website user / Admin Panel - v: " . $c['cmsversion'];
                             @(include "view/view_admin_addwebsiteuser.php");
                         } else {
                             if (isset($action) && $action == "weditprofile") {
                                 $data["website_title"] = "Edit website user / Admin Panel - v: " . $c['cmsversion'];
                                 $model_admin_editprofile = new model_admin_editprofile();
                                 $_SESSION["token"] = $_GET['token'];
                                 $data["profile"] = $model_admin_editprofile->select_profile2($c);
                                 @(include "view/view_admin_editwebsiteuser.php");
                             } else {
                                 if (isset($action) && $action == "editprofile") {
                                     $data["website_title"] = "Edit profile / Admin Panel - v: " . $c['cmsversion'];
                                     $model_admin_editprofile = new model_admin_editprofile();
                                     $data["profile"] = $model_admin_editprofile->select_profile($c);
                                     $model_admin_select_admintypes = new model_admin_select_admintypes();
                                     $data["admin_types"] = $model_admin_select_admintypes->select($c);
                                     @(include "view/view_admin_editprofile.php");
                                 } else {
                                     if (isset($action) && $action == "changePassword") {
                                         $data["website_title"] = "Change Password / Admin Panel - v: " . $c['cmsversion'];
                                         @(include "view/view_admin_changePassword.php");
                                     } else {
                                         if (isset($action) && $action == "profileSettings") {
                                             $model_admin_profile = new model_admin_profile();
                                             $data["profile"] = $model_admin_profile->selectAdminProfile($c);
                                             $data["website_title"] = "Profile settings / Admin Panel - v: " . $c['cmsversion'];
                                             @(include "view/view_admin_profileSettings.php");
                                         } else {
                                             if (isset($action) && $action == "signout") {
                                                 unset($_SESSION["user404"]);
                                                 $redirect = new redirect();
                                                 $redirect->go("?action=login");
                                             } else {
                                                 if (isset($action) && $action == "userRights") {
                                                     $data["website_title"] = "User rights / Admin Panel - v: " . $c['cmsversion'];
                                                     $model_admin_userrights = new model_admin_userrights();
                                                     $admin_rightgroups = $model_admin_userrights->select_admins_rightgroups($c);
                                                     $data['table'] = $admin_rightgroups['table'];
                                                     $data['pager'] = $admin_rightgroups['pager'];
                                                     @(include "view/view_admin_userRights.php");
                                                 } else {
                                                     if (isset($action) && $action == "addAdminRights") {
                                                         $data["website_title"] = "Add admin user rights / Admin Panel - v: " . $c['cmsversion'];
                                                         @(include "view/view_admin_rights.php");
                                                     } else {
                                                         if (isset($action) && $action == "editAdminRights") {
                                                             $data["website_title"] = "Edit admin user rights / Admin Panel - v: " . $c['cmsversion'];
                                                             $model_admin_userrights = new model_admin_userrights();
                                                             $data["user_rights"] = $model_admin_userrights->select_userright($c);
                                                             @(include "view/view_admin_editAdminRights.php");
                                                         } else {
                                                             if ($_GET['action'] == "log") {
                                                                 $data["website_title"] = "Logs / Admin Panel - v: " . $c['cmsversion'];
                                                                 $model_admin_logs = new model_admin_logs();
                                                                 $admin_logs = $model_admin_logs->select_admin_logs($c);
                                                                 $data['table'] = $admin_logs['table'];
                                                                 $data['pager'] = $admin_logs['pager'];
                                                                 @(include "view/view_admin_log.php");
                                                             } else {
                                                                 if ($_GET['action'] == "textConverter") {
                                                                     $data["website_title"] = "Text converter / Admin Panel - v: " . $c['cmsversion'];
                                                                     @(include "view/view_admin_textconverter.php");
                                                                 } else {
                                                                     if ($_GET['action'] == "menuManagment") {
                                                                         $data["website_title"] = "Page managment/ Admin Panel - v: " . $c['cmsversion'];
                                                                         $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                         $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                         $model_admin_menumanagment = new model_admin_menumanagment();
                                                                         $admin_list = $model_admin_menumanagment->select_menus($c);
                                                                         $data['table'] = $admin_list['table'];
                                                                         $data['pager'] = $admin_list['pager'];
                                                                         @(include "view/view_admin_pagemanagment.php");
                                                                     } else {
                                                                         if (isset($action) && $action == "editMenuManagment") {
                                                                             $data["website_title"] = "Edit page managment / Admin Panel - v: " . $c['cmsversion'];
                                                                             $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                             $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                             $model_admin_editMenuManagment = new model_admin_editMenuManagment();
                                                                             $data["pagesManagment"] = $model_admin_editMenuManagment->select_editMenuManagment($c);
                                                                             @(include "view/view_admin_editMenuManagment.php");
                                                                         } else {
                                                                             if (isset($action) && $action == "addPageManagment") {
                                                                                 $data["website_title"] = "Add page managment / Admin Panel - v: " . $c['cmsversion'];
                                                                                 @(include "view/view_admin_addMenuManagment.php");
                                                                             } else {
                                                                                 if (isset($action) && $action == "sitemap") {
                                                                                     $data["website_title"] = "Sitemap / Admin Panel - v: " . $c['cmsversion'];
                                                                                     $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                     $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                     $model_admin_menumanagment = new model_admin_menumanagment();
                                                                                     $admin_list = $model_admin_menumanagment->select_sub($c);
                                                                                     $data['table'] = $admin_list['table'];
                                                                                     $data['pager'] = $admin_list['pager'];
                                                                                     @(include "view/view_admin_sitemap.php");
                                                                                 } else {
                                                                                     if (isset($action) && $action == "addSitemapItem") {
                                                                                         $data["website_title"] = "Add Sitemap Item / Admin Panel - v: " . $c['cmsversion'];
                                                                                         // $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                         // $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                         $check_super = new check_super();
                                                                                         $super_exists = $check_super->super($c);
                                                                                         if (!$super_exists) {
                                                                                             $data["outMessage"] = 2;
                                                                                         } else {
                                                                                             if (isset($_GET['super'], $_GET['sub'])) {
                                                                                                 $pre_slug = new pre_slug();
                                                                                                 $pre_slug_method = $pre_slug->slug($c, $_GET['super'], $_GET['sub']);
                                                                                                 if (is_array($pre_slug_method)) {
                                                                                                     $reverse = array_reverse($pre_slug_method);
                                                                                                     $data['pre_slug'] = implode("/", $reverse);
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                         @(include "view/view_admin_addSitemapItem.php");
                                                                                     } else {
                                                                                         if (isset($action) && $action == "editSitemap") {
                                                                                             $data["website_title"] = "Edit sitemap / Admin Panel - v: " . $c['cmsversion'];
                                                                                             $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                             $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                             $edit_page_interface = new edit_page_interface();
                                                                                             $data["interface"] = $edit_page_interface->out_interface($c);
                                                                                             @(include "view/view_admin_editSiteMap.php");
                                                                                         } else {
                                                                                             if (isset($action) && $action == "newsModule") {
                                                                                                 $data["website_title"] = "News module / Admin Panel - v: " . $c['cmsversion'];
                                                                                                 $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                 $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                 $model_admin_newsmodule = new model_admin_newsmodule();
                                                                                                 $news_list = $model_admin_newsmodule->select_list($c);
                                                                                                 $data['table'] = $news_list['table'];
                                                                                                 $data['pager'] = $news_list['pager'];
                                                                                                 @(include "view/view_admin_news_module.php");
                                                                                             } else {
                                                                                                 if (isset($action) && $action == "addNews" && isset($_GET['newsidx'])) {
                                                                                                     $data["website_title"] = "Add news / Admin Panel - v: " . $c['cmsversion'];
                                                                                                     $news_slug = new news_slug();
                                                                                                     $data["pre_slug"] = $news_slug->slug($c);
                                                                                                     @(include "view/view_admin_addnews.php");
                                                                                                 } else {
                                                                                                     if (isset($action) && $action == "addCatalog" && isset($_GET['catalogidx'])) {
                                                                                                         $data["website_title"] = "Add catalog / Admin Panel - v: " . $c['cmsversion'];
                                                                                                         $news_slug = new news_slug();
                                                                                                         $data["pre_slug"] = $news_slug->slug($c);
                                                                                                         @(include "view/view_admin_addcatalog.php");
                                                                                                     } else {
                                                                                                         if (isset($action) && $action == "catalogModule") {
                                                                                                             $data["website_title"] = "Catalog module / Admin Panel - v: " . $c['cmsversion'];
                                                                                                             $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                             $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                             $model_admin_catalogmodule = new model_admin_catalogmodule();
                                                                                                             $news_list = $model_admin_catalogmodule->select_list($c);
                                                                                                             $data['table'] = $news_list['table'];
                                                                                                             $data['pager'] = $news_list['pager'];
                                                                                                             @(include "view/view_admin_catalog_module.php");
                                                                                                         } else {
                                                                                                             if (isset($action) && $action == "editNewsItem") {
                                                                                                                 $data["website_title"] = "Edit news item / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                 $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                 $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                 $edit_page_interface = new edit_page_interface();
                                                                                                                 $data["interface"] = $edit_page_interface->out_interface($c);
                                                                                                                 @(include "view/view_admin_editNewsItem.php");
                                                                                                             } else {
                                                                                                                 if (isset($action) && $action == "editCatalogItem") {
                                                                                                                     $data["website_title"] = "Edit catalog item / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                     $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                     $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                     $edit_page_interface = new edit_page_interface();
                                                                                                                     $data["interface"] = $edit_page_interface->out_interface($c);
                                                                                                                     @(include "view/view_admin_editCatalogItem.php");
                                                                                                                 } else {
                                                                                                                     if (isset($action) && $action == "catalogMoreInfo") {
                                                                                                                         $data["website_title"] = "Catalog more info  / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                         $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                         $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                         $model_admin_catalogmoreinfo = new model_admin_catalogmoreinfo();
                                                                                                                         $news_list = $model_admin_catalogmoreinfo->select_list_all($c);
                                                                                                                         $data['table'] = $news_list['table'];
                                                                                                                         $data['pager'] = $news_list['pager'];
                                                                                                                         @(include "view/view_admin_catalogmoreinfo.php");
                                                                                                                     } else {
                                                                                                                         if (isset($action) && $action == "addCatalogMoreInfo") {
                                                                                                                             $data["website_title"] = "Add catalog more info / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                             $model_admin_catalogmodule = new model_admin_catalogmodule();
                                                                                                                             $data["catalogs"] = $model_admin_catalogmodule->getcatalogs($c);
                                                                                                                             @(include "view/view_admin_addcatalogmoreinfo.php");
                                                                                                                         } else {
                                                                                                                             if (isset($action, $_GET['id']) && is_numeric($_GET['id']) && $action == "editCatalogMoreInfo") {
                                                                                                                                 $data["website_title"] = "Edit catalog more info / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                 $model_admin_catalogmoreinfo = new model_admin_catalogmoreinfo();
                                                                                                                                 $data['info'] = $model_admin_catalogmoreinfo->select_one($c, $_GET['id']);
                                                                                                                                 $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                 $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                 $model_admin_catalogmodule = new model_admin_catalogmodule();
                                                                                                                                 $data["catalogs"] = $model_admin_catalogmodule->getcatalogs($c);
                                                                                                                                 @(include "view/view_admin_editcatalogmoreinfo.php");
                                                                                                                             } else {
                                                                                                                                 if (isset($action) && $action == "components") {
                                                                                                                                     $data["website_title"] = "Components / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                     $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                     $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                     $model_admin_components = new model_admin_components();
                                                                                                                                     $components = $model_admin_components->select($c);
                                                                                                                                     $data['table'] = $components['table'];
                                                                                                                                     $data['pager'] = $components['pager'];
                                                                                                                                     @(include "view/view_admin_components.php");
                                                                                                                                 } else {
                                                                                                                                     if (isset($action) && $action == "addComponents") {
                                                                                                                                         $data["website_title"] = "Add components / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                         @(include "view/view_admin_addcomponents.php");
                                                                                                                                     } else {
                                                                                                                                         if (isset($action) && $action == "editComponents") {
                                                                                                                                             $data["website_title"] = "Edit components / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                             $edit_page_interface = new edit_page_interface();
                                                                                                                                             $data["interface"] = $edit_page_interface->general_form_components($c);
                                                                                                                                             @(include "view/view_admin_editcomponents.php");
                                                                                                                                         } else {
                                                                                                                                             if (isset($action) && $action == "componentModule") {
                                                                                                                                                 $data["website_title"] = "Component module / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                 $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                                 $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                                 $model_admin_componentsmodele = new model_admin_componentsmodele();
                                                                                                                                                 $components = $model_admin_componentsmodele->select($c);
                                                                                                                                                 $data['table'] = $components['table'];
                                                                                                                                                 $data['pager'] = $components['pager'];
                                                                                                                                                 @(include "view/view_admin_componentsmodel.php");
                                                                                                                                             } else {
                                                                                                                                                 if (isset($action) && $action == "addComponentsModule") {
                                                                                                                                                     $data["website_title"] = "Add components module / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                     @(include "view/view_admin_addcomponentsmodule.php");
                                                                                                                                                 } else {
                                                                                                                                                     if (isset($action) && $action == "editComponentsModule") {
                                                                                                                                                         $data["website_title"] = "Edit components module / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                         $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                                         $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                                         $model_admin_componentsmodele = new model_admin_componentsmodele();
                                                                                                                                                         $data["select"] = $model_admin_componentsmodele->select_one($c);
                                                                                                                                                         @(include "view/view_admin_editcomponentsmodule.php");
                                                                                                                                                     } else {
                                                                                                                                                         if (isset($action) && $action == "languages") {
                                                                                                                                                             $data["website_title"] = "Languages / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                             $model_admin_languages = new model_admin_languages();
                                                                                                                                                             $languages = $model_admin_languages->select($c);
                                                                                                                                                             $data['table'] = $languages['table'];
                                                                                                                                                             $data['pager'] = $languages['pager'];
                                                                                                                                                             @(include "view/view_admin_languages.php");
                                                                                                                                                         } else {
                                                                                                                                                             if (isset($action) && $action == "addlanguage") {
                                                                                                                                                                 $data["website_title"] = "Add language / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                 @(include "view/view_admin_addlanguage.php");
                                                                                                                                                             } else {
                                                                                                                                                                 if (isset($action) && $action == "editLanguage") {
                                                                                                                                                                     $data["website_title"] = "Edit language / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                     $model_admin_languages = new model_admin_languages();
                                                                                                                                                                     $data["info"] = $model_admin_languages->select_one($c);
                                                                                                                                                                     @(include "view/view_admin_editlanguage.php");
                                                                                                                                                                 } else {
                                                                                                                                                                     if (isset($action) && $action == "languageData") {
                                                                                                                                                                         $data["website_title"] = "Language data / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                         $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                                                         $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                                                         $model_admin_languageData = new model_admin_languageData();
                                                                                                                                                                         $languages = $model_admin_languageData->select($c);
                                                                                                                                                                         $data['table'] = $languages['table'];
                                                                                                                                                                         $data['pager'] = $languages['pager'];
                                                                                                                                                                         @(include "view/view_admin_languageData.php");
                                                                                                                                                                     } else {
                                                                                                                                                                         if (isset($action) && $action == "addlanguageData") {
                                                                                                                                                                             $data["website_title"] = "Add language data / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                             @(include "view/view_admin_addlanguageData.php");
                                                                                                                                                                         } else {
                                                                                                                                                                             if (isset($action) && $action == "editLanguageData") {
                                                                                                                                                                                 $data["website_title"] = "Edit language data / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                 $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                                                                 $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                                                                 $model_admin_languageData = new model_admin_languageData();
                                                                                                                                                                                 $data["info"] = $model_admin_languageData->select_one($c);
                                                                                                                                                                                 @(include "view/view_admin_editlanguagedata.php");
                                                                                                                                                                             } else {
                                                                                                                                                                                 if (isset($action) && $action == "charts") {
                                                                                                                                                                                     $data["website_title"] = "Charts / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                     $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                                                                     $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                                                                     $model_admin_charts = new model_admin_charts();
                                                                                                                                                                                     $invoices = $model_admin_charts->select($c);
                                                                                                                                                                                     $data['table'] = $invoices['table'];
                                                                                                                                                                                     $data['pager'] = $invoices['pager'];
                                                                                                                                                                                     @(include "view/view_admin_charts.php");
                                                                                                                                                                                 } else {
                                                                                                                                                                                     if (isset($action) && $action == "addChart") {
                                                                                                                                                                                         $data["website_title"] = "Add Chart / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                         // $model_admin_charts = new model_admin_charts();
                                                                                                                                                                                         // $invoices = $model_admin_charts->select($c);
                                                                                                                                                                                         // $data['table'] = $invoices['table'];
                                                                                                                                                                                         // $data['pager'] = $invoices['pager'];
                                                                                                                                                                                         @(include "view/view_admin_charts_add.php");
                                                                                                                                                                                         //addChart
                                                                                                                                                                                     } else {
                                                                                                                                                                                         if (isset($action) && $action == "emailnewsletter") {
                                                                                                                                                                                             $data["website_title"] = "Email newsletter / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                             $model_admin_newslettermain = new model_admin_newslettermain();
                                                                                                                                                                                             $data["info"] = $model_admin_newslettermain->select_main($c);
                                                                                                                                                                                             $data["email_limit"] = $c["max.send.email.per.day"];
                                                                                                                                                                                             @(include "view/view_admin_emailnewsletter.php");
                                                                                                                                                                                         } else {
                                                                                                                                                                                             if (isset($action) && $action == "invoices") {
                                                                                                                                                                                                 $data["website_title"] = "Invoices / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                 $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                                                                                 $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                                                                                 $model_admin_invoices = new model_admin_invoices();
                                                                                                                                                                                                 $invoices = $model_admin_invoices->select($c);
                                                                                                                                                                                                 $data['table'] = $invoices['table'];
                                                                                                                                                                                                 $data['pager'] = $invoices['pager'];
                                                                                                                                                                                                 @(include "view/view_admin_invoices.php");
                                                                                                                                                                                             } else {
                                                                                                                                                                                                 if (isset($action) && $action == "addInvoice") {
                                                                                                                                                                                                     $data["website_title"] = "Add invoice / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                     $lang = new model_admin_languageData();
                                                                                                                                                                                                     $data["webhosting"] = $lang->l("webhosting");
                                                                                                                                                                                                     $data["creatingawebsite"] = $lang->l("creatingawebsite");
                                                                                                                                                                                                     $data["gadaxdilia"] = $lang->l("gadaxdilia");
                                                                                                                                                                                                     $data["gadasaxdeli"] = $lang->l("gadasaxdeli");
                                                                                                                                                                                                     $data["otherservice"] = $lang->l("otherservice");
                                                                                                                                                                                                     $model_admin_select = new model_admin_select();
                                                                                                                                                                                                     $data["fetch"] = $model_admin_select->select_admin_names_for_invoice($c);
                                                                                                                                                                                                     @(include "view/view_admin_addinvoice.php");
                                                                                                                                                                                                 } else {
                                                                                                                                                                                                     if (isset($action) && $action == "editInvoice") {
                                                                                                                                                                                                         $data["website_title"] = "Edit invoice / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                         $lang = new model_admin_languageData();
                                                                                                                                                                                                         $data["webhosting"] = $lang->l("webhosting");
                                                                                                                                                                                                         $data["creatingawebsite"] = $lang->l("creatingawebsite");
                                                                                                                                                                                                         $data["gadaxdilia"] = $lang->l("gadaxdilia");
                                                                                                                                                                                                         $data["gadasaxdeli"] = $lang->l("gadasaxdeli");
                                                                                                                                                                                                         $data["otherservice"] = $lang->l("otherservice");
                                                                                                                                                                                                         $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                                                                                         $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                                                                                         $model_admin_invoices = new model_admin_invoices();
                                                                                                                                                                                                         $data["info"] = $model_admin_invoices->select_one($c);
                                                                                                                                                                                                         @(include "view/view_admin_editinvoice.php");
                                                                                                                                                                                                     } else {
                                                                                                                                                                                                         if (isset($action) && $action == "gallery") {
                                                                                                                                                                                                             $data["website_title"] = "Gallery module / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                             $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                                                                                             $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                                                                                             $model_admin_gallery = new model_admin_gallery();
                                                                                                                                                                                                             $news_list = $model_admin_gallery->select($c);
                                                                                                                                                                                                             $data['table'] = $news_list['table'];
                                                                                                                                                                                                             $data['pager'] = $news_list['pager'];
                                                                                                                                                                                                             @(include "view/view_admin_gallery.php");
                                                                                                                                                                                                         } else {
                                                                                                                                                                                                             if (isset($action) && $action == "addGallery" && isset($_GET['mediaidx'])) {
                                                                                                                                                                                                                 $data["website_title"] = "Add gallery / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                 $news_slug = new news_slug();
                                                                                                                                                                                                                 $data["pre_slug"] = $news_slug->slug($c);
                                                                                                                                                                                                                 @(include "view/view_admin_addgallery.php");
                                                                                                                                                                                                             } else {
                                                                                                                                                                                                                 if (isset($action) && $action == "editMediaItem") {
                                                                                                                                                                                                                     $data["website_title"] = "Edit gallery item / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                     $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                                                                                                     $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                                                                                                     $edit_page_interface = new edit_page_interface();
                                                                                                                                                                                                                     $data["interface"] = $edit_page_interface->out_interface($c);
                                                                                                                                                                                                                     @(include "view/view_admin_editMediaItem.php");
                                                                                                                                                                                                                 } else {
                                                                                                                                                                                                                     if (isset($action) && $action == "vectormap") {
                                                                                                                                                                                                                         $data["website_title"] = "Vector map / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                         $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                                                                                                         $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                                                                                                         $model_admin_vectormap = new model_admin_vectormap();
                                                                                                                                                                                                                         $map = $model_admin_vectormap->select($c);
                                                                                                                                                                                                                         $data['table'] = $map['table'];
                                                                                                                                                                                                                         $data['pager'] = $map['pager'];
                                                                                                                                                                                                                         @(include "view/view_admin_map.php");
                                                                                                                                                                                                                     } else {
                                                                                                                                                                                                                         if (isset($action) && $action == "managedemails") {
                                                                                                                                                                                                                             $data["website_title"] = "Manage emails / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                             $model_admin_menageemails = new model_admin_menageemails();
                                                                                                                                                                                                                             $groups = $model_admin_menageemails->select($c);
                                                                                                                                                                                                                             $data['table'] = $groups['table'];
                                                                                                                                                                                                                             $data['pager'] = $groups['pager'];
                                                                                                                                                                                                                             @(include "view/view_admin_menageemails.php");
                                                                                                                                                                                                                         } else {
                                                                                                                                                                                                                             if (isset($action) && $action == "editVectorMap") {
                                                                                                                                                                                                                                 $data["website_title"] = "Edit trade map / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                                 $lang = new model_admin_languageData();
                                                                                                                                                                                                                                 $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                                                                                                                 $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                                                                                                                 $model_admin_vectormap = new model_admin_vectormap();
                                                                                                                                                                                                                                 $data["select"] = $model_admin_vectormap->select_one($c);
                                                                                                                                                                                                                                 @(include "view/view_admin_editvectormap.php");
                                                                                                                                                                                                                             } else {
                                                                                                                                                                                                                                 if (isset($action) && $action == "addEmailGroup") {
                                                                                                                                                                                                                                     $data["website_title"] = "Add email groups / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                                     @(include "view/view_admin_addemailgroups.php");
                                                                                                                                                                                                                                 } else {
                                                                                                                                                                                                                                     if (isset($action) && $action == "editEmailGroup") {
                                                                                                                                                                                                                                         $data["website_title"] = "Edit email groups / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                                         $model_admin_menageemails = new model_admin_menageemails();
                                                                                                                                                                                                                                         $data['info'] = $model_admin_menageemails->select_one($c);
                                                                                                                                                                                                                                         @(include "view/view_admin_editemailgroups.php");
                                                                                                                                                                                                                                     } else {
                                                                                                                                                                                                                                         if (isset($action) && $action == "showemails") {
                                                                                                                                                                                                                                             $data["website_title"] = "Email list / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                                             $model_admin_emaillist = new model_admin_emaillist();
                                                                                                                                                                                                                                             $groups = $model_admin_emaillist->select($c);
                                                                                                                                                                                                                                             $data['table'] = $groups['table'];
                                                                                                                                                                                                                                             $data['pager'] = $groups['pager'];
                                                                                                                                                                                                                                             @(include "view/view_admin_menageemailLiss.php");
                                                                                                                                                                                                                                         } else {
                                                                                                                                                                                                                                             if (isset($action) && $action == "addEmail") {
                                                                                                                                                                                                                                                 $data["website_title"] = "Add email / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                                                 @(include "view/view_admin_addemail.php");
                                                                                                                                                                                                                                             } else {
                                                                                                                                                                                                                                                 if (isset($action) && $action == "editEmail") {
                                                                                                                                                                                                                                                     $data["website_title"] = "Edit email / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                                                     $model_admin_emaillist = new model_admin_emaillist();
                                                                                                                                                                                                                                                     $data['info'] = $model_admin_emaillist->select_one($c);
                                                                                                                                                                                                                                                     @(include "view/view_admin_editemail.php");
                                                                                                                                                                                                                                                 } else {
                                                                                                                                                                                                                                                     if (isset($action) && $action == "outbox") {
                                                                                                                                                                                                                                                         $data["website_title"] = "Outbox / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                                                         $model_admin_emaillist = new model_admin_emaillist();
                                                                                                                                                                                                                                                         $outbox = $model_admin_emaillist->outbox($c);
                                                                                                                                                                                                                                                         $data['table'] = $outbox['table'];
                                                                                                                                                                                                                                                         $data['pager'] = $outbox['pager'];
                                                                                                                                                                                                                                                         @(include "view/view_admin_outbox.php");
                                                                                                                                                                                                                                                     } else {
                                                                                                                                                                                                                                                         if (isset($action) && $action == "comments") {
                                                                                                                                                                                                                                                             $data["website_title"] = "Comments / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                                                             $model_admin_comments = new model_admin_comments();
                                                                                                                                                                                                                                                             $outbox = $model_admin_comments->get_comments($c);
                                                                                                                                                                                                                                                             $data['table'] = $outbox['table'];
                                                                                                                                                                                                                                                             $data['pager'] = $outbox['pager'];
                                                                                                                                                                                                                                                             @(include "view/view_admin_comments.php");
                                                                                                                                                                                                                                                         } else {
                                                                                                                                                                                                                                                             if (isset($action) && $action == "editComments") {
                                                                                                                                                                                                                                                                 $data["website_title"] = "Edit comments / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                                                                 $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                                                                                                                                                 $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                                                                                                                                                 $model_admin_comments = new model_admin_comments();
                                                                                                                                                                                                                                                                 $data["data"] = $model_admin_comments->select_one($c);
                                                                                                                                                                                                                                                                 @(include "view/view_admin_editComments.php");
                                                                                                                                                                                                                                                             } else {
                                                                                                                                                                                                                                                                 if (isset($action) && $action == "addComments") {
                                                                                                                                                                                                                                                                     $data["website_title"] = "Add comments / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                                                                     @(include "view/view_admin_addComments.php");
                                                                                                                                                                                                                                                                 } else {
                                                                                                                                                                                                                                                                     if (isset($action) && $action == "fusersstat") {
                                                                                                                                                                                                                                                                         $data["website_title"] = "Front users & statements  / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                                                                         $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                                                                                                                                                         $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                                                                                                                                                         $model_admin_fusersstat = new model_admin_fusersstat();
                                                                                                                                                                                                                                                                         if (isset($_GET['remove'], $_GET['rmid'], $_GET['load']) && $_GET['remove'] == "true" && is_numeric($_GET['rmid'])) {
                                                                                                                                                                                                                                                                             $true = false;
                                                                                                                                                                                                                                                                             if ($_GET['load'] == "users") {
                                                                                                                                                                                                                                                                                 $true = $model_admin_fusersstat->removeMe($c, 'users');
                                                                                                                                                                                                                                                                                 $url = WEBSITE . LANG . '/' . ADMIN_SLUG . '?action=fusersstat&load=users';
                                                                                                                                                                                                                                                                             } else {
                                                                                                                                                                                                                                                                                 if ($_GET['load'] == "products") {
                                                                                                                                                                                                                                                                                     $true = $model_admin_fusersstat->removeMe($c, 'products');
                                                                                                                                                                                                                                                                                     $url = WEBSITE . LANG . '/' . ADMIN_SLUG . '?action=fusersstat&load=products';
                                                                                                                                                                                                                                                                                 } else {
                                                                                                                                                                                                                                                                                     if ($_GET['load'] == "services") {
                                                                                                                                                                                                                                                                                         $true = $model_admin_fusersstat->removeMe($c, 'services');
                                                                                                                                                                                                                                                                                         $url = WEBSITE . LANG . '/' . ADMIN_SLUG . '?action=fusersstat&load=services';
                                                                                                                                                                                                                                                                                     } else {
                                                                                                                                                                                                                                                                                         if ($_GET['load'] == "enquires") {
                                                                                                                                                                                                                                                                                             $true = $model_admin_fusersstat->removeMe($c, 'enquires');
                                                                                                                                                                                                                                                                                             $url = WEBSITE . LANG . '/' . ADMIN_SLUG . '?action=fusersstat&load=enquires';
                                                                                                                                                                                                                                                                                         }
                                                                                                                                                                                                                                                                                     }
                                                                                                                                                                                                                                                                                 }
                                                                                                                                                                                                                                                                             }
                                                                                                                                                                                                                                                                             if ($true) {
                                                                                                                                                                                                                                                                                 redirect::url($url);
                                                                                                                                                                                                                                                                             }
                                                                                                                                                                                                                                                                         }
                                                                                                                                                                                                                                                                         $db_counter = new db_counter();
                                                                                                                                                                                                                                                                         $data["user_count"] = $db_counter->sq($c, '`id`', '`studio404_users`', '`user_type`="website" AND `status`!=1');
                                                                                                                                                                                                                                                                         $data["product_count"] = $db_counter->sq($c, '`id`', '`studio404_module_item`', '`module_idx`=3 AND `status`!=1');
                                                                                                                                                                                                                                                                         $data["service_count"] = $db_counter->sq($c, '`id`', '`studio404_module_item`', '`module_idx`=4 AND `status`!=1');
                                                                                                                                                                                                                                                                         $data["enquire_count"] = $db_counter->sq($c, '`id`', '`studio404_module_item`', '`module_idx`=5 AND `status`!=1');
                                                                                                                                                                                                                                                                         if (isset($_GET["load"]) && $_GET["load"] == "products") {
                                                                                                                                                                                                                                                                             $data["active"] = "products";
                                                                                                                                                                                                                                                                             $outbox = $model_admin_fusersstat->get_products($c);
                                                                                                                                                                                                                                                                         } else {
                                                                                                                                                                                                                                                                             if (isset($_GET["load"]) && $_GET["load"] == "services") {
                                                                                                                                                                                                                                                                                 $data["active"] = "services";
                                                                                                                                                                                                                                                                                 $outbox = $model_admin_fusersstat->get_services($c);
                                                                                                                                                                                                                                                                             } else {
                                                                                                                                                                                                                                                                                 if (isset($_GET["load"]) && $_GET["load"] == "enquires") {
                                                                                                                                                                                                                                                                                     $data["active"] = "enquires";
                                                                                                                                                                                                                                                                                     $outbox = $model_admin_fusersstat->get_enquires($c);
                                                                                                                                                                                                                                                                                 } else {
                                                                                                                                                                                                                                                                                     $data["active"] = "users";
                                                                                                                                                                                                                                                                                     $outbox = $model_admin_fusersstat->get_users($c);
                                                                                                                                                                                                                                                                                 }
                                                                                                                                                                                                                                                                             }
                                                                                                                                                                                                                                                                         }
                                                                                                                                                                                                                                                                         $data['table'] = $outbox['table'];
                                                                                                                                                                                                                                                                         $data['pager'] = $outbox['pager'];
                                                                                                                                                                                                                                                                         @(include "view/view_admin_fusersstat.php");
                                                                                                                                                                                                                                                                     } else {
                                                                                                                                                                                                                                                                         if (isset($action) && $action == "edituserstats") {
                                                                                                                                                                                                                                                                             $data["website_title"] = "Edit users statement / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                                                                             $model_admin_selectLanguage = new model_admin_selectLanguage();
                                                                                                                                                                                                                                                                             $data["language_select"] = $model_admin_selectLanguage->select_option($c);
                                                                                                                                                                                                                                                                             $model_admin_fusersstat = new model_admin_fusersstat();
                                                                                                                                                                                                                                                                             $data["data"] = $model_admin_fusersstat->select_one($c);
                                                                                                                                                                                                                                                                             if ($data["data"]) {
                                                                                                                                                                                                                                                                                 @(include "view/view_admin_edituserstats.php");
                                                                                                                                                                                                                                                                             } else {
                                                                                                                                                                                                                                                                                 redirect::url(WEBSITE . LANG . '/' . ADMIN_SLUG . '?action=welcome');
                                                                                                                                                                                                                                                                             }
                                                                                                                                                                                                                                                                         } else {
                                                                                                                                                                                                                                                                             if (isset($action) && $action == "exelator") {
                                                                                                                                                                                                                                                                                 $data["website_title"] = "Exelator / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                                                                                 $model_admin_showtables = new model_admin_showtables();
                                                                                                                                                                                                                                                                                 $data["table"] = $model_admin_showtables->showtables($c);
                                                                                                                                                                                                                                                                                 $model_admin_sqlcommand = new model_admin_sqlcommand();
                                                                                                                                                                                                                                                                                 if (isset($_GET['load']) && $_GET['load'] == "template_trademap") {
                                                                                                                                                                                                                                                                                     //echo "a";
                                                                                                                                                                                                                                                                                     $data["sqlcommand"] = $model_admin_sqlcommand->trademap($c);
                                                                                                                                                                                                                                                                                 } else {
                                                                                                                                                                                                                                                                                     if (isset($_GET['load'], $_GET['usertype']) && $_GET['load'] == "template_users" && !empty($_GET['usertype'])) {
                                                                                                                                                                                                                                                                                         $data["sqlcommand"] = $model_admin_sqlcommand->template($c, "users", $_GET['usertype']);
                                                                                                                                                                                                                                                                                     } else {
                                                                                                                                                                                                                                                                                         $data["sqlcommand"] = $model_admin_sqlcommand->load($c);
                                                                                                                                                                                                                                                                                     }
                                                                                                                                                                                                                                                                                 }
                                                                                                                                                                                                                                                                                 @(include "view/view_admin_exelator.php");
                                                                                                                                                                                                                                                                                 //redirect::url(WEBSITE.LANG.'/'.ADMIN_SLUG.'?action=welcome');
                                                                                                                                                                                                                                                                             } else {
                                                                                                                                                                                                                                                                                 if (isset($action) && $action == "filemanager") {
                                                                                                                                                                                                                                                                                     $data["website_title"] = "File manager / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                                                                                     @(include "view/view_admin_filemanager.php");
                                                                                                                                                                                                                                                                                 } else {
                                                                                                                                                                                                                                                                                     $data["website_title"] = "Welcome / Admin Panel - v: " . $c['cmsversion'];
                                                                                                                                                                                                                                                                                     $data["c"] = $c;
                                                                                                                                                                                                                                                                                     $userData = new userData();
                                                                                                                                                                                                                                                                                     $data["userIp"] = $userData->getUserIP();
                                                                                                                                                                                                                                                                                     @(include "view/view_admin_home.php");
                                                                                                                                                                                                                                                                                 }
                                                                                                                                                                                                                                                                             }
                                                                                                                                                                                                                                                                         }
                                                                                                                                                                                                                                                                     }
                                                                                                                                                                                                                                                                 }
                                                                                                                                                                                                                                                             }
                                                                                                                                                                                                                                                         }
                                                                                                                                                                                                                                                     }
                                                                                                                                                                                                                                                 }
                                                                                                                                                                                                                                             }
                                                                                                                                                                                                                                         }
                                                                                                                                                                                                                                     }
                                                                                                                                                                                                                                 }
                                                                                                                                                                                                                             }
                                                                                                                                                                                                                         }
                                                                                                                                                                                                                     }
                                                                                                                                                                                                                 }
                                                                                                                                                                                                             }
                                                                                                                                                                                                         }
                                                                                                                                                                                                     }
                                                                                                                                                                                                 }
                                                                                                                                                                                             }
                                                                                                                                                                                         }
                                                                                                                                                                                     }
                                                                                                                                                                                 }
                                                                                                                                                                             }
                                                                                                                                                                         }
                                                                                                                                                                     }
                                                                                                                                                                 }
                                                                                                                                                             }
                                                                                                                                                         }
                                                                                                                                                     }
                                                                                                                                                 }
                                                                                                                                             }
                                                                                                                                         }
                                                                                                                                     }
                                                                                                                                 }
                                                                                                                             }
                                                                                                                         }
                                                                                                                     }
                                                                                                                 }
                                                                                                             }
                                                                                                         }
                                                                                                     }
                                                                                                 }
                                                                                             }
                                                                                         }
                                                                                     }
                                                                                 }
                                                                             }
                                                                         }
                                                                     }
                                                                 }
                                                             }
                                                         }
                                                     }
                                                 }
                                             }
                                         }
                                     }
                                 }
                             }
                         }
                     }
                 }
             }
         }
     } else {
         $data["website_title"] = "Login / Admin Panel - v: " . $c['cmsversion'];
         @(include "view/view_admin_login.php");
     }
 }
 public function upload($c)
 {
     if (isset($_FILES["profileimage"]["name"]) && !empty($_FILES["profileimage"]["name"]) && isset($_SESSION["batumi_username"])) {
         $ext = explode(".", $_FILES["profileimage"]["name"]);
         $ext = strtolower(end($ext));
         if ($ext != "jpg") {
             //return 2;
         } else {
             if ($_FILES["profileimage"]["size"] > 1000000) {
                 //return 2;
             } else {
                 $prefix = explode("@", $_SESSION["batumi_username"] . $_SESSION["batumi_id"]);
                 if (is_array($prefix) && !empty($prefix[0])) {
                     $prefix = $prefix[0];
                 } else {
                     $prefix = '_';
                 }
                 $fileName = $prefix . md5(time()) . '.' . $ext;
                 $target_file = DIR . 'files/usersimage/' . $fileName;
                 if (move_uploaded_file($_FILES["profileimage"]["tmp_name"], $target_file)) {
                     $conn = $this->conn($c);
                     $check = 'SELECT `picture` FROM `studio404_users` WHERE `id`=:companyId AND `username`=:username AND `status`!=:one';
                     $pre_check = $conn->prepare($check);
                     $pre_check->execute(array(":username" => $_SESSION["batumi_username"], ":companyId" => $_SESSION["batumi_id"], ":one" => 1));
                     $ch_fetch = $pre_check->fetch(PDO::FETCH_ASSOC);
                     if (!empty($ch_fetch["picture"])) {
                         $old_pic = DIR . 'files/usersimage/' . $ch_fetch["picture"];
                         @unlink($old_pic);
                     }
                     $sql = 'UPDATE `studio404_users` SET `picture`=:picture WHERE `id`=:companyId AND `username`=:username AND `status`!=:one';
                     $prepare = $conn->prepare($sql);
                     $prepare->execute(array(":username" => $_SESSION["batumi_username"], ":companyId" => $_SESSION["batumi_id"], ":one" => 1, ":picture" => $fileName));
                     $_SESSION["batumi_picture"] = $fileName;
                     if (Input::method("POST", "typo") != "self") {
                         redirect::url(WEBSITE . LANG . "/welcome-system");
                     }
                     //return 1;
                 } else {
                     //return 2;
                 }
             }
         }
     }
     if (isset($_FILES["profileimage2"]["name"]) && !empty($_FILES["profileimage2"]["name"])) {
         $ext = explode(".", $_FILES["profileimage2"]["name"]);
         $ext = strtolower(end($ext));
         if ($ext != "jpg") {
             //return 2;
         } else {
             if ($_FILES["profileimage2"]["size"] > 1000000) {
                 //return 2;
             } else {
                 $prefix = $_SESSION["batumi_id"];
                 $fileName = $prefix . md5(time()) . '.' . $ext;
                 $target_file = DIR . 'files/usersimage/' . $fileName;
                 if (move_uploaded_file($_FILES["profileimage2"]["tmp_name"], $target_file)) {
                     $conn = $this->conn($c);
                     $sql = 'UPDATE `studio404_users` SET `picture`=:picture WHERE `id`=:companyId AND `status`!=:one';
                     $prepare = $conn->prepare($sql);
                     $prepare->execute(array(":companyId" => Input::method("POST", "companyId"), ":one" => 1, ":picture" => $fileName));
                     if (Input::method("POST", "typo") != "self") {
                         redirect::url(WEBSITE . LANG . "/momxmareblis-marTva");
                     }
                     //return 1;
                 } else {
                     //return 2;
                 }
             }
         }
     }
 }
Ejemplo n.º 26
0
    public function template($c)
    {
        $conn = $this->conn($c);
        // connection
        if (empty(Input::method("GET", "idx"))) {
            redirect::url(WEBSITE . LANG . "/welcomesystem");
        }
        $cache = new cache();
        $welcomepage_categories = $cache->index($c, "welcomepage_categories");
        $data["welcomepage_categories"] = json_decode($welcomepage_categories, true);
        /* language variables */
        $language_data = $cache->index($c, "language_data");
        $language_data = json_decode($language_data);
        $model_template_makevars = new model_template_makevars();
        $data["language_data"] = $model_template_makevars->vars($language_data);
        $sql = 'SELECT `namelname`,`picture` FROM `studio404_users` WHERE `id`=:id';
        $prepare = $conn->prepare($sql);
        $prepare->execute(array(":id" => $_SESSION["batumi_id"]));
        if ($prepare->rowCount() > 0) {
            $fetch = $prepare->fetch(PDO::FETCH_ASSOC);
            $data["userdata"] = $fetch;
        } else {
            redirect::url(WEBSITE);
        }
        $catalog_general = $cache->index($c, "catalog_general");
        $data["catalog_general"] = json_decode($catalog_general, true);
        $catalog_table_list = $cache->index($c, "catalog_table_list");
        $data["catalog_table_list"] = json_decode($catalog_table_list, true);
        $catalogitems = $cache->index($c, "catalogitems");
        $data["catalogitems"] = json_decode($catalogitems, true);
        $catalog_form = $cache->index($c, "catalog_form");
        $data["catalog_form"] = json_decode($catalog_form, true);
        $already = array();
        if (Input::method("GET", "filter") == "true") {
            try {
                $searchKey = ' AND ';
                $idx = Input::method("GET", "idx");
                foreach ($_GET as $key => $value) {
                    if ($key == "idx" || $key == "filter" || $value == "" || empty($value)) {
                        continue;
                    }
                    if (is_array($value)) {
                        // checkbox
                        if (!in_array($key, $already)) {
                            $already[] = $key;
                            $s = '( ';
                            foreach ($value as $v) {
                                $s .= 'FIND_IN_SET("' . $v . '", `studio404_module_item`.`' . $key . '`) OR ';
                            }
                            $s .= '`studio404_module_item`.`id`=0 ) AND ';
                            $searchKey .= $s;
                        } else {
                            continue;
                        }
                    } else {
                        if (validatedate::val($value, "d-m-Y")) {
                            // date
                            $d = strtotime($value);
                            $searchKey .= '`studio404_module_item`.`' . $key . '`="' . $d . '" AND ';
                        } else {
                            // text, select
                            $searchKey .= '`studio404_module_item`.`' . $key . '` LIKE "%' . $value . '%" AND ';
                        }
                    }
                }
                $searchKey .= '`studio404_module_item`.`id` != "0" ';
                $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 ' . $searchKey . ' ORDER BY `studio404_module_item`.`id` DESC LIMIT ' . $offset . ', ' . $sw;
                $prepare = $conn->prepare($sql);
                $prepare->execute(array(":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
                $data["catalogitems"] = $prepare->fetchAll(PDO::FETCH_ASSOC);
            } catch (Exception $e) {
            }
        }
        $sql2 = 'SELECT 
		COUNT(`studio404_module_item`.`idx`) AS allitems
		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';
        $prepare2 = $conn->prepare($sql2);
        $prepare2->execute(array(":lang" => LANG_ID, ":status" => 1, ":visibility" => 1));
        $data["fetch"] = $prepare2->fetch(PDO::FETCH_ASSOC);
        @(include $c["website.directory"] . "/catalog.php");
    }