本文整理汇总了PHP中ClassGroupPeer::retrieveByPk方法的典型用法代码示例。如果您正苦于以下问题:PHP ClassGroupPeer::retrieveByPk方法的具体用法?PHP ClassGroupPeer::retrieveByPk怎么用?PHP ClassGroupPeer::retrieveByPk使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ClassGroupPeer
的用法示例。
在下文中一共展示了ClassGroupPeer::retrieveByPk方法的14个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getParentName
public function getParentName()
{
if ($this->getParent() != null && $this->getParent() != 0) {
return ClassGroupPeer::retrieveByPk($this->getParent())->getName();
}
return '-';
}
示例2: link_to_remote
<div class="login">
<p style="text-align:left; width:90%; line-height: 15px; padding-top: 0px;"></p>
<h2 class="contentheading"><b><?php
echo $this->getContext()->getUser()->getAttribute('username_long', '', 'bo');
?>
</b></h2>
<?php
$applicant = TestApplicantPeer::retrieveByPk($this->getContext()->getUser()->getAttribute('user_id', '', 'bo'));
$cls = ClassGroupPeer::retrieveByPk($applicant->getClassGroup1());
?>
<p style="padding-top: 15px; line-height: 20px;">No. Pendaftaran Anda adalah <br><b><?php
echo $applicant->getCode() ? $applicant->getCode() : '-';
?>
</b><br />
Pilihan Kelas Anda adalah <br><b><?php
echo $applicant->getClassGroup1() ? $cls->toString() . ' - ' . $cls->getParentName() : '-';
?>
</b><br /><br>
<?php
echo link_to_remote('Informasi Detail', array('url' => 'auth/test?id=' . $applicant->getId(), 'update' => 'content', 'script' => 'true'), array('class' => 'user_logout', 'title' => 'Detail Informasi'));
?>
<br />
<?php
echo link_to('Logout', '/auth/logout', 'class=user_logout title=keluar');
?>
</p>
</div>
示例3:
<td align="left">2.</td>
<td align="left">Nama</td>
<td align="center">:</td>
<td align="left"><?php
echo $ta->getName() ? $ta->getName() : '-';
?>
</td>
</tr>
<tr>
<td></td>
<td align="left">3.</td>
<td align="left">Pilihan Kelas</td>
<td align="center">:</td>
<td align="left">
<?php
$cls = ClassGroupPeer::retrieveByPk($ta->getClassGroup1());
echo $ta->getClassGroup1() ? $cls->toString() . ' - ' . $cls->getParentName() : '-';
?>
</td>
</tr>
<tr>
<td></td>
<td align="left">4.</td>
<td align="left">Asal Sekolah</td>
<td align="center">:</td>
<td align="left"><?php
echo $ta_detail->getJobTitle() ? $ta_detail->getJobTitle() : '-';
?>
</td>
</tr>
<tr>
示例4: elseif
?>
<?php
}
?>
<?php
} else {
?>
<?php
echo '-';
?>
<?php
}
?>
</td>
<td><?php
echo $student->getClassGroupId() ? ClassGroupPeer::retrieveByPk($student->getClassGroupId())->toString() : '-';
?>
</td>
<td><?php
if ($student->getStatus() == Student::STATUS_ACTIVE) {
echo __('_STUDENT_STATUS_ACTIVE_');
} elseif ($student->getStatus() == Student::STATUS_INACTIVE) {
echo __('_STUDENT_STATUS_INACTIVE_');
} elseif ($student->getStatus() == Student::STATUS_OVERDUE) {
echo __('_STUDENT_STATUS_OVERDUE_');
} elseif ($student->getStatus() == Student::STATUS_FINAL) {
echo __('_STUDENT_STATUS_FINAL_');
} elseif ($student->getStatus() == Student::STATUS_GRADUATE) {
echo __('_STUDENT_STATUS_GRADUATE_');
}
?>
示例5:
</tr>
<tr>
<td align="left">9.</td>
<td align="left">Diterima di Sekolah ini</td>
<td align="center">:</td>
<td align="left"></td>
</tr>
<tr>
<td align="left"></td>
<td align="left">a. Di Kelas <?php
echo $score_rule ? $score_rule->getLanguage() == 'Bilingual' ? '<i style="font-size: 80%; font-weight: normal;"> / In The Grade</i>' : '' : '';
?>
</td>
<td align="center">:</td>
<td align="left"><?php
echo $applicant ? ClassGroupPeer::retrieveByPk($applicant->getClassGroup1())->toString() : '-';
?>
</td>
</tr>
<tr>
<td align="left"></td>
<td align="left">b. Pada Tanggal <?php
echo $score_rule ? $score_rule->getLanguage() == 'Bilingual' ? '<i style="font-size: 80%; font-weight: normal;"> / On The Date of</i>' : '' : '';
?>
</td>
<td align="center">:</td>
<td align="left">12 Juli <?php
echo $student->getYear() ? $student->getYear() : ' ';
?>
</td>
</tr>
示例6: executeListSubject
public function executeListSubject(Criteria $cr = null)
{
$group_id = $this->getContext()->getUser()->getAttribute('group_id', null, 'bo');
$cr = new Criteria();
$this->class_group = ClassGroupPeer::retrieveByPk($this->getRequestParameter('class_id'));
$this->forward404Unless($this->class_group);
$this->academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal_id'));
$this->forward404Unless($this->academic_calendar);
$cr->add(SubjectAccalPeer::ACADEMIC_CALENDAR_ID, $this->academic_calendar->getId());
$cr->addJoin(CourseSchedulePeer::SUBJECT_ACCAL_ID, SubjectAccalPeer::ID);
$cr->add(CourseSchedulePeer::CLASS_GROUP_ID, $this->class_group->getId());
$this->sortSubject($cr);
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('CourseSchedule', $rpp);
$cr->add(SubjectAccalPeer::ACADEMIC_CALENDAR_ID, $this->academic_calendar->getId());
$cr->addJoin(CourseSchedulePeer::SUBJECT_ACCAL_ID, SubjectAccalPeer::ID);
$cr->add(CourseSchedulePeer::CLASS_GROUP_ID, $this->class_group->getId());
$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;
#array_unshift($actions, array('name'=>'_AS_CSV_','url'=>"subject_plan/listSubjectAsCSV?$filter_string", 'color'=>'white', 'type'=>'direct'));
#array_unshift($actions, array('name'=>'_AS_PDF_','url'=>"subject_plan/listSubjectAsPDF?$filter_string", 'color'=>'white', 'type'=>'direct'));
array_unshift($actions, array('name' => 'back', 'url' => "subject_plan/list", 'color' => 'green'));
$this->subtitle = '';
$this->actions = $actions;
}
示例7: input_hidden_tag
<?php
echo input_hidden_tag('accal2', $accal2);
?>
</td>
</tr>
<tr>
<td width="20%" style="vertical-align:middle;"><label><?php
echo __('Class group');
?>
</label></td>
<td width="2%" style="text-align:center; vertical-align:middle;">:</td>
<td style="vertical-align:middle;">
<p class="detail" style="font-weight: bold;">
<?php
echo $class2 ? ClassGroupPeer::retrieveByPk($class2)->getName() : '-';
?>
</p>
<?php
echo input_hidden_tag('class2', $class2);
?>
</td>
</tr>
</tbody>
</table>
</td></tr>
</table>
<table class="form">
<tr><td class="form">
<table class="form_content" width="100%">
示例8: executeSimpan
public function executeSimpan()
{
$academic1 = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal1'));
$academic2 = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal2'));
$class1 = ClassGroupPeer::retrieveByPk($this->getRequestParameter('class1'));
$class2 = ClassGroupPeer::retrieveByPk($this->getRequestParameter('class2'));
return $this->redirect('score_rule_new/preview?class1=' . $this->getRequestParameter('class1') . '&accal1=' . $this->getRequestParameter('accal1') . '&class2=' . $this->getRequestParameter('class2') . '&accal2=' . $this->getRequestParameter('accal2'));
}
示例9: executeGraduateReceipt
public function executeGraduateReceipt()
{
$ta_id = $this->getRequestParameter('id');
$ta = TestApplicantPeer::retrieveByPK($ta_id);
$this->forward404Unless($ta);
$this->ta = $ta;
$ta_detail = $ta->getTestApplicantDetail();
$this->ta_detail = $ta_detail;
$cw = new Criteria();
$cw->add(DepartmentDetailPeer::DEPARTMENT_ID, $ta->getDepartment1());
$this->department_detail = DepartmentDetailPeer::doSelectOne($cw);
#Uang Osis Untuk SMP
if ($ta->getDepartment1() == 2) {
$cm = new Criteria();
$cm->add(AcademicCostPeer::ACADEMIC_CALENDAR_ID, RegTestPeriodPeer::retrieveByPK($ta->getRegTestPeriod1())->getRegPeriod()->getAcademicCalendarId());
$cm->add(AcademicCostPeer::ACADEMIC_COST_COMPONENT_ID, 30);
#$cm->add(AcademicCostPeer::CLASS_GROUP_ID, ClassGroupPeer::retrieveByPk($ta->getClassGroup1())->getId());
$this->osis = AcademicCostPeer::doSelectOne($cm);
}
#Calon Siswa dari Al-Azhar
if ($ta->getIsAlazhar() == TestApplicant::IS_ALAZHAR) {
#Ayah atau Ibu Guru
if ($ta_detail->getFatherJob() == TestApplicant::IS_TEACHER || $ta_detail->getMotherJob() == TestApplicant::IS_TEACHER) {
#Guru Pengajar Al-Azhar (Siswa Dalam - Guru Dalam)
if ($ta_detail->getDetailFatherJob() == 1 || $ta_detail->getDetailMotherJob() == 1) {
$c = new Criteria();
$c->add(AcademicCostPeer::ACADEMIC_CALENDAR_ID, RegTestPeriodPeer::retrieveByPK($ta->getRegTestPeriod1())->getRegPeriod()->getAcademicCalendarId());
$c->add(AcademicCostPeer::ACADEMIC_PROCESS_ID, 1);
$c->add(AcademicCostPeer::CLASS_GROUP_ID, ClassGroupPeer::retrieveByPk($ta->getClassGroup1())->getParent());
$cton1 = $c->getNewCriterion(AcademicCostPeer::PAYER_TYPE_ID, 7);
$cton2 = $c->getNewCriterion(AcademicCostPeer::PAYER_TYPE_ID, 10);
$cton1->addOr($cton2);
$c->add($cton1);
$c->addDescendingOrderByColumn(AcademicCostPeer::AMOUNT);
$academic_costs = AcademicCostPeer::doSelect($c);
$this->academic_costs = $academic_costs;
#SPP Bulanan Guru Dalam
$cr = new Criteria();
$cr->add(AcademicCostPeer::ACADEMIC_CALENDAR_ID, RegTestPeriodPeer::retrieveByPK($ta->getRegTestPeriod1())->getRegPeriod()->getAcademicCalendarId());
$cr->add(AcademicCostPeer::ACADEMIC_PROCESS_ID, 2);
$cr->add(AcademicCostPeer::CLASS_GROUP_ID, ClassGroupPeer::retrieveByPk($ta->getClassGroup1())->getId());
$cr->add(AcademicCostPeer::PAYER_TYPE_ID, 19);
$this->spp = AcademicCostPeer::doSelectOne($cr);
#Guru Pengajar (Siswa Dalam - Guru Luar)
} else {
$c = new Criteria();
$c->add(AcademicCostPeer::ACADEMIC_CALENDAR_ID, RegTestPeriodPeer::retrieveByPK($ta->getRegTestPeriod1())->getRegPeriod()->getAcademicCalendarId());
$c->add(AcademicCostPeer::ACADEMIC_PROCESS_ID, 1);
$c->add(AcademicCostPeer::CLASS_GROUP_ID, ClassGroupPeer::retrieveByPk($ta->getClassGroup1())->getParent());
$cton1 = $c->getNewCriterion(AcademicCostPeer::PAYER_TYPE_ID, 7);
$cton2 = $c->getNewCriterion(AcademicCostPeer::PAYER_TYPE_ID, 9);
$cton1->addOr($cton2);
$c->add($cton1);
$c->addDescendingOrderByColumn(AcademicCostPeer::AMOUNT);
$academic_costs = AcademicCostPeer::doSelect($c);
$this->academic_costs = $academic_costs;
#SPP Bulanan Guru Luar
$cr = new Criteria();
$cr->add(AcademicCostPeer::ACADEMIC_CALENDAR_ID, RegTestPeriodPeer::retrieveByPK($ta->getRegTestPeriod1())->getRegPeriod()->getAcademicCalendarId());
$cr->add(AcademicCostPeer::ACADEMIC_PROCESS_ID, 2);
$cr->add(AcademicCostPeer::CLASS_GROUP_ID, ClassGroupPeer::retrieveByPk($ta->getClassGroup1())->getId());
$cr->add(AcademicCostPeer::PAYER_TYPE_ID, 18);
$this->spp = AcademicCostPeer::doSelectOne($cr);
}
#Ayah dan Ibu Guru
} elseif ($ta_detail->getFatherJob() == TestApplicant::IS_TEACHER && $ta_detail->getMotherJob() == TestApplicant::IS_TEACHER) {
#Guru Pengajar Al-Azhar (Siswa Dalam - Guru Dalam)
if ($ta_detail->getDetailFatherJob() == 1 || $ta_detail->getDetailMotherJob() == 1) {
$c = new Criteria();
$c->add(AcademicCostPeer::ACADEMIC_CALENDAR_ID, RegTestPeriodPeer::retrieveByPK($ta->getRegTestPeriod1())->getRegPeriod()->getAcademicCalendarId());
$c->add(AcademicCostPeer::ACADEMIC_PROCESS_ID, 1);
$c->add(AcademicCostPeer::CLASS_GROUP_ID, ClassGroupPeer::retrieveByPk($ta->getClassGroup1())->getParent());
$cton1 = $c->getNewCriterion(AcademicCostPeer::PAYER_TYPE_ID, 7);
$cton2 = $c->getNewCriterion(AcademicCostPeer::PAYER_TYPE_ID, 10);
$cton1->addOr($cton2);
$c->add($cton1);
$c->addDescendingOrderByColumn(AcademicCostPeer::AMOUNT);
$academic_costs = AcademicCostPeer::doSelect($c);
$this->academic_costs = $academic_costs;
#SPP Bulanan Guru Dalam
$cr = new Criteria();
$cr->add(AcademicCostPeer::ACADEMIC_CALENDAR_ID, RegTestPeriodPeer::retrieveByPK($ta->getRegTestPeriod1())->getRegPeriod()->getAcademicCalendarId());
$cr->add(AcademicCostPeer::ACADEMIC_PROCESS_ID, 2);
$cr->add(AcademicCostPeer::CLASS_GROUP_ID, ClassGroupPeer::retrieveByPk($ta->getClassGroup1())->getId());
$cr->add(AcademicCostPeer::PAYER_TYPE_ID, 19);
$this->spp = AcademicCostPeer::doSelectOne($cr);
#Guru Pengajar (Siswa Dalam - Guru Luar)
} else {
$c = new Criteria();
$c->add(AcademicCostPeer::ACADEMIC_CALENDAR_ID, RegTestPeriodPeer::retrieveByPK($ta->getRegTestPeriod1())->getRegPeriod()->getAcademicCalendarId());
$c->add(AcademicCostPeer::ACADEMIC_PROCESS_ID, 1);
$c->add(AcademicCostPeer::CLASS_GROUP_ID, ClassGroupPeer::retrieveByPk($ta->getClassGroup1())->getParent());
$cton1 = $c->getNewCriterion(AcademicCostPeer::PAYER_TYPE_ID, 7);
$cton2 = $c->getNewCriterion(AcademicCostPeer::PAYER_TYPE_ID, 9);
$cton1->addOr($cton2);
$c->add($cton1);
$c->addDescendingOrderByColumn(AcademicCostPeer::AMOUNT);
$academic_costs = AcademicCostPeer::doSelect($c);
$this->academic_costs = $academic_costs;
#SPP Bulanan Guru Luar
//.........这里部分代码省略.........
示例10: executeDelete
public function executeDelete()
{
$class_group = ClassGroupPeer::retrieveByPk($this->getRequestParameter('id'));
$this->forward404Unless($class_group);
$ref_error = 0;
foreach ($class_group->getRefCountMethods() as $ref) {
$method = "count" . $ref['affix'];
$count = $class_group->{$method}();
if ($count > 0) {
++$ref_error;
$this->getRequest()->setError('class_group/delete/' . sfInflector::camelize($ref['table']), $count);
}
}
if ($ref_error > 0) {
$this->getRequest()->setError('class_group/delete', '_ERR_DELETE_ (' . $class_group->toString() . ' - id:' . $class_group->getId() . ')');
} else {
$class_group->delete();
}
return $this->forward('class_group', 'list');
}
示例11: executeSaveCopy
public function executeSaveCopy()
{
$academic1 = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal1'));
$academic2 = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal2'));
$class1 = ClassGroupPeer::retrieveByPk($this->getRequestParameter('class1'));
$class2 = ClassGroupPeer::retrieveByPk($this->getRequestParameter('class2'));
return $this->redirect('course_sched/previewCopy?class1=' . $this->getRequestParameter('class1') . '&accal1=' . $this->getRequestParameter('accal1') . '&class2=' . $this->getRequestParameter('class2') . '&accal2=' . $this->getRequestParameter('accal2'));
}
示例12: executeSaveStu
public function executeSaveStu()
{
$academic_calendar = AcademicCalendarPeer::retrieveByPK($this->getRequestParameter('accal_id'));
$this->forward404Unless($academic_calendar);
$class_group = ClassGroupPeer::retrieveByPk($this->getRequestParameter('class_id'));
$this->forward404Unless($class_group);
$counseling = CounselingPeer::retrieveByPk($this->getRequestParameter('counseling_id'));
$this->forward404Unless($counseling);
$c = new Criteria();
$c->add(AcademicCalendarPeer::PARENT, $counseling->getAcademicCalendarId());
$accals = AcademicCalendarPeer::doSelect($c);
$student_list_ser = $this->getRequestParameter('student_list_ser');
$params = array();
foreach (explode('&', $this->getRequestParameter('student_list_ser')) as $p) {
$p = explode('=', $p);
$params[rawurldecode($p[0])][] = rawurldecode($p[1]);
}
if (array_key_exists('students', $params)) {
foreach ($params['students'] as $student_id) {
if ($accals) {
foreach ($accals as $accal) {
$ct = new Criteria();
$ct->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $accal->getId(), Criteria::EQUAL);
$ct->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId(), Criteria::NOT_EQUAL);
$ct->add(StudentAccalPeer::STUDENT_ID, $student_id, Criteria::EQUAL);
$stu_accal = StudentAccalPeer::doSelectOne($ct);
if ($stu_accal) {
$stu_accal->delete();
}
$cr = new Criteria();
$cr->add(StudentAccalPeer::ACADEMIC_CALENDAR_ID, $accal->getId());
$cr->add(StudentAccalPeer::CLASS_GROUP_ID, $counseling->getClassGroupId());
$cr->add(StudentAccalPeer::STUDENT_ID, $student_id);
$student_accal = StudentAccalPeer::doSelectOne($cr);
if ($student_accal == null) {
$student_accal = new StudentAccal();
}
$student_accal->setStudentId($student_id);
$student_accal->setAcademicCalendarId($accal->getId());
$student_accal->setClassGroupId($counseling->getClassGroupId());
$student_accal->setStatus(Student::STATUS_ACTIVE);
$student_accal->save();
}
$student = StudentPeer::retrieveByPK($student_id);
#$student->setAcademicCalendarId($counseling->getAcademicCalendarId());
$student->setClassGroupId($counseling->getClassGroupId());
$student->save();
}
}
}
#return $this->redirect('counseling_sd/listEksStu?id='.$schedule->getId().'&detail_id='.$schedule_detail->getId().'&accal_id='.$academic_calendar->getId().'&counseling_id='.$counseling->getId());
#$this->getRequest()->setParameter('accal_id', $academic_calendar->getId());
#$this->getRequest()->setParameter('id', $schedule->getId());
$this->getRequest()->setParameter('id', $counseling->getId());
$this->forward($this->getModuleName(), 'student');
}
示例13: executeGetListForCounseling2
public function executeGetListForCounseling2()
{
$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;
$c = new Criteria();
$dept = $this->getContext()->getUser()->getAttribute('department', null, 'bo');
$c->add(AcademicCalendarPeer::DEPARTMENT_ID, $dept->getChildRecurs(), Criteria::IN);
$c->addJoin(VStudentClassPeer::ACADEMIC_CALENDAR_ID, AcademicCalendarPeer::ID);
$class_id = $this->getRequestParameter('class_id');
$class = ClassGroupPeer::retrieveByPk($class_id);
$class_group = VClassGroupPeer::retrieveByPk($class_id);
if ($class) {
$cton1 = $c->getNewCriterion(VStudentClassPeer::CLASS_GROUP_ID, $class, Criteria::IN);
$cton2 = $c->getNewCriterion(VStudentClassPeer::CLASS_PARENT, $class, Criteria::IN);
$cton1->addOr($cton2);
$c->add($cton1);
#$c->add(VStudentClassPeer::CLASS_GROUP_ID, $class, Criteria::IN);
#$c->add(StudentPeer::CLASS_GROUP_ID, $class->getId(), Criteria::IN);
} elseif ($class_group) {
#$cton1 = $c->getNewCriterion(VStudentClassPeer::CLASS_GROUP_ID, $class_group, Criteria::IN);
#$cton2 = $c->getNewCriterion(VStudentClassPeer::CLASS_PARENT, $class_group, Criteria::IN);
#$cton1->addOr($cton2);
#$c->add($cton1);
$c->add(VStudentClassPeer::CLASS_PARENT, $class_group, Criteria::IN);
} else {
#$c->add(StudentPeer::ACADEMIC_CALENDAR_ID, -1);
$c->add(VStudentClassPeer::ACADEMIC_CALENDAR_ID, -1);
}
// filter out graduated student
$c->add(VStudentClassPeer::STATUS, Student::STATUS_GRADUATE, Criteria::NOT_EQUAL);
$this->sortStudent($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(), 'v_student_class'));
$this->getUser()->setAttribute('max_per_page', $rpp, 'v_student_class');
$pager = new sfPropelPager('VStudentClass', $rpp);
$pager->setCriteria($c);
$page = $this->getRequestParameter('page', $this->getUser()->getAttribute('page', 1, 'v_student_class'));
$this->getUser()->setAttribute('page', $page, 'v_student_class');
$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'=>'student/create', 'color'=>'green'));
$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->actions = $actions;
$this->class_id = $class_id;
}
示例14: executeListShow
public function executeListShow()
{
$employee_id = sfContext::getInstance()->getUser()->getAttribute('user_id', null, 'bo');
$employee = EmployeePeer::retrieveByPK($employee_id);
$this->forward404Unless($employee);
$this->employee_id = $employee_id;
$c = new Criteria();
$c->add(StudentRaportPeer::ACADEMIC_CALENDAR_ID, $this->getRequestParameter('accal_id'));
$c->add(StudentCoursePeer::SUBJECT_CURR_ID, $this->getRequestParameter('subject_id'));
$c->add(StudentCoursePeer::CLASS_GROUP_ID, $this->getRequestParameter('class_id'));
$c->addJoin(VStudentActivePeer::ID, StudentCoursePeer::STUDENT_ID);
$c->addAscendingOrderByColumn(VStudentActivePeer::NAME);
$this->students = VStudentActivePeer::doSelect($c);
$this->student_count = VStudentActivePeer::doCount($c);
$subject_curr = SubjectCurrPeer::retrieveByPk($this->getRequestParameter('subject_id'));
$this->forward404Unless($subject_curr);
$class_group = ClassGroupPeer::retrieveByPk($this->getRequestParameter('class_id'));
$this->forward404Unless($class_group);
$academic_calendar = AcademicCalendarPeer::retrieveByPk($this->getRequestParameter('accal_id'));
$this->forward404Unless($academic_calendar);
$cw = new Criteria();
$cw->add(CourseSchedulePeer::SUBJECT_CURR_ID, $subject_curr->getId());
$cw->add(CourseSchedulePeer::CLASS_GROUP_ID, $class_group->getId());
$cw->add(CourseSchedulePeer::ACADEMIC_CALENDAR_ID, $academic_calendar->getId());
$course_schedule = CourseSchedulePeer::doSelectOne($cw);
$cr = new Criteria();
$cr->add(GradeSpecPeer::PARENT, 1);
$this->grade1 = GradeSpecPeer::doSelect($cr);
$this->count1 = GradeSpecPeer::doCount($cr);
$cr = new Criteria();
$cr->add(GradeSpecPeer::PARENT, 7);
$this->grade2 = GradeSpecPeer::doSelect($cr);
$this->count2 = GradeSpecPeer::doCount($cr);
$cr = new Criteria();
$cr->add(GradeSpecPeer::PARENT, 30);
$this->grade3 = GradeSpecPeer::doSelect($cr);
$this->count3 = GradeSpecPeer::doCount($cr);
$this->subject_curr = $subject_curr;
$this->academic_calendar = $academic_calendar;
$this->class_group = $class_group;
$rpp = $this->getRequestParameter('max_per_page', 999);
$pager = new sfPropelPager('Student', $rpp);
$pager->setCriteria($c);
$pager->setPage($this->getRequestParameter('page', 1));
$pager->init();
$this->pager = $pager;
$actions2 = array(array('name' => '<span>Daftar Guru Kelas</span>', 'url' => 'employee_agenda/list', 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Agenda Kelas</span>', 'url' => 'employee_agenda/listAgenda?course_id=' . $course_schedule->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Absensi</span>', 'url' => 'employee_agenda/listAbsence?course_id=' . $course_schedule->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Jadwal Tugas/Ulangan/PR</span>', 'url' => 'employee_agenda/listTest?course_id=' . $course_schedule->getId(), 'color' => 'sun'));
array_push($actions2, array('name' => '<span>Penilaian</span>', 'url' => 'course_detail/listShow?subject_id=' . $course_schedule->getSubjectCurrId() . '&class_id=' . $course_schedule->getClassGroupId() . '&accal_id=' . $course_schedule->getAcademicCalendarId(), 'color' => 'sun', 'type' => 'direct'));
if ($course_schedule->getClassGroup()->getParent() == 70 || $course_schedule->getClassGroup()->getParent() == 85 || $course_schedule->getClassGroup()->getParent() == 117) {
array_push($actions2, array('name' => '<span>Penilaian Tryout</span>', 'url' => 'course_detail/listTryout?subject_id=' . $course_schedule->getSubjectCurrId() . '&class_id=' . $course_schedule->getClassGroupId() . '&accal_id=' . $course_schedule->getAcademicCalendarId(), 'color' => 'sun'));
}
$this->actions2 = $actions2;
}