public function getDayString() { $context = sfContext::getInstance(); $i18n = new sfI18N(); $i18n->initialize($context); $i18n->setCulture($context->getUser()->getCulture()); switch ($this->getDay()) { case '1': return $i18n->globalMessageFormat->format('_DAY_MONDAY_'); break; case '2': return $i18n->globalMessageFormat->format('_DAY_TUESDAY_'); break; case '3': return $i18n->globalMessageFormat->format('_DAY_WEDNESDAY_'); break; case '4': return $i18n->globalMessageFormat->format('_DAY_THURSDAY_'); break; case '5': return $i18n->globalMessageFormat->format('_DAY_FRIDAY_'); break; case '6': return $i18n->globalMessageFormat->format('_DAY_SATURDAY_'); break; case '7': return $i18n->globalMessageFormat->format('_DAY_SUNDAY_'); break; default: return '-'; break; } }
public function initialize(sfApplicationConfiguration $configuration, sfCache $cache = null, $options = array()) { parent::initialize($configuration, $cache, $options); $application = sfConfig::get('sf_app'); if ($application == 'pc_backend') { $application = 'pc_frontend'; } $this->terms = Doctrine::getTable('SnsTerm'); $this->terms->configure($this->culture, $application); }
public function executeSave() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo'); $employee = EmployeePeer::retrieveByPK($employee_id); $this->forward404Unless($employee); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $class_agenda = new ClassAgenda(); } else { $class_agenda = ClassAgendaPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($class_agenda); } $class_agenda->setId($this->getRequestParameter('id')); $class_agenda->setCourseScheduleId($this->getRequestParameter('course_schedule_id')); $class_agenda->setDetail($this->getRequestParameter('detail')); if ($this->getRequestParameter('date')) { $class_agenda->setDate($this->getRequestParameter('date')); } $class_agenda->setStatus($this->getRequestParameter('status')); $class_agenda->setSubjectGradingId($this->getRequestParameter('subject_grading_id')); $class_agenda->setMeetingPoint($this->getRequestParameter('meeting_point')); $class_agenda->setActionType($this->getRequestParameter('action_type')); $class_agenda->setDay($this->getRequestParameter('day')); if ($this->getRequestParameter('class_group_id')) { $class_agenda->setClassGroupId($this->getRequestParameter('class_group_id')); } else { $cs = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_schedule_id')); $this->forward404Unless($cs); $class_agenda->setClassGroupId($cs->getClassGroupId()); } $class_agenda->setDescription($this->getRequestParameter('description')); $class_agenda->save(); #$params = array(); #foreach (explode('&', $this->getRequestParameter('student_list_ser')) as $p) { # $p = explode('=', $p); # $params[rawurldecode($p[0])][] = rawurldecode($p[1]); #} #if (array_key_exists('students', $params)) { # foreach ($params['students'] as $su_id) { # $student_absence = new StudentAbsence(); # # $student_absence->setStudentId($su_id); # $student_absence->setStart($this->getRequestParameter('date')); # $student_absence->setEnd($this->getRequestParameter('date')); # $student_absence->setAcademicCalendarId($class_agenda->getCourseSchedule()->getAcademicCalendarId()); # $student_absence->setClassGroupId($this->getRequestParameter('class_group_id')); # $student_absence->save(); # } #} return $this->redirect('agenda/edit?id=' . $class_agenda->getId()); #return $this->forward('agenda', 'list'); #return $this->forward('agenda', 'edit?id='.$class_agenda->getId()); }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $cat_language = new CatLanguage(); } else { $cat_language = CatLanguagePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($cat_language); } $cat_language->setId($this->getRequestParameter('id')); $cat_language->setCode($this->getRequestParameter('code')); $cat_language->setName($this->getRequestParameter('name')); $cat_language->save(); return $this->redirect('cat_language/list'); }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_i18n = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $expenditure_journal = new ExpenditureJournal(); } else { $expenditure_journal = ExpenditureJournalPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($expenditure_journal); } $expenditure_journal->setId($this->getRequestParameter('id')); $expenditure_journal->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id')); $expenditure_journal->setAmount($this->getRequestParameter('amount')); //$expenditure_journal->setPaid($this->getRequestParameter('paid')); //$expenditure_journal->setReceivable($this->getRequestParameter('amount')-$this->getRequestParameter('paid')); //$expenditure_journal->setBiayaDesc($this->getRequestParameter('biaya_desc')); $expenditure_journal->setPaidAt($this->getRequestParameter('paid_at')); $expenditure_journal->setStatus($this->getRequestParameter('status')); $expenditure_journal->setBudget($this->getRequestParameter('budget')); $expenditure_journal->save(); return $this->redirect('expenditure_journal/list'); }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $payment_model = new PaymentModel(); } else { $payment_model = PaymentModelPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($payment_model); } $payment_model->setId($this->getRequestParameter('id')); $payment_model->setCode($this->getRequestParameter('code')); $payment_model->setName($this->getRequestParameter('name')); $payment_model->setParent($this->getRequestParameter('parent')); $payment_model->setDescription($this->getRequestParameter('description')); $payment_model->save(); return $this->redirect('payment_model/list'); }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $budget_status = new BudgetStatus(); } else { $budget_status = BudgetStatusPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($budget_status); } $budget_status->setId($this->getRequestParameter('id')); $budget_status->setCode($this->getRequestParameter('code')); $budget_status->setName($this->getRequestParameter('name')); $budget_status->save(); return $this->redirect('budget_status/list'); }
public function executeUpdate() { $group = $this->getContext()->getUser()->getAttribute('group', null, 'bo'); if ($group != 'root') { $this->forward('default', 'index'); } $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $params = new Params(); } else { $params = ParamsPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($params); } $params->setId($this->getRequestParameter('id')); $params->setCode($this->getRequestParameter('code')); $params->setValue($this->getRequestParameter('value')); $params->setDescription($this->getRequestParameter('description')); $params->save(); return $this->redirect('params/list'); }
public function initialize(sfApplicationConfiguration $configuration, sfCache $cache = null, $options = array()) { parent::initialize($configuration, $cache, $options); $this->terms = Doctrine::getTable('SnsTerm'); $this->terms->configure($this->culture, sfConfig::get('sf_app')); }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $class_course = new ClassCourse(); $class_course->setClassGroupId($this->getRequestParameter('class_group_id')); $class_course->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id')); $class_course->setStatus(3); $class_course->save(); $academic_calendar_id = $this->getRequestParameter('academic_calendar_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id); $this->forward404Unless($academic_calendar); $class_group_id = $this->getRequestParameter('class_group_id'); $class_group = ClassGroupPeer::retrieveByPK($class_group_id); $this->forward404Unless($class_group); $c = new Criteria(); $c->add(StudentPeer::CLASS_GROUP_ID, $class_group_id); $students = StudentPeer::doSelect($c); foreach ($students as $student) { $c = new Criteria(); $c->add(VCourseSchedulePeer::CLASS_GROUP_ID, $class_group_id); $c->add(VCourseSchedulePeer::ACADEMIC_CALENDAR_ID, $academic_calendar_id); $courses = VCourseSchedulePeer::doSelect($c); foreach ($courses as $course) { $student_course = new StudentCourse(); $student_course->setStudentId($student->getId()); $student_course->setSubjectAccalId($course->getSubjectAccalId()); $student_course->setClassGroupId($course->getClassGroupId()); $student_course->setStatus(3); $student_course->save(); } } } else { $class_course = ClassCoursePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($class_course); $class_course->setId($this->getRequestParameter('id')); $class_course->setClassGroupId($this->getRequestParameter('class_group_id')); $class_course->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id')); $class_course->setStatus(3); $class_course->save(); $academic_calendar_id = $this->getRequestParameter('academic_calendar_id'); $class_group_id = $this->getRequestParameter('class_group_id'); $c = new Criteria(); $c->add(StudentPeer::CLASS_GROUP_ID, $class_group_id); $students = StudentPeer::doSelect($c); foreach ($students as $student) { $c = new Criteria(); $c->add(VCourseSchedulePeer::CLASS_GROUP_ID, $class_group_id); $c->add(VCourseSchedulePeer::ACADEMIC_CALENDAR_ID, $academic_calendar_id); $courses = VCourseSchedulePeer::doSelect($c); foreach ($courses as $course) { $c = new Critaria(); $c->add(StudenCoursePeer::STUDENT_ID, $student->getId()); $stu_courses = StudentCoursePeer::doSelect($c); foreach ($stu_courses as $stu_courses) { $student_course = StudentCoursePeer::retrieveByPk($stu_courses->getId()); $student_course->setStudentId($student->getId()); $student_course->setSubjectAccalId($course->getSubjectAccalId()); $student_course->setClassGroupId($course->getClassGroupId()); $student_course->setStatus(3); $student_course->save(); } } } } return $this->redirect('subject_plan/list'); }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $student_job_history = new StudentJobHistory(); } else { $student_job_history = StudentJobHistoryPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student_job_history); } $student_job_history->setId($this->getRequestParameter('id')); $student_job_history->setStudentId($this->getRequestParameter('student_id')); $student_job_history->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id')); $student_job_history->setInstanceId($this->getRequestParameter('instance_id')); if ($this->getRequestParameter('start')) { $student_job_history->setStart($this->getRequestParameter('start')); } if ($this->getRequestParameter('end')) { $student_job_history->setEnd($this->getRequestParameter('end')); } $student_job_history->setGrade($this->getRequestParameter('grade')); $student_job_history->setCitationId($this->getRequestParameter('citation_id')); $student_job_history->save(); return $this->redirect('student_job_history/list?student_id=' . $this->getRequestParameter('student_id')); }
public function executeUpdateSchedule() { $schedule = SchedulePeer::retrieveByPk($this->getRequestParameter('schedule_id')); $this->schedule = $schedule; $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $cs_detail = new ScheduleDetail(); } else { $cs_detail = ScheduleDetailPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($cs_detail); } $cs_detail->setId($this->getRequestParameter('id')); $cs_detail->setScheduleId($schedule->getId()); $cs_detail->setDay($this->getRequestParameter('day')); $cs_detail->setClassSessionId($this->getRequestParameter('class_session_id')); $cs_detail->setLocationId($this->getRequestParameter('location_id')); $cs_detail->save(); return $this->redirect('extracurricular/edit?id=' . $schedule->getId()); }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); $student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id')); $this->forward404Unless($student); $this->student = $student; if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $student_leave = new StudentLeave(); $student_leave->setStatus(StudentLeave::STATUS_PROPOSED); } else { $student_leave = StudentLeavePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student_leave); $student_leave->setStatus(StudentLeave::STATUS_CANCELED); } $student_leave->setId($this->getRequestParameter('id')); $student_leave->setStudentId($this->getRequestParameter('student_id')); $student_leave->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id')); $student_leave->save(); $stu = $student_leave->getStudent(); if ($student_leave->getStatus() == StudentLeave::STATUS_ACTIVE) { // add payment journal $job = JobPeer::retrieveByCode($this->getModuleName()); $academic_process = $job->getAcademicProcess(); $c = new Criteria(); $c->add(AcademicCostPeer::ACADEMIC_PROCESS_ID, $academic_process->getId()); $c->add(AcademicCostPeer::ACADEMIC_CALENDAR_ID, $student_leave->getAcademicCalendarId()); $costs = AcademicCostPeer::doSelect($c); foreach ($costs as $c) { $pj = new PaymentJournal(); $pj->setPayer($stu->getId()); $pj->setAcademicCost($c); $pj->setJob($job); $pj->setAmount($c->getAmount()); $pj->setPaid($c->getAmount()); $pj->setReceivable(0); $pj->setAcademicProcess($academic_process); $pj->setPayerType(PaymentJournal::PAYER_TYPE_STUDENT); $pj->save(); $ph = new PaymentHistory(); $ph->setPaymentJournal($pj); $ph->setAmount($c->getAmount()); $ph->save(); } // set student status $stu->setStatus(Student::STATUS_INACTIVE); $stu->save(); // cancelled all student course $c = new Criteria(); $c->add(StudentCoursePeer::STUDENT_ID, $stu->getId()); $c->add(StudentCoursePeer::STATUS, array(StudentCourse::STATUS_PLANNED, StudentCourse::STATUS_APPROVED, StudentCourse::STATUS_ACTIVE), Criteria::IN); $scs = StudentCoursePeer::doSelect($c); foreach ($scs as $sc) { $sc->setStatus(StudentCourse::STATUS_CANCELED); $sc->save(); } } elseif ($student_leave->getStatus() == StudentLeave::STATUS_DONE) { $stu->setStatus(Student::STATUS_ACTIVE); $stu->save(); } return $this->redirect('student_leave_s/list?student_id=' . $student->getId()); }
public function executeSave() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); $params = array(); foreach (explode('&', $this->getRequestParameter('month_list_ser')) as $p) { $p = explode('=', $p); $params[rawurldecode($p[0])][] = rawurldecode($p[1]); } if (array_key_exists('months', $params)) { foreach ($params['months'] as $month_id) { $payment_student = new PaymentJournal(); $student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id')); $c = new Criteria(); $c->add(StudentTypePeer::STUDENT_ID, $student->getId()); $stu_type = StudentTypePeer::doSelectOne($c); $cr = new Criteria(); $cton1 = $cr->getNewCriterion(AcademicCostPeer::PAYER_TYPE_ID, $stu_type->getPayerTypeId(), Criteria::IN); $cton2 = $cr->getNewCriterion(AcademicCostPeer::ACADEMIC_PROCESS_ID, 2, Criteria::IN); $cton3 = $cr->getNewCriterion(AcademicCostPeer::ACADEMIC_CALENDAR_ID, $student->getAcademicCalendarId(), Criteria::IN); $cton4 = $cr->getNewCriterion(AcademicCostPeer::ACADEMIC_CALENDAR_ID, $student->getAcademicCalendar()->getParent(), Criteria::IN); $cton3->addOr($cton4); $cton2->addAnd($cton3); $cton1->addAnd($cton2); $cr->add($cton1); $ac_cost = AcademicCostPeer::doSelectOne($cr); $payment_student->setPayer($this->getRequestParameter('student_id')); $payment_student->setAcademicCostId($ac_cost->getId()); $payment_student->setAcademicProcessId($ac_cost->getAcademicProcessId()); $payment_student->setAmount($ac_cost->getAmount()); $payment_student->setPaid($ac_cost->getAmount()); $payment_student->setReceivable($ac_cost->getAmount() - $ac_cost->getAmount()); $payment_student->setPaidAt($this->getRequestParameter('paid_at')); $payment_student->setPayerType(PaymentJournal::PAYER_TYPE_STUDENT); $payment_student->setPaymentModelId($this->getRequestParameter('payment_model_id')); $payment_student->setYear($this->getRequestParameter('year')); $payment_student->setMonth($month_id); $payment_student->setStatus('S'); $payment_student->save(); $amount_changed = $ac_cost->getAmount(); if ($amount_changed != 0) { $ph = new PaymentHistory(); $ph->setPaymentJournal($payment_student); $ph->setAmount($amount_changed); $ph->save(); } } } return $this->redirect('payment_student/list'); #return $this->forward('payment_student', 'preview?student_id='.$this->getRequestParameter('student_id').'&paid_at='.$this->getRequestParameter('paid_at').'&payment_model_id='.$this->getRequestParameter('payment_model_id').'&year='.$this->getRequestParameter('year')); #return $this->redirect('payment_student/preview?student_id='.$this->getRequestParameter('student_id').'&paid_at='.$this->getRequestParameter('paid_at').'&payment_model_id='.$this->getRequestParameter('payment_model_id').'&year='.$this->getRequestParameter('year')); #return $this->redirect('payment_student/list', # 'before'=>"window.open('".$this->getController()->genUrl('/payment_student/printForm'). # "?student_id='+$('student_id').value+'&paid_at='+$('paid_at').value+'&payment_model_id='+$('payment_model_id').value+'&year='+$('year').value, # 'link', # 'height=480,width=640,toolbar=no,menubar=no,scrollbars=yes,resizable=yes,location=no,directories=no,status=no' # )") }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $counseling_spec = new CounselingSpec(); } else { $counseling_spec = CounselingSpecPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($counseling_spec); } $counseling_spec->setId($this->getRequestParameter('id')); $counseling_spec->setCode($this->getRequestParameter('code')); $counseling_spec->setParent($this->getRequestParameter('parent')); $counseling_spec->setDescription($this->getRequestParameter('description')); $counseling_spec->save(); return $this->redirect('counseling_spec/list'); }
public function executeSavePayment() { #$user_id = $this->getContext()->getUser()->getAttribute('user_id', null, 'bo'); $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); /** $year = $this->getRequestParameter('year'); $month = $this->getRequestParameter('month'); $department = DepartmentPeer::retrieveByPK($this->getRequestParameter('department_id')); $dept_code = $department->getNumCode().'-'; $code_appl = 'REG'; $stu_code = ParamsPeer::retrieveByCode('applicant_code'); $sc = $stu_code->getValue(); $sc = explode('$', $sc); array_shift($sc); $code_len = 0; $code = ''; foreach ($sc as $k => $v) { $v = explode('#', $v); if ($v[0] == 'app') { $code_len += $v[1]; $code .= str_pad($code_appl, $v[1], '0', STR_PAD_LEFT); } elseif ($v[0] == 'dept') { $code .= str_pad($dept_code, $v[1], '0', STR_PAD_LEFT); $code_len += $v[1]; } elseif ($v[0] == 'year') { if (strlen($year) <= $v[1]) { $code .= str_pad($year, $v[1], '0', STR_PAD_LEFT); } else { $code .= substr($year, strlen($year) - $v[1]); } $code_len += $v[1]; } elseif ($v[0] == 'month') { if (strlen($month) <= $v[1]) { $code .= str_pad($month, $v[1], '0', STR_PAD_LEFT); } else { $code .= substr($month, strlen($month) - $v[1]); } $code_len += $v[1]; } elseif ($v[0] == 'seq') { $c = new Criteria(); $c->add(NgTestApplicantPeer::CODE, $code . '%', Criteria::LIKE); $c->addDescendingOrderByColumn(NgTestApplicantPeer::CODE); $c->setLimit(1); $last_applicant = NgTestApplicantPeer::doSelectOne($c); if ($last_applicant) { $lap = $last_applicant->getCode(); $lap = substr_replace($lap, '', 0, $code_len); $lap = substr($lap, 0, $v[1]); $lap++; $code .= str_pad($lap, $v[1], '0', STR_PAD_LEFT); } else { $code .= str_pad(1, $v[1], '0', STR_PAD_LEFT); break; } } $sc[$k] = $v; } **/ $newCode = $this->pmbTools->generateApplicantCode(NgStatusApplicant::CONFIRMED, $this->getRequestParameter('department_id')); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $ng_test_applicant = new NgTestApplicant(); } else { $ng_test_applicant = NgTestApplicantPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($ng_test_applicant); } $ng_test_applicant->setCode($newCode); $ng_test_applicant->setNgStatusApplicantId(NgStatusApplicant::CONFIRMED); $ng_test_applicant->save(); $c = new Criteria(); $c->add(NgRegTestPeriodPeer::NG_REG_PERIOD_ID, $ng_test_applicant->getNgRegTestPeriod()->getNgRegPeriodId()); $nrtps = NgRegTestPeriodPeer::doSelect($c); foreach ($nrtps as $nrtp) { $cw = new Criteria(); $cw->add(NgTestSchedulePeer::NG_REG_TEST_PERIOD_ID, $nrtp->getId()); $cw->addAscendingorderByColumn(NgTestSchedulePeer::ID); $scheds = NgTestSchedulePeer::doSelect($cw); $s1 = array(); foreach ($scheds as $s) { $s1[$s->getNgRegTestPeriodId()][] = array('ng_reg_test_period_id' => $s->getNgRegTestPeriodId(), 'used' => $s->countNgTestApplScheds(), 'capacity' => $s->getCapacity(), 'sched' => $s); } foreach ($s1 as $s) { $c = new Criteria(); $c->add(NgTestSchedulePeer::NG_REG_TEST_PERIOD_ID, $nrtp->getId()); $c->addJoin(TestApplSchedPeer::TEST_SCHEDULE_ID, TestSchedulePeer::ID); $c->add(NgTestApplSchedPeer::NG_TEST_APPLICANT_ID, $ng_test_applicant->getId()); $tas = NgTestApplSchedPeer::doSelectOne($c); if ($tas == null) { $i = 0; while ($s[$i]) { $sched = $s[$i]; if ($sched['used'] < $sched['capacity']) { $tas = new NgTestApplSched(); $tas->setNgTestApplicant($ng_test_applicant); $tas->setNgTestSchedule($sched['sched']); $tas->save(); break; } $i++; } } } } return $this->redirect('ng_test_applicant/list'); }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $ng_achievement_level = new NgAchievementLevel(); } else { $ng_achievement_level = NgAchievementLevelPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($ng_achievement_level); } $ng_achievement_level->setId($this->getRequestParameter('id')); $ng_achievement_level->setCode($this->getRequestParameter('code')); $ng_achievement_level->setName($this->getRequestParameter('detail')); $ng_achievement_level->save(); return $this->redirect('ng_achievement_level/list'); }
public function executeGetListStudent() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo'); $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPk($counseling_id); $year = $this->getRequestParameter('year'); $month = $this->getRequestParameter('month'); $c = new Criteria(); #$c->add(VStuSppPeer::MONTH, $month); #$c->add(VStuSppPeer::YEAR, $year); #$c->addJoin(StudentPeer::ID, VStuSppPeer::PAYER); $c->add(StudentPeer::CLASS_GROUP_ID, $counseling->getClassGroupId()); $c->add(StudentPeer::ACADEMIC_CALENDAR_ID, $counseling->getAcademicCalendarId()); $c->add(StudentPeer::STATUS, Student::STATUS_GRADUATE, Criteria::NOT_EQUAL); $c->add(StudentPeer::STATUS, Student::STATUS_OVERDUE, Criteria::NOT_EQUAL); $this->sortStudent($c); if ($this->getRequest()->hasParameter('filters')) { $filters = $this->getRequestParameter('filters'); if ($filters == 'clear') { $this->filters = null; } else { $defined_filter = false; foreach ($filters as $f) { if (is_array($f)) { if (strlen($f['from']) > 0 || strlen($f['to']) > 0) { $defined_filter = true; break; } } else { if ($f != null && $f != '') { $defined_filter = true; break; } } } if ($defined_filter) { $this->filters = $filters; $this->filterStudent($c, $this->getRequestParameter('filters')); } } } $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student')); $this->getUser()->setAttribute('max_per_page', $rpp, 'student'); $pager = new sfPropelPager('Student', $rpp); $pager->setCriteria($c); $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student')); $this->getUser()->setAttribute('page', $page, 'student'); $pager->setPage($page); $pager->init(); $this->pager = $pager; $actions = array(array('name' => 'filter', 'color' => 'white')); $filter_string = ""; if ($this->filters) { foreach ($this->filters as $key => $val) { $filter_string .= "&filters[{$key}]={$val}"; } $filter_string = preg_replace('/^&/', '', $filter_string); } array_unshift($actions, array('name' => 'Proses', 'type' => 'image', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value", 'title' => 'Proses'))); array_unshift($actions, array('name' => '_AS_CSV_', 'url' => "student_finance/getListStudentAsCSV?month={$month}&year={$year}&{$filter_string}", 'color' => 'black', 'type' => 'direct')); array_unshift($actions, array('name' => '_AS_PDF_', 'url' => "student_finance/getListStudentAsPDF?month={$month}&year={$year}&{$filter_string}", 'color' => 'black', 'type' => 'direct')); $this->actions = $actions; $this->month = $month; $this->year = $year; $this->counseling = $counseling; $this->subtitle = $counseling->getAcademicCalendar()->toString() . ' # ' . $counseling->getClassGroup()->toString(); $actions2 = array(array('name' => '<span>Jurnal Pembayaran Wakaf</span>', 'url' => 'student_finance/listStudent?counseling_id=' . $counseling->getId(), 'color' => 'sky')); array_unshift($actions2, array('name' => '<span>Jurnal Keuangan Murid</span>', 'url' => 'student_finance/list', 'color' => 'sky')); array_push($actions2, array('name' => '<span>Jurnal Pembayaran Infaq</span>', 'url' => 'student_finance/listInfaq?counseling_id=' . $counseling->getId(), 'color' => 'sky')); array_push($actions2, array('name' => '<span>Jurnal Pembayaran SPP</span>', 'url' => 'student_finance/listSpp?counseling_id=' . $counseling->getId(), 'color' => 'sun', 'type' => 'direct')); array_push($actions2, array('name' => '<span>Jurnal Pembayaran Lain-lain</span>', 'url' => 'student_finance/listElse?counseling_id=' . $counseling->getId(), 'color' => 'sky')); $this->actions2 = $actions2; $this->type = 'add'; }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $employee_leave = new EmployeeLeave(); } else { $employee_leave = EmployeeLeavePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($employee_leave); } $employee_leave->setId($this->getRequestParameter('id')); $employee_leave->setEmployeeId($this->getRequestParameter('employee_id')); if ($this->getRequestParameter('start')) { $employee_leave->setStart($this->getRequestParameter('start')); } if ($this->getRequestParameter('end')) { $employee_leave->setEnd($this->getRequestParameter('end')); } $employee = EmployeePeer::retrieveByPK($this->getRequestParameter('employee_id')); if ($employee) { $cd = new Criteria(); $cd->add(EmployeeDetailPeer::EMPLOYEE_ID, $employee->getId()); $employee_detail = EmployeeDetailPeer::doSelectOne($cd); if ($employee_detail->getEmployeeDivisionId()) { $employee_leave->setEmployeeDivisionId($employee_detail->getEmployeeDivisionId()); } if ($employee->getDepartmentId()) { $employee_leave->setDepartmentId($employee->getDepartmentId()); } } $employee_leave->setCode($this->getRequestParameter('code')); $employee_leave->setEmployeeLevelId($this->getRequestParameter('employee_level_id')); $employee_leave->setLeaveTypeId($this->getRequestParameter('leave_type_id')); $employee_leave->setLeaveLength($this->getRequestParameter('leave_length')); $employee_leave->setDetail($this->getRequestParameter('detail')); $employee_leave->setAddress($this->getRequestParameter('address')); $employee_leave->setStatus($this->getRequestParameter('status')); $employee_leave->setAcademicCalendarId($this->getRequestParameter('academic_calendar_id')); $employee_leave->save(); return $this->redirect('employee_leave/list?employee_id=' . $this->getRequestParameter('employee_id')); }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $subject = new Subject(); } else { $subject = SubjectPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($subject); } $subject->setId($this->getRequestParameter('id')); $subject->setCode($this->getRequestParameter('code')); $subject->setName($this->getRequestParameter('name')); $subject->setCredit($this->getRequestParameter('credit')); $subject->setDescription($this->getRequestParameter('description')); $subject->setSubjectGroupId($this->getRequestParameter('subject_group_id')); $subject->setDepartmentId($this->getRequestParameter('department_id')); $subject->save(); return $this->redirect('subject/list'); }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $student = new Student(); } else { $student = StudentPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student); } $student->setId($this->getRequestParameter('id')); $student->setCode($this->getRequestParameter('code')); $student->setName($this->getRequestParameter('name')); $student->setCurriculumId($this->getRequestParameter('curriculum_id')); $student->setClassGroupId($this->getRequestParameter('class_group_id')); $student->setClassName($this->getRequestParameter('class_name')); $student->setTestApplicantId($this->getRequestParameter('test_applicant_id')); $student->setStudentDetailId($this->getRequestParameter('student_detail_id')); $student->setStatus($this->getRequestParameter('status')); $student->save(); return $this->redirect('alumni/list'); }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $formula = new Formula(); } else { $formula = FormulaPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($formula); } $formula->setId($this->getRequestParameter('id')); $formula->setCode($this->getRequestParameter('code')); $formula->setDetail($this->getRequestParameter('detail')); $formula->save(); return $this->redirect('formula/list'); }
public function executeSave() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $class_agenda = new ClassAgenda(); } else { $class_agenda = ClassAgendaPeer::retrieveByPk($this->getRequestParameter('id')); #$this->forward404Unless($class_agenda); } $class_agenda->setId($this->getRequestParameter('id')); $class_agenda->setCourseScheduleId($this->getRequestParameter('course_schedule_id')); $class_agenda->setDetail($this->getRequestParameter('detail')); if ($this->getRequestParameter('date')) { $class_agenda->setDate($this->getRequestParameter('date')); } $class_agenda->setStatus($this->getRequestParameter('status')); $class_agenda->setSubjectGradingId($this->getRequestParameter('subject_grading_id')); $class_agenda->setMeetingPoint($this->getRequestParameter('meeting_point')); $class_agenda->setActionType($this->getRequestParameter('action_type')); $class_agenda->setDay($this->getRequestParameter('day')); $class_agenda->save(); if ($this->hasRequestParameter('file') && $this->getRequestParameter('file') != '' && $this->getRequestParameter('file') != null) { $fileName = $this->getRequestParameter('file'); $ca_file = new ClassAgendaFile(); $ca_file->setClassAgenda($class_agenda); $ca_file->setFile($fileName); $ca_file->save(); } if ($this->hasRequestParameter('file_1') && $this->getRequestParameter('file_1') != '' && $this->getRequestParameter('file_1') != null) { $fileName = $this->getRequestParameter('file_1'); $ca_file = new ClassAgendaFile(); $ca_file->setClassAgenda($class_agenda); $ca_file->setFile($fileName); $ca_file->save(); } if ($this->hasRequestParameter('file_2') && $this->getRequestParameter('file_2') != '' && $this->getRequestParameter('file_2') != null) { $fileName = $this->getRequestParameter('file_2'); $ca_file = new ClassAgendaFile(); $ca_file->setClassAgenda($class_agenda); $ca_file->setFile($fileName); $ca_file->save(); } if ($this->hasRequestParameter('file_3') && $this->getRequestParameter('file_3') != '' && $this->getRequestParameter('file_3') != null) { $fileName = $this->getRequestParameter('file_3'); $ca_file = new ClassAgendaFile(); $ca_file->setClassAgenda($class_agenda); $ca_file->setFile($fileName); $ca_file->save(); } if ($this->hasRequestParameter('file_4') && $this->getRequestParameter('file_4') != '' && $this->getRequestParameter('file_4') != null) { $fileName = $this->getRequestParameter('file_4'); $ca_file = new ClassAgendaFile(); $ca_file->setClassAgenda($class_agenda); $ca_file->setFile($fileName); $ca_file->save(); } if ($this->hasRequestParameter('file_5') && $this->getRequestParameter('file_5') != '' && $this->getRequestParameter('file_5') != null) { $fileName = $this->getRequestParameter('file_5'); $ca_file = new ClassAgendaFile(); $ca_file->setClassAgenda($class_agenda); $ca_file->setFile($fileName); $ca_file->save(); } return $this->redirect('class_agenda/list?id=' . $this->getRequestParameter('course_schedule_id')); }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $employee_detail = new EmployeeDetail(); } else { $employee_detail = EmployeeDetailPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($employee_detail); } $employee_detail->setId($this->getRequestParameter('id')); $employee_detail->setEmployeeId($this->getRequestParameter('employee_id')); if ($this->getRequestParameter('date_in')) { $employee_detail->setDateIn($this->getRequestParameter('date_in')); } if ($this->getRequestParameter('date_out')) { $employee_detail->setDateOut($this->getRequestParameter('date_out')); } $employee_detail->setNickname($this->getRequestParameter('nickname')); $employee_detail->setSex($this->getRequestParameter('sex')); $employee_detail->setPob($this->getRequestParameter('pob')); if ($this->getRequestParameter('dob')) { $employee_detail->setDob($this->getRequestParameter('dob')); } $employee_detail->setReligionId($this->getRequestParameter('religion_id')); $employee_detail->setNationality($this->getRequestParameter('nationality')); $employee_detail->setStatusInFamily($this->getRequestParameter('status_in_family')); $employee_detail->setMotherLanguage($this->getRequestParameter('mother_language')); $employee_detail->setHobby($this->getRequestParameter('hobby')); $employee_detail->setAddress($this->getRequestParameter('address')); $employee_detail->setPhone($this->getRequestParameter('phone')); $employee_detail->setResidenceStatus($this->getRequestParameter('residence_status')); $employee_detail->setVehicle($this->getRequestParameter('vehicle')); $employee_detail->setWorkplaceDistance($this->getRequestParameter('workplace_distance')); $employee_detail->setLastEducation($this->getRequestParameter('last_education')); $employee_detail->setGraduationYear($this->getRequestParameter('graduation_year')); $employee_detail->setCertificateNumber($this->getRequestParameter('certificate_number')); $employee_detail->setFaculty($this->getRequestParameter('faculty')); $employee_detail->setProgram($this->getRequestParameter('program')); $employee_detail->setMayor($this->getRequestParameter('mayor')); $employee_detail->setTeachingLicense($this->getRequestParameter('teaching_license')); $employee_detail->setMaritalStatus($this->getRequestParameter('marital_status')); $employee_detail->setSpouseName($this->getRequestParameter('spouse_name')); $employee_detail->setBloodType($this->getRequestParameter('blood_type')); $employee_detail->setSpousePob($this->getRequestParameter('spouse_pob')); if ($this->getRequestParameter('spouse_dob')) { $employee_detail->setSpouseDob($this->getRequestParameter('spouse_dob')); } $employee_detail->setSpouseEducation($this->getRequestParameter('spouse_education')); $employee_detail->setSpouseReligionId($this->getRequestParameter('spouse_religion_id')); $employee_detail->setNumberOfChild($this->getRequestParameter('number_of_child')); $employee_detail->setChild1Name($this->getRequestParameter('child1_name')); $employee_detail->setChild2Name($this->getRequestParameter('child2_name')); $employee_detail->setTall($this->getRequestParameter('tall')); $employee_detail->setWeight($this->getRequestParameter('weight')); $employee_detail->setIllness($this->getRequestParameter('illness')); $employee_detail->save(); // save photo $photo_dir = sfConfig::get('sf_data_dir') . DIRECTORY_SEPARATOR . 'photos' . DIRECTORY_SEPARATOR; if ($this->hasRequestParameter('photoFile') && $this->getRequestParameter('photoFile') != '' && $this->getRequestParameter('photoFile') != null) { // get photo content $photo_file = $photo_dir . 'tmp' . DIRECTORY_SEPARATOR . $this->getRequestParameter('photoFile'); $content = file_get_contents($photo_file); $im = imagecreatefromstring($content); list($w, $h) = getimagesize($photo_file); // generate photo $photo = imagecreatetruecolor(150, 195); imagecopyresized($photo, $im, 0, 0, 0, 0, 150, 195, $w, $h); // generate thumbnail $thumb = imagecreatetruecolor(100, 130); imagecopyresized($thumb, $im, 0, 0, 0, 0, 100, 130, $w, $h); // get photo record $c = new Criteria(); $c->add(EmployeePhotoPeer::EMPLOYEE_ID, $employee_detail->getEmployeeId()); $employee_photo = EmployeePhotoPeer::doSelectOne($c); if ($employee_photo == null) { $employee_photo = new EmployeePhoto(); $employee_photo->setEmployee($employee_detail->getEmployee()); } // save photo imagepng($photo, $photo_file); $employee_photo->setPhoto(base64_encode(file_get_contents($photo_file))); imagepng($thumb, $photo_file); $employee_photo->setThumbnail(base64_encode(file_get_contents($photo_file))); $employee_photo->save(); unlink($photo_dir . 'tmp' . DIRECTORY_SEPARATOR . $this->getRequestParameter('photoFile')); } return $this->redirect('employee_detail/show?employee_id=' . $employee_detail->getEmployeeId()); }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $member_type = new MemberType(); } else { $member_type = MemberTypePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($member_type); } $member_type->setId($this->getRequestParameter('id')); $member_type->setMemberTemplateId($this->getRequestParameter('member_template_id')); $member_type->setCode($this->getRequestParameter('code')); $member_type->setDescription($this->getRequestParameter('description')); $member_type->save(); $member_type->updateMemberAcl($this->getRequestParameter('member_job'), $this->getRequestParameter('member_acl')); return $this->redirect('member_type/list'); }
public function executeSimpan() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $ng_test_schedule = new NgTestSchedule(); } else { $ng_test_schedule = NgTestSchedulePeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($ng_test_schedule); } $this->ng_reg_period = NgRegPeriodPeer::retrieveByPK($this->getRequestParameter('ng_reg_period_id')); $this->forward404Unless($this->ng_reg_period); $ng_test_schedule->setId($this->getRequestParameter('id')); $ng_test_schedule->setTitle($this->getRequestParameter('title')); $ng_test_schedule->setLocationId($this->getRequestParameter('location_id')); $ng_test_schedule->setNgRegTestPeriodId($this->getRequestParameter('ng_reg_test_period_id')); if ($this->getRequestParameter('start')) { $ng_test_schedule->setStart($this->getRequestParameter('start')); } if ($this->getRequestParameter('end')) { $ng_test_schedule->setEnd($this->getRequestParameter('end')); } $ng_test_schedule->setCapacity($this->getRequestParameter('capacity')); $ng_test_schedule->save(); return $this->redirect('ng_reg_detail/list?id=' . $this->ng_reg_period->getId()); }
public function executeUpdateParent() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); $counseling_id = $this->getRequestParameter('counseling_id'); $counseling = CounselingPeer::retrieveByPK($counseling_id); $this->forward404Unless($counseling); $accal_id = $this->getRequestParameter('academic_calendar_id'); $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id); $this->forward404Unless($academic_calendar); $student_detail = StudentDetailPeer::retrieveByPk($this->getRequestParameter('student_detail_id')); $this->forward404Unless($student_detail); $student_detail->setFather($this->getRequestParameter('father')); $student_detail->setMother($this->getRequestParameter('mother')); $student_detail->save(); $student = StudentPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($student); $father = StudentParentsPeer::retrieveByPK($this->getRequestParameter('father_id')); if ($father == null) { $father = new StudentParents(); } $father->setId($this->getRequestParameter('father_id')); $father->setStudent($student); $father->setRelation(StudentParents::RELATION_FATHER); $father->setName($this->getRequestParameter('father')); $father->setPob($this->getRequestParameter('father_pob')); if ($this->getRequestParameter('father_dob')) { $father->setDob($this->getRequestParameter('father_dob')); } $father->setReligionId($this->getRequestParameter('religion_father')); $father->setCountryId($this->getRequestParameter('father_country')); $father->setDegreeId($this->getRequestParameter('degree_father')); $father->setJob($this->getRequestParameter('father_job')); $father->setNoteDetail($this->getRequestParameter('father_notedetail')); $father->setMonthlyRevenue($this->getRequestParameter('father_revenue')); $father->setOfficePhone($this->getRequestParameter('father_officephone')); $father->setEmail($this->getRequestParameter('father_email')); $father->setAddress($this->getRequestParameter('father_address')); $father->setCellphone($this->getRequestParameter('father_cellphone')); $father->save(); $mother = StudentParentsPeer::retrieveByPK($this->getRequestParameter('mother_id')); if ($mother == null) { $mother = new StudentParents(); } $mother->setId($this->getRequestParameter('mother_id')); $mother->setStudent($student); $mother->setRelation(StudentParents::RELATION_MOTHER); $mother->setName($this->getRequestParameter('mother')); $mother->setPob($this->getRequestParameter('mother_pob')); if ($this->getRequestParameter('mother_dob')) { $mother->setDob($this->getRequestParameter('mother_dob')); } $mother->setReligionId($this->getRequestParameter('religion_mother')); $mother->setCountryId($this->getRequestParameter('mother_country')); $mother->setDegreeId($this->getRequestParameter('degree_mother')); $mother->setJob($this->getRequestParameter('mother_job')); $mother->setNoteDetail($this->getRequestParameter('mother_notedetail')); $mother->setMonthlyRevenue($this->getRequestParameter('mother_revenue')); $mother->setOfficePhone($this->getRequestParameter('mother_officephone')); $mother->setEmail($this->getRequestParameter('mother_email')); $mother->setAddress($this->getRequestParameter('mother_address')); $mother->setCellphone($this->getRequestParameter('mother_cellphone')); $mother->save(); return $this->redirect('counseling_sd/listStudent?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId()); }
public function executeSave() { $curr_id = $this->getRequestParameter('curr_id'); $curr = CurriculumPeer::retrieveByPK($curr_id); $this->forward404Unless($curr); $this->curr = $curr; $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); $params = array(); foreach (explode('&', $this->getRequestParameter('subject_list_ser')) as $p) { $p = explode('=', $p); $params[rawurldecode($p[0])][] = rawurldecode($p[1]); } if (array_key_exists('subjects', $params)) { foreach ($params['subjects'] as $su_id) { $subject_curr = new SubjectCurr(); $subject_curr->setSubjectId($su_id); $subject_curr->setCurriculumId($this->getRequestParameter('curriculum_id')); $subject_curr->save(); } } return $this->redirect('subject_curr/list?curr_id=' . $curr->getId()); }
public function executeUpdate() { $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $ng_applicant_category = new NgApplicantCategory(); } else { $ng_applicant_category = NgApplicantCategoryPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($ng_applicant_category); } $ng_applicant_category->setId($this->getRequestParameter('id')); $ng_applicant_category->setName($this->getRequestParameter('name')); $ng_applicant_category->setDetail($this->getRequestParameter('detail')); $ng_applicant_category->save(); return $this->redirect('ng_applicant_category/list'); }
public function executeUpdate() { $student_id = $this->getRequestParameter('student_id'); $student = StudentPeer::retrieveByPK($student_id); $this->forward404Unless($student); $this->student = $student; $i18n = new sfI18N(); $i18n->initialize($this->getContext()); $i18n->setCulture($this->getUser()->getCulture()); $action_i18n = $i18n->globalMessageFormat->format('save as new'); $action_type = $this->getRequestParameter('action_type'); if ($action_type == $action_i18n || !$this->getRequestParameter('id')) { $alumni_work_history = new AlumniWorkHistory(); } else { $alumni_work_history = AlumniWorkHistoryPeer::retrieveByPk($this->getRequestParameter('id')); $this->forward404Unless($alumni_work_history); } $alumni_work_history->setId($this->getRequestParameter('id')); $alumni_work_history->setStudentId($this->getRequestParameter('student_id')); $alumni_work_history->setEmployeeType($this->getRequestParameter('employee_type')); $alumni_work_history->setCompanyName($this->getRequestParameter('company_name')); $alumni_work_history->setCompanyAddress($this->getRequestParameter('company_address')); $alumni_work_history->setCompanyPhone($this->getRequestParameter('company_phone')); $alumni_work_history->setCompanyFax($this->getRequestParameter('company_fax')); $alumni_work_history->setJobType($this->getRequestParameter('job_type')); $alumni_work_history->setWaitingTime($this->getRequestParameter('waiting_time')); $alumni_work_history->setSalary($this->getRequestParameter('salary')); $alumni_work_history->save(); return $this->redirect('alumni_work_history/list?student_id=' . $student_id); }