public function executePrintForm() { $student = StudentPeer::retrieveByPK($this->getRequestParameter('student_id')); #$this->forward404Unless($student); $payment_model = PaymentModelPeer::retrieveByPK($this->getRequestParameter('payment_model_id')); #$this->forward404Unless($payment_model); $paid_at = $this->getRequestParameter('paid_at'); $year = $this->getRequestParameter('year'); $c = new Criteria(); $c->add(PaymentJournalPeer::PAYER_TYPE, PaymentJournal::PAYER_TYPE_STUDENT); $c->add(PaymentJournalPeer::PAYER, $student->getId()); $c->add(PaymentJournalPeer::ACADEMIC_PROCESS_ID, 2); $c->add(PaymentJournalPeer::STATUS, 'S'); $c->add(PaymentJournalPeer::PAYMENT_MODEL_ID, $payment_model->getId()); $c->add(PaymentJournalPeer::PAID_AT, $paid_at); $payments = PaymentJournal::doSelect($c); $total_cost = 0; foreach ($payments as $c) { $total_cost += $c->getAmount(); } $this->student = $student; $this->payment_model = $payment_model; $this->paid_at = $paid_at; $this->year = $year; $this->actions = $actions; $this->subtitle = $student->toString(); $this->type = ''; $this->total_cost = $total_cost; $this->setViewClass('sfDomPDF'); $this->payments = $payments; }