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

class E_filing extends CI_Controller {
	
	public function __construct(){
		parent::__construct();
		$this->load->model('perkara/delegasi','delegasi');
	}    
	
	function get_new(){
		$query=$this->db->query('SELECT value from sys_config where id=62');
		$index=$query->row()->value;
		$datasend=array('index'=>$index);
	    $data_string = json_encode($datasend);

	    $curl = curl_init();
		curl_setopt_array($curl, array(
		  CURLOPT_URL => base_url_e_filing()."Api_id/baru",
		  CURLOPT_RETURNTRANSFER => true,
		  CURLOPT_HTTPHEADER => array(
		    'Content-Type: application/json',
		    'Content-Length: ' . strlen($data_string)),
		  CURLOPT_ENCODING => "",
		  CURLOPT_MAXREDIRS => 10,
		  CURLOPT_TIMEOUT => 60,
		  CURLOPT_POSTFIELDS => $data_string,
		  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
		  CURLOPT_CUSTOMREQUEST => "POST"));
		
		$response = curl_exec($curl);
		$err = curl_error($curl);

		curl_close($curl);

		if ($err) {
			$st=$err;
		} else {
	 		$st=$response;
		}
		echo $st;
	}

}