コード例 #1
0
 public function importAction(Request $request)
 {
     if ($request->getMethod() == 'POST') {
         $uploadedFile = $request->files->get('Filedata');
         $document = new Document();
         $timestamp = $request->request->get('timestamp');
         $token = $request->request->get('token');
         $document->setFile($uploadedFile, $timestamp, $token);
         if ($document->upload()) {
             $em = $this->getDoctrine()->getManager();
             return new Response(json_encode(Payment::import($em, $document)));
         }
     }
     return new Response(json_encode(false));
 }
コード例 #2
0
 public function removeDocumentNgAction($document_id)
 {
     $em = $this->getDoctrine()->getManager();
     $response = new Response(json_encode(array("result" => Document::removeDocumentById($em, $document_id))));
     $response->headers->set('Content-Type', 'application/json');
     return $response;
 }
コード例 #3
0
 public function indexAction()
 {
     $timestamp = time();
     $token = Document::getToken($timestamp);
     $parameters = array('timestamp' => $timestamp, 'token' => $token);
     $parameters['page'] = $this->get('renovate.pages')->getPageForUrl($this->getRequest()->getUri());
     return $this->render('RenovateMainBundle:Results:index.html.twig', $parameters);
 }
コード例 #4
0
 public function showShareAction($share_name_translit)
 {
     $timestamp = time();
     $token = Document::getToken($timestamp);
     $em = $this->getDoctrine()->getManager();
     $share = $em->getRepository("RenovateMainBundle:Share")->findOneByNameTranslit($share_name_translit);
     if ($share == NULL) {
         return $this->redirect($this->generateUrl('renovate_main_homepage'));
     }
     $parameters = array('share' => $share, 'timestamp' => $timestamp, 'token' => $token);
     $parameters['page'] = $this->get('renovate.pages')->getPageForUrl($this->getRequest()->getUri());
     return $this->render('RenovateMainBundle:Shares:showShare.html.twig', $parameters);
 }
コード例 #5
0
 public function indexAction()
 {
     $timestamp = time();
     $token = Document::getToken($timestamp);
     return $this->render('RenovateMainBundle:Partners:index.html.twig', array('timestamp' => $timestamp, 'token' => $token));
 }