Example #1
0
 public function executeView()
 {
     $user_id = $this->getContext()->getUser()->getAttribute('user_id', null, 'bo');
     $test_applicant = TestApplicantPeer::retrieveByPk($user_id);
     $this->forward404Unless($test_applicant);
     $this->test_applicant_detail = $test_applicant->getTestApplicantDetail();
     $this->test_applicant = $test_applicant;
 }
Example #2
0
 public function executeView()
 {
     $user_id = $this->getContext()->getUser()->getAttribute('user_id', null, 'bo');
     $test_applicant = TestApplicantPeer::retrieveByPk($user_id);
     $c = new Criteria();
     $c->add(TestApplSchedPeer::TEST_APPLICANT_ID, $test_applicant->getId());
     $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $test_applicant->getDepartment1());
     $c->addJoin(AcademicCalendarPeer::ID, RegPeriodPeer::ACADEMIC_CALENDAR_ID);
     $c->addJoin(RegPeriodPeer::ID, RegTestPeriodPeer::REG_PERIOD_ID);
     $c->addJoin(RegTestPeriodPeer::ID, TestSchedulePeer::REG_TEST_PERIOD_ID);
     $c->addJoin(TestSchedulePeer::ID, TestApplSchedPeer::TEST_SCHEDULE_ID);
     $appl_sched1 = TestApplSchedPeer::doSelectJoinTestSchedule($c);
 }
Example #3
0
    <div class="login">
            <p style="text-align:left; width:90%; line-height: 15px; padding-top: 0px;"></p>
            <h2 class="contentheading"><b><?php 
echo $this->getContext()->getUser()->getAttribute('username_long', '', 'bo');
?>
</b></h2>
                    <?php 
$applicant = TestApplicantPeer::retrieveByPk($this->getContext()->getUser()->getAttribute('user_id', '', 'bo'));
$cls = ClassGroupPeer::retrieveByPk($applicant->getClassGroup1());
?>
            <p style="padding-top: 15px; line-height: 20px;">No. Pendaftaran Anda adalah <br><b><?php 
echo $applicant->getCode() ? $applicant->getCode() : '-';
?>
</b><br />
            Pilihan Kelas Anda adalah <br><b><?php 
echo $applicant->getClassGroup1() ? $cls->toString() . ' - ' . $cls->getParentName() : '-';
?>
</b><br /><br>
            <?php 
echo link_to_remote('Informasi Detail', array('url' => 'auth/test?id=' . $applicant->getId(), 'update' => 'content', 'script' => 'true'), array('class' => 'user_logout', 'title' => 'Detail Informasi'));
?>
<br />
            <?php 
echo link_to('Logout', '/auth/logout', 'class=user_logout title=keluar');
?>
</p>
    </div>
Example #4
0
 public function executeSubmit()
 {
     header('Cache-Control: no-cache, must-revalidate');
     header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
     header('Content-type: application/json');
     $this->jsonwrapper = new jsonwrapper();
     /* Check sudah login atau belum */
     if (!$this->getUser()->isAuthenticated2('bo')) {
         $this->jsonwrapper->show_json_error('not login', 'Sorry, You must logged in to access this page.');
     }
     $user_id = $this->getContext()->getUser()->getAttribute('user_id', null, 'bo');
     /* Check apakah user terdaftar */
     $applicant = TestApplicantPeer::retrieveByPk($user_id);
     if (!$applicant) {
         $this->jsonwrapper->show_json_error('not register', 'Sorry, Please register first.');
     }
     /* check ada parameter question atau tidak */
     $data = $this->getRequestParameter('question');
     if (empty($data)) {
         $this->jsonwrapper->show_json_error('allQuestionError', 'Please choose an option.');
     }
     $errorAnswer = array();
     /* Cari Soal */
     $c = new Criteria();
     $c->addAscendingOrderByColumn(AngketpmbSoalPeer::ORDERING);
     $soal = AngketpmbSoalPeer::doSelect($c);
     if (!$soal) {
         $this->jsonwrapper->show_json_error('allQuestionError', 'Question is no longer exist. Please refresh the page.');
     }
     foreach ($soal as $s) {
         if (!array_key_exists($s->getId(), $data)) {
             $errorAnswer[] = array('id' => $s->getId(), 'message' => 'Please choose an option.');
         }
     }
     /* Start Transaction */
     $connection = Propel::getConnection('propel');
     $connection->begin();
     /* Getting or Creating Angket Session */
     $c = new Criteria();
     $c->add(AngketpmbSessionPeer::TEST_APPLICANT_ID, $applicant->getId(), Criteria::EQUAL);
     $angketSession = AngketpmbSessionPeer::doSelectOne($c);
     if (!$angketSession) {
         try {
             $angketSession = new AngketpmbSession();
             $angketSession->setTestApplicantId($applicant->getId());
             $angketSession->save();
         } catch (Exception $e) {
             $connection->rollback();
             $this->jsonwrapper->print_json(array('success' => 0, 'code' => 'processError', 'message' => 'Sorry, there is an error while saving your answer. Please trye again later', 'hideMessage' => 'Error while create applicant session'));
             die;
         }
     }
     /* check apakah ada pertanyaan yang belum dijawab */
     foreach ($data as $key => $value) {
         $soal = AngketpmbSoalPeer::retrieveByPk($key);
         /* Jika soal tidak ketemu */
         if (!$soal) {
             $errorAnswer[] = array('id' => $key, 'message' => 'Question is no longer exist. Please refresh the page.');
             continue;
         }
         /* Jika belum dijawab */
         if (empty($value)) {
             $errorAnswer[] = array('id' => $key, 'message' => 'Please choose an option.');
             continue;
         }
         /* Jika jawaban tidak ketemu */
         $option = AngketpmbOptionPeer::retrieveByPk($value);
         if (!$option) {
             $errorAnswer[] = array('id' => $key, 'message' => 'Option you choosed is no longer exist. Please refresh the page.');
             continue;
         }
         /* Jika jawaban bukan untuk soal ini */
         if ($option->getSoalId() != $soal->getId()) {
             $errorAnswer[] = array('id' => $key, 'message' => 'Option you choosed is not valid. Please refresh the page.');
             continue;
         }
         /* Mencari jawaban yang sudah pernah dijawab */
         $c = new Criteria();
         $c->add(AngketpmbSessionAnswerPeer::SESSION_ID, $angketSession->getId(), Criteria::EQUAL);
         $c->add(AngketpmbSessionAnswerPeer::SOAL_ID, $soal->getId(), Criteria::EQUAL);
         $angketAnswer = AngketpmbSessionAnswerPeer::doSelectOne($c);
         if ($angketAnswer) {
             /* Update */
             if ($angketAnswer->getOptionId() != $option->getId()) {
                 try {
                     $angketAnswer->setOptionId($option->getId());
                     $angketAnswer->save();
                 } catch (Exception $e) {
                     $connection->rollback();
                     $this->jsonwrapper->print_json(array('success' => 0, 'code' => 'processError', 'message' => 'Sorry, there is an error while saving your answer. Please trye again later', 'hideMessage' => 'Error while update applicant answer Id = ' . $angketAnswer->getId()));
                     die;
                 }
             }
         } else {
             /* Insert */
             try {
                 $angketAnswer = new AngketpmbSessionAnswer();
                 $angketAnswer->setSessionId($angketSession->getId());
                 $angketAnswer->setSoalId($soal->getId());
                 $angketAnswer->setOptionId($option->getId());
                 $angketAnswer->save();
             } catch (Exception $e) {
                 $connection->rollback();
                 $this->jsonwrapper->print_json(array('success' => 0, 'code' => 'processError', 'message' => 'Sorry, there is an error while saving your answer. Please trye again later', 'hideMessage' => 'Error while insert applicant answer SoalId = ' . $soal->getId()));
                 die;
             }
         }
     }
     if (count($errorAnswer) > 0) {
         $connection->rollback();
         $this->jsonwrapper->print_json(array('success' => 0, 'code' => 'someQuestionError', 'data' => $errorAnswer));
         die;
     }
     $connection->commit();
     $this->jsonwrapper->print_json(array('success' => 1, 'message' => 'Berhasil'));
     die;
 }
Example #5
0
 public function executeEditResult()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, $this->getModuleName());
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     if (!$acl) {
         $this->forward('default', 'error404');
     }
     $this->can_add = $acl->getAddPriv() == 1;
     $this->can_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $c = new Criteria();
     $c->add(TestApplSchedPeer::TEST_SCHEDULE_ID, $this->getRequestParameter('id'));
     $c->add(TestApplSchedPeer::TEST_APPLICANT_ID, $this->getRequestParameter('appl_id'));
     $this->test_appl_sched = TestApplSchedPeer::doSelectOne($c);
     $this->forward404Unless($this->test_appl_sched);
     $this->test_applicant = TestApplicantPeer::retrieveByPk($this->getRequestParameter('appl_id'));
     $this->forward404Unless($this->test_applicant);
     $this->test_schedule = TestSchedulePeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($this->test_schedule);
     $this->department = DepartmentPeer::retrieveByPk($this->getRequestParameter('dept_id'));
     $this->forward404Unless($this->department);
 }
Example #6
0
 public function executeReg()
 {
     $user_id = $this->getContext()->getUser()->getAttribute('user_id', null, 'bo');
     $applicant = TestApplicantPeer::retrieveByPk($user_id);
     $this->forward404Unless($applicant);
     $applicant_detail = $applicant->getTestApplicantDetail();
     $applicant->setRegTestPeriod1($this->getRequestParameter('id'));
     $applicant->save();
     $scheds1 = $applicant->getRegTestPeriodRelatedByRegTestPeriod1()->getTestSchedules();
     $appl_scheds = $applicant->getTestApplScheds();
     foreach ($test_appl_scheds as $tas) {
         $tas->delete();
     }
     $s1 = array();
     foreach ($scheds1 as $s) {
         $s1[$s->getRegTestPeriodId()][] = array('reg_test_period_id' => $s->getRegTestPeriodId(), 'used' => $s->countTestApplScheds(), 'capacity' => $s->getLocation()->getCapacity(), 'sched' => $s);
     }
     foreach ($s1 as $s) {
         $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++;
         }
     }
     return $this->redirect('auth/test');
 }
Example #7
0
 public function executeDelete()
 {
     $test_applicant = TestApplicantPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($test_applicant);
     $test_applicant->delete();
     return $this->redirect('ac_reg_stu/list');
 }
Example #8
0
<?php

$user_id = $this->getContext()->getUser()->getAttribute('user_id', null, 'bo');
$test_applicant = TestApplicantPeer::retrieveByPk($user_id);
$cr = new Criteria();
$cr->add(TestSubjectPeer::DEPARTMENT_ID, $test_applicant->getDepartment1());
$t_subject1 = TestSubjectPeer::doSelect($cr);
$t_count1 = TestSubjectPeer::doCount($cr);
?>
<div class="block column column-80">
  <!-- Jika terdapat dua pilihan -->
  <?php 
if ($test_applicant->getDepartment2() != null) {
    ?>
            
  <table border="0" cellpadding="2" cellspacing="1" width="60%;">
	<tr><td style='text-align: left; border:none; font-weight: bold;' class="ThRows" nowrap="nowrap" colspan="6">Hasil Ujian Test 1 :</td></tr>
  </table>  
  <?php 
} else {
    ?>
  <table border="0" cellpadding="2" cellspacing="1" width="60%;">
	<tr><td style='text-align: left; border:none; font-weight: bold;' class="ThRows" nowrap="nowrap" colspan="6">Hasil Ujian Test :</td></tr>
  </table>  
  <?php 
}
?>
  <br />
  <table id="masterDataTable" bgcolor="#d4d4d4" border="0" cellpadding="2" cellspacing="1" width="60%;">
	<tr><td style='text-align: center;' class="ThRows" nowrap="nowrap" colspan="<?php 
echo $t_count1;
Example #9
0
 public function executeShowApplicant()
 {
     $group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
     $c = new Criteria();
     $c->add(JobPeer::CODE, 'sm_book/listApplicant');
     $job = JobPeer::doSelectOne($c);
     $acl = AclPeer::retrieveByPK($group_id, $job->getId());
     $this->can_add = $acl->getAddPriv() == 1;
     $this->can_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $test_applicant = TestApplicantPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($test_applicant);
     $actions = array(array('name' => 'back', 'url' => 'sm_book/listApplicant', 'color' => 'black'));
     $this->actions = $actions;
     $this->test_applicant_detail = $test_applicant->getTestApplicantDetail();
     $this->test_applicant = $test_applicant;
     $this->subtitle = $test_applicant->toString() . ' - id:' . $test_applicant->getId();
 }
Example #10
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 #11
0
 public function executeUpdateLocation()
 {
     $params = array();
     foreach (explode('&', $this->getRequestParameter('student_list_ser')) as $p) {
         $p = explode('=', $p);
         $params[rawurldecode($p[0])][] = rawurldecode($p[1]);
     }
     $ts = TestSchedulePeer::retrieveByPK($this->getRequestParameter('id'));
     if (array_key_exists('students', $params)) {
         foreach ($params['students'] as $stu_id) {
             $stu = TestApplicantPeer::retrieveByPk($stu_id);
             $c = new Criteria();
             $c->add(TestApplSchedPeer::TEST_APPLICANT_ID, $stu->getId());
             $c->add(TestApplSchedPeer::TEST_SCHEDULE_ID, $ts->getId());
             $tas = TestApplSchedPeer::doSelectOne($c);
             $tas->setTestScheduleId($this->getRequestParameter('test_schedule_id'));
             $tas->setTestApplicantId($stu->getId());
             $tas->save();
         }
     }
     return $this->redirect('locate_test/listApplicant?id=' . $ts->getId());
 }