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

class MainHome extends CI_Controller {
    
      function __construct() {
        parent::__construct();
      
       $this->load->library('form_validation');
       	$this->load->helper('url');
      
    }
   
public function index()
    {
         $ip = $this->input->ip_address();
     
        $sql = "SELECT ip_adr FROM  allowed_ip where status = '0' and  ip_adr = '$ip' ";	
	
        $rs = $this->db->query($sql)->result_array();


        if(empty($rs)){
            
            echo '<div style= "text-align:center;background-color:red;color:white; margin-top:120px;padding:50px 0 ;"><h1 style="font-size:3rem;">Your are not allowed to access this website.Please Contact Administration .</h1></div>';
           
       
            
        } else{
           
           $this->security->get_csrf_hash();
            
		    $this->load->view('MainIndex/home');

	
	
        }
    }

}