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

class Welcome extends CI_Controller {

	/**
	 * Index Page for this controller.
	 *
	 * Maps to the following URL
	 * 		http://example.com/index.php/welcome
	 *	- or -  
	 * 		http://example.com/index.php/welcome/index
	 *	- or -
	 * Since this controller is set as the default controller in 
	 * config/routes.php, it's displayed at http://example.com/
	 *
	 * So any other public methods not prefixed with an underscore will
	 * map to /index.php/welcome/<method_name>
	 * @see http://codeigniter.com/user_guide/general/urls.html
	 */
	public function index()
	{
		$this->load->view('welcome_message');
	}
	
	public function get_report()
	{
		$this->load->library('rest', 
			array(  
				'server' 	=> 'http://localhost/221sms/index.php/api/',
				'http_user'	=> 'badilag',  
				'http_pass'	=> 'UHJKHG343kljSDFDSS',  
				'http_auth'	=> 'digest'
			)
		); 
		
		$report = $this->rest->get('report/get/report/ILPBA/satker/400729/tahun/2012/bulan/10', 
			null,
			'json'
		); 
		
		echo "<pre>"; 
		var_dump($report);
		echo "</pre>"; 
	}
	
	public function input_report()
	{
		$this->load->library('rest', 
			array(  
				'server' 	=> 'http://localhost/221sms/index.php/api/',
				'http_user'	=> 'admin',  
				'http_pass'	=> '1234',  
				'http_auth'	=> 'digest'
			)
		); 
		
		$report = $this->rest->get('report/input/ILPBA 400729 okt12 RE 11 LK 22 PR 33 DS 44 CG 55 CT 66 IN 77 LL 88', 
			null,
			'json'
		); 
		
		echo "<pre>"; 
		var_dump($report);
		echo "</pre>"; 
	}
}

/* End of file welcome.php */
/* Location: ./application/controllers/welcome.php */