本文整理汇总了PHP中AcademicCalendarPeer::retrieveByPK方法的典型用法代码示例。如果您正苦于以下问题:PHP AcademicCalendarPeer::retrieveByPK方法的具体用法?PHP AcademicCalendarPeer::retrieveByPK怎么用?PHP AcademicCalendarPeer::retrieveByPK使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcademicCalendarPeer
的用法示例。
在下文中一共展示了AcademicCalendarPeer::retrieveByPK方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doSelectByAccal
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: executeList
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: getCourseModelRecurs
public function getCourseModelRecurs()
{
if (!$this->getCourseModel()) {
if ($this->getParent()) {
$p = AcademicCalendarPeer::retrieveByPK($this->getParent());
return $p->getCourseModelRecurs();
}
return self::CM_CUSTOM;
}
return $this->getCourseModel();
}
示例4: executeGetSubject
public function executeGetSubject()
{
$academic_calendar_id = $this->getRequestParameter('academic_calendar_id');
$academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id);
$this->forward404Unless($academic_calendar);
$c = new Criteria();
$c->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$c->addAscendingOrderByColumn(CourseSchedulePeer::CLASS_GROUP_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(), 'course'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'course');
$pager = new sfPropelPager('CourseSchedule', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'course'));
$this->getUser()->setAttribute('page', $page, 'course');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
$actions = array();
$this->actions = $actions;
$this->subtitle = '';
$this->academic_calendar = $academic_calendar;
}
示例5: executeDeleteTemp
public function executeDeleteTemp()
{
$temp_table = TempTablePeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($temp_table);
$temp_table->delete();
$academic_calendar = AcademicCalendarPeer::retrieveByPK($this->getRequestParameter('accal_id'));
$this->forward404Unless($academic_calendar);
$counseling = CounselingPeer::retrieveByPk($this->getRequestParameter('counseling_id'));
$this->forward404Unless($counseling);
$tanggal = $this->getRequestParameter('time');
$time2 = $this->getRequestParameter('time2');
return $this->redirect('rpt_counseling/preview?counseling_id=' . $counseling->getId() . '&accal_id=' . $academic_calendar->getId() . '&time=' . $tanggal . '&time2=' . $time2);
}
示例6: getAcademicCalendar
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;
}
示例7: executeGetListFinalAll
public function executeGetListFinalAll()
{
$academic_calendar_id = $this->getRequestParameter('academic_calendar_id');
$academic_calendar = AcademicCalendarPeer::retrieveByPK($academic_calendar_id);
$this->academic_calendar = $academic_calendar;
$student_id = $this->getRequestParameter('student_id');
$student = StudentPeer::retrieveByPK($student_id);
$this->forward404Unless($student);
$this->student = $student;
$c = new Criteria();
$c->add(StudentAccalPeer::STUDENT_ID, $student_id, Criteria::IN);
$c->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $academic_calendar_id, Criteria::IN);
$stu_accal = StudentAccalPeer::doSelectOne($c);
$this->stu_accal = $stu_accal;
$cw = new Criteria();
$cw->add(CounselingPeer::CLASS_GROUP_ID, $stu_accal->getClassGroupId());
$cw->add(CounselingPeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getParent());
$counseling = CounselingPeer::doSelectOne($cw);
$this->counseling = $counseling;
$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);
#SMP
if ($academic_calendar->getDepartmentId() == 2) {
$cb = new Criteria();
$cb->add(VCoursePeer::CLASS_GROUP_ID, $stu_accal->getClassGroupId(), Criteria::IN);
$cb->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
$cb->add(VCoursePeer::SUBJECT_CURR_ID, 316, Criteria::NOT_IN);
$cb->addAscendingOrderByColumn(VCoursePeer::CODE);
$this->subjects = VCoursePeer::doSelect($cb);
$this->subject_count = VCoursePeer::doCount($cb);
#SD
} elseif ($academic_calendar->getDepartmentId() == 3) {
$cb = new Criteria();
$cb->add(VCoursePeer::CLASS_GROUP_ID, $stu_accal->getClassGroupId(), Criteria::IN);
$cb->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
$cb->add(VCoursePeer::SUBJECT_GROUP_ID, 7, Criteria::IN);
$cb->add(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN);
$cb->add(VCoursePeer::SUBJECT_CURR_ID, 333, Criteria::NOT_IN);
$cb->addAscendingOrderByColumn(VCoursePeer::CODE);
$this->subjects7 = VCoursePeer::doSelect($cb);
$subject_count7 = VCoursePeer::doCount($cb);
$this->subject_count7 = $subject_count7;
$cm = new Criteria();
$cm->add(VCoursePeer::CLASS_GROUP_ID, $stu_accal->getClassGroupId(), Criteria::IN);
$cm->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
$cm->add(VCoursePeer::SUBJECT_GROUP_ID, 8, Criteria::IN);
$cm->addAscendingOrderByColumn(VCoursePeer::CODE);
$this->subjects8 = VCoursePeer::doSelect($cm);
$subject_count8 = VCoursePeer::doCount($cm);
$this->subject_count8 = $subject_count8;
}
$rpp = $this->getRequestParameter('max_per_page', 999);
$pager = new sfPropelPager('VCourse', $rpp);
$pager->setCriteria($c);
$pager->setPage($this->getRequestParameter('page', 1));
$pager->init();
$this->pager = $pager;
$actions = array(array());
$this->actions = $actions;
}
示例8: executeGetListForCourse
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;
}
示例9: executePrintFinal
public function executePrintFinal()
{
$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);
$co = new Criteria();
$co->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
$co->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$cton1 = $co->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 319, Criteria::NOT_IN);
$cton2 = $co->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 333, Criteria::NOT_IN);
$cton1->addAnd($cton2);
$co->add($cton1);
$co->addAscendingOrderByColumn(VCoursePeer::CODE);
$this->subjects = VCoursePeer::doSelect($co);
$subject_count = VCoursePeer::doCount($co);
$this->subject_count = $subject_count;
$cw = new Criteria();
$cw->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
$cw->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
$cton1 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 350, Criteria::IN);
$cton2 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 351, Criteria::IN);
$cton3 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 346, Criteria::IN);
$cton4 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 339, Criteria::IN);
$cton5 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 340, Criteria::IN);
$cton6 = $cw->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 337, Criteria::IN);
$cton5->addOr($cton6);
$cton4->addOr($cton5);
$cton3->addOr($cton4);
$cton2->addOr($cton3);
$cton1->addOr($cton2);
$cw->add($cton1);
$cw->addAscendingOrderByColumn(VCoursePeer::CODE);
$this->subjects1 = VCoursePeer::doSelect($cw);
$subject_count1 = VCoursePeer::doCount($cw);
$this->subject_count1 = $subject_count1;
$cm = new Criteria();
$cm->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
$cm->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
$cton1 = $cm->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 353, Criteria::IN);
$cton2 = $cm->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 354, Criteria::IN);
$cton1->addOr($cton2);
$cm->add($cton1);
$cm->addAscendingOrderByColumn(VCoursePeer::CODE);
$this->ipas = VCoursePeer::doSelect($cm);
$ipa_count = VCoursePeer::doCount($cm);
$this->ipa_count = $ipa_count;
$cl = new Criteria();
$cl->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
$cl->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
$cton1 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 343, Criteria::IN);
$cton2 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 338, Criteria::IN);
$cton3 = $cl->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 347, Criteria::IN);
$cton2->addOr($cton3);
$cton1->addOr($cton2);
$cl->add($cton1);
$cl->addAscendingOrderByColumn(VCoursePeer::CODE);
$this->ips = VCoursePeer::doSelect($cl);
$ips_count = VCoursePeer::doCount($cl);
$this->ips_count = $ips_count;
$cd = new Criteria();
$cd->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
$cd->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
$cton1 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 352, Criteria::IN);
$cton2 = $cd->getNewCriterion(VCoursePeer::SUBJECT_CURR_ID, 349, Criteria::IN);
$cton1->addOr($cton2);
$cd->add($cton1);
$cd->addAscendingOrderByColumn(VCoursePeer::CODE);
$this->subjects2 = VCoursePeer::doSelect($cd);
$subject_count2 = VCoursePeer::doCount($cd);
$this->subject_count2 = $subject_count2;
$cp = new Criteria();
$cp->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
$cp->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
$cp->add(VCoursePeer::SUBJECT_CURR_ID, 348, Criteria::IN);
$cp->addAscendingOrderByColumn(VCoursePeer::CODE);
$this->subjects3 = VCoursePeer::doSelect($cp);
$subject_count3 = VCoursePeer::doCount($cp);
$this->subject_count3 = $subject_count3;
$cq = new Criteria();
$cq->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
$cq->add(VCoursePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId(), Criteria::IN);
$cq->add(VCoursePeer::SUBJECT_CURR_ID, 341, Criteria::IN);
$cq->addAscendingOrderByColumn(VCoursePeer::CODE);
$this->subject4 = VCoursePeer::doSelectOne($cq);
$subject_count4 = VCoursePeer::doCount($cq);
$this->subject_count4 = $subject_count4;
$cblek = new Criteria();
$cblek->add(VCoursePeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::IN);
//.........这里部分代码省略.........
示例10: executeSaveNote
public function executeSaveNote()
{
$counseling_id = $this->getRequestParameter('counseling_id');
$counseling = CounselingPeer::retrieveByPK($counseling_id);
#$this->forward404Unless($counseling);
$accal_id = $this->getRequestParameter('academic_calendar_id');
$academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
#$this->forward404Unless($academic_calendar);
$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, $academic_calendar->getId());
$ced->add(StudentNotePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
$ced->add(StudentNotePeer::COUNSELING_ID, $counseling->getId());
$note = StudentNotePeer::doSelectOne($ced);
if ($note == null) {
$note = new StudentNote();
}
$note->setStudentId($m);
$note->setAcademicCalendarId($academic_calendar->getId());
$note->setClassGroupId($counseling->getClassGroupId());
$note->setCounselingId($counseling->getId());
$note->setNote($desc);
$note->save();
} else {
$ced = new Criteria();
$ced->add(StudentNotePeer::STUDENT_ID, $m);
$ced->add(StudentNotePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$ced->add(StudentNotePeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
$ced->add(StudentNotePeer::COUNSELING_ID, $counseling->getId());
$note = StudentNotePeer::doSelectOne($ced);
if ($note != null) {
$note->delete();
}
}
}
}
return $this->redirect('counseling/listNote?accal_id=' . $academic_calendar->getId() . '&counseling_id=' . $counseling->getId());
}
示例11: image_path
?>
<table border="0" width="100%" style="page-break-after: always;">
<tr>
<td width="100%" align="left">
<table border="0" width="100%">
<tr>
<td width="18%" align="center">
<img src='<?php
echo image_path('logo_' . $academic_calendar->getDepartment()->getNumCode() . '.jpg', true);
?>
' border=0 >
</td>
<?php
$academicYear = AcademicCalendarPeer::retrieveByPK($academic_calendar->getParent());
?>
<td align="center">
<center class="subtitle" style="font-weight: normal;">LAPORAN NILAI TENGAH SEMESTER</center>
<center class="subtitle" style="font-weight: normal;">TAHUN PELAJARAN <?php
echo $academicYear->getName();
?>
</center>
<center class="subtitle" style="font-weight: normal;">SMP ISLAM AL AZHAR 9 KEMANG PRATAMA</center>
<center class="subtitle"></center>
<center style="font-weight: 12px;"><?php
echo $department_detail ? $department_detail->getAddress() ? $department_detail->getAddress() : '' : '';
#echo $score_rule->getId()
?>
<?php
#echo $s_rule->getId()
示例12: executeListRaport
public function executeListRaport()
{
$accal_id = $this->getRequestParameter('accal_id');
$academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
$this->forward404Unless($academic_calendar);
$cw = new Criteria();
$cw->add(ClassGroupPeer::PARENT, 0);
$classes = ClassGroupPeer::doSelect($cw);
$class_id = array();
foreach ($classes as $classe) {
$class_ids[] = $classe->getId();
}
$c = new Criteria();
$c->add(ClassGroupPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId(), Criteria::IN);
$cton1 = $c->getNewCriterion(ClassGroupPeer::PARENT, 0, Criteria::NOT_IN);
$cton2 = $c->getNewCriterion(ClassGroupPeer::PARENT, $class_ids, Criteria::NOT_IN);
$cton1->addAnd($cton2);
$c->add($cton1);
$this->sortClass($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->filterClass($c, $this->getRequestParameter('filters'));
}
}
}
$rpp = $this->getRequestParameter('max_per_page', $this->getUser()->getAttribute('max_per_page', ParamsPeer::retrieveByCode('row_per_page')->getValue(), 'class_group'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'class_group');
$pager = new sfPropelPager('ClassGroup', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'class_group'));
$this->getUser()->setAttribute('page', $page, 'class_group');
$pager->setPage($page);
$pager->init();
$this->pager = $pager;
## Menentukan Aturan Penilaian
$cd = new Criteria();
$cd->add(ClassGroupPeer::DEPARTMENT_ID, $academic_calendar->getDepartmentId());
$cd->addJoin(ScoreRulePeer::CLASS_GROUP_ID, ClassGroupPeer::ID);
$cd->add(ScoreRulePeer::TYPE, 1);
$score_rule = ScoreRulePeer::doSelectOne($cd);
$this->score_rule = $score_rule;
## Menentukan Aturan Penilaian Yang digunakan
$cm = new Criteria();
$cm->add(ScoreRuleSubjectPeer::SCORE_RULE_ID, $score_rule->getId(), Criteria::IN);
$cm->add(ScoreRuleSubjectPeer::PUBLISHED, 1, Criteria::IN);
$cm->addAscendingOrderByColumn(ScoreRuleSubjectPeer::SEQUENCE);
$list_subs = ScoreRuleSubjectPeer::doSelect($cm);
$subject_count = ScoreRuleSubjectPeer::doCount($cm);
$this->list_subs = $list_subs;
$this->subject_count = $subject_count;
$actions = array();
array_unshift($actions, array('name' => 'Print PDF', 'url' => "rpt_all_academic/listRaportAsPDF?accal_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct'));
array_unshift($actions, array('name' => 'Print Excel', 'url' => "rpt_all_academic/listRaportAsCSV?accal_id=" . $academic_calendar->getId(), 'color' => 'black', 'type' => 'direct'));
$this->actions = $actions;
$actions2 = array(array('name' => '<span>' . $academic_calendar->toString() . '</span>', 'url' => 'rpt_all_academic/list', 'color' => 'volcadot'));
array_push($actions2, array('name' => '<span>Analisis Nilai UTS</span>', 'url' => 'rpt_all_academic/listUts?accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Analisis Nilai UAS</span>', 'url' => 'rpt_all_academic/listUas?accal_id=' . $academic_calendar->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Analisis Nilai Raport</span>', 'url' => 'rpt_all_academic/listRaport?accal_id=' . $academic_calendar->getId(), 'color' => 'sky', 'type' => 'direct'));
$this->actions2 = $actions2;
$this->subtitle = $academic_calendar->toString();
$this->academic_calendar = $academic_calendar;
}
示例13: executeUpdateScoreAfective
public function executeUpdateScoreAfective()
{
$subject_id = $this->getRequestParameter('subject_id');
$class_id = $this->getRequestParameter('class_id');
$accal_id = $this->getRequestParameter('accal_id');
$course_id = $this->getRequestParameter('course_id');
$grade_spec_id = $this->getRequestParameter('grade_spec_id');
$course_schedule = CourseSchedulePeer::retrieveByPK($course_id);
$academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
$scores = $this->getRequestParameter('score');
foreach ($scores as $k => $score) {
if ($score != null) {
if ($score != '-') {
$ids = split('_', $k);
$c = new Criteria();
$c->add(StudentGradeRaportPeer::STUDENT_ACCAL_ID, $ids[0]);
$c->add(StudentGradeRaportPeer::GRADE_SPEC_ID, $ids[1]);
$c->add(StudentGradeRaportPeer::COURSE_SCHEDULE_ID, $course_id);
$g = StudentGradeRaportPeer::doSelectOne($c);
if ($g == null) {
$g = new StudentGradeRaport();
}
$g->setGradeSpecId($ids[1]);
$g->setGrade($score);
$g->setCourseScheduleId($course_id);
$g->setGradeValue($score);
$g->setStudentAccalId($ids[0]);
$g->setSubjectCurrId($course_schedule->getSubjectCurrId());
$g->save();
} else {
$ids = split('_', $k);
$c = new Criteria();
$c->add(StudentGradeRaportPeer::STUDENT_ACCAL_ID, $ids[0]);
$c->add(StudentGradeRaportPeer::GRADE_SPEC_ID, $ids[1]);
$c->add(StudentGradeRaportPeer::COURSE_SCHEDULE_ID, $course_id);
$g = StudentGradeRaportPeer::doSelectOne($c);
if ($g != null) {
$g->delete();
}
}
}
}
return $this->redirect('course_afective/finishScore?course_id=' . $course_id . '&grade_spec_id=' . $grade_spec_id);
}
示例14: executeSelectByAccal
public function executeSelectByAccal()
{
$student_course_id = $this->getRequestParameter('student_course_id');
$student_course = StudentCoursePeer::retrieveByPK($student_course_id);
if (!$student_course) {
$student_course = new StudentCourse();
}
$student_id = $this->getRequestParameter('student_id');
$student = StudentPeer::retrieveByPK($student_id);
// $this->forward404Unless($student);
$accal_id = $this->getRequestParameter('accal_id');
$accal = AcademicCalendarPeer::retrieveByPK($accal_id);
$disabled = array();
if ($student) {
$student_courses = $student->getStudentCoursesJoinSubjectAccal();
foreach ($student_courses as $sc) {
if ($sc->getSubjectAccal()->getAcademicCalendarId() == $accal->getId() && $student_course->getSubjectAccalId() != $sc->getSubjectAccal()->getId()) {
$disabled[] = $sc->getSubjectAccal()->getId();
}
}
}
$content = array();
$objs = SubjectAccalPeer::doSelectByAccal();
if ($student) {
foreach ($objs as $o) {
$content[$o->getId()] = $o->toString();
$c = new Criteria();
$c->add(SubjectAccalPeer::ID, $o->getId());
$c->add(SubjectCurrPeer::SUBJECT_ID, $o->getSubjectId());
$c->addJoin(AcademicCalendarPeer::ID, SubjectAccalPeer::ACADEMIC_CALENDAR_ID);
$c->addJoin(AcademicCalendarPeer::CURRICULUM_ID, SubjectCurrPeer::CURRICULUM_ID);
$c->addJoin(SubjectCurrPeer::ID, SubjectPrereqPeer::SUBCURR);
$sps = SubjectPrereqPeer::doSelect($c);
foreach ($sps as $sp) {
$s = $sp->getSubjectCurrRelatedBySubcurrPrereq()->getSubject();
// prereq subject must be in closed state
$c = new Criteria();
$c->add(SubjectAccalPeer::SUBJECT_ID, $s->getId());
$c->add(StudentCoursePeer::STUDENT_ID, $student_id);
$c->add(StudentCoursePeer::STATUS, StudentCourse::STATUS_CLOSED);
$c->addJoin(StudentCoursePeer::SUBJECT_ACCAL_ID, SubjectAccalPeer::ID);
$scs = StudentCoursePeer::doSelect($c);
$isPassGrade = false;
$isPassCredit = true;
$isPassIndex = true;
foreach ($scs as $sc) {
$grade = $sc->getFinalGrade();
$gc = GradeConversionPeer::retrieveByName($grade[0]);
// check prereq subject grade
if ($gc && $gc->getGrade() >= $sp->getGradeConversion()->getGrade()) {
$isPassGrade = true;
} else {
$isPassGrade = false;
}
// check credit requirement
if ($sp->getTotalCredit() > 0) {
if ($sc->getTotalCreditClosed() >= $sp->getTotalCredit()) {
$isPassCredit = true;
} else {
$isPassCredit = false;
}
}
// check index requirement
if ($sp->getPerformanceIndex() > 0) {
if ($sc->getPerformanceIndex() >= $sp->getPerformanceIndex()) {
$isPassIndex = true;
} else {
$isPassIndex = false;
}
}
}
$s0 = $sp->getSubjectCurrRelatedBySubcurrPrereq()->getSubject()->toString();
$s1 = $sp->getSubjectCurrRelatedBySubcurr()->getSubject()->toString();
// echo "<div align=left><pre>";
// echo "$s1 -> $s0 | isPassGrade:$isPassGrade isPassCredit:$isPassCredit isPassIndex:$isPassIndex";
// echo "</pre></div>";
if (!$isPassGrade || !$isPassCredit || !$isPassIndex) {
$disabled[] = $o->getId();
}
}
}
} else {
foreach ($objs as $o) {
$content[$o->getId()] = $o->toString();
}
}
$this->content = $content;
$this->disabled = $disabled;
}
示例15: executeUpdateScore
public function executeUpdateScore()
{
$subject_id = $this->getRequestParameter('subject_id');
$class_id = $this->getRequestParameter('class_id');
$accal_id = $this->getRequestParameter('accal_id');
$course_id = $this->getRequestParameter('course_id');
$grade_spec_id = $this->getRequestParameter('grade_spec_id');
$academic_calendar = AcademicCalendarPeer::retrieveByPK($accal_id);
$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, $class_id);
$cd->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $accal_id);
$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, $subject_id);
$c->add(StudentRaportPeer::CLASS_GROUP_ID, $class_id);
$c->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $accal_id);
$g = StudentRaportPeer::doSelectOne($c);
if ($g == null) {
$g = new StudentRaport();
}
$g->setStudentId($ids[0]);
$g->setGradeSpecId($ids[1]);
$g->setGrade($score);
$g->setSubjectCurrId($subject_id);
$g->setClassGroupId($class_id);
$g->setAcademicCalendarId($accal_id);
$g->setCitationId($stu_accal->getId());
$g->save();
## UTS Teori dan Praktek
if ($ids[1] == 22 || $ids[1] == 23) {
$cg = new Criteria();
$cg->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
$cg->add(StudentRaportPeer::GRADE_SPEC_ID, 22);
$cg->add(StudentRaportPeer::SUBJECT_CURR_ID, $subject_id);
$cg->add(StudentRaportPeer::CLASS_GROUP_ID, $class_id);
$cg->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $accal_id);
$praktek_uts = StudentRaportPeer::doSelectOne($cg);
$cf = new Criteria();
$cf->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
$cf->add(StudentRaportPeer::GRADE_SPEC_ID, 23);
$cf->add(StudentRaportPeer::SUBJECT_CURR_ID, $subject_id);
$cf->add(StudentRaportPeer::CLASS_GROUP_ID, $class_id);
$cf->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $accal_id);
$teori_uts = StudentRaportPeer::doSelectOne($cf);
if ($praktek_uts != null && $teori_uts != null) {
$score_uts = round(($praktek_uts->getGrade() + $teori_uts->getGrade()) / 2);
} elseif ($praktek_uts != null && $teori_uts == null) {
$score_uts = $praktek_uts->getGrade();
} elseif ($praktek_uts == null && $teori_uts != null) {
$score_uts = $teori_uts->getGrade();
}
$f = new Criteria();
$f->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
$f->add(StudentRaportPeer::GRADE_SPEC_ID, 14);
$f->add(StudentRaportPeer::SUBJECT_CURR_ID, $subject_id);
$f->add(StudentRaportPeer::CLASS_GROUP_ID, $class_id);
$f->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $accal_id);
$uts = StudentRaportPeer::doSelectOne($f);
if ($uts == null) {
$uts = new StudentRaport();
}
$uts->setStudentId($ids[0]);
$uts->setGradeSpecId(14);
$uts->setGrade($score_uts);
$uts->setSubjectCurrId($subject_id);
$uts->setClassGroupId($class_id);
$uts->setAcademicCalendarId($accal_id);
$uts->setCitationId($stu_accal->getId());
$uts->save();
## UAS Teori dan Praktek
} elseif ($ids[1] == 27 || $ids[1] == 28) {
$ct = new Criteria();
$ct->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
$ct->add(StudentRaportPeer::GRADE_SPEC_ID, 27);
$ct->add(StudentRaportPeer::SUBJECT_CURR_ID, $subject_id);
$ct->add(StudentRaportPeer::CLASS_GROUP_ID, $class_id);
$ct->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $accal_id);
$praktek_uas = StudentRaportPeer::doSelectOne($ct);
$ch = new Criteria();
$ch->add(StudentRaportPeer::STUDENT_ID, $ids[0]);
$ch->add(StudentRaportPeer::GRADE_SPEC_ID, 28);
$ch->add(StudentRaportPeer::SUBJECT_CURR_ID, $subject_id);
$ch->add(StudentRaportPeer::CLASS_GROUP_ID, $class_id);
$ch->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $accal_id);
$teori_uas = StudentRaportPeer::doSelectOne($ch);
if ($praktek_uas != null && $teori_uas != null) {
$score_uas = round(($praktek_uas->getGrade() + $teori_uas->getGrade()) / 2);
} elseif ($praktek_uas != null && $teori_uas == null) {
$score_uas = $praktek_uas->getGrade();
} elseif ($praktek_uas == null && $teori_uas != null) {
$score_uas = $teori_uas->getGrade();
}
//.........这里部分代码省略.........