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

class MY_Controller extends CI_Controller{
    
    public function __construct() {
        parent::__construct();

        // 1. Load file helper
        $this->load->helper('file');

        // 2. Read the file
        $fh = fopen('../agent/agent_info.txt','r');
		
	    // 3.
	    if($line = fgets($fh)){
			$info_dump = json_decode($line, true);
		}

		// 4.
		fclose($fh);

		// 5.
		$site_agent = '702';
		$this->contacts = $info_dump[$site_agent];

	}
   
}