public function historiqueAction() { $source = null; $cible = null; $request = $this->getRequest(); $montant = ""; $repository = $this->getDoctrine()->getManager()->getRepository('ConvertDeviseBundle:Devise'); $devise = $repository->findAll(); // On vérifie qu'elle est de type POST if ($request->getMethod() == 'POST') { $source = $request->request->get('_source'); $cible = $request->request->get('_cible'); $montant = $request->request->get('_montant'); $sourcecible = $source . $cible; $this->getparamAction(); //connexion entre api yahoo et application $this->convertAction($sourcecible); $t = new \Datetime(); $t->getTimestamp(); $datedemande = $t; $etatip = 1; //adresse ip du client $ipdclient = $_SERVER["REMOTE_ADDR"]; $this->getclientAction($ipdclient, $datedemande); $cour = $this->cour; $nbdemande = 1; $hist = new Historique(); $hist->setSource($source); $hist->setCible($cible); $hist->setDatedemande($datedemande); $hist->setNbdemande($nbdemande); $hist->setCour($cour); $hist->setMontant($montant); $hist->setIpdclient($ipdclient); if ($this->bloque == true) { $etatip = 0; $hist->setEtatip($etatip); $em = $this->getDoctrine()->getManager(); $em->persist($hist); $em->flush(); return $this->render('ConvertDeviseBundle:Devise:blacklist.html.twig'); } else { $hist->setEtatip($etatip); $em = $this->getDoctrine()->getManager(); $em->persist($hist); $em->flush(); } } return $this->render('ConvertDeviseBundle:Devise:index.html.twig', array('devise' => $devise, 'cour' => $this->cour, 'montant' => $montant, 'source' => $source, 'cible' => $cible)); }
/** * {@inheritDoc} */ public function setCour($cour) { $this->__initializer__ && $this->__initializer__->__invoke($this, 'setCour', array($cour)); return parent::setCour($cour); }