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

class Career extends CI_Controller {
	// Session Authoriesed
	public function __construct() {
		parent::__construct();
		
		$admin = $this->session->userdata('admin');
		$column['id'] = $admin['id'];
		$table = 'tbl_user';
		
	    // loading common model
	    $this->load->model('Common_model');
		$result = $this->Common_model->Result($column,$table);
		if($result['password'] == $admin['password']){
		    $login = true;
		} else {
		    $login = false;
		}
		
		if (empty($admin) || $login==false) {
			$this->session->set_flashdata('msg','Your Session Has Been Expired');
			redirect(base_url().'master/login/index');
		}
	}

	public function index()
	{
        // loading form validation
        $this->load->library('form_validation');
        
        // loading common model
        $this->load->model('Common_model');
        
        $column['id'] = 1;
        $table = 'tbl_settings';
        // get common data
        $data['data'] = $this->Common_model->Result($column,$table);
        
        $table = 'tbl_career';
        // get common data
        $data['career'] = $this->Common_model->Results($table);
        
        // get page name
        $page = 'career';
        $data['page'] = $page;
        
        // here we are checking view is available
        if(file_exists('./application/views/master/'.$page.'/'.$page.'.php')){
            // loading page view
            $this->load->view('master/'.$page.'/'.$page,$data);
        }
        else
        {
            // loading 404 page
            redirect(base_url().'master/page/index/404');
        }
	}

}

?>