public function empautoAction() { $term = $this->_getParam('term', null); $output = array(array('id' => '', 'value' => 'No records', 'label' => 'No records')); $emp_model = new Default_Model_Employee(); if ($term != '') { $emp_arr = $emp_model->getAutoReportEmp($term); if (count($emp_arr) > 0) { $output = array(); foreach ($emp_arr as $emp) { $output[] = array('id' => $emp['user_id'], 'value' => $emp['emp_name'], 'label' => $emp['emp_name'], 'profile_img' => $emp['profileimg']); } } } $this->_helper->json($output); }