当前位置: 首页>>代码示例>>PHP>>正文


PHP JobPeer::retrieveByCode方法代码示例

本文整理汇总了PHP中JobPeer::retrieveByCode方法的典型用法代码示例。如果您正苦于以下问题:PHP JobPeer::retrieveByCode方法的具体用法?PHP JobPeer::retrieveByCode怎么用?PHP JobPeer::retrieveByCode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在JobPeer的用法示例。


在下文中一共展示了JobPeer::retrieveByCode方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: executePaymentSlip

 public function executePaymentSlip()
 {
     $stu = StudentPeer::retrieveByPK($this->getRequestParameter('student_id'));
     $job = JobPeer::retrieveByCode($this->getModuleName());
     $academic_process = $job->getAcademicProcess();
     $this->forward404Unless($stu && $job && $academic_process);
     $c = new Criteria();
     $c->add(AcademicProcessPeer::CODE, $academic_process->getCode());
     $c->addJoin(AcademicProcessPeer::ID, AcademicCostPeer::ACADEMIC_PROCESS_ID);
     $c->addJoin(AcademicCostPeer::ACADEMIC_CALENDAR_ID, StudentLeavePeer::ACADEMIC_CALENDAR_ID);
     $c->add(StudentLeavePeer::STATUS, StudentLeave::STATUS_APPROVED);
     $c->add(StudentLeavePeer::STUDENT_ID, $stu->getId());
     $costs = AcademicCostPeer::doSelect($c);
     $total_cost = 0;
     foreach ($costs as $c) {
         $total_cost += $c->getAmount();
     }
     $this->stu = $stu;
     $this->costs = $costs;
     $this->total_cost = $total_cost;
     $this->setViewClass('sfDomPDF');
 }
开发者ID:taryono,项目名称:school,代码行数:22,代码来源:actions.class.php

示例2: executePrintBankTransferForm

 public function executePrintBankTransferForm()
 {
     $student_course = StudentCoursePeer::retrieveByPK($this->getRequestParameter('id'));
     $stu = StudentPeer::retrieveByPK($this->getRequestParameter('student_id'));
     $accal = $student_course->getSubjectAccal()->getAcademicCalendar();
     $job = JobPeer::retrieveByCode($this->getModuleName());
     $academic_process = $job->getAcademicProcess();
     $this->forward404Unless($student_course && $stu && $accal && $job && $academic_process);
     $c = new Criteria();
     $c->add(AcademicCostPeer::ACADEMIC_CALENDAR_ID, $accal->getId());
     $c->add(AcademicProcessPeer::CODE, $academic_process->getCode());
     $c->addJoin(AcademicProcessPeer::ID, AcademicCostPeer::ACADEMIC_PROCESS_ID);
     $costs = AcademicCostPeer::doSelect($c);
     $c = new Criteria();
     $c->add(StudentCoursePeer::STUDENT_ID, $stu->getId());
     $c->add(SubjectAccalPeer::ACADEMIC_CALENDAR_ID, $accal->getId());
     $c->add(StudentCoursePeer::STATUS, StudentCourse::STATUS_APPROVED);
     $c->addJoin(SubjectAccalPeer::ID, StudentCoursePeer::SUBJECT_ACCAL_ID);
     $scs = StudentCoursePeer::doSelect($c);
     $total_subject = 0;
     $total_credit = 0;
     $total_credit_cost = 0;
     $total_cost = 0;
     $total_subject_cost = 0;
     foreach ($costs as $c) {
         if ($c->getAcademicCostComponent()->getUnit() == AcademicCostComponent::UNIT_CREDIT) {
             foreach ($scs as $sc) {
                 $total_credit += $sc->getSubjectAccal()->getSubject()->getCredit();
                 $total_cost += $c->getAmount() * $sc->getSubjectAccal()->getSubject()->getCredit();
                 $total_credit_cost += $c->getAmount() * $sc->getSubjectAccal()->getSubject()->getCredit();
             }
         } elseif ($c->getAcademicCostComponent()->getUnit() == AcademicCostComponent::UNIT_SUBJECT) {
             foreach ($scs as $sc) {
                 ++$total_subject;
                 $total_cost += $c->getAmount();
                 $total_subject_cost += $c->getAmount();
             }
         } else {
             $total_cost += $c->getAmount();
         }
     }
     $this->stu = $stu;
     $this->accal = $accal;
     $this->costs = $costs;
     $this->total_credit = $total_credit;
     $this->total_credit_cost = $total_credit_cost;
     $this->total_cost = $total_cost;
     $this->total_subject = $total_subject;
     $this->total_subject_cost = $total_subject_cost;
     $this->setViewClass('sfDomPDF');
 }
开发者ID:taryono,项目名称:school,代码行数:51,代码来源:actions.class.php

示例3: executePaymentSlip

 public function executePaymentSlip()
 {
     $comprehensive_exam = ComprehensiveExamPeer::retrieveByPK($this->getRequestParameter('id'));
     $stu = $comprehensive_exam->getStudent();
     $job = JobPeer::retrieveByCode($this->getModuleName());
     $academic_process = $job->getAcademicProcess();
     $this->forward404Unless($stu && $job && $academic_process);
     $c = new Criteria();
     $c->add(AcademicCostPeer::ACADEMIC_PROCESS_ID, $academic_process->getId());
     $c->add(AcademicCostPeer::ACADEMIC_CALENDAR_ID, $comprehensive_exam->getAcademicCalendarId());
     $costs = AcademicCostPeer::doSelect($c);
     $total_cost = 0;
     foreach ($costs as $c) {
         $total_cost += $c->getAmount();
     }
     $this->stu = $stu;
     $this->costs = $costs;
     $this->total_cost = $total_cost;
     $this->setViewClass('sfDomPDF');
 }
开发者ID:taryono,项目名称:school,代码行数:20,代码来源:actions.class.php

示例4: executeInsertPaymentJournal

 public function executeInsertPaymentJournal()
 {
     $student_course = StudentCoursePeer::retrieveByPK($this->getRequestParameter('id'));
     $stu = StudentPeer::retrieveByPK($this->getRequestParameter('student_id'));
     $accal = $student_course->getAcademicCalendar();
     $job = JobPeer::retrieveByCode($this->getModuleName());
     $academic_process = $job->getAcademicProcess();
     $this->forward404Unless($student_course && $stu && $accal && $job && $academic_process);
     //		$c = new Criteria();
     //		$c->add(AcademicCostPeer::ACADEMIC_CALENDAR_ID, $accal->getId());
     //		$c->add(AcademicProcessPeer::CODE, $academic_process->getCode());
     //		$c->addJoin(AcademicProcessPeer::ID, AcademicCostPeer::ACADEMIC_PROCESS_ID);
     //		$costs = AcademicCostPeer::doSelect($c);
     #$c = new Criteria();
     #$c->add(StudentCoursePeer::STUDENT_ID, $stu->getId());
     #$c->add(SubjectAccalPeer::ACADEMIC_CALENDAR_ID, $accal->getId());
     #$c->add(StudentCoursePeer::STATUS, StudentCourse::STATUS_APPROVED);
     #$c->addJoin(SubjectAccalPeer::ID, StudentCoursePeer::SUBJECT_ACCAL_ID);
     #$scs = StudentCoursePeer::doSelect($c);
     $paids = $this->getRequestParameter('paid');
     foreach ($paids as $key => $val) {
         $c = AcademicCostPeer::retrieveByPK($key);
         $payment_journal = new PaymentJournal();
         $payment_journal->setAcademicCost($c);
         $payment_journal->setJob($job);
         $payment_journal->setPayer($stu->getId());
         #$amount = 0;
         #if ($c->getAcademicCostComponent()->getUnit() == AcademicCostComponent::UNIT_CREDIT) {
         #	foreach ($scs as $sc) {
         #		$amount += $c->getAmount() * $sc->getSubjectAccal()->getSubject()->getCredit();
         #	}
         #} elseif ($c->getAcademicCostComponent()->getUnit() == AcademicCostComponent::UNIT_SUBJECT) {
         #	foreach ($scs as $sc) {
         #		$amount += $c->getAmount();
         #	}
         #} else {
         $amount = $c->getAmount();
         #}
         $payment_journal->setAmount($amount);
         $payment_journal->setPaid($val);
         $payment_journal->setReceivable($amount - $val);
         $payment_journal->setAcademicProcess($academic_process);
         $payment_journal->setPayerType(PaymentJournal::PAYER_TYPE_STUDENT);
         if ($amount - $val == 0) {
             $payment_journal->setStatus('S');
         } elseif ($amount - $val > 0) {
             $payment_journal->setStatus('M');
         } elseif ($amount - $val < 0) {
             $payment_journal->setStatus('P');
         }
         $payment_journal->save();
         $ph = new PaymentHistory();
         $ph->setPaymentJournal($payment_journal);
         $ph->setAmount($val);
         $ph->save();
     }
     // activate all paid credit
     if ($this->hasRequestParameter('status[student_course]') && $this->getRequestParameter('status[student_course]') == 1) {
         $c = new Criteria();
         $c->add(StudentCoursePeer::STUDENT_ID, $stu->getId());
         $c->add(StudentCoursePeer::STATUS, StudentCourse::STATUS_APPROVED);
         $approved_scs = StudentCoursePeer::doSelect($c);
         foreach ($approved_scs as $asc) {
             $asc->setStatus(StudentCourse::STATUS_ACTIVE);
             $asc->save();
         }
     }
     // change student status to active
     if ($this->hasRequestParameter('status[student]') && $this->getRequestParameter('status[student]') == Student::STATUS_ACTIVE) {
         $stu->setStatus(Student::STATUS_ACTIVE);
         $stu->setAcademicCalendarId($accal->getId());
         $stu->save();
     }
     return $this->redirect('student_course/list?student_id=' . $stu->getId());
 }
开发者ID:taryono,项目名称:school,代码行数:75,代码来源:actions.class.php

示例5: executePaymentSlip

 public function executePaymentSlip()
 {
     $gradc = GradCeremonyPeer::retrieveByPK($this->getRequestParameter('id'));
     $stu = $gradc->getStudent();
     $accal = $gradc->getAcademicCalendar();
     $job = JobPeer::retrieveByCode($this->getModuleName());
     $academic_process = $job->getAcademicProcess();
     $this->forward404Unless($gradc && $stu && $accal && $job && $academic_process);
     $c = new Criteria();
     $c->add(AcademicCostPeer::ACADEMIC_CALENDAR_ID, $accal->getId());
     $c->add(AcademicProcessPeer::CODE, $academic_process->getCode());
     $c->addJoin(AcademicProcessPeer::ID, AcademicCostPeer::ACADEMIC_PROCESS_ID);
     $costs = AcademicCostPeer::doSelect($c);
     $total_cost = 0;
     foreach ($costs as $c) {
         $total_cost += $c->getAmount();
     }
     $this->gradc = $gradc;
     $this->stu = $stu;
     $this->accal = $accal;
     $this->costs = $costs;
     $this->total_cost = $total_cost;
     $this->setViewClass('sfDomPDF');
 }
开发者ID:taryono,项目名称:school,代码行数:24,代码来源:actions.class.php


注:本文中的JobPeer::retrieveByCode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。