예제 #1
0
 public static function doSelectByAccal()
 {
     $student_course_id = sfContext::getInstance()->getRequest()->getParameter('id');
     $student_course = StudentCoursePeer::retrieveByPK($student_course_id);
     if ($student_course) {
         if (!$student_course->getSubjectAccal()) {
             return array();
         }
         $accal = $student_course->getSubjectAccal()->getAcademicCalendar();
     } else {
         $accal_id = sfContext::getInstance()->getRequest()->getParameter('accal_id');
         $accal = AcademicCalendarPeer::retrieveByPK($accal_id);
     }
     if ($accal == null) {
         return array();
     }
     $c = new Criteria();
     $c->addAscendingOrderByColumn(AcademicCalendarPeer::CODE);
     $c->addAscendingOrderByColumn(SubjectPeer::NAME);
     $c->addAscendingOrderByColumn(EmployeePeer::NAME);
     $c->addJoin(AcademicCalendarPeer::ID, SubjectAccalPeer::ACADEMIC_CALENDAR_ID);
     $c->addJoin(SubjectPeer::ID, SubjectAccalPeer::SUBJECT_ID);
     $c->addJoin(EmployeePeer::ID, SubjectAccalPeer::EMPLOYEE_ID);
     $c->add(SubjectAccalPeer::ACADEMIC_CALENDAR_ID, $accal->getId());
     $objs = SubjectAccalPeer::doSelect($c);
     return $objs;
 }
예제 #2
0
 public function executeList()
 {
     $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_edit = $acl->getEditPriv() == 1;
     $this->can_remove = $acl->getRemovePriv() == 1;
     $accal_id = $this->getRequestParameter('accal_id');
     $accal = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($accal);
     $this->accal = $accal;
     $c = new Criteria();
     $c->add(SubjectAccalPeer::ACADEMIC_CALENDAR_ID, $accal_id);
     $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(), 'subject_accal_s'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'subject_accal_s');
     $pager = new sfPropelPager('SubjectAccal', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'subject_accal_s'));
     $this->getUser()->setAttribute('page', $page, 'subject_accal_s');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array(array('name' => 'filter', 'color' => 'white'));
     if ($acl->getAddPriv()) {
         array_unshift($actions, array('name' => 'add', 'url' => 'subject_accal_s/create?accal_id=' . $accal_id, 'color' => 'green'));
     }
     $this->actions = $actions;
 }
예제 #3
0
 public function getAccal($departmentId)
 {
     $criteria = new Criteria();
     $criteria->add(AcademicCalendarPeer::DEPARTMENT_ID, $departmentId, Criteria::EQUAL);
     $criteria->add(AcademicCalendarPeer::COURSE_MODEL, 'C', Criteria::EQUAL);
     $criteria->add(AcademicCalendarPeer::CURR_SYSTEM_ID, '1', Criteria::EQUAL);
     $accal = AcademicCalendarPeer::doSelectOne($criteria);
     return $accal;
 }
예제 #4
0
파일: Employee.php 프로젝트: taryono/school
 public function getCustody()
 {
     $cr = new Criteria();
     $cr->add(AcademicCalendarPeer::DEPARTMENT_ID, $this->getDepartmentId());
     $cr->add(AcademicCalendarPeer::COURSE_MODEL, 'C');
     $cr->add(AcademicCalendarPeer::CURR_SYSTEM_ID, 1);
     $parent = AcademicCalendarPeer::doSelectOne($cr);
     $c = new Criteria();
     $c->add(CounselingTutorPeer::EMPLOYEE_ID, $this->getId());
     $c->addJoin(CounselingPeer::ID, CounselingTutorPeer::COUNSELING_ID);
     $c->add(CounselingPeer::ACADEMIC_CALENDAR_ID, $parent->getId());
     $custody = CounselingPeer::doSelectOne($c);
     return $custody;
 }
예제 #5
0
<tr>
	<td width="39%" valign="top">
	<!-- Course Schedule -->
	<table class="form">
	<tr><td class="form">
		<table class="form_content" width="100%">
			<tbody>
				<tr>
          				<td class='first' width="25%" style="vertical-align:top;"><label><?php 
echo __('Academic calendar');
?>
</label></td>
           				<td class="first" width="2%" style="text-align:center; vertical-align:top;">:</td>
					<td class="first" style="vertical-align:top;">
					<?php 
echo my_object_select_tag($course_schedule, 'getAcademicCalendarId', AcademicCalendarPeer::getParents(), array('include_blank' => true, 'related_class' => 'AcademicCalendar', 'text_method' => '__toString', 'peer_method' => 'doSelectFiltered'));
?>
            				<?php 
echo form_error('academic_calendar_id');
?>
            				</td>
        			</tr>
        
        			<tr>
        				<td style="vertical-align:middle;"><label><?php 
echo __('Class group');
?>
</label></td>
            				<td style="text-align:center; vertical-align:middle;">:</td>
					<td style="vertical-align:middle;">
					<?php 
예제 #6
0
 public function executePrintAll()
 {
     header('Cache-Control: no-cache, must-revalidate');
     header('Expires: Mon, 26 Jul 1997 05:00:00 GMT');
     header('Content-type: application/json', true);
     /* TODO: Optimize code without file_get_contents. Use save from sfDomPdf */
     /* Set Report Base Dir */
     $this->reportBaseDir = WWW_ROOT . '/report';
     /* Get Param */
     $time = $this->getRequestParameter('time');
     $time2 = $this->getRequestParameter('time2');
     $tgl = $this->getRequestParameter('tgl');
     $counseling_id = $this->getRequestParameter('counseling_id');
     $accal_id = $this->getRequestParameter('accal_id');
     $student_id = $this->getRequestParameter('student_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     /* Preparing Directory */
     /* WWW_ROOT/report/{accal_id}/{counseling_id}/{student_id} */
     $studentDir = $this->prepareReportDir($accal_id, $counseling_id, $student_id);
     /* Set Param */
     $param = "time={$time}&time2={$time2}&tgl={$tgl}&counseling_id={$counseling_id}&accal_id={$accal_id}&student_id={$student_id}";
     /* Set Prefix Filename */
     /* {accal_id}_{counseling_id}_{student_id}_{cover/register/final} */
     $prefixFilename = $accal_id . '_' . $counseling_id . '_' . $student_id . '_';
     /* Preparing zip file */
     $files_to_zip = array();
     /* Save Cover */
     $coverUrl = 'http://' . BASE_HREF . '/bo/' . SF_ENVFILE . '.php/counseling_sd/printCover/?' . $param;
     $cover = file_get_contents($coverUrl);
     $coverFilename = $prefixFilename . 'cover.pdf';
     $coverPath = $studentDir . '/' . $coverFilename;
     file_put_contents($coverPath, $cover);
     $files_to_zip[] = array('path' => $coverPath, 'filename' => $coverFilename);
     /* Save Register */
     $registerUrl = 'http://' . BASE_HREF . '/bo/' . SF_ENVFILE . '.php/counseling_sd/printRegister/?' . $param;
     $register = file_get_contents($registerUrl);
     $registerFilename = $prefixFilename . 'register.pdf';
     $registerPath = $studentDir . '/' . $registerFilename;
     file_put_contents($registerPath, $register);
     $files_to_zip[] = array('path' => $registerPath, 'filename' => $registerFilename);
     /* Save Final */
     if ($academic_calendar->getDepartment()->getCourseModel() == Department::CM_TK) {
         $finalUrl = 'http://' . BASE_HREF . '/bo/' . SF_ENVFILE . '.php/counseling_sd/printReport/?' . $param;
     } else {
         $finalUrl = 'http://' . BASE_HREF . '/bo/' . SF_ENVFILE . '.php/counseling_sd/printFinal/?' . $param;
     }
     $final = file_get_contents($finalUrl);
     $finalFilename = $prefixFilename . 'final.pdf';
     $finalPath = $studentDir . '/' . $finalFilename;
     file_put_contents($finalPath, $final);
     $files_to_zip[] = array('path' => $finalPath, 'filename' => $finalFilename);
     $result = $this->create_zip($files_to_zip, $studentDir . '/' . $prefixFilename . 'report.zip', true);
     $zipFile = 'http://' . BASE_HREF . '/bo/report/' . $accal_id . '/' . $counseling_id . '/' . $student_id . '/' . $prefixFilename . 'report.zip';
     $coverFile = 'http://' . BASE_HREF . '/bo/report/' . $accal_id . '/' . $counseling_id . '/' . $student_id . '/' . $prefixFilename . 'cover.pdf';
     $registerFile = 'http://' . BASE_HREF . '/bo/report/' . $accal_id . '/' . $counseling_id . '/' . $student_id . '/' . $prefixFilename . 'register.pdf';
     $finalFile = 'http://' . BASE_HREF . '/bo/report/' . $accal_id . '/' . $counseling_id . '/' . $student_id . '/' . $prefixFilename . 'final.pdf';
     $output = array('zip' => $zipFile, 'cover' => $coverFile, 'register' => $registerFile, 'final' => $finalFile, 'finalUrl' => $finalUrl);
     $this->jsonwrapper->print_json($output);
     die;
 }
예제 #7
0
echo include_partial('global/title', array('type' => 'list', 'title' => __('Admin Penilaian'), 'actions' => $actions, 'subtitle' => $subtitle . ($sf_request->haserrors() ? '<div class=form_error>* ' . __('_form_has_error_') . '</div>' : '')));
echo input_hidden_tag('employee_id', $employee->getid());
?>
    <table class="form" width="100%">
    <tr>
    <td class="form" style="vertical-align:top;">
            <table class="form_content" width="100%">
            <tbody>
                    <tr>
                            <td class='first' width="100%" style="vertical-align:top;">
                                    <label><?php 
echo __('Academic calendar');
?>
</label><br/>
                                            <?php 
echo my_object_select_tag($counseling, 'getAcademicCalendarId', AcademicCalendarPeer::getParents(), array('related_class' => 'AcademicCalendar', 'include_blank' => true, 'peer_method' => 'doSelectFiltered'));
?>
<br />
                                    <div class="tips">pilih tahun ajaran yang diinginkan</div>    
                            </td>
                    </tr>

                    <tr>
                            <td width="100%" class="first">
                                    <div id='subject_list' style="overflow: auto; width: 100%; height: 50em;"></div>
                                    <?php 
echo observe_field('academic_calendar_id', array('update' => 'subject_list', 'url' => 'score_admin/getSubject', 'with' => "'academic_calendar_id='+\$('academic_calendar_id').value+'&employee_id='+\$('employee_id').value+'&include_blank=true'", 'before' => "showIndicator('subject_list', 'snakebig_black');", 'complete' => "hideIndicator();"));
?>
                            </td>
                    </tr>			
예제 #8
0
                    
                    			<td>
					<b><?php 
        echo $counseling->getStudentCount() . ' Siswa';
        ?>
</b></td>
                    
                    			<?php 
        $c = new Criteria();
        $c->add(AcademicCalendarPeer::COURSE_MODEL, 'A');
        $c->add(AcademicCalendarPeer::PARENT, $counseling->getAcademicCalendarId());
        $accal1 = AcademicCalendarPeer::doSelectOne($c);
        $cw = new Criteria();
        $cw->add(AcademicCalendarPeer::COURSE_MODEL, 'B');
        $cw->add(AcademicCalendarPeer::PARENT, $counseling->getAcademicCalendarId());
        $accal2 = AcademicCalendarPeer::doSelectOne($cw);
        ?>
                    
                    			<!-- UTS -->
                    			<td style="text-align: center;" class="first">
                    			<?php 
        echo link_to_remote(image_tag('nilai.png', 'title=Rekap Nilai UTS Semester 1'), array('url' => 'counseling_menu/listUts?accal_id=' . $accal1->getId() . '&counseling_id=' . $counseling->getId() . '&employee_id=' . $employee_id, 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"));
        ?>
                    			</td>
                    
                    
                    			<td style="text-align: center;" class="first">
                    			<?php 
        echo link_to_remote(image_tag('nilai.png', 'title=Rekap Nilai UTS Semester 2'), array('url' => 'counseling_menu/listUts?accal_id=' . $accal2->getId() . '&counseling_id=' . $counseling->getId() . '&employee_id=' . $employee_id, 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"));
        ?>
                    			</td>
예제 #9
0
 public static function doSelectJoinAllExceptClassType(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     CounselingPeer::addSelectColumns($c);
     $startcol2 = CounselingPeer::NUM_COLUMNS - CounselingPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     EmployeePeer::addSelectColumns($c);
     $startcol3 = $startcol2 + EmployeePeer::NUM_COLUMNS;
     AcademicCalendarPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + AcademicCalendarPeer::NUM_COLUMNS;
     ClassGroupPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + ClassGroupPeer::NUM_COLUMNS;
     $c->addJoin(CounselingPeer::EMPLOYEE_ID, EmployeePeer::ID);
     $c->addJoin(CounselingPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $c->addJoin(CounselingPeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = CounselingPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = EmployeePeer::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->getEmployee();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addCounseling($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initCounselings();
             $obj2->addCounseling($obj1);
         }
         $omClass = AcademicCalendarPeer::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->getAcademicCalendar();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addCounseling($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initCounselings();
             $obj3->addCounseling($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->getClassGroup();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addCounseling($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initCounselings();
             $obj4->addCounseling($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
예제 #10
0
 public function executeListLeave()
 {
     $employee_id = $this->getRequestParameter('employee_id');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $accal_id = $this->getRequestParameter('academic_calendar_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $c = new Criteria();
     $c->add(EmployeePermitPeer::EMPLOYEE_ID, $employee->getId(), Criteria::IN);
     $c->add(EmployeePermitPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
     $this->sortPermit($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->filterPermit($c, $this->getRequestParameter('filters'));
             }
         }
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'employee_permit'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'employee_permit');
     $pager = new sfPropelPager('EmployeePermit', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'employee_permit'));
     $this->getUser()->setAttribute('page', $page, 'employee_permit');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array();
     $filter_string = "";
     if ($this->filters) {
         foreach ($this->filters as $key => $val) {
             $filter_string .= "&filters[{$key}]={$val}";
         }
         $filter_string = preg_replace('/^&/', '', $filter_string);
     }
     array_unshift($actions, array('name' => 'Print Excel', 'url' => "employee_permit_recapt/listLeaveAsCSV?{$filter_string}&employee_id=" . $employee->getId() . "&academic_calendar_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => 'Print PDF', 'url' => "employee_permit_recapt/listLeaveAsPDF?{$filter_string}&employee_id=" . $employee->getId() . "&academic_calendar_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct'));
     $this->actions = $actions;
     $this->subtitle = $employee->toString();
     $this->employee = $employee;
     $this->academic_calendar = $academic_calendar;
     $actions2 = array(array('name' => '<span>Rekap Cuti</span>', 'url' => 'employee_permit_recapt/list', 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Detail Cuti</span>', 'url' => 'employee_permit_recapt/listLeave?employee_id=' . $employee->getId() . '&academic_calendar_id=' . $academic_calendar->getId(), 'color' => 'sun', 'type' => 'direct'));
     $this->actions2 = $actions2;
 }
예제 #11
0
 public function executeSave()
 {
     $counseling_id = $this->getRequestParameter('counseling_id');
     $counseling = CounselingPeer::retrieveByPK($counseling_id);
     $this->forward404Unless($counseling);
     $term = $this->getRequestParameter('term');
     $accal_id = $this->getRequestParameter('academic_calendar_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $employee_id = $this->getRequestParameter('employee_id');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $descs = $this->getRequestParameter('desc');
     foreach ($descs as $m => $desc) {
         if ($desc != null) {
             if ($desc != '-') {
                 $ced = new Criteria();
                 $ced->add(StudentDescPeer::STUDENT_ACCAL_ID, $m);
                 $ced->add(StudentDescPeer::TERM, $term);
                 $spec = StudentDescPeer::doSelectOne($ced);
                 if ($spec == null) {
                     $spec = new StudentDesc();
                 }
                 $spec->setStudentAccalId($m);
                 $spec->setTerm($term);
                 $spec->setNote($desc);
                 $spec->save();
             } else {
                 $ced = new Criteria();
                 $ced->add(StudentDescPeer::STUDENT_ACCAL_ID, $m);
                 $ced->add(StudentDescPeer::TERM, $term);
                 $spec = StudentDescPeer::doSelectOne($ced);
                 if ($spec != null) {
                     $spec->delete();
                 }
             }
         }
     }
     return $this->redirect('course_tk/listScore?accal_id=' . $academic_calendar->getId() . '&term=' . $term . '&counseling_id=' . $counseling->getId() . '&employee_id=' . $employee_id);
 }
예제 #12
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;
 }
예제 #13
0
 public function executeSaveCopy()
 {
     $accal_tujuan = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal1'));
     $accal_asal = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal2'));
     $params = array();
     foreach (explode('&', $this->getRequestParameter('ekskul_list_ser')) as $p) {
         $p = explode('=', $p);
         $params[rawurldecode($p[0])][] = rawurldecode($p[1]);
     }
     if (array_key_exists('ekskuls', $params)) {
         foreach ($params['ekskuls'] as $ekskul_id) {
             $sc = SchedulePeer::retrieveByPK($ekskul_id);
             $cw = new Criteria();
             $cw->add(ScheduleDetailPeer::SCHEDULE_ID, $sc->getId());
             $sc_details = ScheduleDetailPeer::doSelect($cw);
             $cd = new Criteria();
             $cd->add(ScheduleTutorPeer::SCHEDULE_ID, $sc->getId());
             $sc_tutors = ScheduleTutorPeer::doSelect($cd);
             $schedule = new Schedule();
             $schedule->setGradeComponentId($sc->getGradeComponentId());
             $schedule->setAcademicCalendarId($accal_tujuan->getId());
             $schedule->setType(2);
             $schedule->setEmployeeId($sc->getEmployeeId());
             $schedule->save();
             foreach ($sc_details as $sc_detail) {
                 $schedule_detail = new ScheduleDetail();
                 $schedule_detail->setSchedule($schedule);
                 $schedule_detail->setLocationId($sc_detail->getLocationId());
                 $schedule_detail->setClassSessionId($sc_detail->getClassSessionId());
                 $schedule_detail->setDay($sc_detail->getDay());
                 $schedule_detail->save();
                 $cb = new Criteria();
                 $cb->add(StudentRaportPeer::GRADE_COMPONENT_ID, $sc->getGradeComponentId());
                 $cb->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $sc->getAcademicCalendarId());
                 $cb->add(StudentRaportPeer::SCHEDULE_DETAIL_ID, $sc_detail->getId());
                 $cb->add(StudentRaportPeer::SCHEDULE_ID, $sc->getId());
                 $stu_raports = StudentRaportPeer::doSelect($cb);
                 foreach ($stu_raports as $stu_raport) {
                     $sr = new StudentRaport();
                     $sr->setStudentId($stu_raport->getStudentId());
                     $sr->setAcademicCalendarId($accal_tujuan->getId());
                     $sr->setGradeComponentId($sc->getGradeComponentId());
                     $sr->setClassGroupId($sc->getClassGroupId());
                     $sr->setSchedule($schedule);
                     $sr->setScheduleDetail($schedule_detail);
                     $sr->save();
                 }
             }
             foreach ($sc_tutors as $sc_tutor) {
                 $schedule_tutor = new ScheduleTutor();
                 $schedule_tutor->setSchedule($schedule);
                 $schedule_tutor->setEmployeeId($sc_tutor->getEmployeeId());
                 $schedule_tutor->save();
             }
         }
     }
     return $this->redirect('extracurricular/list');
 }
예제 #14
0
 public static function doSelectJoinAllExceptGradeComponent(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     SchedulePeer::addSelectColumns($c);
     $startcol2 = SchedulePeer::NUM_COLUMNS - SchedulePeer::NUM_LAZY_LOAD_COLUMNS + 1;
     SubjectCurrPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + SubjectCurrPeer::NUM_COLUMNS;
     EmployeePeer::addSelectColumns($c);
     $startcol4 = $startcol3 + EmployeePeer::NUM_COLUMNS;
     ClassGroupPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + ClassGroupPeer::NUM_COLUMNS;
     LocationPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + LocationPeer::NUM_COLUMNS;
     ClassSessionPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + ClassSessionPeer::NUM_COLUMNS;
     AcademicCalendarPeer::addSelectColumns($c);
     $startcol8 = $startcol7 + AcademicCalendarPeer::NUM_COLUMNS;
     GradeSpecPeer::addSelectColumns($c);
     $startcol9 = $startcol8 + GradeSpecPeer::NUM_COLUMNS;
     $c->addJoin(SchedulePeer::SUBJECT_CURR_ID, SubjectCurrPeer::ID);
     $c->addJoin(SchedulePeer::EMPLOYEE_ID, EmployeePeer::ID);
     $c->addJoin(SchedulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
     $c->addJoin(SchedulePeer::LOCATION_ID, LocationPeer::ID);
     $c->addJoin(SchedulePeer::CLASS_SESSION_ID, ClassSessionPeer::ID);
     $c->addJoin(SchedulePeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $c->addJoin(SchedulePeer::GRADE_SPEC_ID, GradeSpecPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = SchedulePeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = SubjectCurrPeer::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->getSubjectCurr();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addSchedule($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initSchedules();
             $obj2->addSchedule($obj1);
         }
         $omClass = EmployeePeer::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->getEmployee();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addSchedule($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initSchedules();
             $obj3->addSchedule($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->getClassGroup();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addSchedule($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initSchedules();
             $obj4->addSchedule($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->addSchedule($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initSchedules();
             $obj5->addSchedule($obj1);
         }
         $omClass = ClassSessionPeer::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->getClassSession();
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addSchedule($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initSchedules();
             $obj6->addSchedule($obj1);
         }
         $omClass = AcademicCalendarPeer::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->getAcademicCalendar();
             if ($temp_obj7->getPrimaryKey() === $obj7->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj7->addSchedule($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj7->initSchedules();
             $obj7->addSchedule($obj1);
         }
         $omClass = GradeSpecPeer::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->getGradeSpec();
             if ($temp_obj8->getPrimaryKey() === $obj8->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj8->addSchedule($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj8->initSchedules();
             $obj8->addSchedule($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
예제 #15
0
?>

<table class="form">
<tr><td class="form">
	<table class="form_content" width="100%">
	<tbody>
		<tr>
          	<td class='first' width="20%" style="vertical-align:top;"><label><?php 
echo __('Academic calendar');
?>
</label></td>
           	<td class="first" width="2%" style="text-align:center; vertical-align:top;">:</td>
			<td class="first" colspan="4" style="vertical-align:top;">
			<p class="detail" style="font-weight: bold;">
			<?php 
echo $accal_id ? AcademicCalendarPeer::retrieveByPk($accal_id)->getName() : '-';
?>
</p>
            <?php 
echo input_hidden_tag('academic_calendar_id', $accal_id);
?>
            </td>
        </tr>
        
        <tr>
        	<td width="20%" style="vertical-align:middle;"><label><?php 
echo __('Class group');
?>
</label></td>
            <td width="2%" style="text-align:center; vertical-align:middle;">:</td>
			<td style="vertical-align:middle;" width="28%">
예제 #16
0
 public static function doSelectJoinAllExceptClassGroup(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     VStudentCoursePeer::addSelectColumns($c);
     $startcol2 = VStudentCoursePeer::NUM_COLUMNS - VStudentCoursePeer::NUM_LAZY_LOAD_COLUMNS + 1;
     StudentPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + StudentPeer::NUM_COLUMNS;
     SubjectAccalPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + SubjectAccalPeer::NUM_COLUMNS;
     SubjectCurrPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + SubjectCurrPeer::NUM_COLUMNS;
     AcademicCalendarPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + AcademicCalendarPeer::NUM_COLUMNS;
     $c->addJoin(VStudentCoursePeer::STUDENT_ID, StudentPeer::ID);
     $c->addJoin(VStudentCoursePeer::SUBJECT_ACCAL_ID, SubjectAccalPeer::ID);
     $c->addJoin(VStudentCoursePeer::SUBJECT_CURR_ID, SubjectCurrPeer::ID);
     $c->addJoin(VStudentCoursePeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = VStudentCoursePeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = StudentPeer::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->getStudent();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addVStudentCourse($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initVStudentCourses();
             $obj2->addVStudentCourse($obj1);
         }
         $omClass = SubjectAccalPeer::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->getSubjectAccal();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addVStudentCourse($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initVStudentCourses();
             $obj3->addVStudentCourse($obj1);
         }
         $omClass = SubjectCurrPeer::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->getSubjectCurr();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addVStudentCourse($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initVStudentCourses();
             $obj4->addVStudentCourse($obj1);
         }
         $omClass = AcademicCalendarPeer::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->getAcademicCalendar();
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addVStudentCourse($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initVStudentCourses();
             $obj5->addVStudentCourse($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
예제 #17
0
 public function executeEdit()
 {
     $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;
     $class_agenda = ClassAgendaPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($class_agenda);
     $this->subtitle = '';
     if (sfContext::getInstance()->getUser()->getAttribute('usertype', null, 'bo') == 'lector') {
         $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
         $employee = EmployeePeer::retrieveByPK($employee_id);
         $this->forward404Unless($employee);
         $this->subtitle = $employee->toString();
         $this->employee_id = $employee_id;
     }
     $accal_options = array();
     $c = new Criteria();
     $dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
     $c->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
     $c->addDescendingOrderByColumn(AcademicCalendarPeer::CODE);
     $accals = AcademicCalendarPeer::doSelect($c);
     foreach ($accals as $accal) {
         if ($accal->getParent() != null) {
             $accal_options[$accal->getId()] = '&middot;&nbsp;&nbsp;' . $accal->toString();
         } else {
             $accal_options[$accal->getId()] = $accal->toString();
         }
     }
     $this->accal_options = $accal_options;
     $this->actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'cancel', 'url' => 'agenda/list', 'color' => 'black'));
     $this->subtitle = '';
     $this->type = 'add';
     $this->class_agenda = $class_agenda;
     $c = new Criteria();
     $c->add(SubjectGradingPeer::SUBJECT_CURR_ID, $class_agenda->getCourseSchedule()->getSubjectCurrId(), Criteria::IN);
     $c->addAscendingOrderByColumn(SubjectGradingPeer::ID);
     $objs = SubjectGradingPeer::doSelect($c);
     $grades = array();
     foreach ($objs as $o) {
         $grades[$o->getId()] = $o->getGradeComponent()->toString();
     }
     $this->grades = $grades;
     $this->selected_grade = $class_agenda->getSubjectGradingId();
     $scheds_options = array();
     $c = new Criteria();
     $c->add(CourseScheduleTutorPeer::EMPLOYEE_ID, $employee_id, Criteria::IN);
     $c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $class_agenda->getCourseSchedule()->getAcademicCalendarId(), Criteria::IN);
     $c->addJoin(CourseSchedulePeer::ID, CourseScheduleTutorPeer::COURSE_SCHEDULE_ID);
     $c->addJoin(CourseScheduleDetailPeer::COURSE_SCHEDULE_ID, CourseSchedulePeer::ID);
     $c->addAscendingOrderByColumn(CourseScheduleDetailPeer::CLASS_SESSION_ID);
     $csds = CourseScheduleDetailPeer::doSelect($c);
     foreach ($csds as $csd) {
         $scheds_options[$csd->getCourseScheduleId()] = $csd->getCourseSchedule()->getSubjectCurr()->getSubject()->getName() . ' # ' . $csd->getCourseSchedule()->getClassGroup()->getName();
     }
     $this->scheds = $scheds_options;
     $this->selected_sched = $class_agenda->getCourseScheduleId();
     $c = new Criteria();
     $cton4 = $c->getNewCriterion(StudentAbsencePeer::END, $class_agenda->getDate(), Criteria::IN);
     $cton3 = $c->getNewCriterion(StudentAbsencePeer::START, $class_agenda->getDate(), Criteria::IN);
     $cton2 = $c->getNewCriterion(StudentAbsencePeer::ACADEMIC_CALENDAR_ID, $class_agenda->getCourseSchedule()->getAcademicCalendarId(), Criteria::IN);
     $cton1 = $c->getNewCriterion(StudentAbsencePeer::CLASS_GROUP_ID, $class_agenda->getClassGroupId(), Criteria::IN);
     $cton3->addOr($cton4);
     $cton2->addAnd($cton3);
     $cton1->addAnd($cton2);
     $c->add($cton1);
     $this->student_absences = StudentAbsencePeer::doSelect($c);
     $this->stu_count = StudentAbsencePeer::doCount($c);
 }
예제 #18
0
 public static function doSelectJoinAllExceptLeaveType(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     EmployeeLeavePeer::addSelectColumns($c);
     $startcol2 = EmployeeLeavePeer::NUM_COLUMNS - EmployeeLeavePeer::NUM_LAZY_LOAD_COLUMNS + 1;
     EmployeePeer::addSelectColumns($c);
     $startcol3 = $startcol2 + EmployeePeer::NUM_COLUMNS;
     DepartmentPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + DepartmentPeer::NUM_COLUMNS;
     AcademicCalendarPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + AcademicCalendarPeer::NUM_COLUMNS;
     EmployeeLevelPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + EmployeeLevelPeer::NUM_COLUMNS;
     EmployeeDivisionPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + EmployeeDivisionPeer::NUM_COLUMNS;
     $c->addJoin(EmployeeLeavePeer::EMPLOYEE_ID, EmployeePeer::ID);
     $c->addJoin(EmployeeLeavePeer::DEPARTMENT_ID, DepartmentPeer::ID);
     $c->addJoin(EmployeeLeavePeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $c->addJoin(EmployeeLeavePeer::EMPLOYEE_LEVEL_ID, EmployeeLevelPeer::ID);
     $c->addJoin(EmployeeLeavePeer::EMPLOYEE_DIVISION_ID, EmployeeDivisionPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = EmployeeLeavePeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = EmployeePeer::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->getEmployee();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addEmployeeLeave($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initEmployeeLeaves();
             $obj2->addEmployeeLeave($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->addEmployeeLeave($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initEmployeeLeaves();
             $obj3->addEmployeeLeave($obj1);
         }
         $omClass = AcademicCalendarPeer::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->getAcademicCalendar();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addEmployeeLeave($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initEmployeeLeaves();
             $obj4->addEmployeeLeave($obj1);
         }
         $omClass = EmployeeLevelPeer::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->getEmployeeLevel();
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addEmployeeLeave($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initEmployeeLeaves();
             $obj5->addEmployeeLeave($obj1);
         }
         $omClass = EmployeeDivisionPeer::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->getEmployeeDivision();
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addEmployeeLeave($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initEmployeeLeaves();
             $obj6->addEmployeeLeave($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
예제 #19
0
 public function filterCounseling($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         if ($key == 'NAME') {
             $c->addJoin(ClassCounselingPeer::STUDENT_ID, StudentPeer::ID);
             $column = StudentPeer::getTableMap()->getColumn('NAME');
         } elseif ($key == 'CODE') {
             $c->addJoin(ClassCounselingPeer::STUDENT_ID, StudentPeer::ID);
             $column = StudentPeer::getTableMap()->getColumn('CODE');
         } elseif ($key == 'CODE2') {
             $c->addJoin(ClassCounselingPeer::STUDENT_ID, StudentPeer::ID);
             $column = StudentPeer::getTableMap()->getColumn('CODE2');
         } elseif ($key == 'YEAR') {
             $c->addJoin(ClassCounselingPeer::STUDENT_ID, StudentPeer::ID);
             $column = StudentPeer::getTableMap()->getColumn('YEAR');
         } elseif ($key == 'SUBJECT_NAME') {
             $c->addJoin(ClassCounselingPeer::COURSE_SCHEDULE_ID, CourseSchedulePeer::ID);
             $c->addJoin(CourseSchedulePeer::SUBJECT_CURR_ID, SubjectCurrPeer::ID);
             $c->addJoin(SubjectCurrPeer::SUBJECT_ID, SubjectPeer::ID);
             $column = SubjectPeer::getTableMap()->getColumn('NAME');
         } elseif ($key == 'ACADEMIC_CALENDAR_ID') {
             $c->addJoin(ClassCounselingPeer::COURSE_SCHEDULE_ID, CourseSchedulePeer::ID);
             $c->addJoin(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
             $column = AcademicCalendarPeer::getTableMap()->getColumn('ID');
         } elseif ($key == 'CLASS_NAME') {
             $c->addJoin(ClassCounselingPeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
             $column = ClassGroupPeer::getTableMap()->getColumn('NAME');
         } else {
             $column = ClassCounselingPeer::getTableMap()->getColumn($key);
         }
         $name = $column->getFullyQualifiedName();
         $creoleType = $column->getCreoleType();
         if ($creoleType == CreoleTypes::TIMESTAMP) {
             $c->add($name, $value, Criteria::LIKE);
         } else {
             if ($creoleType == CreoleTypes::DATE) {
                 $c->add($name, $value, Criteria::LIKE);
             } else {
                 if ($creoleType == CreoleTypes::INTEGER) {
                     $c->add($name, $value, Criteria::EQUAL);
                 } else {
                     if ($creoleType == CreoleTypes::VARCHAR || $creoleType == CreoleTypes::CHAR) {
                         $c->add($name, "%{$value}%", Criteria::LIKE);
                     }
                 }
             }
         }
     }
 }
예제 #20
0
					
                		</tr>
				<tr class="list" id='filter' <?php 
if (!isset($filters)) {
    echo 'style=""';
}
?>
>
					<td class='filter'><?php 
echo submit_image_tag('/images/magnifier.png', array('class' => 'sort', 'onclick' => "blur();"));
?>
</td>
					
                    			<td class='filter_first'>
					<?php 
echo my_object_select_tag(isset($filters['ACADEMIC_CALENDAR_ID']) ? $filters['ACADEMIC_CALENDAR_ID'] : null, null, AcademicCalendarPeer::getParents(), array('include_blank' => true, 'related_class' => 'AcademicCalendar', 'text_method' => '__toString', 'control_name' => 'filters[ACADEMIC_CALENDAR_ID]', 'peer_method' => 'doSelectFiltered', 'style' => 'width: 80px;'));
?>
					</td>
					
					<td class='filter'><?php 
echo input_date_tag('filters[DATE]', isset($filters['DATE']) ? $filters['DATE'] : null, array('rich' => true, 'calendar_button_img' => '/images/calendar.gif'));
?>
</td>
                    
					<td class='filter'>
					<?php 
echo input_tag('filters[SUBJECT_NAME]', isset($filters['SUBJECT_NAME']) ? $filters['SUBJECT_NAME'] : null, array('size' => 15));
?>
</td>
					
                    			<td class='filter'>
예제 #21
0
 public static function doSelectJoinAllExceptDepartment(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     LocationPeer::addSelectColumns($c);
     $startcol2 = LocationPeer::NUM_COLUMNS - LocationPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     LocationCategoryPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + LocationCategoryPeer::NUM_COLUMNS;
     LocationConditionPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + LocationConditionPeer::NUM_COLUMNS;
     AcademicCalendarPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + AcademicCalendarPeer::NUM_COLUMNS;
     $c->addJoin(LocationPeer::LOCATION_CATEGORY_ID, LocationCategoryPeer::ID);
     $c->addJoin(LocationPeer::LOCATION_CONDITION_ID, LocationConditionPeer::ID);
     $c->addJoin(LocationPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = LocationPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = LocationCategoryPeer::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->getLocationCategory();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addLocation($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initLocations();
             $obj2->addLocation($obj1);
         }
         $omClass = LocationConditionPeer::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->getLocationCondition();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addLocation($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initLocations();
             $obj3->addLocation($obj1);
         }
         $omClass = AcademicCalendarPeer::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->getAcademicCalendar();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addLocation($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initLocations();
             $obj4->addLocation($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
예제 #22
0
 public static function doSelectJoinAllExceptCountry(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     TestApplicantDetailPeer::addSelectColumns($c);
     $startcol2 = TestApplicantDetailPeer::NUM_COLUMNS - TestApplicantDetailPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     RegionPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + RegionPeer::NUM_COLUMNS;
     ReligionPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + ReligionPeer::NUM_COLUMNS;
     AcademicCalendarPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + AcademicCalendarPeer::NUM_COLUMNS;
     $c->addJoin(TestApplicantDetailPeer::REGION_ID, RegionPeer::ID);
     $c->addJoin(TestApplicantDetailPeer::RELIGION_ID, ReligionPeer::ID);
     $c->addJoin(TestApplicantDetailPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = TestApplicantDetailPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = RegionPeer::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->getRegion();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addTestApplicantDetail($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initTestApplicantDetails();
             $obj2->addTestApplicantDetail($obj1);
         }
         $omClass = ReligionPeer::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->getReligion();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addTestApplicantDetail($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initTestApplicantDetails();
             $obj3->addTestApplicantDetail($obj1);
         }
         $omClass = AcademicCalendarPeer::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->getAcademicCalendar();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addTestApplicantDetail($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initTestApplicantDetails();
             $obj4->addTestApplicantDetail($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
예제 #23
0
 public static function doSelectJoinAllExceptMonth(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     AccalPeriodPeer::addSelectColumns($c);
     $startcol2 = AccalPeriodPeer::NUM_COLUMNS - AccalPeriodPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     AcademicCalendarPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + AcademicCalendarPeer::NUM_COLUMNS;
     $c->addJoin(AccalPeriodPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = AccalPeriodPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = AcademicCalendarPeer::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->getAcademicCalendar();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addAccalPeriod($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initAccalPeriods();
             $obj2->addAccalPeriod($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
예제 #24
0
 public function filterPayment($c, $filters)
 {
     $filters_key = array_keys($filters);
     foreach ($filters_key as $key) {
         $value = $filters[$key];
         if ($value == '' || $value == null) {
             continue;
         }
         if ($key == 'ACADEMIC_COST_COMPONENT_ID') {
             $c->addJoin(AcademicCostPeer::ACADEMIC_COST_COMPONENT_ID, AcademicCostComponentPeer::ID);
             $c->addJoin(PaymentJournalPeer::ACADEMIC_COST_ID, AcademicCostPeer::ID);
             $column = AcademicCostPeer::getTableMap()->getColumn($key);
         } elseif ($key == 'YEAR') {
             $c->addJoin(AcademicCalendarPeer::ID, StudentPeer::ACADEMIC_CALENDAR_ID);
             $c->addJoin(PaymentJournalPeer::PAYER, StudentPeer::ID);
             $column = AcademicCalendarPeer::getTableMap()->getColumn('NAME');
         } else {
             $column = PaymentJournalPeer::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 || $creoleType == CreoleTypes::CHAR) {
                 $c->add($name, $value, Criteria::EQUAL);
             } else {
                 if ($creoleType == CreoleTypes::VARCHAR) {
                     $c->add($name, "%{$value}%", Criteria::LIKE);
                 }
             }
         }
     }
 }
예제 #25
0
 public static function doSelectJoinAllExceptBankAccount(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     VAcademicCostTaPeer::addSelectColumns($c);
     $startcol2 = VAcademicCostTaPeer::NUM_COLUMNS - VAcademicCostTaPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     AcademicCalendarPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + AcademicCalendarPeer::NUM_COLUMNS;
     AcademicCostComponentPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + AcademicCostComponentPeer::NUM_COLUMNS;
     AcademicProcessPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + AcademicProcessPeer::NUM_COLUMNS;
     $c->addJoin(VAcademicCostTaPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $c->addJoin(VAcademicCostTaPeer::ACADEMIC_COST_COMPONENT_ID, AcademicCostComponentPeer::ID);
     $c->addJoin(VAcademicCostTaPeer::ACADEMIC_PROCESS_ID, AcademicProcessPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = VAcademicCostTaPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = AcademicCalendarPeer::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->getAcademicCalendar();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addVAcademicCostTa($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initVAcademicCostTas();
             $obj2->addVAcademicCostTa($obj1);
         }
         $omClass = AcademicCostComponentPeer::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->getAcademicCostComponent();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addVAcademicCostTa($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initVAcademicCostTas();
             $obj3->addVAcademicCostTa($obj1);
         }
         $omClass = AcademicProcessPeer::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->getAcademicProcess();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addVAcademicCostTa($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initVAcademicCostTas();
             $obj4->addVAcademicCostTa($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
예제 #26
0
 public static function doSelectJoinAllExceptStudentDetail(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     VMemberStudentPeer::addSelectColumns($c);
     $startcol2 = VMemberStudentPeer::NUM_COLUMNS - VMemberStudentPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     MemberDetailPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + MemberDetailPeer::NUM_COLUMNS;
     DepartmentPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + DepartmentPeer::NUM_COLUMNS;
     AcademicCalendarPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + AcademicCalendarPeer::NUM_COLUMNS;
     ClassGroupPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + ClassGroupPeer::NUM_COLUMNS;
     StudentPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + StudentPeer::NUM_COLUMNS;
     $c->addJoin(VMemberStudentPeer::MEMBER_DETAIL_ID, MemberDetailPeer::ID);
     $c->addJoin(VMemberStudentPeer::DEPARTMENT_ID, DepartmentPeer::ID);
     $c->addJoin(VMemberStudentPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $c->addJoin(VMemberStudentPeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
     $c->addJoin(VMemberStudentPeer::STUDENT_ID, StudentPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = VMemberStudentPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = MemberDetailPeer::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->getMemberDetail();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addVMemberStudent($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initVMemberStudents();
             $obj2->addVMemberStudent($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->addVMemberStudent($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initVMemberStudents();
             $obj3->addVMemberStudent($obj1);
         }
         $omClass = AcademicCalendarPeer::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->getAcademicCalendar();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addVMemberStudent($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initVMemberStudents();
             $obj4->addVMemberStudent($obj1);
         }
         $omClass = ClassGroupPeer::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->getClassGroup();
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addVMemberStudent($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initVMemberStudents();
             $obj5->addVMemberStudent($obj1);
         }
         $omClass = StudentPeer::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->getStudent();
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addVMemberStudent($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initVMemberStudents();
             $obj6->addVMemberStudent($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
예제 #27
0
 public function getAcademicCalendar($con = null)
 {
     include_once 'lib/model/om/BaseAcademicCalendarPeer.php';
     if ($this->aAcademicCalendar === null && $this->academic_calendar_id !== null) {
         $this->aAcademicCalendar = AcademicCalendarPeer::retrieveByPK($this->academic_calendar_id, $con);
     }
     return $this->aAcademicCalendar;
 }
예제 #28
0
 public static function doSelectJoinAllExceptEmployee(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     AbsenceEkskulPeer::addSelectColumns($c);
     $startcol2 = AbsenceEkskulPeer::NUM_COLUMNS - AbsenceEkskulPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     StudentPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + StudentPeer::NUM_COLUMNS;
     AcademicCalendarPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + AcademicCalendarPeer::NUM_COLUMNS;
     ClassGroupPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + ClassGroupPeer::NUM_COLUMNS;
     SchedulePeer::addSelectColumns($c);
     $startcol6 = $startcol5 + SchedulePeer::NUM_COLUMNS;
     ScheduleDetailPeer::addSelectColumns($c);
     $startcol7 = $startcol6 + ScheduleDetailPeer::NUM_COLUMNS;
     GradeComponentPeer::addSelectColumns($c);
     $startcol8 = $startcol7 + GradeComponentPeer::NUM_COLUMNS;
     $c->addJoin(AbsenceEkskulPeer::STUDENT_ID, StudentPeer::ID);
     $c->addJoin(AbsenceEkskulPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
     $c->addJoin(AbsenceEkskulPeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
     $c->addJoin(AbsenceEkskulPeer::SCHEDULE_ID, SchedulePeer::ID);
     $c->addJoin(AbsenceEkskulPeer::SCHEDULE_DETAIL_ID, ScheduleDetailPeer::ID);
     $c->addJoin(AbsenceEkskulPeer::GRADE_COMPONENT_ID, GradeComponentPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = AbsenceEkskulPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = StudentPeer::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->getStudent();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addAbsenceEkskul($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initAbsenceEkskuls();
             $obj2->addAbsenceEkskul($obj1);
         }
         $omClass = AcademicCalendarPeer::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->getAcademicCalendar();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addAbsenceEkskul($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initAbsenceEkskuls();
             $obj3->addAbsenceEkskul($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->getClassGroup();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addAbsenceEkskul($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initAbsenceEkskuls();
             $obj4->addAbsenceEkskul($obj1);
         }
         $omClass = SchedulePeer::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->getSchedule();
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addAbsenceEkskul($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initAbsenceEkskuls();
             $obj5->addAbsenceEkskul($obj1);
         }
         $omClass = ScheduleDetailPeer::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->getScheduleDetail();
             if ($temp_obj6->getPrimaryKey() === $obj6->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj6->addAbsenceEkskul($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj6->initAbsenceEkskuls();
             $obj6->addAbsenceEkskul($obj1);
         }
         $omClass = GradeComponentPeer::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->getGradeComponent();
             if ($temp_obj7->getPrimaryKey() === $obj7->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj7->addAbsenceEkskul($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj7->initAbsenceEkskuls();
             $obj7->addAbsenceEkskul($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }
예제 #29
0
 public function executePrintCounseling()
 {
     $counseling_id = $this->getRequestParameter('counseling_id');
     $counseling = CounselingPeer::retrieveByPK($counseling_id);
     $this->forward404Unless($counseling);
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($this->getRequestParameter('accal_id'));
     $this->forward404Unless($academic_calendar);
     $time = $this->getRequestParameter('time');
     $time2 = $this->getRequestParameter('time2');
     $tgl = $this->getRequestParameter('tgl_cetak');
     $c = new Criteria();
     $c->add(TempTablePeer::COUNSELING_ID, $counseling->getId());
     $c->add(TempTablePeer::TIME, $time);
     $c->addJoin(VStudentActivePeer::ID, TempTablePeer::STUDENT_ID);
     $c->addAscendingOrderByColumn(VStudentActivePeer::CLASS_NAME);
     $students = VStudentActivePeer::doSelect($c);
     $this->forward404Unless($students);
     $ce = new Criteria();
     $ce->add(DepartmentDetailPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId());
     $this->department_detail = DepartmentDetailPeer::doSelectOne($ce);
     $c = new Criteria();
     $c->add(CounselingSpecPeer::PARENT, 0);
     $c->addAscendingOrderByColumn(CounselingSpecPeer::ID);
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'counseling_spec'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'counseling_spec');
     $pager = new sfPropelPager('CounselingSpec', $rpp);
     $pager->setPeerMethod('doSelectOrdered');
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'counseling_spec'));
     $this->getUser()->setAttribute('page', $page, 'counseling_spec');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     ## Menentukan Aturan Penilaian
     $cd = new Criteria();
     $cd->add(ClassGroupPeer::DEPARTMENT_ID, $counseling->getAcademicCalendar()->getDepartmentId());
     $cd->addJoin(ScoreRulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
     $cd->add(ScoreRulePeer::TYPE, 6);
     $score_rule = ScoreRulePeer::doSelectOne($cd);
     $this->score_rule = $score_rule;
     $this->students = $students;
     $this->subtitle = '';
     $this->counseling = $counseling;
     $this->tanggal = $time;
     $this->tgl_cetak = $tgl;
     $this->time2 = $time2;
     $this->academic_calendar = $academic_calendar;
     $this->papersize = 'a4';
     $this->orientation = 'portrait';
     $this->setViewClass('sfDomPDF');
 }
예제 #30
0
 public static function doSelectJoinAllExceptDepartment(Criteria $c, $con = null)
 {
     $c = clone $c;
     if ($c->getDbName() == Propel::getDefaultDB()) {
         $c->setDbName(self::DATABASE_NAME);
     }
     VAcademicCalendarPeer::addSelectColumns($c);
     $startcol2 = VAcademicCalendarPeer::NUM_COLUMNS - VAcademicCalendarPeer::NUM_LAZY_LOAD_COLUMNS + 1;
     AcademicCalendarPeer::addSelectColumns($c);
     $startcol3 = $startcol2 + AcademicCalendarPeer::NUM_COLUMNS;
     CurriculumPeer::addSelectColumns($c);
     $startcol4 = $startcol3 + CurriculumPeer::NUM_COLUMNS;
     ClassGroupPeer::addSelectColumns($c);
     $startcol5 = $startcol4 + ClassGroupPeer::NUM_COLUMNS;
     CurrSystemPeer::addSelectColumns($c);
     $startcol6 = $startcol5 + CurrSystemPeer::NUM_COLUMNS;
     $c->addJoin(VAcademicCalendarPeer::PARENT, AcademicCalendarPeer::ID);
     $c->addJoin(VAcademicCalendarPeer::CURRICULUM_ID, CurriculumPeer::ID);
     $c->addJoin(VAcademicCalendarPeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
     $c->addJoin(VAcademicCalendarPeer::CURR_SYSTEM_ID, CurrSystemPeer::ID);
     $rs = BasePeer::doSelect($c, $con);
     $results = array();
     while ($rs->next()) {
         $omClass = VAcademicCalendarPeer::getOMClass();
         $cls = Propel::import($omClass);
         $obj1 = new $cls();
         $obj1->hydrate($rs);
         $omClass = AcademicCalendarPeer::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->getAcademicCalendar();
             if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj2->addVAcademicCalendar($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj2->initVAcademicCalendars();
             $obj2->addVAcademicCalendar($obj1);
         }
         $omClass = CurriculumPeer::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->getCurriculum();
             if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj3->addVAcademicCalendar($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj3->initVAcademicCalendars();
             $obj3->addVAcademicCalendar($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->getClassGroup();
             if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj4->addVAcademicCalendar($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj4->initVAcademicCalendars();
             $obj4->addVAcademicCalendar($obj1);
         }
         $omClass = CurrSystemPeer::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->getCurrSystem();
             if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
                 $newObject = false;
                 $temp_obj5->addVAcademicCalendar($obj1);
                 break;
             }
         }
         if ($newObject) {
             $obj5->initVAcademicCalendars();
             $obj5->addVAcademicCalendar($obj1);
         }
         $results[] = $obj1;
     }
     return $results;
 }