public function editpopupAction()
 {
     Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
     }
     $id = $this->getRequest()->getParam('id');
     $userid = $this->getRequest()->getParam('unitId');
     if ($id == '') {
         $id = $loginUserId;
     }
     // For open the form in popup...
     $empadditionaldetailsform = new Default_Form_empadditionaldetails();
     $empadditionaldetailsModal = new Default_Model_Empadditionaldetails();
     $countriesModel = new Default_Model_Countries();
     $veteranstatusmodel = new Default_Model_Veteranstatus();
     $militaryservicemodel = new Default_Model_Militaryservice();
     $countrieslistArr = $countriesModel->getTotalCountriesList();
     $empadditionaldetailsform->countries_served->addMultiOption('', 'Select Country');
     if (!empty($countrieslistArr)) {
         foreach ($countrieslistArr as $countrieslistres) {
             $empadditionaldetailsform->countries_served->addMultiOption($countrieslistres['id'], utf8_encode($countrieslistres['country_name']));
         }
     }
     $militaryserviceArr = $militaryservicemodel->getTotalMilitaryServiceData();
     $empadditionaldetailsform->military_servicetype->addMultiOption('', 'Select Service Type');
     if (!empty($militaryserviceArr)) {
         foreach ($militaryserviceArr as $militaryserviceres) {
             $empadditionaldetailsform->military_servicetype->addMultiOption($militaryserviceres['id'], $militaryserviceres['militaryservicetype']);
         }
     }
     $veteranstatusArr = $veteranstatusmodel->getTotalVeteranStatusData();
     $empadditionaldetailsform->veteran_status->addMultiOption('', 'Select Veteran Status');
     if (!empty($veteranstatusArr)) {
         foreach ($veteranstatusArr as $veteranstatusres) {
             $empadditionaldetailsform->veteran_status->addMultiOption($veteranstatusres['id'], $veteranstatusres['veteranstatus']);
         }
     }
     if ($id) {
         $data = $empadditionaldetailsModal->getEmpAdditionalDetailsData($id);
         if (!empty($data)) {
             $empadditionaldetailsform->populate($data[0]);
             $empadditionaldetailsform->setDefault('countries_served', $data[0]['countries_served']);
             $empadditionaldetailsform->setDefault('military_servicetype', $data[0]['military_servicetype']);
             $empadditionaldetailsform->setDefault('veteran_status', $data[0]['veteran_status']);
             $from_date = sapp_Global::change_date($data[0]['from_date'], 'view');
             $to_date = sapp_Global::change_date($data[0]['to_date'], 'view');
             $empadditionaldetailsform->from_date->setValue($from_date);
             $empadditionaldetailsform->to_date->setValue($to_date);
             $this->view->data = $data;
         }
     }
     $empadditionaldetailsform->setAttrib('action', BASE_URL . 'empadditionaldetails/editpopup/unitId/' . $userid);
     $this->view->form = $empadditionaldetailsform;
     $this->view->controllername = 'empadditionaldetails';
     if ($this->getRequest()->getPost()) {
         $result = $this->save($empadditionaldetailsform, $userid);
         $this->view->msgarray = $result;
     }
 }
 public function deleteAction()
 {
     $auth = Zend_Auth::getInstance();
     if ($auth->hasIdentity()) {
         $loginUserId = $auth->getStorage()->read()->id;
     }
     $id = $this->_request->getParam('objid');
     $messages['message'] = '';
     $messages['msgtype'] = '';
     $actionflag = 3;
     if ($id) {
         $veteranstatusmodel = new Default_Model_Veteranstatus();
         $menumodel = new Default_Model_Menu();
         $veteranstatusdata = $veteranstatusmodel->getVeteranStatusDataByID($id);
         $data = array('isactive' => 0, 'modifieddate' => gmdate("Y-m-d H:i:s"));
         $where = array('id=?' => $id);
         $Id = $veteranstatusmodel->SaveorUpdateVeteranStatusData($data, $where);
         if ($Id == 'update') {
             $menuidArr = $menumodel->getMenuObjID('/veteranstatus');
             $menuID = $menuidArr[0]['id'];
             $result = sapp_Global::logManager($menuID, $actionflag, $loginUserId, $id);
             $configmail = sapp_Global::send_configuration_mail('Veteran Status', $veteranstatusdata[0]['veteranstatus']);
             $messages['message'] = 'Veteran status deleted successfully.';
             $messages['msgtype'] = 'success';
         } else {
             $messages['message'] = 'Veteran status cannot be deleted.';
             $messages['msgtype'] = 'error';
         }
     } else {
         $messages['message'] = 'Veteran status cannot be deleted.';
         $messages['msgtype'] = 'error';
     }
     $this->_helper->json($messages);
 }