public function executeSavePreviewCopy() { $class_group1 = $this->getRequestParameter('class1'); $academic1 = $this->getRequestParameter('accal1'); $class_group2 = $this->getRequestParameter('class2'); $academic2 = $this->getRequestParameter('accal2'); $c = new Criteria(); $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $academic1); $c->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_group1); $c_schedules = CourseSchedulePeer::doSelect($c); foreach ($c_schedules as $c_schedule) { $course_schedule = new CourseSchedule(); $course_schedule->setSubjectCurrId($c_schedule->getSubjectCurrId()); $course_schedule->setKkm($c_schedule->getKkm()); $course_schedule->setClassGroupId($class_group2); $course_schedule->setAcademicCalendarId($academic2); $course_schedule->setEmployeeId($c_schedule->getEmployeeId()); $course_schedule->setName($c_schedule->getName()); $course_schedule->save(); $cw = new Criteria(); $cw->add(CourseScheduleDetailPeer::COURSE_SCHEDULE_ID, $c_schedule->getId()); $c_details = CourseScheduleDetailPeer::doSelect($cw); foreach ($c_details as $c_detail) { $course_detail = new CourseScheduleDetail(); $course_detail->setCourseSchedule($course_schedule); $course_detail->setLocationId($c_detail->getLocationId()); $course_detail->setClassSessionId($c_detail->getClassSessionId()); $course_detail->setDay($c_detail->getDay()); $course_detail->save(); } $cr = new Criteria(); $cr->add(CourseScheduleTutorPeer::COURSE_SCHEDULE_ID, $c_schedule->getId()); $c_tutors = CourseScheduleTutorPeer::doSelect($cr); foreach ($c_tutors as $c_tutor) { $course_tutor = new CourseScheduleTutor(); $course_tutor->setCourseSchedule($course_schedule); $course_tutor->setEmployeeId($c_tutor->getEmployeeId()); $course_tutor->save(); } } return $this->redirect('course_sched/preview?class_group_id=' . $class_group2 . '&accal_id=' . $academic2); }
public function addCourseScheduleTutor(CourseScheduleTutor $l) { $this->collCourseScheduleTutors[] = $l; $l->setEmployee($this); }
public function executeSaveDetail() { $params = array(); foreach (explode('&', $this->getRequestParameter('employee_list_ser')) as $p) { $p = explode('=', $p); $params[rawurldecode($p[0])][] = rawurldecode($p[1]); } if (array_key_exists('employees', $params)) { foreach ($params['employees'] as $emp_id) { $cs_tutor = new CourseScheduleTutor(); $cs_tutor->setEmployeeId($emp_id); $cs_tutor->setCourseScheduleId($this->getRequestParameter('id')); $cs_tutor->save(); } } $course_schedule = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($course_schedule); return $this->redirect('course_schedule/preview?class_group_id=' . $course_schedule->getClassGroupId() . '&accal_id=' . $course_schedule->getAcademicCalendarId()); }