Example #1
0
 public function executeRun()
 {
     $this->applicant = $this->applicant;
     $this->error = false;
     $this->regTestPeriod = RegTestPeriodPeer::retrieveByPK($this->applicant->getRegTestPeriod1());
     if (!$this->regTestPeriod) {
         $this->success = true;
         $this->messageError = 'RegTestPeriod not found';
         return false;
     }
     $cd = new Criteria();
     $cd->add(TestSchedulePeer::REG_TEST_PERIOD_ID, $this->regTestPeriod->getId());
     $cd->addJoin(TestSchedulePeer::ID, TestApplSchedPeer::TEST_SCHEDULE_ID);
     $cd->add(TestApplSchedPeer::TEST_APPLICANT_ID, $this->applicant->getId());
     $this->testAppl = TestApplSchedPeer::doSelectOne($cd);
     if (!$this->testAppl) {
         $this->success = true;
         $this->messageError = 'Test Applicant Schedule not found';
         return false;
     }
     $cd = new Criteria();
     $cd->add(RegSchedulePeer::REG_PERIOD_ID, $this->regTestPeriod->getRegPeriodId(), Criteria::EQUAL);
     $cd->addAscendingOrderByColumn(RegSchedulePeer::START);
     $this->regSchedules = RegSchedulePeer::doSelect($cd);
 }
Example #2
0
 public function executeRun()
 {
     $this->applicant = $this->applicant;
     $this->error = false;
     $this->regTestPeriod = RegTestPeriodPeer::retrieveByPK($this->applicant->getRegTestPeriod1());
     if (!$this->regTestPeriod) {
         $this->success = true;
         $this->messageError = 'RegTestPeriod not found';
         return false;
     }
     $testSubjectCriteria = new Criteria();
     $testSubjectCriteria->add(TestSubjectPeer::DEPARTMENT_ID, $this->applicant->getDepartment1());
     $testSubject = TestSubjectPeer::doSelect($testSubjectCriteria);
     $testSubjectCount = TestSubjectPeer::doCount($testSubjectCriteria);
     if ($testSubjectCount < 1) {
         $this->success = true;
         $this->messageError = 'Test Subject not found';
         return false;
     }
     $testSubjectId = array();
     foreach ($testSubject as $t) {
         $testSubjectId[] = $t->getId();
     }
     $testScoreCriteria = new Criteria();
     $testScoreCriteria->add(TestScorePeer::TEST_APPLICANT_ID, $this->applicant->getId(), Criteria::EQUAL);
     $testScoreCriteria->add(TestScorePeer::TEST_SUBJECT_ID, $testSubjectId, Criteria::IN);
     $testScoresTemp = TestScorePeer::doSelect($testScoreCriteria);
     $testScores = array();
     foreach ($testScoresTemp as $t) {
         $testScores[$t->getTestSubjectId()] = $t;
     }
     $this->testSubject = $testSubject;
     $this->testSubjectCount = $testSubjectCount;
     $this->testScores = $testScores;
 }
Example #3
0
 public function executeApplicant()
 {
     $this->applicant = $this->applicant;
     $this->error = false;
     $this->department = DepartmentPeer::retrieveByPK($this->applicant->getDepartment1());
     $this->classGroup = ClassGroupPeer::retrieveByPK($this->applicant->getClassGroup1());
     $this->regTestPeriod = RegTestPeriodPeer::retrieveByPK($this->applicant->getRegTestPeriod1());
     if (!$this->regTestPeriod) {
         $this->error = true;
         $this->messageError = 'RegTestPeriod not found';
         return false;
     }
 }
Example #4
0
 public function signInApplicant($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('reg_period1', RegTestPeriodPeer::retrieveByPK($user->getRegTestPeriod1())->getRegPeriod()->getName(), 'bo');
     $this->setAttribute('reg_period2', $user->getRegTestPeriod2() ? RegTestPeriodPeer::retrieveByPK($user->getgetRegTestPeriod2())->getRegPeriod()->getName() : '', 'bo');
     $this->setAttribute('login_time', time(), 'bo');
 }
Example #5
0
 public static function retrieveByPKs($pks, $con = null)
 {
     if ($con === null) {
         $con = Propel::getConnection(self::DATABASE_NAME);
     }
     $objs = null;
     if (empty($pks)) {
         $objs = array();
     } else {
         $criteria = new Criteria();
         $criteria->add(RegTestPeriodPeer::ID, $pks, Criteria::IN);
         $objs = RegTestPeriodPeer::doSelect($criteria, $con);
     }
     return $objs;
 }
Example #6
0
 public static function doSelectOrdered()
 {
     $criteria = new Criteria();
     $criteria->addAscendingOrderByColumn(AcademicCalendarPeer::CODE);
     $criteria->addAscendingOrderByColumn(RegPeriodPeer::CODE);
     $criteria->addAscendingOrderByColumn(RegTestPeriodPeer::CODE);
     $criteria->addJoin(RegTestPeriodPeer::REG_PERIOD_ID, RegPeriodPeer::ID);
     $criteria->addJoin(RegPeriodPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     return RegTestPeriodPeer::doSelect($criteria);
 }
Example #7
0
 public static function doSelectByRegTestPeriod1()
 {
     $ta_id = sfContext::getInstance()->getRequest()->getParameter('id');
     $ta = TestApplicantPeer::retrieveByPK($ta_id);
     if ($ta == null) {
         return array();
     }
     $accal_id = RegTestPeriodPeer::retrieveByPK($ta->getRegTestPeriod1())->getRegPeriodId()->getAcademicCalendarId();
     $c = new Criteria();
     $c->add(LocationPeer::ACADEMIC_CALENDAR_ID, $accal_id);
     $objs = LocationPeer::doSelect($c);
     return $objs;
 }
Example #8
0
 public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
 {
     $keys = RegTestPeriodPeer::getFieldNames($keyType);
     if (array_key_exists($keys[0], $arr)) {
         $this->setId($arr[$keys[0]]);
     }
     if (array_key_exists($keys[1], $arr)) {
         $this->setCode($arr[$keys[1]]);
     }
     if (array_key_exists($keys[2], $arr)) {
         $this->setRegPeriodId($arr[$keys[2]]);
     }
     if (array_key_exists($keys[3], $arr)) {
         $this->setStart($arr[$keys[3]]);
     }
     if (array_key_exists($keys[4], $arr)) {
         $this->setEnd($arr[$keys[4]]);
     }
     if (array_key_exists($keys[5], $arr)) {
         $this->setName($arr[$keys[5]]);
     }
 }
Example #9
0
 public function executePaymentProcess()
 {
     $this->getEnquirer();
     if (!$this->filterUser(true)) {
         $this->jsonwrapper->print_json(array('success' => false, 'code' => 'security', 'message' => 'You must login to access this url.'));
     }
     $applicant = $this->pmbTools->getApplicant($this->user);
     if (!$applicant) {
         $this->jsonwrapper->show_json_error('Permission', 'You dont have permission to access this page');
     }
     if ($applicant->getStatus() != StudentDetail::BUY && $applicant->getStatus() != StudentDetail::WEB && $applicant->getStatus() != StudentDetail::CONFIRM) {
         $this->jsonwrapper->show_json_error('Permission', 'You dont have permission to access this page');
     }
     $param = $this->getAllRequestParameter();
     $valid = true;
     $error_message = array();
     /* payment method */
     if (empty($param['payment_method'])) {
         $error_message[] = array('field' => 'payment_method', 'message' => 'Please enter payment method');
         $valid = false;
     } else {
         $paymentMethod = PaymentModelPeer::retrieveByPK($param['payment_method']);
         if (!$paymentMethod) {
             $error_message[] = array('field' => 'payment_method', 'message' => 'Payment method not exist');
             $valid = false;
         }
     }
     /* payment date */
     if (empty($param['payment_date'])) {
         $error_message[] = array('field' => 'payment_date', 'message' => 'Please enter payment date');
         $valid = false;
     }
     if (!$valid) {
         $this->jsonwrapper->print_json(array('success' => false, 'code' => 'notvalid', 'error' => $error_message));
     }
     /* Start Transaction */
     $connection = Propel::getConnection('propel');
     $connection->begin();
     /* Set Up Registration Test Period */
     $regPeriod = $this->pmbTools->getRegistrationPeriod($applicant->getDepartment1());
     if (!$regPeriod) {
         $this->jsonwrapper->show_json_error('TestPeriod', 'Registration Period not found');
     }
     $c = new Criteria();
     $c->add(RegTestPeriodPeer::REG_PERIOD_ID, $regPeriod->getId());
     $regTestPeriods = RegTestPeriodPeer::doSelect($c);
     $save = false;
     foreach ($regTestPeriods 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']);
                         try {
                             $tas->save();
                             $save = true;
                         } catch (Exception $e) {
                             $connection->rollback();
                             $this->jsonwrapper->print_json(array('success' => false, 'code' => 'fail', 'message' => 'Error while save test applicant schedule, please try again later.'));
                         }
                         break;
                     }
                     $i++;
                 }
             }
         }
         if (!$save) {
             $connection->rollback();
             $this->jsonwrapper->print_json(array('success' => false, 'code' => 'fail', 'message' => 'Error.'));
         }
         $regTestPeriod = $reg_test_period;
         $applicant->setRegTestPeriod1($reg_test_period->getId());
         try {
             $applicant->save();
         } catch (Exception $e) {
             $connection->rollback();
             $this->jsonwrapper->print_json(array('success' => false, 'code' => 'fail', 'message' => 'Error while save test applicant registration test period, please try again later.'));
         }
         break;
     }
     /* Save new applicant code */
     $newCode = $this->pmbTools->generateApplicantCode(StudentDetail::WEB);
     $applicant->setStatus(StudentDetail::CONFIRM);
     $applicant->setCode($newCode);
     try {
         $applicant->save();
     } catch (Exception $e) {
         $connection->rollback();
         $this->jsonwrapper->print_json(array('success' => false, 'code' => 'fail', 'message' => 'Error while save the applicant data, please try again later.'));
     }
     /* Set Payment */
     $paymentDate = date('Y-m-d', strtotime($param['payment_date']));
     $c = new Criteria();
     $cton1 = $c->getNewCriterion(AcademicCostPeer::ACADEMIC_CALENDAR_ID, $regTestPeriod->getRegPeriod()->getAcademicCalendarId(), Criteria::IN);
     $cton2 = $c->getNewCriterion(AcademicCostPeer::ACADEMIC_PROCESS_ID, 1, Criteria::IN);
     $cton3 = $c->getNewCriterion(AcademicCostPeer::ACADEMIC_COST_COMPONENT_ID, 1, Criteria::IN);
     $cton2->addAnd($cton3);
     $cton1->addAnd($cton2);
     $c->add($cton1);
     $costs = AcademicCostPeer::doSelect($c);
     $total_cost = 0;
     foreach ($costs as $cost) {
         $c = new Criteria();
         $c->add(PaymentApplicantPeer::TEST_APPLICANT_ID, $applicant->getId());
         $payment_applicant = PaymentApplicantPeer::doSelectOne($c);
         if ($payment_applicant == null) {
             $payment_applicant = new PaymentApplicant();
         }
         $payment_applicant->setTestApplicant($applicant);
         $payment_applicant->setPaymentModelId($paymentMethod->getId());
         $payment_applicant->setPaidAt($paymentDate);
         $payment_applicant->setAcademicCostId($cost->getId());
         $payment_applicant->setAcademicProcessId(1);
         $payment_applicant->setAmount($cost->getAmount());
         $payment_applicant->setPayerType(PaymentJournal::PAYER_TYPE_APPLICANT);
         $payment_applicant->setStatus('S');
         $payment_applicant->setPaid($cost->getAmount());
         echo 'a';
         try {
             $payment_applicant->save();
         } catch (Exception $e) {
             $connection->rollback();
             $this->jsonwrapper->print_json(array('success' => false, 'code' => 'fail', 'message' => 'Error while save the data, please try again later.'));
         }
     }
     /* Commit Transaction */
     $connection->rollback();
     /*
     $connection->commit();
     */
     $this->jsonwrapper->print_json(array('success' => true, 'code' => 'success', 'message' => 'Data successfully saved', 'href' => $this->pmbTools->pmbUrl('')));
     /* ---- */
 }
Example #10
0
 public static function doSelectJoinAllExceptCurriculum(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     VTestApplicantPeer::addSelectColumns($c);
     $startcol2 = VTestApplicantPeer::NUM_COLUMNS - VTestApplicantPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     RegTestPeriodPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + RegTestPeriodPeer::NUM_COLUMNS;
     RegTestPeriodPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + RegTestPeriodPeer::NUM_COLUMNS;
     $c->addJoin(VTestApplicantPeer::REG_TEST_PERIOD1, RegTestPeriodPeer::ID);
     $c->addJoin(VTestApplicantPeer::REG_TEST_PERIOD2, RegTestPeriodPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = VTestApplicantPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = RegTestPeriodPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getRegTestPeriodRelatedByRegTestPeriod1();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addVTestApplicantRelatedByRegTestPeriod1($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initVTestApplicantsRelatedByRegTestPeriod1();
             $obj2->addVTestApplicantRelatedByRegTestPeriod1($obj1);
         }
         $omClass = RegTestPeriodPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getRegTestPeriodRelatedByRegTestPeriod2();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addVTestApplicantRelatedByRegTestPeriod2($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initVTestApplicantsRelatedByRegTestPeriod2();
             $obj3->addVTestApplicantRelatedByRegTestPeriod2($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Example #11
0
 public static function doSelectJoinAllExceptLocationRelatedByLocation2(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     TestApplicantPeer::addSelectColumns($c);
     $startcol2 = TestApplicantPeer::NUM_COLUMNS - TestApplicantPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     TestApplicantDetailPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + TestApplicantDetailPeer::NUM_COLUMNS;
     DepartmentPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + DepartmentPeer::NUM_COLUMNS;
     ClassGroupPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + ClassGroupPeer::NUM_COLUMNS;
     RegTestPeriodPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + RegTestPeriodPeer::NUM_COLUMNS;
     DepartmentPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + DepartmentPeer::NUM_COLUMNS;
     ClassGroupPeer::addSelectColumns($c);
     $startcol8 = $startcol7 + ClassGroupPeer::NUM_COLUMNS;
     RegTestPeriodPeer::addSelectColumns($c);
     $startcol9 = $startcol8 + RegTestPeriodPeer::NUM_COLUMNS;
     $c->addJoin(TestApplicantPeer::TEST_APPLICANT_DETAIL_ID, TestApplicantDetailPeer::ID);
     $c->addJoin(TestApplicantPeer::DEPARTMENT_1, DepartmentPeer::ID);
     $c->addJoin(TestApplicantPeer::CLASS_GROUP1, ClassGroupPeer::ID);
     $c->addJoin(TestApplicantPeer::REG_TEST_PERIOD1, RegTestPeriodPeer::ID);
     $c->addJoin(TestApplicantPeer::DEPARTMENT_2, DepartmentPeer::ID);
     $c->addJoin(TestApplicantPeer::CLASS_GROUP2, ClassGroupPeer::ID);
     $c->addJoin(TestApplicantPeer::REG_TEST_PERIOD2, RegTestPeriodPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = TestApplicantPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = TestApplicantDetailPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getTestApplicantDetail();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addTestApplicant($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initTestApplicants();
             $obj2->addTestApplicant($obj1);
         }
         $omClass = DepartmentPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getDepartmentRelatedByDepartment1();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addTestApplicantRelatedByDepartment1($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initTestApplicantsRelatedByDepartment1();
             $obj3->addTestApplicantRelatedByDepartment1($obj1);
         }
         $omClass = ClassGroupPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj4 = new $cls();
         $obj4->hydrate($rs, $startcol4);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj4 = $temp_obj1->getClassGroupRelatedByClassGroup1();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addTestApplicantRelatedByClassGroup1($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initTestApplicantsRelatedByClassGroup1();
             $obj4->addTestApplicantRelatedByClassGroup1($obj1);
         }
         $omClass = RegTestPeriodPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj5 = new $cls();
         $obj5->hydrate($rs, $startcol5);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj5 = $temp_obj1->getRegTestPeriodRelatedByRegTestPeriod1();
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addTestApplicantRelatedByRegTestPeriod1($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initTestApplicantsRelatedByRegTestPeriod1();
             $obj5->addTestApplicantRelatedByRegTestPeriod1($obj1);
         }
         $omClass = DepartmentPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj6 = new $cls();
         $obj6->hydrate($rs, $startcol6);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj6 = $temp_obj1->getDepartmentRelatedByDepartment2();
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addTestApplicantRelatedByDepartment2($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initTestApplicantsRelatedByDepartment2();
             $obj6->addTestApplicantRelatedByDepartment2($obj1);
         }
         $omClass = ClassGroupPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj7 = new $cls();
         $obj7->hydrate($rs, $startcol7);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj7 = $temp_obj1->getClassGroupRelatedByClassGroup2();
             if ($temp_obj7->getPrimaryKey() === $obj7->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj7->addTestApplicantRelatedByClassGroup2($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj7->initTestApplicantsRelatedByClassGroup2();
             $obj7->addTestApplicantRelatedByClassGroup2($obj1);
         }
         $omClass = RegTestPeriodPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj8 = new $cls();
         $obj8->hydrate($rs, $startcol8);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj8 = $temp_obj1->getRegTestPeriodRelatedByRegTestPeriod2();
             if ($temp_obj8->getPrimaryKey() === $obj8->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj8->addTestApplicantRelatedByRegTestPeriod2($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj8->initTestApplicantsRelatedByRegTestPeriod2();
             $obj8->addTestApplicantRelatedByRegTestPeriod2($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Example #12
0
 public static function doSelectJoinAllExceptDepartment(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     VLocationPeer::addSelectColumns($c);
     $startcol2 = VLocationPeer::NUM_COLUMNS - VLocationPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     LocationPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + LocationPeer::NUM_COLUMNS;
     LocationCategoryPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + LocationCategoryPeer::NUM_COLUMNS;
     RegTestPeriodPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + RegTestPeriodPeer::NUM_COLUMNS;
     $c->addJoin(VLocationPeer::LOCATION_ID, LocationPeer::ID);
     $c->addJoin(VLocationPeer::LOCATION_CATEGORY_ID, LocationCategoryPeer::ID);
     $c->addJoin(VLocationPeer::REG_TEST_PERIOD_ID, RegTestPeriodPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = VLocationPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = LocationPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getLocation();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addVLocation($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initVLocations();
             $obj2->addVLocation($obj1);
         }
         $omClass = LocationCategoryPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getLocationCategory();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addVLocation($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initVLocations();
             $obj3->addVLocation($obj1);
         }
         $omClass = RegTestPeriodPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj4 = new $cls();
         $obj4->hydrate($rs, $startcol4);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj4 = $temp_obj1->getRegTestPeriod();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addVLocation($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initVLocations();
             $obj4->addVLocation($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Example #13
0
 public function executeFinish()
 {
     if ($this->getUser()->isAuthenticated2('bo')) {
         $user_id = $this->getContext()->getUser()->getAttribute('user_id', null, 'bo');
         $applicant = TestApplicantPeer::retrieveByPk($user_id);
         $this->forward404Unless($applicant);
         $cw = new Criteria();
         $cw->add(AcademicCalendarPeer::DEPARTMENT_ID, $applicant->getDepartment1(), Criteria::IN);
         $cw->addJoin(RegPeriodPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
         $cw->addJoin(RegTestPeriodPeer::REG_PERIOD_ID, RegPeriodPeer::ID);
         $reg_test_periods = RegTestPeriodPeer::doSelect($cw);
         $this->reg_test_periods = $reg_test_periods;
         $this->applicant_detail = $applicant->getTestApplicantDetail();
         $this->applicant = $applicant;
     } else {
         $this->redirect('default/index');
     }
 }
Example #14
0
 public function executeDelete()
 {
     $reg_test_period = RegTestPeriodPeer::retrieveByPk($this->getRequestParameter('test_id'));
     $this->forward404Unless($reg_test_period);
     $test_schedule = TestSchedulePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($test_schedule);
     $ref_error = 0;
     foreach ($test_schedule->getRefCountMethods() as $ref) {
         $method = "count" . $ref['affix'];
         $count = $test_schedule->{$method}();
         if ($count > 0) {
             ++$ref_error;
             $this->getRequest()->setError('test_schedule/delete/' . sfInflector::camelize($ref['table']), $count);
         }
     }
     if ($ref_error > 0) {
         $this->getRequest()->setError('test_schedule/delete', '_ERR_DELETE_ (' . $test_schedule->toString() . ' - id:' . $test_schedule->getId() . ')');
     } else {
         $test_schedule->delete();
     }
     #return $this->forward('locate_test', 'listTest?id='.$reg_test_period->getId().'&reg_period_id='.$reg_test_period->getRegPeriodId());
     return $this->redirect('locate_test/listTest?id=' . $reg_test_period->getId() . '&reg_period_id=' . $reg_test_period->getRegPeriodId());
 }
Example #15
0
                            	<?php 
echo $test_applicant->getRegTestPeriod2() ? RegTestPeriodPeer::retrieveByPK($test_applicant->getRegTestPeriod2())->getRegPeriod()->getAcademicCalendar()->toString() : '-';
?>
                            </b></p>
                            </td>
        				</tr>
        				<tr>   
           					<td style="vertical-align:middle;" width="30%"><label><?php 
echo __('Jadwal Test 2');
?>
</label></td>
           					<td width="2%" style="text-align:center; vertical-align:middle;">:</td>
		   					<td style="vertical-align:middle;">
							<p class="detail"><b>
                            	<?php 
echo $test_applicant->getRegTestPeriod2() ? RegTestPeriodPeer::retrieveByPK($test_applicant->getRegTestPeriod2())->toString() : '-';
?>
                            </b></p>
                            </td>
        				</tr>
                   	</table>
        			</td>
        		</tr>
        		</table>
        		</td></tr>
                
                <tr><td colspan="3"><div class="subtitle">Profil Calon Siswa</div></td></tr>
				<!-- Fifth Line -->
        		<tr>
           			<td style="vertical-align:middle;"><label  ><?php 
echo __('Short name');
                            <td width="30%" align="left">Gelombang Pendaftaran</td>
                            <td width="5%" align="center">:</td>
                            <td width="57%" align="left">
                    <?php 
echo $ta->getRegTestPeriod1() && RegTestPeriodPeer::retrieveByPK($ta->getRegTestPeriod1()) ? RegTestPeriodPeer::retrieveByPK($ta->getRegTestPeriod1())->getRegPeriod()->getName() : '';
?>
                    </td>
                    </tr>
                <tr>
                    <td></td>
                            <td align="left">20.</td>
                            <td align="left">Periode Pendaftaran</td>
                            <td align="center">:</td>
                            <td align="left">
                                    <?php 
$reg_test_period = RegTestPeriodPeer::retrieveByPK($ta->getRegTestPeriod1());
?>
                                     <?php 
echo $reg_test_period->getRegPeriod()->getStart() ? DateToIndo($reg_test_period->getRegPeriod()->getStart()) : '-';
?>
&nbsp;s.d&nbsp;<?php 
echo $reg_test_period->getRegPeriod()->getEnd() ? DateToIndo($reg_test_period->getRegPeriod()->getEnd()) : '-';
?>
                    </td>
                    </tr>
            </table>
            </td>    
        </tr>
        <tr><td height="10px;">&nbsp;</td></tr>
        <tr><td align="justify" style="vertical-align: middle;">Simpanlah lembar pendaftaran ini sebagai bukti pendaftaran Anda. 
        <br />Gunakan <b>No Pendaftaran dan Tanggal Lahir</b> Calon Siswa untuk mengakses Informasi PMB di alamat <em>http://pmbonline.muhajirien.org</em></td></tr>
Example #17
0
 public static function doSelectJoinAllExceptLocation(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     TestSchedulePeer::addSelectColumns($c);
     $startcol2 = TestSchedulePeer::NUM_COLUMNS - TestSchedulePeer::NUM_LAZY_LOAD_COLUMNS + 1;
     RegTestPeriodPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + RegTestPeriodPeer::NUM_COLUMNS;
     TestSubjectPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + TestSubjectPeer::NUM_COLUMNS;
     $c->addJoin(TestSchedulePeer::REG_TEST_PERIOD_ID, RegTestPeriodPeer::ID);
     $c->addJoin(TestSchedulePeer::TEST_SUBJECT_ID, TestSubjectPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = TestSchedulePeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = RegTestPeriodPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getRegTestPeriod();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addTestSchedule($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initTestSchedules();
             $obj2->addTestSchedule($obj1);
         }
         $omClass = TestSubjectPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getTestSubject();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addTestSchedule($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initTestSchedules();
             $obj3->addTestSchedule($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
Example #18
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');
     $reg_test_period = RegTestPeriodPeer::retrieveByPk($this->getRequestParameter('reg_test_period_id'));
     $this->forward404Unless($reg_test_period);
     $reg_test_period->setId($this->getRequestParameter('reg_test_period_id'));
     $reg_test_period->setName($this->getRequestParameter('name'));
     $reg_test_period->setCode($this->getRequestParameter('code'));
     $reg_test_period->setRegPeriodId($this->getRequestParameter('reg_period_id'));
     $reg_test_period->save();
     $test_schedule = TestSchedulePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($test_schedule);
     $test_schedule->setId($this->getRequestParameter('id'));
     $test_schedule->setRegTestPeriodId($this->getRequestParameter('reg_test_period_id'));
     #$test_schedule->setTestSubjectId($this->getRequestParameter('test_subject_id'));
     $test_schedule->setLocationId($this->getRequestParameter('location_id'));
     if ($this->getRequestParameter('start')) {
         $test_schedule->setStart($this->getRequestParameter('start'));
     }
     if ($this->hasRequestParameter('end')) {
         $test_schedule->setEnd($this->getRequestParameter('end'));
     }
     $test_schedule->save();
     return $this->redirect('test_schedule/list');
 }
Example #19
0
 public static function doSelectJoinAllExceptClassGroupRelatedByClassId(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     VApplicantTestPeer::addSelectColumns($c);
     $startcol2 = VApplicantTestPeer::NUM_COLUMNS - VApplicantTestPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     TestApplicantDetailPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + TestApplicantDetailPeer::NUM_COLUMNS;
     DepartmentPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + DepartmentPeer::NUM_COLUMNS;
     RegTestPeriodPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + RegTestPeriodPeer::NUM_COLUMNS;
     LocationPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + LocationPeer::NUM_COLUMNS;
     $c->addJoin(VApplicantTestPeer::TEST_APPLICANT_DETAIL_ID, TestApplicantDetailPeer::ID);
     $c->addJoin(VApplicantTestPeer::DEPARTMENT_ID, DepartmentPeer::ID);
     $c->addJoin(VApplicantTestPeer::REG_TEST_PERIOD_ID, RegTestPeriodPeer::ID);
     $c->addJoin(VApplicantTestPeer::LOCATION_ID, LocationPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = VApplicantTestPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = TestApplicantDetailPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj2 = new $cls();
         $obj2->hydrate($rs, $startcol2);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj2 = $temp_obj1->getTestApplicantDetail();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addVApplicantTest($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initVApplicantTests();
             $obj2->addVApplicantTest($obj1);
         }
         $omClass = DepartmentPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj3 = new $cls();
         $obj3->hydrate($rs, $startcol3);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj3 = $temp_obj1->getDepartment();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addVApplicantTest($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initVApplicantTests();
             $obj3->addVApplicantTest($obj1);
         }
         $omClass = RegTestPeriodPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj4 = new $cls();
         $obj4->hydrate($rs, $startcol4);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj4 = $temp_obj1->getRegTestPeriod();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addVApplicantTest($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initVApplicantTests();
             $obj4->addVApplicantTest($obj1);
         }
         $omClass = LocationPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj5 = new $cls();
         $obj5->hydrate($rs, $startcol5);
         $newObject = true;
         for ($j = 0, $resCount = count($results); $j < $resCount; $j++) {
             $temp_obj1 = $results[$j];
             $temp_obj5 = $temp_obj1->getLocation();
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addVApplicantTest($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initVApplicantTests();
             $obj5->addVApplicantTest($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
    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();
    ?>
","<?php 
    if ($test_applicant->getStatus() == StudentDetail::BUY) {
Example #21
0
 public function countRegTestPeriods($criteria = null, $distinct = false, $con = null)
 {
     include_once 'lib/model/om/BaseRegTestPeriodPeer.php';
     if ($criteria === null) {
         $criteria = new Criteria();
     } elseif ($criteria instanceof Criteria) {
         $criteria = clone $criteria;
     }
     $criteria->add(RegTestPeriodPeer::REG_PERIOD_ID, $this->getId());
     return RegTestPeriodPeer::doCount($criteria, $distinct, $con);
 }
Example #22
0
?>
<table align="center" style="border-collapse:collapse; width:100%; position: absolute;">
	
    <tr>
    	<td align="justify" width="100%">
		<?php 
$cls = ClassGroupPeer::retrieveByPk($ta->getClassGroup1());
?>
        <p style="text-align: justify;">Berikut Merupakan Rincian Biaya Pendidikan di <b><?php 
echo $department_detail ? $department_detail->getName() ? $department_detail->getName() : '' : '';
?>
 Program <?php 
echo $ta->getClassGroup1() ? $cls->getParentName() : '-';
?>
</b> Tahun Pelajaran <?php 
echo RegTestPeriodPeer::retrieveByPK($ta->getRegTestPeriod1())->getRegPeriod()->getAcademicCalendar()->getName();
?>
 :</p></td>
    </tr>    
    <tr>
    	<td align="justify" width="100%">
         <table border="0" width="100%">
    		<?php 
$i = 0;
foreach ($academic_costs as $academic_cost) {
    $i++;
    ?>
            <tr>
            	<td width="3%"></td>
    			<td width="3%" align="left"><?php 
    echo $i . '.';
Example #23
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');
 }
Example #24
0
 public function getRegTestPeriod($con = null)
 {
     include_once 'lib/model/om/BaseRegTestPeriodPeer.php';
     if ($this->aRegTestPeriod === null && $this->reg_test_period_id !== null) {
         $this->aRegTestPeriod = RegTestPeriodPeer::retrieveByPK($this->reg_test_period_id, $con);
     }
     return $this->aRegTestPeriod;
 }
Example #25
0
 public function getRegTestPeriodRelatedByRegTestPeriod2($con = null)
 {
     include_once 'lib/model/om/BaseRegTestPeriodPeer.php';
     if ($this->aRegTestPeriodRelatedByRegTestPeriod2 === null && $this->reg_test_period2 !== null) {
         $this->aRegTestPeriodRelatedByRegTestPeriod2 = RegTestPeriodPeer::retrieveByPK($this->reg_test_period2, $con);
     }
     return $this->aRegTestPeriodRelatedByRegTestPeriod2;
 }
Example #26
0
        echo "&nbsp;Nov&nbsp;";
    } elseif ($bln1 == 12) {
        echo "&nbsp;Des&nbsp;";
    }
    echo $tahun1;
} else {
    echo '-';
}
?>
                                    </span><br />
                                    Periode Pembayaran
                                    </li>
                                    <li style="padding-top: 3px;">
                                    <span style="color:darkgoldenrod;">
									<?php 
$reg_test_period = RegTestPeriodPeer::retrieveByPK($applicant->getRegTestPeriod1());
$tanggal2 = substr($reg_test_period->getStart(), 8, 2);
$bln2 = substr($reg_test_period->getStart(), 5, 2);
$tahun2 = substr($reg_test_period->getStart(), 0, 4);
?>
									<?php 
if ($reg_test_period->getStart() != null) {
    echo $tanggal2;
    if ($bln2 == 1) {
        echo "&nbsp;Jan&nbsp;";
    } elseif ($bln2 == 2) {
        echo "&nbsp;Feb&nbsp;";
    } elseif ($bln2 == 3) {
        echo "&nbsp;Mar&nbsp;";
    } elseif ($bln2 == 4) {
        echo "&nbsp;April&nbsp;";
?>
</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>
	<tr><td colspan="3">
	<?php 
if ($ta->getDepartment1() == 2) {
    ?>
     	<?php 
    echo DepartmentPeer::retrieveByPK($ta->getDepartment1())->toString();
    ?>
&nbsp;ISLAM AL-AZHAR 10 KEMBANGAN