public function viewAction()
 {
     $id = intval($this->getRequest()->getParam('id'));
     $callval = $this->getRequest()->getParam('call');
     if ($callval == 'ajaxcall') {
         $this->_helper->layout->disableLayout();
     }
     $objName = 'myholidaycalendar';
     $holidaydatesform = new Default_Form_holidaydates();
     $holidaydatesmodel = new Default_Model_Holidaydates();
     $holidaygroupsmodel = new Default_Model_Holidaygroups();
     $holidaydatesform->removeElement("submit");
     $data = $holidaydatesmodel->getsingleHolidayDatesData($id);
     $groupdataArr = $holidaygroupsmodel->getAllGroupData();
     if (sizeof($groupdataArr) > 0) {
         foreach ($groupdataArr as $groupdatares) {
             $holidaydatesform->groupid->addMultiOption($groupdatares['id'], utf8_encode($groupdatares['groupname']));
         }
     }
     $elements = $holidaydatesform->getElements();
     if (count($elements) > 0) {
         foreach ($elements as $key => $element) {
             if ($key != "Cancel" && $key != "Edit" && $key != "Delete" && $key != "Attachments") {
                 $element->setAttrib("disabled", "disabled");
             }
         }
     }
     if (!empty($data)) {
         $holidaydatesform->populate($data);
         $holidaydate = sapp_Global::change_date($data['holidaydate'], 'view');
         $holidaydatesform->holidaydate->setValue($holidaydate);
         $this->view->controllername = $objName;
         $this->view->id = $id;
         $this->view->form = $holidaydatesform;
         $this->view->ermsg = '';
     } else {
         $this->view->ermsg = 'nodata';
     }
 }
 public function viewpopupAction()
 {
     Zend_Layout::getMvcInstance()->setLayoutPath(APPLICATION_PATH . "/layouts/scripts/popup/");
     $id = $this->getRequest()->getParam('id');
     $callval = $this->getRequest()->getParam('call');
     if ($callval == 'ajaxcall') {
         $this->_helper->layout->disableLayout();
     }
     $objName = 'empholidays';
     $holidaydatesform = new Default_Form_holidaydates();
     $holidaydatesmodel = new Default_Model_Holidaydates();
     $holidaydatesform->removeElement("submit");
     $data = $holidaydatesmodel->getsingleHolidayDatesData($id);
     $elements = $holidaydatesform->getElements();
     if (count($elements) > 0) {
         foreach ($elements as $key => $element) {
             if ($key != "Cancel" && $key != "Edit" && $key != "Delete" && $key != "Attachments") {
                 $element->setAttrib("disabled", "disabled");
             }
         }
     }
     $holidaydatesform->populate($data);
     $holidaydate = sapp_Global::change_date($data['holidaydate'], 'view');
     $holidaydatesform->holidaydate->setValue($holidaydate);
     $this->view->controllername = $objName;
     $this->view->id = $id;
     $this->view->form = $holidaydatesform;
 }