<?php
class bin_details_report extends Admin_Controller {
	
	function __construct() {
		parent::__construct(TRUE);
		$this->load->model('bin_details_report_model','',TRUE);
		$this->load->model('home/home_model','',TRUE);
	}
	
	function index()
	{
		
		$data['devices'] = $this->bin_details_report_model->prepareCombo();
		$this->load->view('bin_details_report', $data);
	}
	function loadData(){
		
		$data = $this->bin_details_report_model->getAllData(); 
                $responce = new stdClass();
		$responce->page = $data['page'];
		$responce->total = $data['total_pages'];
		$responce->records = $data['count'];
		$i=0;
                
		foreach($data['result'] as $row) {
                        if($row->empty_or_full == 0){
                            $empty_or_full = "Full";
                        }
                        if($row->empty_or_full == 1){
                            $empty_or_full = "Empty";
                        }
                        $row->empty_or_full = $empty_or_full;
			$responce->rows[$i] = $row;
			$i++;
		}
                //echo json_encode($responce);
		$this->output->set_output(json_encode($responce));
	}
	
	
}
?>