本文整理汇总了PHP中Registration::setAc方法的典型用法代码示例。如果您正苦于以下问题:PHP Registration::setAc方法的具体用法?PHP Registration::setAc怎么用?PHP Registration::setAc使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Registration
的用法示例。
在下文中一共展示了Registration::setAc方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeStudentRegradeDetail
public function executeStudentRegradeDetail(sfWebRequest $request)
{
## <SectionDetail>, <StudentDetail>, <GradedCourses> <CreateForm> <activatedRegrades> ## THESE ARE NEEDED STEP BY STEP
$this->showCourseGrades = FALSE;
$this->showFormResult = FALSE;
$this->showActivatedRegrade = FALSE;
$this->registrationIdsArray = array();
$this->coursesIdsArray = array();
$this->regradeRegistrationIdsArray = array();
$this->activatedCourseIdsArray = array();
$this->departmentName = $this->getUser()->getAttribute('departmentName');
$this->programSectionId = $request->getParameter('sectionId');
$this->studentId = $request->getParameter('studentId');
$this->enrollmentId = $request->getParameter('enrollmentId');
$this->sectionDetail = Doctrine_Core::getTable('ProgramSection')->getOneProgramSectionById($this->programSectionId);
$this->studentDetail = Doctrine_Core::getTable('Student')->getStudentDetailById($this->studentId);
$this->programName = Doctrine_Core::getTable('ProgramSection')->getOneProgramSectionById($this->programSectionId)->getProgram();
## RETRIEVE STUDENT REGISTERED COURSES UNDER ONE SEMESTER ENROLLMENT,
#1. Find enrollment
$this->enrollment = Doctrine_Core::getTable('EnrollmentInfo')->findOneStudentEnrollmentInforById($this->enrollmentId);
$this->forward404Unless($this->enrollment);
#2. Find all Registrations per enrollment above
$this->registrations = Doctrine_Core::getTable('Registration')->getEnrollmentRegistrations($this->enrollment->getId());
$this->forward404Unless($this->registrations);
foreach ($this->registrations as $registration) {
$this->registrationIdsArray[$registration->getId()] = $registration->getId();
if ($registration->getIsGradeComplain() == TRUE || $registration->getIsMakeup() == TRUE || $registration->getIsReexam() == TRUE) {
$this->regradeRegistrationIdsArray[$registration->getId()] = $registration->getId();
}
}
#3. Find all courses [StudentCourseGrade] under each Registration, a)Calculatables, b)Have Grade
$this->activeGradedStudentCourses = Doctrine_Core::getTable('StudentCourseGrade')->getActiveRegistrationCourses($this->registrationIdsArray, $this->studentId);
$this->forward404Unless($this->activeGradedStudentCourses);
#3.1 Check if there graded courses
if ($this->activeGradedStudentCourses->count() != 0) {
$this->showCourseGrades = TRUE;
}
#3.2 Find all courses [StudentCourseGrade] under each Registration, a)Calculatables, b)Have Grade c)not under regrade process (not activated)
$this->activeNotReGradedStudentCourses = Doctrine_Core::getTable('StudentCourseGrade')->getActiveRegistrationNotRegradedCourses($this->registrationIdsArray, $this->studentId);
$this->forward404Unless($this->activeNotReGradedStudentCourses);
#4. PREPARE REGRADE REQUEST FORM
##COURSE
$this->coursesIdsArray[''] = 'Select Course to Regrade';
foreach ($this->activeNotReGradedStudentCourses as $course) {
$this->coursesIdsArray[$course->getCourseId()] = $course->getCourse();
}
##REGRADE - FROM FormChoices
##AC MINUTE, REMARK
## THE FORM
$this->frontendRegradeRequestForm = new FrontendRegradeRequestForm($this->enrollmentId, $this->studentId, $this->coursesIdsArray);
#5. ACTIVATED REGRADES
#5.1 - Get all special / regrade registrations
$this->activatedCoursesForRegrade = Doctrine_Core::getTable('StudentCourseGrade')->getActivatedCoursesForRegrade($this->regradeRegistrationIdsArray, $this->studentId);
$this->forward404Unless($this->activatedCoursesForRegrade);
#5.2 - Arrange activated regradable courses for form
if ($this->activatedCoursesForRegrade->count() != 0) {
$this->showActivatedRegrade = TRUE;
$this->activatedCourseIdsArray[''] = '-- Select Course To Regrade --';
foreach ($this->activatedCoursesForRegrade as $activatedCFR) {
$this->activatedCourseIdsArray[$activatedCFR->getId()] = $activatedCFR->getCourse();
}
#KEEP COURSE ID ARRAY ON SESSION, TO BE USED WHEN REGRADE VALUE IS ENTERED
$this->getUser()->setAttribute('activatedCourseIdsArray', $this->activatedCourseIdsArray);
}
#6. DATAWORKER FOR VIEW
$gradeChoices = Doctrine_Core::getTable('Grade')->getAllLetterGradeChoices();
$this->getUser()->setAttribute('gradeChoices', $gradeChoices);
## created for use when new regrade value is entered,
$this->frontendRegradeSubmissionForm = new FrontendRegradeSubmissionForm($this->enrollmentId, $this->studentId, $this->activatedCourseIdsArray, $gradeChoices);
### PROCESS THE FORM IF SUBMITTED ###
if ($request->isMethod('post')) {
$this->frontendRegradeRequestForm->bind($request->getParameter('regraderequestform'));
if ($this->frontendRegradeRequestForm->isValid()) {
$formData = $this->frontendRegradeRequestForm->getValues();
$this->courseId = $formData['course_id'];
$this->regradeReason = $formData['regrade_reason'];
$this->studentId = $formData['student_id'];
$this->enrollmentInfoId = $formData['enrollment_info_id'];
$this->remark = $formData['remark'];
$this->ac = $formData['ac'];
if ($this->courseId == '' || $this->regradeReason == '' || $this->studentId == '' || $this->enrollmentInfoId == '') {
$this->getUser()->setFlash('error', 'Error occured: nothing performed, please redo actions ');
$this->redirect('regrade/studentRegradeDetail?sectionId=' . $this->programSectionId . '&studentId=' . $this->studentId . '&enrollmentId=' . $this->enrollmentId);
}
## REGISTER STUDENT BASED ON ENROLLMENTINFO FOR SPECIFIED REGRADE REASON
$registration = new Registration();
$registration->setEnrollmentInfoId($this->enrollmentInfoId);
$registration->setAc($this->ac);
$registration->setDate(date('m-d-Y'));
$registration->setRemark($this->remark);
if ($this->regradeReason == 'gradecomplain') {
$registration->setIsGradeComplain(TRUE);
}
if ($this->regradeReason == 'reexam') {
$registration->setIsReexam(TRUE);
}
if ($this->regradeReason == 'makeup') {
$registration->setIsMakeup(TRUE);
}
$registration->save();
//.........这里部分代码省略.........