<?php

if (!defined('BASEPATH'))
    exit('No direct script access allowed');

class Site extends CI_Controller {

    function __construct() {
        parent::__construct();
        $this->headerData = array();
        $this->footerData = array();
        $this->load->helper("text");
        $this->load->helper('form');
        $this->load->model('Checkdata', '', TRUE);
        $this->load->model('Func', '', TRUE);
        $this->load->model('Get_Lang', '', TRUE);
        $this->load->library('user_agent');
        $this->load->helper('url');
        $this->load->model('DateTimeFunc', '', TRUE);


        $this->headerData['contactUs'] = $this->db->query("SELECT coId, companyName, emailAddress, emailAddress2, phoneNumber, phoneNumber2, address, latitude FROM contact_us WHERE coId = 1")->result_object();
        $this->footerData['contactUs'] = $this->db->query("SELECT coId, companyName, emailAddress, emailAddress2, phoneNumber, phoneNumber2, address FROM contact_us WHERE coId = 1")->result_object();

        $this->headerData['socialMedia'] = $this->db->query("SELECT coId, phoneNumber, facebook, instagram, twitter, snapchat, whatsapp, whatsapp2, messanger FROM contact_us WHERE coId = 1")->result_object();

        $this->footerData['siteSeting'] = $this->db->query("SELECT theValue FROM site_setting")->result_object();
        $this->headerData['siteSeting'] = $this->db->query("SELECT theValue FROM site_setting")->result_object();
        $this->headerData['theLogo'] = $this->headerData['siteSeting'][2]->theValue;
        $this->headerData['backgroundColor'] = $this->headerData['siteSeting'][1]->theValue;
        $this->headerData['color'] = $this->headerData['siteSeting'][0]->theValue;
        $this->footerData['theLogo'] = $this->headerData['siteSeting'][2]->theValue;

        $this->headerData['theSharePhoto'] = 'http://' . $_SERVER['SERVER_NAME'] . '/public/uploads/php/files/logos/thumbnail/' . $this->headerData['siteSeting'][2]->theValue;
        $this->headerData['theShareTitle'] = $this->footerData['contactUs'][0]->companyName;

        if (!ini_get('date.timezone')) {
//            date_default_timezone_set('GMT');
            date_default_timezone_set('Europe/Istanbul');
        }

        $theLang = $this->session->userdata("lang");


        if ($theLang == "ar") {
            $langId = 1;
        } else if ($theLang == "tr") {
            $langId = 3;
        } else {
            $langId = 2;
            $session = array('lang' => "en");
            $this->session->set_userdata($session);
        }
        $this->headerData['theLang'] = $theLang;
        $this->headerData['langId'] = $langId;

        $this->headerData['allAboutUs'] = $this->db->query("SELECT abId, theText, theTitle FROM about_us WHERE langId = '$langId' ")->result_object();


        $this->headerData['headerCategories'] = $this->db->query("SELECT caId, theTitle$langId as theTitle FROM categories WHERE isDeleted = 0 AND parentId = 0 LIMIT 9")->result_object();
        $this->headerData['mainCategories'] = $this->db->query("SELECT caId, theTitle$langId as theTitle FROM categories WHERE isDeleted = 0 AND parentId = 0")->result_object();
    }

    public function index($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/index', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function index1($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-1', $this->headerData);
            $this->load->view('content/index-1', $pageData);
            $this->load->view('common/footer-1', $this->footerData);
        }
    }

    public function index2($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-2', $this->headerData);
            $this->load->view('content/index-2', $pageData);
            $this->load->view('common/footer-2', $this->footerData);
        }
    }

    public function index3($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-3', $this->headerData);
            $this->load->view('content/index-3', $pageData);
            $this->load->view('common/footer-3', $this->footerData);
        }
    }

    public function index4($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-4', $this->headerData);
            $this->load->view('content/index-4', $pageData);
            $this->load->view('common/footer-4', $this->footerData);
        }
    }

    public function index5($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-5', $this->headerData);
            $this->load->view('content/index-5', $pageData);
            $this->load->view('common/footer-5', $this->footerData);
        }
    }

    public function index6($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-6', $this->headerData);
            $this->load->view('content/index-6', $pageData);
            $this->load->view('common/footer-6', $this->footerData);
        }
    }

    public function index7($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-7', $this->headerData);
            $this->load->view('content/index-7', $pageData);
            $this->load->view('common/footer-7', $this->footerData);
        }
    }

    public function index8($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-8', $this->headerData);
            $this->load->view('content/index-8', $pageData);
            $this->load->view('common/footer-8', $this->footerData);
        }
    }

    public function index9($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-9', $this->headerData);
            $this->load->view('content/index-9', $pageData);
            $this->load->view('common/footer-9', $this->footerData);
        }
    }

    public function index10($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-10', $this->headerData);
            $this->load->view('content/index-10', $pageData);
            $this->load->view('common/footer-10', $this->footerData);
        }
    }

    public function index11($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-11', $this->headerData);
            $this->load->view('content/index-11', $pageData);
            $this->load->view('common/footer-11', $this->footerData);
        }
    }

    public function index12($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-12', $this->headerData);
            $this->load->view('content/index-12', $pageData);
            $this->load->view('common/footer-12', $this->footerData);
        }
    }

    public function index13($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-13', $this->headerData);
            $this->load->view('content/index-13', $pageData);
            $this->load->view('common/footer-13', $this->footerData);
        }
    }

    public function index14($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-14', $this->headerData);
            $this->load->view('content/index-14', $pageData);
            $this->load->view('common/footer-14', $this->footerData);
        }
    }

    public function index15($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-15', $this->headerData);
            $this->load->view('content/index-15', $pageData);
            $this->load->view('common/footer-15', $this->footerData);
        }
    }

    public function index16($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-16', $this->headerData);
            $this->load->view('content/index-16', $pageData);
            $this->load->view('common/footer-16', $this->footerData);
        }
    }

    public function index17($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-17', $this->headerData);
            $this->load->view('content/index-17', $pageData);
            $this->load->view('common/footer-17', $this->footerData);
        }
    }

    public function index18($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-18', $this->headerData);
            $this->load->view('content/index-18', $pageData);
            $this->load->view('common/footer-18', $this->footerData);
        }
    }

    public function index19($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-19', $this->headerData);
            $this->load->view('content/index-19', $pageData);
            $this->load->view('common/footer-19', $this->footerData);
        }
    }

    public function index20($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-20', $this->headerData);
            $this->load->view('content/index-20', $pageData);
            $this->load->view('common/footer-20', $this->footerData);
        }
    }

    public function index21($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-21', $this->headerData);
            $this->load->view('content/index-21', $pageData);
            $this->load->view('common/footer-21', $this->footerData);
        }
    }

    public function index22($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-22', $this->headerData);
            $this->load->view('content/index-22', $pageData);
            $this->load->view('common/footer-22', $this->footerData);
        }
    }

    public function index23($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Home Page";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Anasayfa";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الرئيسية";
            }



            $this->load->view('common/header-23', $this->headerData);
            $this->load->view('content/index-23', $pageData);
            $this->load->view('common/footer-23', $this->footerData);
        }
    }

    public function about1($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - About Us";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Hakkımızda";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - نبذة عن";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/about-1', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function about2($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - About Us";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Hakkımızda";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - نبذة عن";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/about-2', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function blog1($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المدونة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/blog-1', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function blog2($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المدونة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/blog-2', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function blog3($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المدونة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/blog-3', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function blog4($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المدونة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/blog-4', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function blog5($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المدونة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/blog-5', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function blog6($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المدونة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/blog-6', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function blog7($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المدونة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/blog-7', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function blog8($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المدونة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/blog-8', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function blog9($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المدونة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/blog-9', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function blog10($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المدونة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/blog-10', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function blog11($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المدونة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/blog-11', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function blog12($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المدونة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/blog-12', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function blog_details1($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المدونة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/blog-details-1', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function blog_details2($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المدونة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/blog-details-2', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function blog_details3($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Blog";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المدونة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/blog-details-3', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function category1($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Category";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Category";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الفئات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/category-1', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function category2($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Category";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Category";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الفئات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/category-2', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function category3($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Category";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Category";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الفئات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/category-3', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function category4($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Category";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Category";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الفئات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/category-4', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function category5($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Category";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Category";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الفئات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/category-5', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function category6($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Category";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Category";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الفئات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/category-6', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function products1($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Products";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Ürünler";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المنتجات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/products-1', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function products2($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Products";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Ürünler";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المنتجات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/products-2', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function products3($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Products";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Ürünler";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المنتجات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/products-3', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function products4($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Products";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Ürünler";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المنتجات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/products-4', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function products5($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Products";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Ürünler";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المنتجات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/products-5', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function products6($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Products";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Ürünler";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المنتجات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/products-6', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function products7($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Products";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Ürünler";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المنتجات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/products-7', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function products8($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Products";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Ürünler";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المنتجات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/products-8', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function products9($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Products";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Ürünler";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المنتجات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/products-9', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function products10($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Products";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Ürünler";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - المنتجات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/products-10', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }
    
    
    
    
    
    
    
    

    public function checkout($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Checkout";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Ödeme";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الدفع";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/checkout', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function contact1($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Contact Us";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Bize Ulaşın";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - اتصل بنا";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/contact-1', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function contact2($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Contact Us";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Bize Ulaşın";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - اتصل بنا";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/contact-2', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function cart($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Cart";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Sepetim";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - السلة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/cart', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function dashboard($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Dashboard";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Gösterge Paneli";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - لوحة التحكم";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/dashboard', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function faq($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - FAQ";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - SSS";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - الأسئلة الشائعة";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/faq', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function login($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Login";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - Oturum aç";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - التسجيل والدخول";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/login', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function wishlist($url = Null, $url3 = NULL) {
        $pageData = array();
        $theLang = $this->session->userdata("lang");
        if ($url) {
            $url2 = str_replace("-", "_", $url);
            if (method_exists($this, $url2)) {
                if ($url3) {
                    $this->$url2($url3);
                } else {
                    $this->$url2();
                }
            } else {

                $checkURL = $this->db->query("SELECT page, content_id FROM links WHERE url = '$url'")->result_object();
                if (empty($checkURL)) {
                    header("Location:/error");
                    exit();
                }
                $thePage = $checkURL[0]->page;
                $theID = $checkURL[0]->content_id;
                if ($thePage == 'categories') {
                    $this->products($theID);
                } elseif ($thePage == 'blog') {
                    $this->blog($theID);
                } elseif ($thePage == 'subCategories') {
                    $this->product_details($theID);
                } elseif (method_exists($this, $thePage)) {

                    $this->$thePage($theID);
                } else {
                    header("Location:/error");
                    exit();
                }
            }
        } else {

            if ($theLang == "en") {
                $langId = 2;
                $this->headerData['pageTitle'] = "Masasouq - Wishlist";
            } else if ($theLang == "tr") {
                $langId = 3;
                $this->headerData['pageTitle'] = "Masasouq - İstek Listesi";
            } else {
                $langId = 1;
                $this->headerData['pageTitle'] = "Masasouq - قائمة الرغبات";
            }



            $this->load->view('common/header', $this->headerData);
            $this->load->view('content/wishlist', $pageData);
            $this->load->view('common/footer', $this->footerData);
        }
    }

    public function quickView() {
        $pageData = array();

        $this->load->view('content/popup/quickView', $pageData);
    }


    public function error() {
        $pageData = array();
        $theLang = $this->session->userdata("lang");

        if ($theLang == "en") {
            $langId = 2;
            $this->headerData['pageTitle'] = "Masasouq - About Us";
        } else if ($theLang == "tr") {
            $langId = 3;
            $this->headerData['pageTitle'] = "Masasouq - Hakkımızda";
        } else {
            $langId = 1;
            $this->headerData['pageTitle'] = "Masasouq - نبذة عن";
        }

        $this->load->view('common/header', $this->headerData);
        $this->load->view('content/error', $pageData);
        $this->load->view('common/footer', $this->footerData);
    }

    public function admin() {
        header("Location:/admin/login");
        exit();
    }

    public function logout() {
        $this->session->sess_destroy();
        header("Location: /");
    }

    function ajax($param1, $param2 = NULL, $param3 = NULL) {
        switch ($param1) {

            case "changeLanguage":
                $lang = $this->Checkdata->checkInputData($this->input->post("lang"));
                if ($lang == 'ar') {
                    $session = array(
                        'lang' => 'ar'
                    );
                    $this->session->set_userdata($session);
                } else if ($lang == 'tr') {
                    $session = array(
                        'lang' => 'tr'
                    );
                    $this->session->set_userdata($session);
                } else {
                    $session = array(
                        'lang' => 'en'
                    );
                    $this->session->set_userdata($session);
                }
                echo 1;
                break;


            case "sendApply":
                $this->load->helper('form');
                $this->load->library('form_validation');
                $theLang = $this->session->userdata("lang");
                if ($theLang == "en") {
                    $langId = 2;
                } else if ($theLang == "tr") {
                    $langId = 3;
                } else {
                    $langId = 1;
                }

                $this->form_validation->set_rules('name', $this->Get_Lang->gl("Full_Name", $langId), 'required');
                $this->form_validation->set_rules('email', $this->Get_Lang->gl("email_address", $langId), 'required|valid_email');
                $this->form_validation->set_rules('message', $this->Get_Lang->gl("message", $langId), 'required');

                if ($this->form_validation->run() === FALSE) {
                    echo validation_errors();
                } else {
                    $processArr = array();
                    $toDataBase = array();

                    $processArr[$this->Get_Lang->gl("Full_Name", $langId)] = $this->Checkdata->checkInputData($this->input->post("name"));
//                    $processArr["Cep_Telefon"] = $this->Checkdata->checkInputData($this->input->post("phone"));
                    $processArr[$this->Get_Lang->gl("email_address", $langId)] = $this->Checkdata->checkInputData($this->input->post("email"));
                    $processArr[$this->Get_Lang->gl("Subject", $langId)] = $this->Checkdata->checkInputData($this->input->post("subject"));
                    $processArr[$this->Get_Lang->gl("message", $langId)] = $this->input->post("message");

                    $toDataBase['theName'] = $this->Checkdata->checkInputData($this->input->post("name"));
//                    $toDataBase['phoneNumber'] = $processArr["Cep_Telefon"];
                    $toDataBase['emailAddress'] = $this->Checkdata->checkInputData($this->input->post("email"));
                    $toDataBase['howToContact'] = $this->Checkdata->checkInputData($this->input->post("subject"));
                    $toDataBase['note'] = $this->input->post("message");

                    $this->db->insert("contactus_form", $toDataBase);
                    $emailAddress = $toDataBase['emailAddress'];
                    $name = $toDataBase['theName'];

                    $subject = $this->Checkdata->checkInputData($this->input->post("subject"));
                    $htmlBody = "<table>";
                    foreach ($processArr as $key => $value) {
                        $htmlBody .= '<tr><td> ' . str_replace("_", " ", $key) . ': </td><td>' . $processArr[$key] . '</td></tr>';
                    }
                    $htmlBody .= "</table>";

                    $getEmail = $this->db->query("SELECT emailAddress FROM contact_us WHERE coId = 1")->result_object();
                    if ($getEmail[0]->emailAddress) {
                        $theEmail = $getEmail[0]->emailAddress;
                    } else {
                        $theEmail = "ahmedof592@gmail.com";
                    }

                    $this->load->library('email');
                    $config = Array(
                        'protocol' => 'smtp',
                        'smtp_host' => 'mail.tibtop.com.tr',
                        'smtp_port' => 25,
                        'smtp_timeout' => '5',
                        'smtp_crypto' => 'tls',
                        'smtp_user' => 'info@tibtop.com.tr',
                        'smtp_pass' => 'Info99',
                        'mailtype' => 'html',
                        'charset' => 'iso-8859-1'
                    );
                    $this->load->library('email', $config);
                    $result = $this->email
                            ->from("$emailAddress", "$name")
                            ->to("$theEmail")
                            ->bcc("ahmedof592@gmail.com")
                            ->subject($subject)
                            ->message($htmlBody);
                    if ($this->email->send())
                        echo 1;
                    else
                        echo $this->email->print_debugger();
                }
                break;

            case "subscribers":

                $this->load->helper('form');
                $this->load->library('form_validation');

                $this->form_validation->set_rules('subemail', 'Email', 'required|valid_email');

                if ($this->form_validation->run() === FALSE) {
                    echo validation_errors();
                } else {
                    $theEmail = $this->input->post("subemail");
                    $processArr = array();

                    $checkEmail = $this->db->query("SELECT suId FROM subscribers WHERE emailAddress = '$theEmail'")->result_object();

                    if ($checkEmail) {
                        echo "already exists...";
                    } else {
                        $processArr['emailAddress'] = $theEmail;
                        $this->db->insert("subscribers", $processArr);
                        echo 1;
                    }
                }
                break;
        }
    }

}
