本文整理汇总了PHP中GradeSpecPeer::retrieveByPK方法的典型用法代码示例。如果您正苦于以下问题:PHP GradeSpecPeer::retrieveByPK方法的具体用法?PHP GradeSpecPeer::retrieveByPK怎么用?PHP GradeSpecPeer::retrieveByPK使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GradeSpecPeer
的用法示例。
在下文中一共展示了GradeSpecPeer::retrieveByPK方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: executeGetChild
public function executeGetChild()
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$ct = new Criteria();
$ct->add(JobPeer::CODE, $this->getModuleName());
$job = JobPeer::doSelectOne($ct);
$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;
$id = $this->getRequestParameter('id');
$grade_spec = GradeSpecPeer::retrieveByPK($id);
$level = $this->getRequestParameter('level');
if ($level == null) {
$level = 0;
}
$c = new Criteria();
$c->add(GradeSpecPeer::PARENT, $grade_spec->getId());
$this->sort($c);
$this->rows = GradeSpecPeer::doSelect($c);
$this->level = $level + 1;
$this->parent_id = $id;
$this->parent_class = $this->getRequestParameter('parent_class');
}
示例2: getLevel
public function getLevel()
{
if ($this->getParent() != 0) {
return GradeSpecPeer::retrieveByPK($this->getParent())->getLevel() + 1;
} else {
return 1;
}
}
示例3: getGradeSpec
public function getGradeSpec($con = null)
{
include_once 'lib/model/om/BaseGradeSpecPeer.php';
if ($this->aGradeSpec === null && $this->grade_spec_id !== null) {
$this->aGradeSpec = GradeSpecPeer::retrieveByPK($this->grade_spec_id, $con);
}
return $this->aGradeSpec;
}
示例4: getGradeSpecRelatedByParent
public function getGradeSpecRelatedByParent($con = null)
{
include_once 'lib/model/om/BaseGradeSpecPeer.php';
if ($this->aGradeSpecRelatedByParent === null && $this->parent !== null) {
$this->aGradeSpecRelatedByParent = GradeSpecPeer::retrieveByPK($this->parent, $con);
}
return $this->aGradeSpecRelatedByParent;
}
示例5: input_tag
<td ><?php
echo $student->getStudent() ? $student->getStudent()->getName() : '-';
?>
</td>
<td align="center"><?php
echo $course_reg ? $course_reg->getKkm() ? $course_reg->getKkm() : '-' : '-';
?>
</td>
<td class="first" align="center">
<?php
echo input_tag('score[' . $student->getStudentId() . '_' . $grade_spec->getId() . ']', array_key_exists($student->getStudentId() . '#' . $grade_spec->getId(), $grades) ? $grades[$student->getStudentId() . '#' . $grade_spec->getId()] : '', array('size' => 2, 'maxlength' => 5, 'style' => 'font-size: 10px;'));
?>
</td>
<?php
if (GradeSpecPeer::retrieveByPK($grade_spec->getParent())->getParent() == 1) {
?>
<?php
$ct = new Criteria();
$ct->add(GradeSpecPeer::PARENT, $grade_spec->getParent(), Criteria::IN);
$ct->add(GradeSpecPeer::ID, $grade_spec->getId(), Criteria::NOT_IN);
$specs = GradeSpecPeer::doSelect($ct);
foreach ($specs as $spec) {
?>
<td align="center"><?php
echo array_key_exists($student->getStudentId() . '#' . $spec->getId(), $grades) ? $grades[$student->getStudentId() . '#' . $spec->getId()] : '-';
?>
</td>
<?php
示例6: executeGetListAfective
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: executeSaveUploadTest
public function executeSaveUploadTest()
{
$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();
$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);
$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();
$grade_spec = GradeSpecPeer::retrieveByPK($ids[2]);
if ($c_regulation) {
#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()) {
if ($uh == null) {
$uh = new StudentRaport();
}
$uh->setStudentId($ids[0]);
$uh->setGradeSpecId($grade_spec->getParent());
$uh->setGrade($c_regulation->getKkm());
$uh->setSubjectCurrId($course_schedule->getSubjectCurrId());
$uh->setClassGroupId($course_schedule->getClassGroupId());
$uh->setAcademicCalendarId($course_schedule->getAcademicCalendarId());
$uh->setCitationId($stu_accal->getId());
$uh->save();
} elseif ($nr->getGrade() < $c_regulation->getKkm()) {
if ($uh == null) {
//.........这里部分代码省略.........
示例8: sendSmsCourseTest
public function sendSmsCourseTest($schedule, $userType, $userMessage)
{
$dayName = array(1 => 'Senin', 2 => 'Selasa', 3 => 'Rabu', 4 => 'Kamis', 5 => "Jum'at", 6 => 'Sabtu', 7 => 'Minggu');
$gradeSpecCode = $schedule->getGradeSpec()->getCode();
$parentGradeSpec = GradeSpecPeer::retrieveByPK($schedule->getGradeSpec()->getParent());
$parentCode = $parentGradeSpec->getCode();
$gradeSpec = $parentCode . '' . $gradeSpecCode;
$subjectCurr = $schedule->getSubjectCurr()->getSubject()->getCode();
$classGroup = $schedule->getClassGroup()->getName();
$location = $schedule->getLocation()->getCampus();
$day = $dayName[date('N', strtotime($schedule->getDate()))];
$date = date('d-n-y', strtotime($schedule->getDate()));
$time = date('H:i', strtotime($schedule->getDate()));
$materi = $schedule->getDetail();
$departmentId = $schedule->getClassGroup()->getDepartmentId();
$senderId = $this->getSenderId($departmentId);
/* Generate Message */
$message = $senderId->getText() . ' ';
$message .= $gradeSpec . ' ' . $subjectCurr . ' ' . $classGroup . '. ' . $day . ', ' . $date . ' ' . '. ' . $userMessage;
/* Get Students */
$students = $this->contact->getStudents($schedule->getClassGroupId());
/* Mapping SMS */
$sms = array('subject' => 'INFO JADWAL ' . $gradeSpec . ' ' . $subjectCurr . ' kelas ' . $classGroup, 'message' => $message);
$this->sendSmsToStudent($senderId->getId(), $schedule->getEmployeeId(), $userType, $sms, $students);
}
示例9: executeGetList
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;
}