Esempio n. 1
0
 public function executeEnquirer()
 {
     $this->applicant = $this->applicant;
     $this->error = false;
     $this->department = DepartmentPeer::retrieveByPK($this->applicant->getDepartment1());
     $this->classGroup = ClassGroupPeer::retrieveByPK($this->applicant->getClassGroup1());
 }
Esempio n. 2
0
 public function getParentalIndex()
 {
     $parentalIndex = "#" . str_pad($this->getId(), 3, '0', STR_PAD_LEFT);
     $this->level = 1;
     if ($this->getParent() !== null && $this->getParent() != 0) {
         $p = ClassGroupPeer::retrieveByPK($this->getParent());
         $parentalIndex = str_pad($p->getParentalIndex(), 3, '0', STR_PAD_LEFT) . "_" . $parentalIndex;
         $this->level += $p->level;
     }
     $this->parentalIndex = $parentalIndex;
     return $parentalIndex;
 }
Esempio n. 3
0
 public function signInTestApplicant($user)
 {
     $this->addCredential('bo');
     $this->setAttribute('user_id', $user->getId(), 'bo');
     $this->setAttribute('username_long', $user->getName(), 'bo');
     $this->setAuthenticated2(true, 'bo');
     $this->setAttribute('username', $user->getCode(), 'bo');
     $this->setAttribute('department_id1', DepartmentPeer::retrieveByPK($user->getDepartment1())->getId(), 'bo');
     $this->setAttribute('department1_name', DepartmentPeer::retrieveByPK($user->getDepartment1())->getName(), 'bo');
     #$this->setAttribute('department_id2', $user->getDepartment2()? DepartmentPeer::retrieveByPK($user->getDepartment2())->getId() : '', 'bo');
     #$this->setAttribute('department2_name', $user->getDepartment2()? DepartmentPeer::retrieveByPK($user->getDepartment2())->getName() : '', 'bo');
     $this->setAttribute('class_name1', ClassGroupPeer::retrieveByPK($user->getClassGroup1())->getName(), 'bo');
     $this->setAttribute('class_parent1', ClassGroupPeer::retrieveByPK($user->getClassGroup1())->getParentName(), 'bo');
     #$this->setAttribute('class_name2', $user->getClassGroup2()? ClassGroupPeer::retrieveByPK($user->getClassGroup2())->getName() : '', 'bo');
     #$this->setAttribute('class_parent2', $user->getClassGroup2()? ClassGroupPeer::retrieveByPK($user->getClassGroup2())->getParentName() : '', 'bo');
     $this->setAttribute('login_time', time(), 'bo');
 }
Esempio n. 4
0
 public function executeGetCourseByAccal()
 {
     $accal_id = $this->getRequestParameter('accal_id');
     $accal = AcademicCalendarPeer::retrieveByPK($accal_id);
     #$this->forward404Unless($accal);
     $class_id = $this->getRequestParameter('class_id');
     $class = ClassGroupPeer::retrieveByPK($class_id);
     #$this->forward404Unless($class);
     $c = new Criteria();
     $c->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_id, Criteria::IN);
     $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $accal_id, Criteria::IN);
     $c->add(CourseSchedulePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN);
     $c->add(CourseSchedulePeer::SUBJECT_CURR_ID, 316, Criteria::NOT_IN);
     $objs = CourseSchedulePeer::doSelect($c);
     $subjects = array();
     foreach ($objs as $o) {
         $subjects[$o->getId()] = $o->getSubjectCurr()->getSubject()->getName();
     }
     $this->content = $subjects;
     $this->setTemplate('buildOptions');
 }
Esempio n. 5
0
 public static function doSelectByClassGroup2()
 {
     $ta_id = sfContext::getInstance()->getRequest()->getParameter('id');
     $ta = TestApplicantPeer::retrieveByPK($ta_id);
     if ($ta == null) {
         return array();
     }
     if ($ta->getClassGroup2() != null) {
         $dept_id = ClassGroupPeer::retrieveByPK($ta->getClassGroup2())->getDepartmentId();
         $c = new Criteria();
         $c->addJoin(RegPeriodPeer::ID, RegTestPeriodPeer::REG_PERIOD_ID);
         $c->addJoin(AcademicCalendarPeer::ID, RegPeriodPeer::ACADEMIC_CALENDAR_ID);
         $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept_id);
         $objs = RegTestPeriodPeer::doSelect($c);
         return $objs;
     }
 }
Esempio n. 6
0
 public static function doSelectByClassGroup1()
 {
     $ta_id = sfContext::getInstance()->getRequest()->getParameter('id');
     $ta = TestApplicantPeer::retrieveByPK($ta_id);
     if ($ta == null) {
         return array();
     }
     $dept_id = ClassGroupPeer::retrieveByPK($ta->getClassGroup1())->getDepartmentId();
     $c = new Criteria();
     $c->add(LocationPeer::DEPARTMENT_ID, $dept_id);
     $objs = LocationPeer::doSelect($c);
     return $objs;
 }
Esempio n. 7
0
 public function filterStudent($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         if ($key == 'DEPARTMENT_ID') {
             $c->addJoin(AcademicCalendarPeer::ID, StudentPeer::ACADEMIC_CALENDAR_ID);
             $c->addJoin(DepartmentPeer::ID, AcademicCalendarPeer::DEPARTMENT_ID);
             $column = DepartmentPeer::getTableMap()->getColumn('ID');
         } elseif ($key == 'CLASS_NAME') {
             $c->addJoin(ClassGroupPeer::ID, StudentPeer::CLASS_GROUP_ID);
             $column = ClassGroupPeer::getTableMap()->getColumn('NAME');
         } elseif ($key == 'ABSENCE') {
             $column = StudentPeer::getTableMap()->getColumn('CLASS_NAME');
         } else {
             $column = StudentPeer::getTableMap()->getColumn($key);
         }
         $name = $column->getFullyQualifiedName();
         $creoleType = $column->getCreoleType();
         if ($creoleType == CreoleTypes::TIMESTAMP) {
             $from = $value['from'];
             $to = $value['to'];
             if ($from != '' && $from != null) {
                 $c->add($name, $from, Criteria::GREATER_EQUAL);
             }
             if ($to != '' && $to != null) {
                 $c->add($name, $to, Criteria::LESS_EQUAL);
             }
         } else {
             if ($creoleType == CreoleTypes::INTEGER) {
                 if ($name == StudentPeer::CLASS_GROUP_ID) {
                     $cg = ClassGroupPeer::retrieveByPK($value);
                     $c->add($name, $cg->getChildRecurs(), Criteria::IN);
                 } else {
                     $c->add($name, $value, Criteria::EQUAL);
                 }
             } else {
                 if ($creoleType == CreoleTypes::VARCHAR || $creoleType == CreoleTypes::CHAR) {
                     $c->add($name, "%{$value}%", Criteria::LIKE);
                 }
             }
         }
     }
 }
Esempio n. 8
0
 public function executeGetListForCourse()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $cr = new Criteria();
     $academic_calendar_id = $this->getRequestParameter('academic_calendar_id');
     $class_group_id = $this->getRequestParameter('class_group_id');
     $accal = AcademicCalendarPeer::retrieveByPK($academic_calendar_id);
     $class = ClassGroupPeer::retrieveByPK($class_group_id);
     $cr->add(VCourseSchedulePeer::ACADEMIC_CALENDAR_ID, $this->getRequestParameter('academic_calendar_id'));
     $cr->add(VCourseSchedulePeer::CLASS_GROUP_ID, $this->getRequestParameter('class_group_id'));
     if ($this->getRequest()->hasParameter('filters')) {
         $filters = $this->getRequestParameter('filters');
         if ($filters == 'clear') {
             $this->filters = null;
         } else {
             $defined_filter = false;
             foreach ($filters as $f) {
                 if ($f != null && $f != '') {
                     $defined_filter = true;
                     break;
                 }
             }
             if ($defined_filter) {
                 $this->filters = $filters;
                 $this->filterSubject($cr, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'course_schedule'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'course_schedule');
     $pager = new sfPropelPager('VCourseSchedule', $rpp);
     $pager->setCriteria($cr);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course_schedule'));
     $this->getUser()->setAttribute('page', $page, 'course_schedule');
     $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);
     }
     $this->filter_string = $filter_string;
     $this->subtitle = '';
     $this->actions = $actions;
     $this->academic_calendar_id = $academic_calendar_id;
     $this->class_group_id = $class_group_id;
 }
</td>
        </tr>
		<tr>
        	<td style="text-align:left;">Nama Calon Murid</td>
            <td style="text-align:center;">:</td>
            <td style="text-align: justify;"><?php 
echo $appl->getName();
?>
</td>
        </tr>
        <tr>
        	<td style="text-align:left;">Kelas</td>
            <td style="text-align:center;">:</td>
            <td style="text-align: justify;">
			<?php 
echo $appl->getClassGroup1() ? ClassGroupPeer::retrieveByPK($appl->getClassGroup1())->getName() . '&nbsp;-&nbsp;' . ClassGroupPeer::retrieveByPK($appl->getClassGroup1())->getParentName() : '-';
?>
</td>
        </tr>
        <tr>
        	<td style="text-align:left;">Asal Sekolah</td>
            <td style="text-align:center;">:</td>
            <td style="text-align: justify;">
			<?php 
echo $appl->getTestApplicantDetail()->getJobTitle() ? $appl->getTestApplicantDetail()->getJobTitle() : '-';
?>
</td>
        </tr>
        
        <?php 
$i = 0;
Esempio n. 10
0
    ++$i;
    ?>
"<?php 
    echo $i + ($pager->getPage() - 1) * $pager->getMaxPerPage();
    ?>
","<?php 
    echo $test_applicant->getCode();
    ?>
","<?php 
    echo $test_applicant->getName();
    ?>
","<?php 
    echo DepartmentPeer::retrieveByPK($test_applicant->getDepartment1())->toString();
    ?>
","<?php 
    echo ClassGroupPeer::retrieveByPK($test_applicant->getClassGroup1())->toString();
    ?>
","<?php 
    echo $test_applicant->getRegTestPeriod1() ? RegTestPeriodPeer::retrieveByPK($test_applicant->getRegTestPeriod1())->getRegPeriod()->getName() : '-';
    ?>
","<?php 
    if ($test_applicant->getApplicantType() == TestApplicant::STATUS_NEW) {
        echo __('Baru');
    } elseif ($test_applicant->getApplicantType() == TestApplicant::STATUS_TRANSFER) {
        echo __('Pindahan');
    } elseif ($test_applicant->getApplicantType() == TestApplicant::STATUS_EXTEND) {
        echo __('Lanjutan');
    }
    ?>
","<?php 
    echo $test_applicant->getYear();
Esempio n. 11
0
 public function getClassGroupRelatedByParent($con = null)
 {
     include_once 'lib/model/om/BaseClassGroupPeer.php';
     if ($this->aClassGroupRelatedByParent === null && $this->parent !== null) {
         $this->aClassGroupRelatedByParent = ClassGroupPeer::retrieveByPK($this->parent, $con);
     }
     return $this->aClassGroupRelatedByParent;
 }
Esempio n. 12
0
 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');
     $subject_curr_id = $this->getRequestParameter('subject_curr_id');
     $subject_curr = SubjectCurrPeer::retrieveByPK($subject_curr_id);
     $this->forward404Unless($subject_curr);
     $academic_calendar_id = $this->getRequestParameter('accal_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);
     $course_sched = CourseSchedulePeer::retrieveByPk($this->getRequestParameter('course_id'));
     $this->forward404Unless($course_sched);
     $cur13_term = Cur13TermPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($cur13_term);
     $cur13_term->setCourseScheduleId($course_sched->getId());
     $cur13_term->setCode($this->getRequestParameter('code'));
     $cur13_term->setName($this->getRequestParameter('name'));
     $cur13_term->setDescription($this->getRequestParameter('description'));
     #$cur13_term->setCur13KiId($this->getRequestParameter('cur13_ki_id'));
     $cur13_term->save();
     $spkis = $this->getRequestParameter('spki');
     $bobot = $this->getRequestParameter('bobot');
     foreach ($spkis as $l => $spki) {
         $ct = new Criteria();
         $ct->add(Cur13TermSpecPeer::CUR13_TERM_ID, $cur13_term->getId());
         $ct->add(Cur13TermSpecPeer::GRADE_SPEC_ID, $l);
         $cur13_ts = Cur13TermSpecPeer::doSelectOne($ct);
         if ($cur13_ts == null) {
             $cur13_ts = new Cur13TermSpec();
         }
         $cur13_ts->setCur13TermId($cur13_term->getId());
         $cur13_ts->setGradeSpecId($l);
         $cur13_ts->setBobot($bobot[$l]);
         $cur13_ts->save();
     }
     $delspkis = $this->getRequestParameter('delspki');
     foreach ($delspkis as $l => $delspki) {
         $ct = new Criteria();
         $ct->add(Cur13TermSpecPeer::CUR13_TERM_ID, $cur13_term->getId());
         $ct->add(Cur13TermSpecPeer::GRADE_SPEC_ID, $l);
         $cur13_ts = Cur13TermSpecPeer::doSelectOne($ct);
         if ($cur13_ts != null) {
             $cur13_ts->delete();
         }
     }
     return $this->redirect('cur13_term/getSubject?subject_curr_id=' . $subject_curr->getId() . '&accal_id=' . $academic_calendar->getId() . '&class_group_id=' . $class_group->getId());
 }
Esempio n. 13
0
 public function executeSelectByClassGroup()
 {
     $class_id = $this->getRequestParameter('class_id');
     $this->forward404Unless($class_id);
     $class = ClassGroupPeer::retrieveByPK($class_id);
     $dept_id = $class->getDepartmentId();
     $objs = LocationPeer::doSelectByDepartment($dept_id);
     $content = array();
     $disabled = array();
     foreach ($objs as $o) {
         $content[$o->getId()] = $o->toStringWithCap();
         if ($o->isSchedFull()) {
             $disabled[] = $o->getId();
         }
     }
     $this->content = $content;
     $this->disabled = $disabled;
 }
Esempio n. 14
0
 public function executeGetListCourse()
 {
     $accal_id = $this->getRequestParameter('accal_id');
     $accal = AcademicCalendarPeer::retrieveByPK($accal_id);
     #$this->forward404Unless($accal);
     $this->accal = $accal;
     $this->accal_id = $accal_id;
     $class_id = $this->getRequestParameter('class_id');
     $class_group = ClassGroupPeer::retrieveByPK($class_id);
     #$this->forward404Unless($class_group);
     $this->class_group = $class_group;
     $this->class_id = $class_id;
     $c = new Criteria();
     $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $accal_id, Criteria::IN);
     $c->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_id, Criteria::IN);
     $c->addJoin(VCourseDetailPeer::COURSE_SCHEDULE_ID, CourseSchedulePeer::ID);
     #$this->sortCourse($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->filter($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'course'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'course');
     $pager = new sfPropelPager('VCourseDetail', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course'));
     $this->getUser()->setAttribute('page', $page, 'course');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions2 = array(array('name' => 'filter', 'color' => 'white'));
     $this->actions2 = $actions2;
 }
Esempio n. 15
0
 public function executeUpdatePackaged()
 {
     $student_id = $this->getRequestParameter('student_id');
     $student = StudentPeer::retrieveByPK($student_id);
     $this->forward404Unless($student);
     $this->student = $student;
     $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);
     $status = $this->getRequestParameter('status');
     $this->forward404Unless($status);
     $subject_accals = $academic_calendar->getSubjectAccals();
     $sas = array();
     foreach ($subject_accals as $sa) {
         if ($sa->getSubject()) {
             $sas[] = $sa->getId();
         }
     }
     $saved_sas = array();
     $saved_student_courses = $student->getStudentCourses();
     foreach ($saved_student_courses as $ssc) {
         $saved_sas[] = $ssc->getSubjectAccalId();
     }
     $disabled_sa = array_intersect($sas, $saved_sas);
     // calculate sc rules
     $objs = SubjectAccalPeer::doSelectByAccal();
     foreach ($objs as $o) {
         $content[$o->getId()] = $o->toStringWithLector();
         $c = new Criteria();
         $c->add(SubjectAccalPeer::ID, $o->getId());
         $c->add(SubjectCurrPeer::SUBJECT_ID, $o->getSubjectId());
         $c->addJoin(AcademicCalendarPeer::ID, SubjectAccalPeer::ACADEMIC_CALENDAR_ID);
         $c->addJoin(AcademicCalendarPeer::CURRICULUM_ID, SubjectCurrPeer::CURRICULUM_ID);
         $c->addJoin(SubjectCurrPeer::ID, SubjectPrereqPeer::SUBCURR);
         $sps = SubjectPrereqPeer::doSelect($c);
         foreach ($sps as $sp) {
             $s = $sp->getSubjectCurrRelatedBySubcurrPrereq()->getSubject();
             // prereq subject must be in closed state
             $c = new Criteria();
             $c->add(SubjectAccalPeer::SUBJECT_ID, $s->getId());
             $c->add(StudentCoursePeer::STUDENT_ID, $student_id);
             $c->add(StudentCoursePeer::STATUS, StudentCourse::STATUS_CLOSED);
             $c->addJoin(StudentCoursePeer::SUBJECT_ACCAL_ID, SubjectAccalPeer::ID);
             $scs = StudentCoursePeer::doSelect($c);
             $isPassGrade = false;
             $isPassCredit = true;
             $isPassIndex = true;
             foreach ($scs as $sc) {
                 $grade = $sc->getFinalGrade();
                 $gc = GradeConversionPeer::retrieveByName($grade[0]);
                 // check prereq subject grade
                 if ($gc && $gc->getGrade() >= $sp->getGradeConversion()->getGrade()) {
                     $isPassGrade = true;
                 } else {
                     $isPassGrade = false;
                 }
                 // check credit requirement
                 if ($sp->getTotalCredit() > 0) {
                     if ($sc->getTotalCreditClosed() >= $sp->getTotalCredit()) {
                         $isPassCredit = true;
                     } else {
                         $isPassCredit = false;
                     }
                 }
                 // check index requirement
                 if ($sp->getPerformanceIndex() > 0) {
                     if ($sc->getPerformanceIndex() >= $sp->getPerformanceIndex()) {
                         $isPassIndex = true;
                     } else {
                         $isPassIndex = false;
                     }
                 }
             }
             $s0 = $sp->getSubjectCurrRelatedBySubcurrPrereq()->getSubject()->toString();
             $s1 = $sp->getSubjectCurrRelatedBySubcurr()->getSubject()->toString();
             if (!$isPassGrade || !$isPassCredit || !$isPassIndex) {
                 $disabled_sa[] = $o->getId();
             }
         }
     }
     $selected_sa = array_diff($sas, $disabled_sa);
     foreach ($selected_sa as $sa_id) {
         $student_course = new StudentCourse();
         $student_course->setStudentId($student_id);
         $student_course->setSubjectAccalId($sa_id);
         $student_course->setStatus($status);
         $student_course->setClassGroupId($class_group_id);
         $student_course->save();
     }
     return $this->redirect('student_course_s/list?student_id=' . $student->getId());
 }
Esempio n. 16
0
        ?>
</td>
                                                <td><?php 
        echo $member->getDepartmentId() ? $member->getDepartment()->toString() : '-';
        ?>
</td>
                                                <td><?php 
        echo $member->getStudent() ? $member->getStudent()->getYear() : '-';
        ?>
</td>
                                                <td><?php 
        echo $member->getDepartmentId() ? AcademicCalendarPeer::retrieveByPK($member->getDepartmentId())->getName() : '-';
        ?>
</td>    
                                                <td><?php 
        echo $member->getClassName() ? ClassGroupPeer::retrieveByPK($member->getClassName())->getName() : '-';
        ?>
</td>
                                                <td><?php 
        if ($member->getStatus() == Student::STATUS_ACTIVE) {
            echo __('Active');
        } elseif ($member->getStatus() == Student::STATUS_GRADUATE) {
            echo __('In Active');
        }
        ?>
                                                 </td>
                                 </tr>
                          <?php 
    }
    ?>
                   <?php 
Esempio n. 17
0
 /**
  * setClassGroup function
  * function to set the counseling
  * @param int $counselingId
  */
 public function setClassGroup($classGroupId)
 {
     $this->classGroup = ClassGroupPeer::retrieveByPK($classGroupId);
 }
Esempio n. 18
0
 public function executeUpdate()
 {
     ## Kelas yang dipilih
     $class = ClassGroupPeer::retrieveByPK($this->getRequestParameter('class_group1'));
     $dept = DepartmentPeer::retrieveByPk($this->getRequestParameter('department_id'));
     $cd = new Criteria();
     $cd->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 2);
     $cd->add(AcademicCalendarPeer::COURSE_MODEL, 'C');
     $cd->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept->getId());
     $accal_applicant = AcademicCalendarPeer::doSelectOne($cd);
     $applicant_detail = new TestApplicantDetail();
     $applicant_detail->setId($this->getRequestParameter('test_applicant_detail_id'));
     $applicant_detail->setShortName($this->getRequestParameter('short_name'));
     $applicant_detail->setPob($this->getRequestParameter('pob'));
     if ($this->getRequestParameter('dob')) {
         $applicant_detail->setDob($this->getRequestParameter('dob'));
     }
     $applicant_detail->setSex($this->getRequestParameter('sex'));
     $applicant_detail->setReligionId($this->getRequestParameter('religion_id'));
     $applicant_detail->setCountryId($this->getRequestParameter('country_id'));
     $applicant_detail->setNativeLanguage($this->getRequestParameter('native_language'));
     $applicant_detail->setFather($this->getRequestParameter('father'));
     $applicant_detail->setMother($this->getRequestParameter('mother'));
     $applicant_detail->setFatherJob($this->getRequestParameter('father_job'));
     $applicant_detail->setMotherJob($this->getRequestParameter('mother_job'));
     $applicant_detail->setDetailFatherJob($this->getRequestParameter('detail_father_job'));
     $applicant_detail->setDetailMotherJob($this->getRequestParameter('detail_mother_job'));
     $applicant_detail->setAddress($this->getRequestParameter('address'));
     $applicant_detail->setPostCode($this->getRequestParameter('post_code'));
     $applicant_detail->setRegionId($this->getRequestParameter('region_id'));
     $applicant_detail->setPhone($this->getRequestParameter('home_phone'));
     $applicant_detail->setCellphone($this->getRequestParameter('father_cellphone'));
     $applicant_detail->setCompany($this->getRequestParameter('company'));
     $applicant_detail->setParentName($this->getRequestParameter('father'));
     $applicant_detail->setJobTitle($this->getRequestParameter('job_title'));
     $applicant_detail->setSchoolOfOrigin($this->getRequestParameter('school_of_origin'));
     $applicant_detail->setSchoolOfOriginAddress($this->getRequestParameter('school_of_origin_address'));
     $applicant_detail->setRegNote($this->getRequestParameter('reg_note'));
     $applicant_detail->setChildNumber($this->getRequestParameter('child_number'));
     $applicant_detail->setBloodSiblings($this->getRequestParameter('blood_siblings'));
     $applicant_detail->setStepSiblings($this->getRequestParameter('step_siblings'));
     $applicant_detail->setOrphanageStatus($this->getRequestParameter('orphanage_status'));
     $applicant_detail->setResidenceStatus($this->getRequestParameter('residence_status'));
     $applicant_detail->setHomeDistance($this->getRequestParameter('home_distance'));
     $applicant_detail->setTransport($this->getRequestParameter('transport'));
     #$applicant_detail->setAcademicCalendarId($accal_applicant->getId());
     $applicant_detail->setIllness($this->getRequestParameter('illness'));
     $applicant_detail->setIllnessNote($this->getRequestParameter('illness_note'));
     $applicant_detail->setGraduationGrade($this->getRequestParameter('graduation_grade'));
     $applicant_detail->setGraduationYear($this->getRequestParameter('graduation_year'));
     $applicant_detail->setBloodType($this->getRequestParameter('blood_type'));
     $applicant_detail->setTall($this->getRequestParameter('tall'));
     $applicant_detail->setWeight($this->getRequestParameter('weight'));
     $applicant_detail->save();
     $applicant = new TestApplicant();
     $is_new = true;
     $applicant->setId($this->getRequestParameter('id'));
     $applicant->setName($this->getRequestParameter('name'));
     $applicant->setCode2($this->getRequestParameter('code2'));
     $applicant->setClassGroup1($this->getRequestParameter('class_group1'));
     $applicant->setDepartment1($this->getRequestParameter('department_id'));
     ## Siswa Dalam
     if ($this->getRequestParameter('is_alazhar') == TestApplicant::IS_ALAZHAR) {
         $code_appl = '.' . $dept->getCode() . '.A';
     } else {
         $code_appl = '.' . $dept->getCode() . '.B';
     }
     $stu_code = ParamsPeer::retrieveByCode('sma_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] == 'year') {
             $code_a = substr($accal_applicant->getName(), 2, 2);
             $code_b = substr($accal_applicant->getName(), 7, 2);
             $yr = $code_a . '/' . $code_b;
             if (strlen($yr) <= $v[1]) {
                 $code .= str_pad($yr, $v[1], '0', STR_PAD_LEFT);
             } else {
                 $code .= substr($yr, strlen($yr) - $v[1]);
             }
             $code_len += $v[1];
         } elseif ($v[0] == 'app') {
             $code_len += $v[1];
             $code .= str_pad($code_appl, $v[1], '0', STR_PAD_LEFT);
         } elseif ($v[0] == 'seq') {
             $c = new Criteria();
             $c->add(TestApplicantPeer::CODE, $code . '%', Criteria::LIKE);
             $c->addDescendingOrderByColumn(TestApplicantPeer::CODE);
             $c->setLimit(1);
             $last_applicant = TestApplicantPeer::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;
     }
     $applicant->setCode($code);
     $applicant->setDepartment2($accal_applicant->getId());
     $applicant->setApplicantType(TestApplicant::STATUS_NEW);
     $applicant->setYear($accal_applicant->getYear());
     $applicant->setCode2($this->getRequestParameter('code2'));
     $applicant->setIsAlazhar($this->getRequestParameter('is_alazhar'));
     $crypted = sha1(sfConfig::get('app_salt') . $applicant_detail->getDob('dmY'));
     $applicant->setPassword($crypted);
     $applicant->setStatus(StudentDetail::WEB);
     $applicant->setTestApplicantDetail($applicant_detail);
     if ($dept->getCourseModel() == Department::CM_SMP) {
         $applicant->setClassGroup2($this->getRequestParameter('class_group2'));
     } elseif ($dept->getCourseModel() == Department::CM_SMA) {
         //$applicant->setClassGroup2($this->getRequestParameter('program'));
     }
     $applicant->save();
     $c = new Criteria();
     $c->add(RegPeriodPeer::CURRICULUM_ID, $applicant->getIsAlazhar());
     $c->add(RegPeriodPeer::ACADEMIC_CALENDAR_ID, $applicant->getDepartment2());
     $c->addJoin(RegTestPeriodPeer::REG_PERIOD_ID, RegPeriodPeer::ID);
     $reg_test_periods = RegTestPeriodPeer::doSelect($c);
     foreach ($reg_test_periods as $reg_test_period) {
         $cw = new Criteria();
         $cw->add(TestSchedulePeer::REG_TEST_PERIOD_ID, $reg_test_period->getId());
         $cw->addAscendingorderByColumn(TestSchedulePeer::ID);
         $scheds = TestSchedulePeer::doSelect($cw);
         $s1 = array();
         foreach ($scheds as $s) {
             $s1[$s->getRegTestPeriodId()][] = array('reg_test_period_id' => $s->getRegTestPeriodId(), 'used' => $s->countTestApplScheds(), 'capacity' => $s->getCapacity(), 'sched' => $s);
         }
         foreach ($s1 as $s) {
             $c = new Criteria();
             $c->add(TestSchedulePeer::REG_TEST_PERIOD_ID, $reg_test_period->getId());
             $c->addJoin(TestApplSchedPeer::TEST_SCHEDULE_ID, TestSchedulePeer::ID);
             $c->add(TestApplSchedPeer::TEST_APPLICANT_ID, $applicant->getId());
             $tas = TestApplSchedPeer::doSelectOne($c);
             if ($tas == null) {
                 $i = 0;
                 while ($s[$i]) {
                     $sched = $s[$i];
                     if ($sched['used'] < $sched['capacity']) {
                         $tas = new TestApplSched();
                         $tas->setTestApplicant($applicant);
                         $tas->setTestSchedule($sched['sched']);
                         $tas->save();
                         break;
                     }
                     $i++;
                 }
             }
         }
         $test_applicant = TestApplicantPeer::retrieveByPk($applicant->getId());
         $this->forward404Unless($test_applicant);
         $test_applicant->setRegTestPeriod1($reg_test_period->getId());
         $test_applicant->save();
     }
     if ($applicant_detail->getDetailFatherJob() == 1) {
         $father_job == 'Guru / Pengajar / Karyawan AlAzhar';
     } elseif ($applicant_detail->getDetailFatherJob() == 2) {
         $father_job == 'Guru / Pengajar Non ALAzhar';
     } elseif ($applicant_detail->getDetailFatherJob() == 3) {
         $father_job == 'Pegawai Swasta';
     } elseif ($applicant_detail->getDetailFatherJob() == 4) {
         $father_job == 'Pegawai Negeri Sipil';
     } elseif ($applicant_detail->getDetailFatherJob() == 5) {
         $father_job == 'Wiraswasta';
     } elseif ($applicant_detail->getDetailFatherJob() == 6) {
         $father_job == 'Tidak Bekerja';
     } else {
         $father_job == 'Lainnya';
     }
     if ($applicant_detail->getDetailMotherJob() == 1) {
         $mother_job == 'Guru / Pengajar / Karyawan AlAzhar';
     } elseif ($applicant_detail->getDetailMotherJob() == 2) {
         $mother_job == 'Guru / Pengajar Non ALAzhar';
     } elseif ($applicant_detail->getDetailMotherJob() == 3) {
         $mother_job == 'Pegawai Swasta';
     } elseif ($applicant_detail->getDetailMotherJob() == 4) {
         $mother_job == 'Pegawai Negeri Sipil';
     } elseif ($applicant_detail->getDetailMotherJob() == 5) {
         $mother_job == 'Wiraswasta';
     } elseif ($applicant_detail->getDetailMotherJob() == 6) {
         $mother_job == 'Tidak Bekerja';
     } else {
         $mother_job == 'Lainnya';
     }
     #Data Orang Tua (Ayah)
     $applicant_father = new TestApplicantParents();
     $applicant_father->setName($this->getRequestParameter('father'));
     $applicant_father->setTestApplicant($applicant);
     if ($this->getRequestParameter('father_dob')) {
         $applicant_father->setDob($this->getRequestParameter('father_dob'));
     }
     $applicant_father->setPob($this->getRequestParameter('father_pob'));
     $applicant_father->setReligionId($this->getRequestParameter('religion_father'));
     $applicant_father->setDegreeId($this->getRequestParameter('degree_father'));
     $applicant_father->setJob($father_job);
     $applicant_father->setAddress($this->getRequestParameter('address'));
     $applicant_father->setOfficePhone($this->getRequestParameter('father_office_phone'));
     $applicant_father->setPostCode($this->getRequestParameter('post_code'));
     $applicant_father->setRegionId($this->getRequestParameter('region_id'));
     $applicant_father->setHomePhone($this->getRequestParameter('home_phone'));
     $applicant_father->setCellphone($this->getRequestParameter('father_cellphone'));
     $applicant_father->setCountryId($this->getRequestParameter('father_country'));
     $applicant_father->setMonthlyRevenue($this->getRequestParameter('father_revenue'));
     $applicant_father->setEmail($this->getRequestParameter('email'));
     $applicant_father->setNote($this->getRequestParameter('father_note'));
     $applicant_father->setNoteDetail($this->getRequestParameter('father_note_detail'));
     if ($this->getRequestParameter('father_date_note')) {
         $applicant_father->setNoteDate($this->getRequestParameter('father_date_note'));
     }
     $applicant_father->setRelation(StudentParents::RELATION_FATHER);
     $applicant_father->save();
     #Data Orang Tua (Ibu)
     $applicant_mother = new TestApplicantParents();
     $applicant_mother->setName($this->getRequestParameter('mother'));
     $applicant_mother->setTestApplicant($applicant);
     if ($this->getRequestParameter('mother_dob')) {
         $applicant_mother->setDob($this->getRequestParameter('mother_dob'));
     }
     $applicant_mother->setPob($this->getRequestParameter('mother_pob'));
     $applicant_mother->setReligionId($this->getRequestParameter('religion_mother'));
     $applicant_mother->setDegreeId($this->getRequestParameter('degree_mother'));
     $applicant_mother->setJob($mother_job);
     $applicant_mother->setAddress($this->getRequestParameter('address'));
     $applicant_mother->setOfficePhone($this->getRequestParameter('mother_office_phone'));
     $applicant_mother->setPostCode($this->getRequestParameter('post_code'));
     $applicant_mother->setRegionId($this->getRequestParameter('region_id'));
     $applicant_mother->setHomePhone($this->getRequestParameter('home_phone'));
     $applicant_mother->setCellphone($this->getRequestParameter('mother_cellphone'));
     $applicant_mother->setCountryId($this->getRequestParameter('mother_country'));
     $applicant_mother->setMonthlyRevenue($this->getRequestParameter('mother_revenue'));
     $applicant_mother->setEmail($this->getRequestParameter('email'));
     $applicant_mother->setNote($this->getRequestParameter('mother_note'));
     $applicant_mother->setNoteDetail($this->getRequestParameter('mother_note_detail'));
     if ($this->getRequestParameter('mother_date_note')) {
         $applicant_mother->setNoteDate($this->getRequestParameter('mother_date_note'));
     }
     $applicant_mother->setRelation(StudentParents::RELATION_MOTHER);
     $applicant_mother->save();
     $this->getContext()->getUser()->signInTestApplicant($applicant);
     #return $this->redirect('auth/start');
     return $this->redirect('auth/index');
 }
Esempio n. 19
0
 public function filterDetail($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         if ($key == 'NG_REG_TEST_PERIOD_ID') {
             $c->addJoin(NgRegTestPeriodPeer::ID, NgRegTestDetailPeer::NG_REG_TEST_PERIOD_ID);
             $column = NgRegTestPeriodPeer::getTableMap()->getColumn('ID');
         } else {
             $column = NgRegTestDetailPeer::getTableMap()->getColumn($key);
         }
         $name = $column->getFullyQualifiedName();
         $creoleType = $column->getCreoleType();
         if ($creoleType == CreoleTypes::TIMESTAMP) {
             $from = $value['from'];
             $to = $value['to'];
             if ($from != '' && $from != null) {
                 $c->add($name, $from, Criteria::GREATER_EQUAL);
             }
             if ($to != '' && $to != null) {
                 $c->add($name, $to, Criteria::LESS_EQUAL);
             }
         } else {
             if ($creoleType == CreoleTypes::INTEGER) {
                 if ($name == StudentPeer::CLASS_GROUP_ID) {
                     $cg = ClassGroupPeer::retrieveByPK($value);
                     $c->add($name, $cg->getChildRecurs(), Criteria::IN);
                 } else {
                     $c->add($name, $value, Criteria::EQUAL);
                 }
             } else {
                 if ($creoleType == CreoleTypes::VARCHAR || $creoleType == CreoleTypes::CHAR) {
                     $c->add($name, "%{$value}%", Criteria::LIKE);
                 }
             }
         }
     }
 }
Esempio n. 20
0
 public function getClassGroupRelatedByClassGroup2($con = null)
 {
     include_once 'lib/model/om/BaseClassGroupPeer.php';
     if ($this->aClassGroupRelatedByClassGroup2 === null && $this->class_group2 !== null) {
         $this->aClassGroupRelatedByClassGroup2 = ClassGroupPeer::retrieveByPK($this->class_group2, $con);
     }
     return $this->aClassGroupRelatedByClassGroup2;
 }
Esempio n. 21
0
 public function executeGetList()
 {
     $class_id = $this->getRequestParameter('class_group_id');
     $class_group = ClassGroupPeer::retrieveByPK($class_id);
     $this->forward404Unless($class_group);
     $this->class_group = $class_group;
     #$c = new Criteria();
     #$cton1 = $c->getNewCriterion(StudentPeer::CLASS_GROUP_ID, $class_id, Criteria::IN);
     #$cton2 = $c->getNewCriterion(StudentPeer::STATUS, Student::STATUS_GRADUATE, Criteria::NOT_EQUAL);
     #$cton3 = $c->getNewCriterion(StudentPeer::STATUS, Student::STATUS_OVERDUE, Criteria::NOT_EQUAL);
     #$cton2->addAnd($cton3);
     #$cton1->addAnd($cton2);
     #$c->add($cton1);
     $c = new Criteria();
     $c->add(VStudentActivePeer::CLASS_GROUP_ID, $class_id, Criteria::IN);
     $c->addJoin(StudentPeer::ID, VStudentActivePeer::ID);
     $c->addAscendingOrderByColumn(StudentPeer::NAME);
     $this->sort($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->filter($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;
     $actions2 = array(array('name' => 'filter', 'color' => 'white'));
     $this->actions2 = $actions2;
 }
Esempio n. 22
0
 public function executeSaveScoreSmp()
 {
     $accal_id = $this->getRequestParameter('accal_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $this->academic_calendar = $academic_calendar;
     $schedule = SchedulePeer::retrieveByPk($this->getRequestParameter('schedule_id'));
     $this->forward404Unless($schedule);
     $this->schedule = $schedule;
     $schedule_detail = ScheduleDetailPeer::retrieveByPk($this->getRequestParameter('detail_id'));
     $this->forward404Unless($schedule_detail);
     $this->schedule_detail = $schedule_detail;
     $class_group = ClassGroupPeer::retrieveByPK($this->getRequestParameter('class_id'));
     $this->forward404Unless($class_group);
     $scores = $this->getRequestParameter('score');
     foreach ($scores as $k => $score) {
         if ($score != null) {
             $cr = new Criteria();
             $cr->add(StudentRaportPeer::GRADE_COMPONENT_ID, $schedule->getGradeComponentId());
             $cr->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $schedule->getAcademicCalendarId());
             $cr->add(StudentRaportPeer::SCHEDULE_DETAIL_ID, $schedule_detail->getId());
             $cr->add(StudentRaportPeer::SCHEDULE_ID, $schedule->getId());
             $cr->add(StudentRaportPeer::CLASS_GROUP_ID, $class_group->getId());
             $cr->add(StudentRaportPeer::STUDENT_ID, $k);
             $sc = StudentRaportPeer::doSelectOne($cr);
             $sc->setStudentId($k);
             $sc->setAcademicCalendarId($schedule->getAcademicCalendarId());
             $sc->setGradeComponentId($schedule->getGradeComponentId());
             $sc->setClassGroupId($class_group->getId());
             $sc->setScheduleId($schedule->getId());
             $sc->setScheduleDetailId($schedule_detail->getId());
             $sc->setGrade($score);
             $sc->save();
         }
     }
     return $this->redirect('extracurricular_new/listEksStu?id=' . $schedule->getId() . '&detail_id=' . $schedule_detail->getId() . '&accal_id=' . $academic_calendar->getId());
 }
Esempio n. 23
0
        ?>
							
                        </p>
						</td>
						<td><?php 
        echo $test_applicant->getName() ? $test_applicant->getName() : '-';
        ?>
</td>
                        
						<td><?php 
        echo $test_applicant->getClassGroup1() ? ClassGroupPeer::retrieveByPK($test_applicant->getClassGroup1())->getName() : '-';
        ?>
</td>
   						
                        <td><?php 
        echo $test_applicant->getClassGroup1() ? ClassGroupPeer::retrieveByPK($test_applicant->getClassGroup1())->getParentName() : '-';
        ?>
</td>
						
                        <td>
						<?php 
        if ($test_applicant->getApplicantType() == TestApplicant::STATUS_NEW) {
            echo __('Baru');
        } elseif ($test_applicant->getApplicantType() == TestApplicant::STATUS_TRANSFER) {
            echo __('Pindahan');
        } elseif ($test_applicant->getApplicantType() == TestApplicant::STATUS_EXTEND) {
            echo __('Lanjutan');
        }
        ?>
</td>
						
Esempio n. 24
0
        ?>
</td>
				<td class='first'><?php 
        echo ClassGroupPeer::retrieveByPK($test_applicant->getClassGroup1())->toString();
        ?>
</td>
				<td class='first'><?php 
        echo $test_applicant->getRegTestPeriod1() ? RegTestPeriodPeer::retrieveByPK($test_applicant->getRegTestPeriod1())->getRegPeriod()->getName() : '-';
        ?>
</td>
				<td nowrap><?php 
        echo $test_applicant->getDepartment2() ? DepartmentPeer::retrieveByPK($test_applicant->getDepartment2())->toString() . ' (' . $test_applicant->getIsPass1() . '-' . $test_applicant->getRank1() . ')' : '-';
        ?>
</td>
				<td><?php 
        echo $test_applicant->getClassGroup2() ? ClassGroupPeer::retrieveByPK($test_applicant->getClassGroup2())->toString() : '-';
        ?>
</td>
				<td><?php 
        echo $test_applicant->getRegTestPeriod2() ? RegTestPeriodPeer::retrieveByPK($test_applicant->getRegTestPeriod2())->getRegPeriod()->getName() : '-';
        ?>
</td>
				<td ><?php 
        if ($test_applicant->getApplicantType() == TestApplicant::STATUS_NEW) {
            echo __('Baru');
        } elseif ($test_applicant->getApplicantType() == TestApplicant::STATUS_TRANSFER) {
            echo __('Pindahan');
        } elseif ($test_applicant->getApplicantType() == TestApplicant::STATUS_EXTEND) {
            echo __('Lanjutan');
        }
        ?>
Esempio n. 25
0
 public function getClassGroup($con = null)
 {
     include_once 'lib/model/om/BaseClassGroupPeer.php';
     if ($this->aClassGroup === null && $this->class_group_id !== null) {
         $this->aClassGroup = ClassGroupPeer::retrieveByPK($this->class_group_id, $con);
     }
     return $this->aClassGroup;
 }
        </td>
    </tr>
    <tr>
    	<td>7. Kategori</td>
        <td style=" text-align: center;">:</td>
        <td>
		<?php 
echo $ta->getClassGroup1() && ClassGroupPeer::retrieveByPK($ta->getClassGroup1()) ? ClassGroupPeer::retrieveByPK($ta->getClassGroup1())->getParentName() : '';
?>
</td>
    </tr>
	<tr>
    	<td>8. Kelas</td>
        <td style=" text-align: center;">:</td>
        <td><?php 
echo $ta->getClassGroup1() && ClassGroupPeer::retrieveByPK($ta->getClassGroup1()) ? ClassGroupPeer::retrieveByPK($ta->getClassGroup1())->getName() : '';
?>
</td>
    </tr>
	<tr>
    	<td>9. Gelombang pandaftaran</td>
        <td style="text-align: center;">:</td>
        <td><?php 
echo $ta->getRegTestPeriod1() && RegTestPeriodPeer::retrieveByPK($ta->getRegTestPeriod1()) ? RegTestPeriodPeer::retrieveByPK($ta->getRegTestPeriod1())->getRegPeriod()->getName() : '';
?>
</td>
    </tr>
	<tr><td colspan="3"><br /><br>Jakarta, <?php 
echo date('d-m-Y');
?>
</td></tr>