<?php
defined('BASEPATH') OR exit('No direct script access allowed');

class Main extends CI_Controller {
	function __construct(){
		parent::__construct();
	}

	public function index()
	{	
		
		$data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='Ynaps.com';

		

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
		<link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/demo1.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';
		
		
		$get_sliders=$this->db->query("select * from site_img where img_place='slider1' and img_status='1' order by img_sort asc limit 10");
		$allsliedsrs=$get_sliders->result_array();
		$data['allsliedsrs']=$allsliedsrs;

		$this->load->view('inc/_header',$data);
		$this->load->view('inc/brain.php',$data);
		$this->load->view('home.php',$data);
		$this->load->view('inc/_footer',$data);
	}
	function admin(){
		redirect(base_url('admin/login'));
	}

	function about(){
		$data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='YNAPS';

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
		<link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/demo1.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

		$this->load->view('inc/_header',$data);
		$this->load->view('about',$data);
		$this->load->view('inc/_footer',$data);
	}

	

	function contact(){
		$data=db_variables();
		$data['seo_title'] = 'Contact | INCRIVE ENTERTAINMENTS';
		$data['seo_description'] = 'INCRIVE ENTERTAINMENTS';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='YNAPS';

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

		$this->load->view('inc/_header',$data);
		$this->load->view('contact',$data);
		$this->load->view('inc/_footer',$data);
	}

	function test(){
		echo "<pre>";print_r($this->session->all_userdata());echo "</pre>";
		// $this->load->view('test');
	}





	function accounts(){ $this->account(); }

		function account(){
		check_session('1','profile');
		$theoption=$this->uri->segment(3);
		switch($theoption){
			case 'login':
				$this->login();
			break;
			default:
				$this->login();
			break;

		}
	}

	public function signup($user_type=null){
		check_session(1,'profile');

		$data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';

		$data['page_name']='YNAPS';
		$data['user_type']=$user_type;

		if(isset($_GET['refer'])){
			$_SESSION['refer']=$_GET['refer'];
		}

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

		$this->load->view('inc/_header',$data);
		$this->load->view('signup',$data);
		$this->load->view('inc/_footer',$data);
	}

	public function login(){
		check_session(1,'profile');
		$data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='YNAPS';

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

		$this->load->view('inc/_header',$data);
		$this->load->view('login',$data);
		$this->load->view('inc/_footer',$data);
	}

	function password(){
        if(isset($_SESSION['yid']) && $_SESSION['yid'] !=''){ redirect(base_url('profile')); }
        $data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='Password';

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

        $this->load->view('inc/_header.php',$data);
        $this->load->view('password_reset.php',$data);
        $this->load->view('inc/_footer.php',$data);
    }

    function reset_password(){
        // if(isset($_SESSION['yid']) && $_SESSION['yid'] !=''){ redirect(base_url('profile')); }

        $data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='Reset Password';

        $email=$this->input->get('mail');

		$getdats=$this->db->query("select pass_reset from site_mem where email='$email' ");
		$thedetails=$getdats->row_array();

        $c=$this->input->get('c');
		if($thedetails['pass_reset'] != $c ){
			redirect(base_url('error-404'));
		}

        $hash=$this->input->get('ha');

        if(sha1($email).'90' != $hash ){
            redirect(base_url('profile'));
        }else{
        $data['e']=$email;

        $assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';
	    
        $this->load->view('inc/_header.php',$data);
        $this->load->view('password_reset2.php',$data);
        $this->load->view('inc/_footer.php',$data);
    }
    }
	
	function terms(){
		$data=db_variables();
		$data['seo_title'] = 'Terms | INCRIVE ENTERTAINMENTS';
		$data['seo_description'] = "INCRIVE ENTERTAINMENTS: Consulting & Agency";
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';

		$data['page_name']='Terms';

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

		$this->load->view('inc/_header',$data);
		// $this->load->view('inc/section',$data);
		$this->load->view('terms',$data);
		$this->load->view('inc/_footer',$data);
	}
	function privacy(){
		$data=db_variables();
		$data['seo_title'] = 'Privacy INCRIVE ENTERTAINMENTS';
		$data['seo_description'] = "INCRIVE ENTERTAINMENTS: Consulting & Agency";
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';

		$data['page_name']='YNAPS';

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

		$this->load->view('inc/_header',$data);
		// $this->load->view('inc/section',$data);
		$this->load->view('terms',$data);
		$this->load->view('inc/_footer',$data);
	}
	
	function profile(){
		@session_start();
		check_session('2','account');
		$data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='Profile';

		$yid=$_SESSION['yid'];
		$themyuser_details=$this->ynaps_model->getprofile_data('*',$_SESSION['yid']);
		$data['profile_data']=$themyuser_details;

		$yid=$_SESSION['yid'];
		$email=$_SESSION['email'];

        $assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

		$this->load->view('inc/_header',$data);
		$this->load->view('inc/section2',$data);
		$this->load->view('profile',$data);
		$this->load->view('inc/_footer',$data);
	}

	function otp_verify(){
		check_session(2,'accounts');
		$data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='YNAPS';

		$thedetails=$this->ynaps_model->getprofile_data('*',$_SESSION['yid']);
		if($thedetails['user_email_status'] =='1'){
			redirect(base_url('profile'));
		}
		$data['profile_data']=$thedetails;
		$yid=$_SESSION['yid'];
		$email=$_SESSION['email'];

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

		$this->load->view('inc/_header',$data);
		$this->load->view('otp_verify',$data);
		$this->load->view('inc/_footer',$data);
	}	

	function edit($data_pass=null){
		$data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='Edit';
		$themyuser_details=$this->ynaps_model->getprofile_data('*',$_SESSION['yid']);
		$data['profile_data']=$themyuser_details;

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

		check_session('2','account');
		$this->load->view('inc/_header',$data);
		$this->load->view('inc/section2',$data);
		$this->load->view('edit',$data);
		$this->load->view('inc/_footer',$data);
	}

	function verify(){
		$data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='YNAPS';
	$data['profile_data']=$this->ynaps_model->getprofile_data('*',$_SESSION['yid']);


		check_session('2','account');
		$this->load->view('inc/_header',$data);
		$this->load->view('verify',$data);
		$this->load->view('inc/_footer',$data);
	}

	function logout(){
		$user_data = $this->session->all_userdata();
        foreach ($user_data as $key => $value) {
        if ($key != 'session_id' && $key != 'ip_address' && $key != 'user_agent' && $key != 'last_activity') {
              $this->session->unset_userdata($key);
        } }
    $this->session->sess_destroy();
    redirect(base_url());
	}

	// ----------------Added by Aamir
	public function products(){
		$data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='Ynaps.com';

		$Allservices=$this->db->query("select * from `x-services` order by service_id desc limit 4");
		$services=$Allservices->result_array();
		$data['services']=$services;

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

		$this->load->view('inc/_header',$data);
		$this->load->view('products.php',$data);
		$this->load->view('inc/_footer',$data);
	}
	public function product($pro_id=null){
		$data=db_variables();
		

		$SingleProduct=$this->db->query("select * from `x-products` where pid = '$pro_id' ");
		$product=$SingleProduct->result_array();
		$data['product_detail']=$product;

		// Added by Aamir
	    $assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';



	    $data['seo_title'] = $product['0']['name'].' Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='Ynaps.com';

		$this->load->view('inc/_header',$data);
		if ($SingleProduct->num_rows()>0) {
			$this->load->view('product.php',$data);
		}else{
			$this->load->view('not_found.php',$data);
		}
		$this->load->view('inc/_footer',$data);
	}
	public function cart(){
		$data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='Ynaps.com';

		$Allservices=$this->db->query("select * from `x-services` order by service_id desc limit 4");
		$services=$Allservices->result_array();
		$data['services']=$services;

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

		$this->load->view('inc/_header',$data);
		$this->load->view('cart.php',$data);
		$this->load->view('inc/_footer',$data);
	}
	public function checkout(){
		check_session('2','login');
		$data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='Ynaps.com';

		$Allservices=$this->db->query("select * from `x-services` order by service_id desc limit 10");
		$services=$Allservices->result_array();
		$data['services']=$services;

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

		$this->load->view('inc/_header',$data);
		$this->load->view('checkout.php',$data);
		$this->load->view('inc/_footer',$data);
	}
	public function search(){
		$data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='Ynaps.com';

		$get_Search = $this->input->get('q');
		if ($get_Search!="") {
			$S_qry = "%".$get_Search."%";
		}else{$S_qry = "";}

		$SingleProduct=$this->db->query("SELECT * from `x-products` where (title like '$S_qry' OR name like '$S_qry') ");
		$product=$SingleProduct->result_array();
		$data['product_detail']=$product;

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

		$this->load->view('inc/_header',$data);
		if ($SingleProduct->num_rows()>0) {
			$this->load->view('search.php',$data);
		}else{
			$this->load->view('not_found.php',$data);
		}
		$this->load->view('inc/_footer',$data);
	}

	// -----///////////////////////////




/// out of web//////////////////////////	
	

function Service(){
	$data=db_variables();
	$data['seo_title'] = 'Get Serviced with INCRIVE ENTERTAINMENTS';
	$data['seo_description'] = 'you can contact us anytime and we will call you back within 12 hrs. you can also email and whatsapp us for instant replies.';
	$data['seo_image'] = base_url('assets/avator/og_img.jpg');
	$data['seo_keywords'] = 'keywords';
	$data['page_name']='YNAPS';

	$get_services=$this->db->query("select * from `x-services` order by service_id desc");
	$allservices=$get_services->result_array();
	$data['services']=$allservices;


	$this->load->view('inc/_header',$data);
	$this->load->view('service',$data);
	$this->load->view('inc/_footer',$data);
}
function Services($service=null){
	$data=db_variables();
	
	$Allservices=$this->db->query("select * from `x-services` order by service_id desc limit 10");
	$services=$Allservices->result_array();
	$data['services']=$services;

	$get_services=$this->db->query("select * from `x-services` where service_id='$service'");
	$Allservices=$get_services->row_array();
	$data['service']=$Allservices;

	$data['seo_title'] = $Allservices['service_name'].' INCRIVE ENTERTAINMENTS';
	$data['seo_description'] = trim_text(strip_tags($Allservices['service_description']),200);
	$data['seo_image'] = base_url('assets/avator/upload/').$Allservices['service_image'];
	$data['seo_keywords'] = 'keywords';
	$data['page_name']='YNAPS';

	$data['serv_id']=$service;
	$this->load->view('inc/_header',$data);
	$this->load->view('services',$data);
	$this->load->view('inc/_footer',$data);
}

function blog(){
	$data=db_variables();
	$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
	$data['seo_description'] = "INCRIVE ENTERTAINMENTS: Consulting & Agency";
	$data['seo_image'] = base_url('assets/avator/og_img.jpg');
	$data['seo_keywords'] = 'keywords';
	$data['page_name']='YNAPS';

	$total_num='100';
	$rec_per_page='30';
	$this->load->library('pagination');
	$config['base_url'] = base_url('blog');
	$config['total_rows'] = $total_num;
	$config['per_page'] = $rec_per_page;
	$config['num_links'] = 10;
	$config['use_page_numbers'] = TRUE;
	$config['full_tag_open'] = "<span class='page_num'>";
	$config['full_tag_close'] = '</span>';
	$config['reuse_query_string'] = true;
	$config['page_query_string'] = TRUE;
	$config['query_string_segment'] = 'page';
	$this->pagination->initialize($config);

	@$page=$_GET['page'];
	$limit1=$page*$rec_per_page;

	$geththeblogs=$this->db->query("select * from site_blogs order by blog_id desc  limit $limit1, $rec_per_page ");
	$all_blogs=$geththeblogs->result_array();
	$data['blogs']=$all_blogs;

	$allblogs=$this->db->query("select * from site_blogs order by blog_id desc  limit 3");
	$show_blogs=$allblogs->result_array();
	$data['show_blogs']=$show_blogs;

	$this->load->view('inc/_header',$data);
	$this->load->view('blog',$data);
	$this->load->view('inc/_footer',$data);
}
function theBlog($blogid, $title){
	$data=db_variables();
	$config['base_url'] = base_url('blog');
	
	$geththeblog=$this->db->query("select * from site_blogs where blog_id='$blogid'");
	$theBlog=$geththeblog->row_array();
	$data['theBlog']=$theBlog;

	$allblogs=$this->db->query("select * from site_blogs order by blog_id desc  limit 3");
	$show_blogs=$allblogs->result_array();
	$data['show_blogs']=$show_blogs;

	if(empty($theBlog)){
		redirect(base_url('blog'));
	}

	$data['seo_title'] = $theBlog['title'];
	$data['seo_description'] = trim_text(strip_tags($theBlog['comment']),200);
	if($theBlog['blog_img']!='')
		$data['seo_image'] = base_url('assets/avator/upload/').$theBlog['blog_img'];
	else
	  $data['seo_image'] = base_url('assets/avator/og_img.jpg');
	$data['seo_keywords'] = 'keywords';
	$data['page_name']='YNAPS';


	$this->load->view('inc/_header',$data);
	//$this->load->view('inc/section',$data);
	$this->load->view('theBlog',$data);
	$this->load->view('inc/_footer',$data);
}
function view_checkout(){
	check_session('2','account');
	$data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='View Checkout';

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

        $this->load->view('inc/_header.php',$data);
        $this->load->view('view_checkout',$data);
        $this->load->view('inc/_footer.php',$data);
}
function thank_you(){
	$data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='Check Status';

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

	    @session_start();
	    unset($_SESSION['ecom_order_id']);
	    unset($_SESSION['ecom_cart']);
	    unset($_SESSION['ecom_order_name']);
	    unset($_SESSION['chk_code']);

        $this->load->view('inc/_header.php',$data);
        $this->load->view('thank_you.php',$data);
        $this->load->view('inc/_footer.php',$data);
}

////////////////////////////////////////////// main data/////

function pay_now(){
	@session_start();
		check_session('2','account');

		if(!isset($_SESSION['ecom_order_id'])){
			redirect(base_url('cart'));
		}
	$data=db_variables();
		$data['seo_title'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now.';
		$data['seo_description'] = 'Incrive Entertainments, Get Offers and discount buy discount codes for your fav places now. We have more than 20K places listed on the platform';
		$data['seo_image'] = base_url('assets/avator/og_img.jpg');
		$data['seo_keywords'] = 'keywords';
		$data['page_name']='Pay Now';

		$assets_path = base_url('assets/theme/');
	    $data['site_assets'] = '
	    <link rel="stylesheet" href="'.$assets_path.'css/vendor/ecicons.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/animate.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/swiper-bundle.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/jquery-ui.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/countdownTimer.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/slick.min.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/nouislider.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/plugins/bootstrap.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/style.css">
	    <link rel="stylesheet" href="'.$assets_path.'css/responsive.css">
	    <link rel="stylesheet" id="bg-switcher-css" href="'.$assets_path.'css/backgrounds/bg-4.css">';

        $this->load->view('inc/_header.php',$data);
        $this->load->view('pay_now.php',$data);
        $this->load->view('inc/_footer.php',$data);
}

}
