/** * Retrieve data in json format * * @return void * @author **/ function get_data($serial_number = '') { $obj = new View(); if (!$this->authorized()) { $obj->view('json', array('msg' => array('error' => 'Not authenticated'))); return; } $out = array(); $model = new Disk_report_model(); foreach ($model->retrieve_records($serial_number) as $res) { $out[] = $res->rs; } $obj->view('json', array('msg' => $out)); }