Exemplo n.º 1
0
 public function paymentForm(\Jazzee\Entity\Applicant $applicant, $amount)
 {
     $form = new \Foundation\Form();
     $form->setAction($this->_controller->getActionPath());
     $form->newHiddenElement('amount', $amount);
     $field = $form->newField();
     $field->setLegend($this->_paymentType->getName());
     $field = $form->newField();
     $instructions = "<p><strong>Application Fee:</strong> &#36;{$amount}</p>";
     $instructions .= '<p><strong>Make Checks Payable to:</strong> ' . $this->_paymentType->getVar('payable') . '</p>';
     if ($this->_paymentType->getVar('address')) {
         $instructions .= '<p><h4>Mail Check to:</h4>' . nl2br($this->_paymentType->getVar('address')) . '</p>';
     }
     if ($this->_paymentType->getVar('coupon')) {
         $instructions .= '<p><h4>Include the following information with your payment:</h4> ' . nl2br($this->_paymentType->getVar('coupon')) . '</p>';
     }
     $search = array('_Applicant_Name_', '_Applicant_ID_', '_Program_Name_', '_Program_ID_');
     $replace = array();
     $replace[] = $applicant->getFirstName() . ' ' . $applicant->getLastName();
     $replace[] = $applicant->getId();
     $replace[] = $applicant->getApplication()->getProgram()->getName();
     $replace[] = $applicant->getApplication()->getProgram()->getId();
     $instructions = str_ireplace($search, $replace, $instructions);
     $instructions .= '<p>Click the Pay By Check button to pay your fee by check.  Your account will be temporarily credited and you can complete your application.  Your application will not be reviewed until your check is recieved.</p>';
     $field->setInstructions($instructions);
     $form->newButton('submit', 'Pay By Check');
     return $form;
 }
Exemplo n.º 2
0
 /**
  * PDF a full single applicant
  * @param \Jazzee\Entity\Applicant $applicant
  * @return string the PDF buffer suitable for display
  */
 public function pdf(\Jazzee\Entity\Applicant $applicant)
 {
     $elements = array('applicant' => array(), 'pages' => array());
     $elements['applicant']['firstName'] = $applicant->getFirstName();
     $elements['applicant']['lastName'] = $applicant->getLastName();
     $elements['applicant']['middleName'] = $applicant->getMiddleName();
     $elements['applicant']['fullName'] = $applicant->getFullName();
     $elements['applicant']['suffix'] = $applicant->getSuffix();
     $elements['applicant']['email'] = $applicant->getEmail();
     $elements['applicant']['id'] = $applicant->getId();
     $elements['applicant']['externalid'] = $applicant->getExternalId();
     if ($applicant->isLocked()) {
         switch ($applicant->getDecision()->status()) {
             case 'finalDeny':
                 $status = 'Denied';
                 break;
             case 'finalAdmit':
                 $status = 'Admited';
                 break;
             case 'acceptOffer':
                 $status = 'Accepted';
                 break;
             case 'declineOffer':
                 $status = 'Declined';
                 break;
             default:
                 $status = 'No Decision';
         }
     } else {
         $status = 'Not Locked';
     }
     $elements['applicant']['status'] = $status;
     foreach ($applicant->getApplication()->getApplicationPages() as $applicationPage) {
         if ($applicationPage->getJazzeePage() instanceof \Jazzee\Interfaces\PdfPage) {
             $applicationPage->getJazzeePage()->setApplicant($applicant);
             $applicationPage->getJazzeePage()->setController($this->_controller);
             $elements['pages'][$applicationPage->getPage()->getId()] = $applicationPage->getJazzeePage()->getPdfTemplateValues();
         }
     }
     return $this->generatePDF($elements);
 }