Пример #1
0
                                        <?php 
            if ($can_remove) {
                echo link_to_remote(__('delete'), array('url' => 'agenda/delete?id=' . $agenda->getId(), 'confirm' => __('Are you sure?'), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'red', 'style' => 'font-size:10px;'));
            }
            ?>
                                        </p>
                                    <?php 
        }
        ?>
                                </td>
        <?php 
        if (sfContext::getInstance()->getUser()->getAttribute('usertype', null, 'bo') != 'lector') {
            ?>
                                    <td>
            <?php 
            $course_schedules = CourseSchedulePeer::retrieveByPK($agenda->getCourseScheduleId());
            $tutors = array();
            foreach ($course_schedules->getCourseScheduleTutors() as $ta) {
                $tutors[] = $ta->getEmployee() ? link_to_remote('&middot; ' . $ta->getEmployee()->toString(), array('url' => 'agenda/showEmployee?id=' . $ta->getEmployeeId(), 'update' => 'content', 'script' => 'true', 'before' => "this.blur();showIndicator('content', 'snakebig_black');", 'complete' => "hideIndicator()"), array('class' => 'white')) : '-';
            }
            echo join("<br>", $tutors);
            ?>
</td>
                            <?php 
        }
        ?>
                                <td><?php 
        echo $agenda->getClassGroup() ? $agenda->getClassGroup()->toString() : '-';
        ?>
</td>
                                <td><?php 
Пример #2
0
 public function getCourseSchedule($con = null)
 {
     include_once 'lib/model/om/BaseCourseSchedulePeer.php';
     if ($this->aCourseSchedule === null && $this->course_schedule_id !== null) {
         $this->aCourseSchedule = CourseSchedulePeer::retrieveByPK($this->course_schedule_id, $con);
     }
     return $this->aCourseSchedule;
 }
Пример #3
0
 public function executeUpdate2()
 {
     $course_schedule_id = $this->getRequestParameter('course_id');
     $course_schedule = CourseSchedulePeer::retrieveByPK($course_schedule_id);
     $this->forward404Unless($course_schedule);
     $this->course_schedule = $course_schedule;
     $academic_calendar = $course_schedule->getAcademicCalendar();
     $this->academic_calendar = $academic_calendar;
     $cur13_id = $this->getRequestParameter('cur13_id');
     $cur13_ki = Cur13KiPeer::retrieveByPK($cur13_id);
     $this->forward404Unless($cur13_ki);
     $this->cur13_ki = $cur13_ki;
     $nilai = $this->getRequestParameter('nilai');
     foreach ($nilai as $studentAccalId => $n) {
         $studentAccal = StudentAccalPeer::retrieveByPK($studentAccalId);
         if (!$studentAccal) {
             continue;
         }
         $c = new Criteria();
         $c->add(Cur13ReportPeer::STUDENT_ACCAL_ID, $studentAccal->getId(), Criteria::EQUAL);
         $c->add(Cur13ReportPeer::CUR13_KI_ID, $cur13_ki->getId(), Criteria::EQUAL);
         $c->add(Cur13ReportPeer::COURSE_SCHEDULE_ID, $course_schedule->getId(), Criteria::EQUAL);
         $nilaiSiswa = Cur13ReportPeer::doSelectOne($c);
         if (!$nilaiSiswa) {
             $nilaiSiswa = new Cur13Report();
             $nilaiSiswa->setStudentAccalId($studentAccal->getId());
             $nilaiSiswa->setCur13KiId($cur13_ki->getId());
             $nilaiSiswa->setCourseScheduleId($course_schedule->getId());
         }
         if (empty($n['rata2'])) {
             $nilaiSiswa->setGrade('');
             $nilaiSiswa->setRemark('');
             $nilaiSiswa->setGradeScale('');
             $nilaiSiswa->setTotalValue('');
             $nilaiSiswa->setAvgValue('');
             $nilaiSiswa->setDescription('');
         } else {
             $nilaiSiswa->setGrade($n['rata2']);
             $nilaiSiswa->setRemark($n['capaian']);
             $nilaiSiswa->setGradeScale($n['scale']);
             $nilaiSiswa->setDescription($n['description']);
         }
         $nilaiSiswa->save();
     }
     if ($cur13_id == ScoreRule::THREE) {
         return $this->redirect('course_sd/listRecaptKi3?accal_id=' . $academic_calendar->getId() . '&course_id=' . $course_schedule->getId());
     } else {
         return $this->redirect('course_sd/listRecaptKi4?accal_id=' . $academic_calendar->getId() . '&course_id=' . $course_schedule->getId());
     }
 }
Пример #4
0
 /**
  * setCourseSchedule function
  * function to set the course schedule
  * @param int $courseScheduleId
  */
 public function setCourseSchedule($courseScheduleId)
 {
     $this->courseSchedule = CourseSchedulePeer::retrieveByPK($courseScheduleId);
     $this->setAcademicCalendar($this->getCourseSchedule()->getAcademicCalendarId());
     $this->setClassGroup($this->getCourseSchedule()->getClassGroupId());
 }
Пример #5
0
 public function executeSaveUploadAfective()
 {
     $scores = $this->getRequestParameter('score');
     $id_course = 0;
     foreach ($scores as $k => $score) {
         if ($score != null) {
             if ($score != '-') {
                 $ids = split('_', $k);
                 #$ids [0] == Id Student
                 #$ids [1] == Id Course Schedule
                 #$ids [2] == Id Grade Spec
                 $course_schedule = CourseSchedulePeer::retrieveByPK($ids[1]);
                 $id_course = $course_schedule->getId();
                 $c = new Criteria();
                 $c->add(StudentGradeRaportPeer::STUDENT_ACCAL_ID, $ids[0]);
                 $c->add(StudentGradeRaportPeer::GRADE_SPEC_ID, $ids[2]);
                 $c->add(StudentGradeRaportPeer::COURSE_SCHEDULE_ID, $id_course);
                 $g = StudentGradeRaportPeer::doSelectOne($c);
                 if ($g == null) {
                     $g = new StudentGradeRaport();
                 }
                 $g->setGradeSpecId($ids[2]);
                 $g->setGrade($score);
                 $g->setCourseScheduleId($id_course);
                 $g->setGradeValue($score);
                 $g->setStudentAccalId($ids[0]);
                 $g->setSubjectCurrId($course_schedule->getSubjectCurrId());
                 $g->save();
             } else {
                 $ids = split('_', $k);
                 #$ids [0] == Id Student
                 #$ids [1] == Id Course Schedule
                 #$ids [2] == Id Grade Spec
                 $course_schedule = CourseSchedulePeer::retrieveByPK($ids[1]);
                 $id_course = $course_schedule->getId();
                 $c = new Criteria();
                 $c->add(StudentGradeRaportPeer::STUDENT_ACCAL_ID, $ids[0]);
                 $c->add(StudentGradeRaportPeer::GRADE_SPEC_ID, $ids[2]);
                 $c->add(StudentGradeRaportPeer::COURSE_SCHEDULE_ID, $id_course);
                 $g = StudentGradeRaportPeer::doSelectOne($c);
                 if ($g != null) {
                     $g->delete();
                 }
             }
         }
     }
     return $this->redirect('course_score_new/uploadAfektifFinish?course_id=' . $id_course);
 }
Пример #6
0
 public function executeGetListAfective()
 {
     $course_id = $this->getRequestParameter('course_id');
     $course_schedule = CourseSchedulePeer::retrieveByPK($course_id);
     $this->forward404Unless($course_schedule);
     $this->course_schedule = $course_schedule;
     $grade_spec_id = $this->getRequestParameter('grade_spec_id');
     $grade_spec = GradeSpecPeer::retrieveByPK($grade_spec_id);
     $this->forward404Unless($grade_spec);
     $this->grade_spec = $grade_spec;
     if ($grade_spec_id) {
         $c = new Criteria();
         $c->addJoin(VStudentAccalPeer::STUDENT_ID, VStudentActivePeer::ID);
         $c->add(VStudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
         $c->add(VStudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
         $c->addAscendingOrderByColumn(VStudentAccalPeer::CLASS_NAME);
     } else {
         $c = new Criteria();
         $c->add(VStudentAccalPeer::ACADEMIC_CALENDAR_ID, -1);
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'student');
     $pager = new sfPropelPager('VStudentAccal', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student'));
     $this->getUser()->setAttribute('page', $page, 'student');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     ## Mengelompokkan Penilaian Anak berdasarkan Tahun Ajaran dan Kelas
     $cr = new Criteria();
     $cr->add(StudentGradeRaportPeer::COURSE_SCHEDULE_ID, $course_schedule->getId());
     $stugrades = StudentGradeRaportPeer::doSelect($cr);
     $this->stugrades = $stugrades;
     $grades = array();
     $grade_avg = array();
     foreach ($stugrades as $stugrade) {
         $grades[$stugrade->getStudentAccalId() . '#' . $stugrade->getGradeSpecId()] = $stugrade->getGrade();
         $grade_avg[$stugrade->getGradeSpecId()] = (array_key_exists($stugrade->getGradeSpecId(), $grade_avg) ? $grade_avg[$stugrade->getGradeSpecId()] : 0) + $stugrade->getGrade();
     }
     $this->grades = $grades;
     $this->grade_avg = $grade_avg;
     $cw = new Criteria();
     $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
     $cw->add(CourseRegulationPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
     $cw->add(CourseRegulationPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
     $course_reg = CourseRegulationPeer::doSelectOne($cw);
     $this->course_reg = $course_reg;
     $this->subtitle = $grade_spec->toString() . ' - ' . $grade_spec->getParentName();
     $actions3 = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'get_template', 'url' => "course_afective/getTemplateAfective?course_id=" . $course_id . "&grade_spec_id=" . $grade_spec_id, 'color' => 'black', 'type' => 'direct'), array('name' => 'reset', 'type' => 'reset', 'options' => array('class' => 'save_button', 'onclick' => "\$\$('.score').each(function(el){el.style.borderColor='';el.style.borderWidth='';});")));
     $this->actions3 = $actions3;
 }
Пример #7
0
 if ($score_rule->getLanguage() == 'Indonesia') {
     echo $remark_know != 'M' ? $remark_select[$remark_know . '#' . GradeConversion::TYPE_KNOWLEDGE] : ' ';
 } else {
     echo $remark_know != 'M' ? $descript_select[$remark_know . '#' . GradeConversion::TYPE_KNOWLEDGE] : ' ';
 }
 ?>
                         </th>
                     </tr>
                     <tr>
                         <th style="font-weight: normal; vertical-align: middle; border-top: none;" width="4%"></th>
                         <th style="font-weight: normal; text-align: left; vertical-align: middle; border-top: none;" width="22%">
                             <?php 
 ## Nama Guru
 if (array_key_exists($subject->getSubjectCurrId(), $course_ids)) {
     $course_sched_id = $course_ids[$subject->getSubjectCurrId()];
     $course_schedule = CourseSchedulePeer::retrieveByPK($course_sched_id);
     $tutors = array();
     foreach ($course_schedule->getCourseScheduleTutors() as $cr) {
         $tutors[] = $cr->getEmployee() ? '(' . $cr->getEmployee()->getName() . ')' : '-';
     }
     echo join(",", $tutors);
 }
 ?>
                         </th>
                         <th style="font-weight: normal; text-align: left;" width="25%"><?php 
 if ($score_rule->getLanguage() == 'Inggris') {
     echo 'Skill';
 } elseif ($score_rule->getLanguage() == 'Indonesia') {
     echo 'Keterampilan';
 } else {
     echo 'Skill';
Пример #8
0
 public function executeSaveUpload()
 {
     $scores = $this->getRequestParameter('score');
     $id_course = 0;
     $id_student = 0;
     foreach ($scores as $k => $score) {
         if ($score != null) {
             if ($score != '-') {
                 $ids = split('_', $k);
                 $course_schedule = CourseSchedulePeer::retrieveByPK($ids[1]);
                 $id_course = $course_schedule->getId();
                 $student = StudentPeer::retrieveByPK($ids[0]);
                 $id_student = $student->getId();
                 $cd = new Criteria();
                 $cd->add(StudentAccalPeer::STUDENT_ID, $ids[0]);
                 $cd->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                 $cd->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                 $stu_accal = StudentAccalPeer::doSelectOne($cd);
                 $c = new Criteria();
                 $c->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
                 $c->add(StudentRaportPeer::GRADE_SPEC_ID, $ids[2]);
                 $c->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
                 $c->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                 $c->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                 $g = StudentRaportPeer::doSelectOne($c);
                 if ($g == null) {
                     $g = new StudentRaport();
                 }
                 $g->setStudentId($ids[0]);
                 $g->setGradeSpecId($ids[2]);
                 $g->setGrade($score);
                 $g->setSubjectCurrId($course_schedule->getSubjectCurrId());
                 $g->setClassGroupId($course_schedule->getClassGroupId());
                 $g->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
                 $g->setCitationId($stu_accal->getId());
                 $g->save();
             } else {
                 $ids = split('_', $k);
                 $course_schedule = CourseSchedulePeer::retrieveByPK($ids[1]);
                 $c = new Criteria();
                 $c->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
                 $c->add(StudentRaportPeer::GRADE_SPEC_ID, $ids[2]);
                 $c->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
                 $c->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                 $c->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                 $g = StudentRaportPeer::doSelectOne($c);
                 if ($g != null) {
                     $g->delete();
                 }
             }
         }
     }
     $hiddenscores = $this->getRequestParameter('hiddenscore');
     foreach ($hiddenscores as $j => $hiddenscore) {
         $ids = split('_', $j);
         $course_schedule = CourseSchedulePeer::retrieveByPK($ids[1]);
         $student = StudentPeer::retrieveByPK($ids[0]);
         $cd = new Criteria();
         $cd->add(StudentAccalPeer::STUDENT_ID, $ids[0]);
         $cd->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
         $cd->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
         $stu_accal = StudentAccalPeer::doSelectOne($cd);
         $cw = new Criteria();
         $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
         $cw->add(CourseRegulationPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
         $cw->add(CourseRegulationPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
         $c_regulation = CourseRegulationPeer::doSelectOne($cw);
         if ($c_regulation) {
             $cr = new Criteria();
             $cr->add(GradeSpecPeer::PARENT, 1);
             $cr->addAscendingOrderByColumn(GradeSpecPeer::ID);
             $grade1 = GradeSpecPeer::doSelect($cr);
             $count1 = GradeSpecPeer::doCount($cr);
             $ct = new Criteria();
             $ct->add(GradeSpecPeer::PARENT, 7);
             $ct->addAscendingOrderByColumn(GradeSpecPeer::ID);
             $grade2 = GradeSpecPeer::doSelect($ct);
             $count2 = GradeSpecPeer::doCount($ct);
             $student_grades = array();
             $student_total_grades = 0;
             $student_grade_count = 0;
             $student_grades2 = array();
             $student_total_grades2 = 0;
             $student_grade_count2 = 0;
             $connection = Propel::getConnection();
             $statement = $connection->createStatement();
             $sql = "SELECT grade_spec_id, sum(grade) grade FROM grade_spec g left outer join student_raport s on grade_spec_id = g.id WHERE PARENT=" . $grade1[0]->getParent() . " and student_id = " . $student->getId() . " and subject_curr_id = " . $course_schedule->getSubjectCurrId() . " and class_group_id = " . $course_schedule->getClassGroupId() . " and academic_calendar_id = " . $course_schedule->getAcademicCalendarId() . " group by student_id, subject_curr_id, class_group_id, academic_calendar_id, grade_spec_id";
             $result = $statement->executeQuery($sql, ResultSet::FETCHMODE_NUM);
             while ($result->next()) {
                 $ra = $result->getRow();
                 $student_grades[$ra[0]] = $ra[1];
                 $student_total_grades += $ra[1];
                 $student_grade_count += 1;
             }
             $sql2 = "SELECT grade_spec_id, sum(grade) grade FROM grade_spec g left outer join student_raport s on grade_spec_id = g.id WHERE PARENT=" . $grade2[0]->getParent() . " and student_id = " . $student->getId() . " and subject_curr_id = " . $course_schedule->getSubjectCurrId() . " and class_group_id = " . $course_schedule->getClassGroupId() . " and academic_calendar_id = " . $course_schedule->getAcademicCalendarId() . " group by student_id, subject_curr_id, class_group_id, academic_calendar_id, grade_spec_id";
             $result2 = $statement->executeQuery($sql2, ResultSet::FETCHMODE_NUM);
             while ($result2->next()) {
                 $ra2 = $result2->getRow();
                 $student_grades2[$ra2[0]] = $ra2[1];
                 $student_total_grades2 += $ra2[1];
                 $student_grade_count2 += 1;
             }
             foreach ($grade1 as $g1) {
                 if (array_key_exists($g1->getId(), $student_grades)) {
                     $student_grades[$g1->getId()];
                 }
             }
             $avg1 = 0;
             if ($student_grade_count > 0) {
                 $avg1 = round($student_total_grades / $student_grade_count);
             }
             foreach ($grade2 as $g2) {
                 if (array_key_exists($g2->getId(), $student_grades2)) {
                     $student_grades2[$g2->getId()];
                 }
             }
             $avg2 = 0;
             if ($student_grade_count2 > 0) {
                 $avg2 = round($student_total_grades2 / $student_grade_count2);
             }
             $cm = new Criteria();
             $cm->add(StudentRaportPeer::STUDENT_ID, $student->getId());
             $cm->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
             $cm->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
             $cm->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
             $stu_scores = StudentRaportPeer::doSelect($cm);
             $student_score = array();
             foreach ($stu_scores as $stu_score) {
                 $student_score[$stu_score->getGradeSpecId()] = $stu_score->getGrade();
             }
             ## Format 2 (RUH+UTS+UAS)/3
             if ($c_regulation->getFormulaId() == 2) {
                 $scoreBLP = round(($avg1 + $student_score[14] + $student_score[15]) / 3);
                 # Format 3 (3RUH+UTS+UAS)/5
             } elseif ($c_regulation->getFormulaId() == 3) {
                 $scoreBLP = round((3 * $avg1 + $student_score[14] + $student_score[15]) / 5);
                 ## Format 4 (2RUH+RTGS+UTS+UAS)/5
             } elseif ($c_regulation->getFormulaId() == 4) {
                 $scoreBLP = round((2 * $avg1 + $avg2 + $student_score[14] + $student_score[15]) / 5);
                 ## Format 5 (2RUH+RTGS+UAS)/4
             } elseif ($c_regulation->getFormulaId() == 5) {
                 $scoreBLP = round((2 * $avg1 + $avg2 + $student_score[15]) / 4);
                 ## Format 6 (2RUH+UAS)/3
             } elseif ($c_regulation->getFormulaId() == 6) {
                 $scoreBLP = round((2 * $avg1 + $student_score[15]) / 3);
                 ## Format 7 (50%RUH+10%RTGS+20%UTS+20%UAS)
             } elseif ($c_regulation->getFormulaId() == 7) {
                 $scoreBLP = round(0.5 * $avg1 + 0.1 * $avg2 + 0.2 * $student_score[14] + 0.2 * $student_score[15]);
                 ## Format 8  (2NH+UTS+UAS)/4
             } elseif ($c_regulation->getFormulaId() == 8) {
                 $nh = round((7 * $avg1 + 3 * $avg2) / 10);
                 $scoreBLP = round(($nh + $student_score[14] + $student_score[15]) / 4);
                 ## Format 9  (3NH+NUTS+NUKK)/5
             } elseif ($c_regulation->getFormulaId() == 9) {
                 $nh = round((3 * $avg1 + $avg2) / 5);
                 $scoreBLP = round((3 * $nh + $student_score[14] + $student_score[15]) / 5);
                 ## Format 10 (70%*NH+30%*(UTS+UAS))
             } elseif ($c_regulation->getFormulaId() == 10) {
                 $nh = round($avg1 + 2 * $avg2);
                 $scoreBLP = round(0.7 * $nh + 0.3 * ($student_score[14] + $student_score[15]));
                 ## Format 1 atau Lainnya (RTGS+RUH+UTS+UAS)/4
             } else {
                 $scoreBLP = round(($avg1 + $avg2 + $student_score[14] + $student_score[15]) / 4);
             }
             $cn = new Criteria();
             $cn->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
             $cn->add(StudentRaportPeer::GRADE_SPEC_ID, 16);
             $cn->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
             $cn->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
             $cn->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
             $graport = StudentRaportPeer::doSelectOne($cn);
             if ($graport == null) {
                 $graport = new StudentRaport();
             }
             $graport->setStudentId($ids[0]);
             $graport->setGradeSpecId(16);
             $graport->setGrade($scoreBLP);
             $graport->setSubjectCurrId($course_schedule->getSubjectCurrId());
             $graport->setClassGroupId($course_schedule->getClassGroupId());
             $graport->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
             $graport->setCitationId($stu_accal->getId());
             $graport->save();
             ## Menyimpan Nilai Raport Murni
             $ii = new Criteria();
             $ii->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
             $ii->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
             $ii->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
             $ii->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
             $ii->add(StudentRaportPeer::GRADE_SPEC_ID, 88);
             $gi = StudentRaportPeer::doSelectOne($ii);
             if ($gi == null) {
                 $gi = new StudentRaport();
             }
             $gi->setStudentId($ids[0]);
             $gi->setGradeSpecId(88);
             $gi->setGrade($scoreBLP);
             $gi->setSubjectCurrId($course_schedule->getSubjectCurrId());
             $gi->setClassGroupId($course_schedule->getClassGroupId());
             $gi->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
             $gi->setCitationId($stu_accal->getId());
             $gi->save();
         }
     }
     return $this->redirect('course_kognitif/uploadFinish?course_id=' . $id_course);
 }
Пример #9
0
 public function executeSaveRaportHistory()
 {
     $course_id = $this->getRequestParameter('course_id');
     $course_schedule = CourseSchedulePeer::retrieveByPK($course_id);
     $this->forward404Unless($course_schedule);
     $cw = new Criteria();
     $cw->add(CourseRegulationPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
     $cw->add(CourseRegulationPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
     $cw->add(CourseRegulationPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
     $c_regulation = CourseRegulationPeer::doSelectOne($cw);
     if ($c_regulation) {
         $scores = $this->getRequestParameter('score');
         foreach ($scores as $k => $score) {
             if ($score != null) {
                 if ($score != '-') {
                     $ids = split('_', $k);
                     $cd = new Criteria();
                     $cd->add(StudentAccalPeer::STUDENT_ID, $ids[0]);
                     $cd->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                     $cd->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                     $stu_accal = StudentAccalPeer::doSelectOne($cd);
                     $c = new Criteria();
                     $c->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
                     $c->add(StudentRaportPeer::GRADE_SPEC_ID, $ids[1]);
                     $c->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
                     $c->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                     $c->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                     $g = StudentRaportPeer::doSelectOne($c);
                     if ($g == null) {
                         $g = new StudentRaport();
                     }
                     $g->setStudentId($ids[0]);
                     $g->setGradeSpecId($ids[1]);
                     $g->setGrade($score);
                     $g->setSubjectCurrId($course_schedule->getSubjectCurrId());
                     $g->setClassGroupId($course_schedule->getClassGroupId());
                     $g->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
                     $g->setCitationId($stu_accal->getId());
                     $g->save();
                 } else {
                     $ids = split('_', $k);
                     $c = new Criteria();
                     $c->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
                     $c->add(StudentRaportPeer::GRADE_SPEC_ID, $ids[1]);
                     $c->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
                     $c->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                     $c->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                     $g = StudentRaportPeer::doSelectOne($c);
                     if ($g != null) {
                         $g->delete();
                     }
                 }
             }
         }
         #Nilai Utama dan Remed
         $exams = $this->getRequestParameter('exam');
         foreach ($exams as $k => $exam) {
             if ($exam != null) {
                 if ($exam != '-') {
                     $ids = split('_', $k);
                     $cd = new Criteria();
                     $cd->add(StudentAccalPeer::STUDENT_ID, $ids[0]);
                     $cd->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                     $cd->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                     $stu_accal = StudentAccalPeer::doSelectOne($cd);
                     $c = new Criteria();
                     $c->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
                     $c->add(StudentRaportPeer::GRADE_SPEC_ID, $ids[1]);
                     $c->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
                     $c->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                     $c->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                     $g = StudentRaportPeer::doSelectOne($c);
                     if ($g == null) {
                         $g = new StudentRaport();
                     }
                     $g->setStudentId($ids[0]);
                     $g->setGradeSpecId($ids[1]);
                     $g->setGrade($exam);
                     $g->setSubjectCurrId($course_schedule->getSubjectCurrId());
                     $g->setClassGroupId($course_schedule->getClassGroupId());
                     $g->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
                     $g->setCitationId($stu_accal->getId());
                     $g->save();
                     $grade_spec = GradeSpecPeer::retrieveByPK($ids[1]);
                     #Nilai Utama
                     if ($grade_spec->getCode() == 'NU') {
                         $cg = new Criteria();
                         $cg->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
                         $cg->add(StudentRaportPeer::GRADE_SPEC_ID, $grade_spec->getId());
                         $cg->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
                         $cg->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                         $cg->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                         $nu = StudentRaportPeer::doSelectOne($cg);
                         $f = new Criteria();
                         $f->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
                         $f->add(StudentRaportPeer::GRADE_SPEC_ID, $grade_spec->getParent());
                         $f->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
                         $f->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                         $f->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                         $uh = StudentRaportPeer::doSelectOne($f);
                         if ($uh == null) {
                             $uh = new StudentRaport();
                         }
                         $uh->setStudentId($ids[0]);
                         $uh->setGradeSpecId($grade_spec->getParent());
                         $uh->setGrade($nu->getGrade());
                         $uh->setSubjectCurrId($course_schedule->getSubjectCurrId());
                         $uh->setClassGroupId($course_schedule->getClassGroupId());
                         $uh->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
                         $uh->setCitationId($stu_accal->getId());
                         $uh->save();
                         #Nilai Remedial
                     } elseif ($grade_spec->getCode() == 'NR') {
                         $cg = new Criteria();
                         $cg->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
                         $cg->add(StudentRaportPeer::GRADE_SPEC_ID, $grade_spec->getId());
                         $cg->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
                         $cg->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                         $cg->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                         $nr = StudentRaportPeer::doSelectOne($cg);
                         $f = new Criteria();
                         $f->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
                         $f->add(StudentRaportPeer::GRADE_SPEC_ID, $grade_spec->getParent());
                         $f->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
                         $f->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                         $f->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                         $uh = StudentRaportPeer::doSelectOne($f);
                         if ($nr->getGrade() >= $c_regulation->getKkm()) {
                             $score_atas = $nr->getGrade() - $c_regulation->getKkm();
                             $score_bawah = round(0.1 * (100 - $c_regulation->getKkm()));
                             $score = round($c_regulation->getKkm() + $score_atas / $score_bawah);
                             if ($uh == null) {
                                 $uh = new StudentRaport();
                             }
                             $uh->setStudentId($ids[0]);
                             $uh->setGradeSpecId($grade_spec->getParent());
                             $uh->setGrade($score);
                             $uh->setSubjectCurrId($course_schedule->getSubjectCurrId());
                             $uh->setClassGroupId($course_schedule->getClassGroupId());
                             $uh->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
                             $uh->setCitationId($stu_accal->getId());
                             $uh->save();
                         }
                         #Nilai Pengayaan
                     } elseif ($grade_spec->getCode() == 'NP') {
                         $cg = new Criteria();
                         $cg->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
                         $cg->add(StudentRaportPeer::GRADE_SPEC_ID, $grade_spec->getId());
                         $cg->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
                         $cg->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                         $cg->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                         $nr = StudentRaportPeer::doSelectOne($cg);
                         $f = new Criteria();
                         $f->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
                         $f->add(StudentRaportPeer::GRADE_SPEC_ID, $grade_spec->getParent());
                         $f->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
                         $f->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                         $f->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                         $uh = StudentRaportPeer::doSelectOne($f);
                         if ($nr->getGrade() >= $uh->getGrade()) {
                             $score_atas = $nr->getGrade() - $uh->getGrade();
                             $score_bawah = round(0.1 * (100 - $uh->getGrade()));
                             $score = round($uh->getGrade() + $score_atas / $score_bawah);
                             if ($uh == null) {
                                 $uh = new StudentRaport();
                             }
                             $uh->setStudentId($ids[0]);
                             $uh->setGradeSpecId($grade_spec->getParent());
                             $uh->setGrade($score);
                             $uh->setSubjectCurrId($course_schedule->getSubjectCurrId());
                             $uh->setClassGroupId($course_schedule->getClassGroupId());
                             $uh->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
                             $uh->setCitationId($stu_accal->getId());
                             $uh->save();
                         }
                     }
                 } else {
                     $ids = split('_', $k);
                     $c = new Criteria();
                     $c->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
                     $c->add(StudentRaportPeer::GRADE_SPEC_ID, $ids[1]);
                     $c->add(StudentRaportPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId());
                     $c->add(StudentRaportPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                     $c->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                     $g = StudentRaportPeer::doSelectOne($c);
                     if ($g != null) {
                         $g->delete();
                     }
                 }
             }
         }
     }
     return $this->redirect('course_score/listHistory');
 }
Пример #10
0
 public function executeListAbsence()
 {
     $employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
     $employee = EmployeePeer::retrieveByPK($employee_id);
     $this->forward404Unless($employee);
     $course_id = $this->getRequestParameter('course_id');
     $course_schedule = CourseSchedulePeer::retrieveByPK($course_id);
     $this->forward404Unless($course_schedule);
     $accal_id = $this->getRequestParameter('accal_id');
     $academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
     $this->forward404Unless($academic_calendar);
     $month_id = $this->getRequestParameter('month_id');
     $title = MonthPeer::retrieveByPK($month_id);
     $this->forward404Unless($title);
     $c = new Criteria();
     $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
     $c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
     $c->addJoin(StudentPeer::ID, StudentAccalPeer::STUDENT_ID);
     $c->add(StudentPeer::STATUS, 2, Criteria::NOT_EQUAL);
     $c->add(StudentPeer::STATUS, 3, Criteria::NOT_EQUAL);
     $c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME);
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'student');
     $pager = new sfPropelPager('Student', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student'));
     $this->getUser()->setAttribute('page', $page, 'student');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     $actions = array();
     array_unshift($actions, array('name' => 'Print Excel', 'url' => "course/listAbsenceAsCSV?accal_id=" . $academic_calendar->getId() . "&course_id=" . $course_schedule->getId() . "&month_id=" . $month_id, 'color' => 'black', 'type' => 'direct'));
     array_unshift($actions, array('name' => 'Print PDF', 'url' => "course/listAbsenceAsPDF?accal_id=" . $academic_calendar->getId() . "&course_id=" . $course_schedule->getId() . "&month_id=" . $month_id, 'color' => 'black', 'type' => 'direct'));
     $this->actions = $actions;
     $bln1 = substr($academic_calendar->getStart(), 5, 2);
     $bln2 = substr($academic_calendar->getEnd(), 5, 2);
     $cw = new Criteria();
     $cton1 = $cw->getNewCriterion(MonthPeer::ID, $bln1, Criteria::GREATER_EQUAL);
     $cton2 = $cw->getNewCriterion(MonthPeer::ID, $bln2, Criteria::LESS_EQUAL);
     $cton1->addAnd($cton2);
     $cw->add($cton1);
     $months = MonthPeer::doSelect($cw);
     if ($course_schedule->getAcademicCalendar()->getCourseModel() == 'A') {
         $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'course/listScore', 'color' => 'sun'));
     } else {
         $actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'course/listScore2', 'color' => 'sun'));
     }
     foreach ($months as $month) {
         if ($month->getId() == $title->getId()) {
             array_push($actions2, array('name' => '<span>' . $month->getName() . '</span>', 'url' => 'course/listAbsence?accal_id=' . $academic_calendar->getId() . '&course_id=' . $course_schedule->getId() . "&month_id=" . $month->getId(), 'color' => 'sky', 'type' => 'direct'));
         } else {
             array_push($actions2, array('name' => '<span>' . $month->getName() . '</span>', 'url' => 'course/listAbsence?accal_id=' . $academic_calendar->getId() . '&course_id=' . $course_schedule->getId() . "&month_id=" . $month->getId(), 'color' => 'sun'));
         }
     }
     $this->actions2 = $actions2;
     $this->course_schedule = $course_schedule;
     $this->title = $title;
     $this->month = $title;
     $this->judul = $title->getName();
     $this->tahun = $academic_calendar->getYear();
     $this->subtitle = 'Absensi Bulan ' . $title->getName() . ' - ' . $academic_calendar->getYear() . ' # ' . $course_schedule->getClassGroup()->toString();
     $this->employee_id = $employee_id;
     $this->academic_calendar = $academic_calendar;
     $this->jumHari = cal_days_in_month(CAL_GREGORIAN, $title->getMonth(), $academic_calendar->getYear());
 }
Пример #11
0
 public function executeAddSchedule()
 {
     $course_id = $this->getRequestParameter('id');
     $course_schedule = CourseSchedulePeer::retrieveByPK($course_id);
     $this->forward404Unless($course_schedule);
     $this->course_schedule = $course_schedule;
     $this->course_id = $course_id;
     $cs_detail = new CourseScheduleDetail();
     $this->cs_detail = $cs_detail;
     $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'cancel', 'url' => 'course_sched/preview?class_group_id=' . $course_schedule->getClassGroupId() . '&accal_id=' . $course_schedule->getAcademicCalendarId(), 'color' => 'black'));
     $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName();
     $this->type = 'add';
     $this->actions = $actions;
 }
Пример #12
0
 public function executeEditSchedule2()
 {
     $course_id = $this->getRequestParameter('course_id');
     $course_schedule = CourseSchedulePeer::retrieveByPK($course_id);
     $this->course_schedule = $course_schedule;
     $cs_detail = CourseScheduleDetailPeer::retrieveByPK($this->getRequestParameter('id'));
     $this->cs_detail = $cs_detail;
     $c = new Criteria();
     $c->add(VCoursePeer::ID, $this->getRequestParameter('vcourse_id'));
     $c_schedule = VCoursePeer::doSelectOne($c);
     $this->forward404Unless($c_schedule);
     $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")), array('name' => 'cancel', 'url' => 'course_schedule/edit?id=' . $c_schedule->getId(), 'color' => 'black'));
     $this->subtitle = $course_schedule->getSubjectCurr()->getSubject()->getName();
     $this->type = 'edit';
     $this->actions = $actions;
     $this->c_schedule = $c_schedule;
 }
Пример #13
0
 public function executeGetListMiddle()
 {
     $course_id = $this->getRequestParameter('course_id');
     $course_schedule = CourseSchedulePeer::retrieveByPK($course_id);
     $this->course_schedule = $course_schedule;
     $student_id = $this->getRequestParameter('student_id');
     $student = StudentPeer::retrieveByPK($student_id);
     $this->forward404Unless($student);
     $this->student = $student;
     $cr = new Criteria();
     $cr->add(GradeSpecPeer::PARENT, 1);
     $this->grade1 = GradeSpecPeer::doSelect($cr);
     $this->count1 = GradeSpecPeer::doCount($cr);
     $crew = new Criteria();
     $crew->add(GradeSpecPeer::PARENT, 7);
     $this->grade2 = GradeSpecPeer::doSelect($crew);
     $this->count2 = GradeSpecPeer::doCount($crew);
     $actions3 = array();
     $this->actions3 = $actions3;
 }
Пример #14
0
							<?php 
echo $course_schedule->getSubjectCurr() ? $course_schedule->getSubjectCurr()->getSubject()->toName() : '-';
?>
</b></p>
					</td>
                		</tr>   
                		<tr>
                			<td style="vertical-align:top;"><label ><?php 
echo __('Lector');
?>
</label></td>
                    			<td width="3%" style="text-align:center; vertical-align:top;">:</td>
					<td style="vertical-align:top;">
                    			<p class="detail" style="font-weight: bold;">
					<?php 
$course_schedules = CourseSchedulePeer::retrieveByPK($course_schedule->getId());
$tutors = array();
foreach ($course_schedules->getCourseScheduleTutors() as $cr) {
    $tutors[] = $cr->getEmployee() ? '&middot; ' . $cr->getEmployee()->getName() : '-';
}
echo join("<br>", $tutors);
?>
                   	 		</p></td>
                		</tr>			
            		</tbody>
		</table>
	</td></tr>
	</table>	
	</td>
	
	<td width="1%">&nbsp;</td>
Пример #15
0
 public function executeSaveNotes()
 {
     $course_id = $this->getRequestParameter('course_id');
     $course_schedule = CourseSchedulePeer::retrieveByPK($course_id);
     $this->forward404Unless($course_schedule);
     $descs = $this->getRequestParameter('desc');
     foreach ($descs as $m => $desc) {
         if ($desc != null) {
             if ($desc != '-') {
                 $ced = new Criteria();
                 $ced->add(StudentNotePeer::STUDENT_ID, $m);
                 $ced->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                 $ced->add(StudentNotePeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                 $ced->add(StudentNotePeer::RANKING, 5);
                 $note = StudentNotePeer::doSelectOne($ced);
                 if ($note == null) {
                     $note = new StudentNote();
                 }
                 $note->setStudentId($m);
                 $note->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
                 $note->setClassGroupId($course_schedule->getClassGroupId());
                 $note->setNote($desc);
                 $note->setRanking(5);
                 $note->save();
             } else {
                 $ced = new Criteria();
                 $ced->add(StudentNotePeer::STUDENT_ID, $m);
                 $ced->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
                 $ced->add(StudentNotePeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
                 $ced->add(StudentNotePeer::RANKING, 5);
                 $note = StudentNotePeer::doSelectOne($ced);
                 if ($note != null) {
                     $note->delete();
                 }
             }
         }
     }
     return $this->redirect('course_score/listPersonality?course_id=' . $course_schedule->getId());
 }
Пример #16
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;
     $course_schedule = CourseSchedulePeer::retrieveByPK($this->getRequestParameter('course_id'));
     $this->forward404Unless($course_schedule);
     $course_schedule_id = $course_schedule->getId();
     $grade_options = array();
     $c = new Criteria();
     $c->add(SubjectGradingPeer::SUBJECT_CURR_ID, $course_schedule->getSubjectCurrId(), Criteria::IN);
     $c->addAscendingOrderByColumn(SubjectGradingPeer::ID);
     $grades = SubjectGradingPeer::doSelect($c);
     foreach ($grades as $grade) {
         $grade_options[$grade->getId()] = $grade->getGradeComponent()->toString();
     }
     $this->grade_options = $grade_options;
     $class_agenda = ClassAgendaPeer::retrieveByPk($this->getRequestParameter('id'));
     $this->forward404Unless($class_agenda);
     $actions = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     if ($acl->getRemovePriv()) {
         array_push($actions, array('name' => 'delete', 'url' => 'class_agenda/delete?id=' . $class_agenda->getId() . '&sched_id=' . $course_schedule->getId(), 'color' => 'red'));
     }
     array_push($actions, array('name' => 'cancel', 'url' => 'class_agenda/list?id=' . $course_schedule->getId(), 'color' => 'black'));
     $this->subtitle = $class_agenda->toString() . ' - id:' . $class_agenda->getId();
     $this->type = 'edit';
     $this->class_agenda = $class_agenda;
     $this->actions = $actions;
     $this->course_schedule_id = $class_agenda->getCourseScheduleId();
     $this->course_schedule = $course_schedule;
     $actions2 = array(array('name' => '<span>Jadwal Pelajaran</span>', 'url' => 'course_sched/list', 'color' => 'sky'));
     array_push($actions2, array('name' => '<span>Agenda Kelas</span>', 'url' => 'class_agenda/list?id=' . $course_schedule->getId(), 'color' => 'sun', 'type' => 'direct'));
     $this->actions2 = $actions2;
 }
Пример #17
0
 public function executeGetList()
 {
     $course_id = $this->getRequestParameter('course_id');
     $course_schedule = CourseSchedulePeer::retrieveByPK($course_id);
     #$this->forward404Unless($course_schedule);
     $this->course_schedule = $course_schedule;
     $grade_spec_id = $this->getRequestParameter('grade_spec_id');
     $grade_spec = GradeSpecPeer::retrieveByPK($grade_spec_id);
     $this->forward404Unless($grade_spec);
     $this->grade_spec = $grade_spec;
     if ($grade_spec_id) {
         $c = new Criteria();
         $c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $course_schedule->getAcademicCalendarId());
         $c->add(StudentAccalPeer::CLASS_GROUP_ID, $course_schedule->getClassGroupId());
         $c->addJoin(VStudentActivePeer::ID, StudentAccalPeer::STUDENT_ID);
         $c->addJoin(StudentPeer::ID, VStudentActivePeer::ID);
         $c->addAscendingOrderByColumn(StudentPeer::CLASS_NAME);
     } else {
         $c = new Criteria();
         $c->add(StudentPeer::ACADEMIC_CALENDAR_ID, -1);
     }
     $rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'student'));
     $this->getUser()->setAttribute('max_per_page', $rpp, 'student');
     $pager = new sfPropelPager('Student', $rpp);
     $pager->setCriteria($c);
     $page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'student'));
     $this->getUser()->setAttribute('page', $page, 'student');
     $pager->setPage($page);
     $pager->init();
     $this->pager = $pager;
     #$actions3 = array();
     $actions3 = array(array('name' => 'save', 'type' => 'submit', 'options' => array('class' => 'save_button', 'onclick' => "action_type.value=this.value")));
     $this->actions3 = $actions3;
 }