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)); }
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; }
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); }
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); }
public function indexAction() { $timestamp = time(); $token = Document::getToken($timestamp); return $this->render('RenovateMainBundle:Partners:index.html.twig', array('timestamp' => $timestamp, 'token' => $token)); }