<?php
/**
 * Created by PhpStorm.
 * User: Farhad Zaman
 * Date: 12/20/2016
 * Time: 11:29 AM
 */
defined('BASEPATH') OR exit('No direct script access allowed');

class Home extends CI_Controller {


    public function __construct()
    {
        // Call the CI_Model constructor
        parent::__construct();

        $this->load->model('Home_model');
        $this->load->model('User_Model');
        $this->load->library("session");
        $this->load->helper('url');
        if($this->load->is_loaded("CI_Minifier")){
            $this->ci_minifier->enable_obfuscator(3);
        }
           
    }

    function index(){ 
   
        
        $this->load->view('home_header');
        $this->load->view('home');
        $this->load->view('home_footer');
      
    }


    public function getFooBanks()
    {
        
       // $ip = $_SERVER['REMOTE_ADDR'];
        $ip = "192.140.149.244";
        $details = json_decode(file_get_contents("http://ipinfo.io/{$ip}/json"));

        $data['companies_list'] = $this->Home_model->getCompanies_list_lat_lang($details->city);

        $this->load->view('home_header');
        $this->load->view('company_filter_list',$data);
        $this->load->view('home_footer');

    }

    public function getCompanyListWithName()
    {
         
        $var = $this->input->post('search');
        $data['companies_list'] = $this->Home_model->getCompanies_listByName($var);
        $this->load->view('home_header');
        $this->load->view('home',$data);
        $this->load->view('home_footer');
    }


}