public function addstaffAction() { $institute = new Institution(); $helper = new Helper(); $request = $this->getRequest(); if (isset($_POST['update'])) { $institute->updateStaff(); $this->_redirect(Settings::$COUNTRY_BASE_URL . "/institution/institutionedit/id/" . $_POST['updateid']); } $instituteid = $request->getParam('id'); # PULLING STAFF LISTING FOR THIS INSTITUTION $staff = $helper->getAllTutors(); $this->view->assign('tutors', $staff); $this->view->assign('id', $instituteid); # PULLING STAFF LISTING FOR THIS INSTITUTION $staff = $institute->listStaff($instituteid); $selected = array(); foreach ($staff as $s) { $selected[] = $s['tutorid']; } $this->view->assign('selectedstaff', $selected); }