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'); $bunitid = $this->getRequest()->getParam('unitId'); $callval = $this->getRequest()->getParam('call'); if ($callval == 'ajaxcall') { $this->_helper->layout->disableLayout(); } $holidaydatesform = new Default_Form_holidaydates(); $holidaydatesmodel = new Default_Model_Holidaydates(); $holidaygroupsmodel = new Default_Model_Holidaygroups(); $holidaydatesform->submit->setLabel('Update'); if ($id) { $data = $holidaydatesmodel->getParticularHolidayDateData($id); if (!empty($data)) { $data = $data[0]; $groupdataArr = $holidaygroupsmodel->getParticularGroupData($data['groupid']); if (sizeof($groupdataArr) > 0) { $holidaydatesform->groupid->addMultiOption($groupdataArr[0]['id'], utf8_encode($groupdataArr[0]['groupname'])); } $holidaydatesform->populate($data); $holidaydate = sapp_Global::change_date($data['holidaydate'], 'view'); $holidaydatesform->holidaydate->setValue($holidaydate); $holidaydatesform->setAttrib('action', DOMAIN . 'holidaydates/editpopup/id/' . $id . '/unitId/' . $bunitid); } else { $this->view->rowexist = "rows"; } } else { $this->view->rowexist = "norows"; } $this->view->form = $holidaydatesform; $this->view->groupid = $bunitid; $this->view->controllername = 'holidaydates'; if ($this->getRequest()->getPost()) { $result = $this->popupsave($holidaydatesform); $this->view->msgarray = $result; } }
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; }