public function getrequestsAction() { $service_desk_id = $this->_getParam('service_desk_id', null); $service_desk_conf_id = $this->_getParam('service_desk_conf_id', null); $data = array(); $options = sapp_Global::selectOptionBuilder('', 'Select request', ''); if ($service_desk_id != '') { $sd_dept_model = new Default_Model_Servicedeskdepartment(); $data = $sd_dept_model->getRequestsById($service_desk_id); if (count($data) > 0) { foreach ($data as $opt) { $options .= sapp_Global::selectOptionBuilder($opt['id'], utf8_encode($opt['service_request_name']), ''); } } } $attachment = false; if ($service_desk_conf_id != '') { $sd_conf_model = new Default_Model_Servicedeskconf(); $sd_conf_data = $sd_conf_model->getServiceDeskConfbyID($service_desk_conf_id); if (count($sd_conf_data) > 0) { if ($sd_conf_data[0]['attachment'] == 1) { $attachment = true; } } } $this->_helper->json(array('options' => $options, 'datacount' => count($data), 'attachment' => $attachment)); }