public function indexAction() { $this->view->title = "Office meetings"; //Acl // $access = new App_Model_Access(); // $checkaccess = $access->accessRights('Activity',$this->view->globalvalue[0]['name'],'activityeditAction'); // if (($checkaccess != NULL)) { //view $this->view->meeting_id = $meeting_id = $this->_request->getParam('meeting_id'); $meeting = new Officemeeting_Model_Meeting(); $this->view->fetchmeeting = $meeting->fetchMeetingdetailsForID($meeting_id); // } else { // $this->_redirect('index/index'); // } }
public function meetingeditAction() { //Acl //$access = new App_Model_Access(); //$checkaccess = $access->accessRights('Institution',$this->view->globalvalue[0]['name'],'addinstitutionAction'); //if (($checkaccess != NULL)) { //edit $this->view->pageTitle = 'Office meetings'; $path = $this->view->baseUrl(); $this->view->title = "Edit Meeting"; $this->view->meeting_id = $meeting_id = $this->_getParam('meeting_id'); $meetingForm = new Officemeeting_Form_Meeting($path); $this->view->meetingForm = $meetingForm; $meeting = new Officemeeting_Model_Meeting(); //load office names in the drop down list box $office = new Officemeeting_Model_Meeting(); $officelevel = $this->view->adm->viewRecord("ourbank_officehierarchy", "id", "ASC"); foreach ($officelevel as $officelevel1) { $meetingForm->institute_bank_id->addMultiOption($officelevel1['id'], $officelevel1['type']); } $days = $this->view->adm->viewRecord("ourbank_master_frequencypayment", "id", "ASC"); foreach ($days as $days) { $meetingForm->meeting_day->addMultiOption($days['id'], $days['name']); } $fetchMeetingDetails = $meeting->fetchMeetingdetailsForID($meeting_id); $officeleveid = $fetchMeetingDetails[0]['officelevel']; $officenames = $office->fetchofficenames($officeleveid); foreach ($officenames as $officenames) { $meetingForm->group_name->addMultiOption($officenames['id'], $officenames['name']); } foreach ($fetchMeetingDetails as $meetings) { $this->view->meetingForm->meeting_name->setValue($meetings['name']); $this->view->meetingForm->institute_bank_id->setValue($meetings['officelevel']); $this->view->meetingForm->group_name->setValue($meetings['office_id']); $this->view->meetingForm->meeting_place->setValue($meetings['place']); $this->view->meetingForm->meeting_day->setValue($meetings['wid']); $formdata2 = array('id' => $meetings['id'], 'name' => $meetings['name'], 'officelevel' => $meetings['officelevel'], 'office_id' => $meetings['office_id'], 'place' => $meetings['place'], 'frequency' => $meetings['wid'], 'created_by' => $this->view->createdby); } $meetingForm->meeting_name->removeValidator('Db_NoRecordExists'); if ($this->_request->isPost() && $this->_request->getPost('Submit')) { $id = $this->_getParam('meeting_id'); $formData = $this->_request->getPost(); $this->view->meeting_id = $meeting_id = $this->_getParam('meeting_id'); if ($meetingForm->isValid($formData)) { $formdata1 = array('name' => $formData['meeting_name'], 'officelevel' => $formData['institute_bank_id'], 'office_id' => $formData['group_name'], 'place' => $formData['meeting_place'], 'frequency' => $formData['meeting_day'], 'created_by' => $this->view->createdby); $this->view->adm->updateLog("ourbank_officemeeting_log", $formdata2, $this->view->createdby); //update $this->view->adm->updateRecord("ourbank_officemeeting", $id, $formdata1); $this->_redirect('/officemeetingcommonview/index/index/meeting_id/' . $id); } } // } else { // $this->_redirect('index/index'); // } }