예제 #1
0
 /**
  * @name empnamewithidautoAction
  *
  * This method is used to send json output of employee names with ID for autocomplete field in activity log report
  *
  *  @author Deepthi
  *  @version 1.0
  */
 public function empnamewithidautoAction()
 {
     $logmanager_model = new Default_Model_Logmanager();
     $term = $this->_getParam('term', null);
     $output = array(array('id' => '', 'value' => 'No records', 'label' => 'No records'));
     if ($term != '') {
         $emp_arr = $logmanager_model->getAutoReportEmpnameWithId($term);
         if (count($emp_arr) > 0) {
             $output = array();
             foreach ($emp_arr as $emp) {
                 $output[] = array('id' => $emp['id'], 'value' => $emp['emp_name'], 'label' => $emp['emp_name'], 'profile_img' => $emp['profileimg']);
             }
         }
     }
     $this->_helper->json($output);
 }