public function retrieveApplicationAction()
 {
     $request = $this->getRequest();
     $leadType = $request->request->get('leadType');
     $refNum = $request->request->get('refNum');
     $details = array();
     if ($leadType && $refNum) {
         switch ($leadType) {
             case 1:
                 $parkingApp = LeasingParkingLeadsPeer::getRecords($refNum);
                 if (!empty($parkingApp)) {
                     $status = LeasingStatusPeer::retrieveByPK($parkingApp->getStatus());
                     $leadDocs = LeasingLeadDocumentPeer::getLeadDocumentByLeadId($leadType, $parkingApp->getId());
                     $docs = array();
                     $payment = LeasingParkingPaymentDetailsPeer::getDetailsByParkingLeadId($parkingApp->getId());
                     foreach ($leadDocs as $ld) {
                         $docs[$ld->getId()] = $ld->getLeasingDocument()->getDocument();
                     }
                     $details = array('parkingAppId' => $parkingApp->getId(), 'refNum' => $parkingApp->getApplicationNumber(), 'name' => $parkingApp->getFname() . ' ' . $parkingApp->getLname(), 'mobile' => $parkingApp->getMobile(), 'email' => $parkingApp->getEmail(), 'reqStatus' => $status->getStatus(), 'property' => $parkingApp->getProperty(), 'unit' => $parkingApp->getUnit(), 'slots' => $parkingApp->getSlots(), 'paymentTerms' => $parkingApp->getPaymentTerms(), 'docs' => $docs, 'payment' => $payment, 'paymentType' => $parkingApp->getPaymentType());
                     return $this->render('LeasingPaymentBundle::parkingPayment.html.twig', array('details' => $details));
                 } else {
                     echo -1;
                     exit;
                 }
                 break;
             case 2:
                 $eventApp = LeasingEventBookingsPeer::getRecords($refNum);
                 if (!empty($eventApp)) {
                     $status = LeasingStatusPeer::retrieveByPK($eventApp->getStatus());
                     $leadDocs = LeasingLeadDocumentPeer::getLeadDocumentByLeadId($leadType, $eventApp->getId());
                     $docs = array();
                     $payment = LeasingEventPaymentDetailsPeer::getEventPaymentDetailsByEventBookingId($eventApp->getId());
                     foreach ($leadDocs as $ld) {
                         $docs[$ld->getId()] = $ld->getLeasingDocument()->getDocument();
                     }
                     $details = array('eventAppId' => $eventApp->getId(), 'refNum' => $eventApp->getApplicationNumber(), 'name' => $eventApp->getLeasingEventLeads()->getFname() . ' ' . $eventApp->getLeasingEventLeads()->getLname(), 'mobile' => $eventApp->getLeasingEventLeads()->getMobile(), 'email' => $eventApp->getLeasingEventLeads()->getEmail(), 'reqStatus' => $status->getStatus(), 'eventPlace' => $eventApp->getLeasingEventPlace()->getName(), 'eventDate' => $eventApp->getEventDate(), 'eventTime' => $eventApp->getEventStartTime() . ' - ' . $eventApp->getEventEndTime(), 'docs' => $docs, 'payment' => $payment);
                     return $this->render('LeasingPaymentBundle::eventPayment.html.twig', array('details' => $details));
                 } else {
                     echo -1;
                     exit;
                 }
                 break;
             default:
                 break;
         }
         echo -2;
         exit;
     } else {
         throw new AccessDeniedHttpException();
     }
 }