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

class DashboardController extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see https://codeigniter.com/userguide3/general/urls.html
	 */
	public $shop;
    public $shopData;
    public function __construct()
    {
        parent::__construct();// you have missed this line.
        $this->load->helper('cookie');
        $this->shop = $this->input->get('shop')??$this->input->cookie('shop');
        if(!$this->shop){
            redirect(base_url("auth"));
        }
        $this->shopData =$this->adminModel->get_row("app_record",array("shop_address"=>$this->shop));
        
		
    }  

	public function index()
	{
		//$this->output->set_header('Authorization : enormapps.com'); 
		$this->load->view('pages/dashboard');
	}

	public function redirectToDashboard(){
		 redirect(base_url("admin/dashboard?".getQueryStringParameters()));
	}

}
