Exemplo n.º 1
0
 private function addCommande()
 {
     $commandes = Commande::getBy(array());
     $mail = true;
     while (count($commandes) <= 5) {
         $commande = new Commande();
         $restaurant = Restaurant::getOneBy(array('name' => 'Ma Queue Mickey'));
         $item = ItemMenu::getOneBy(array('name' => 'Burger'));
         $address = Address::getOneBy(array('address' => '18 Rue des Roses'));
         $commande->setItem($item, 2);
         $commande->setStatus(Commande::COMMAND_STATUS_PAYED);
         $commande->setDatetime('12/12/12 12:12');
         $commande->createConfirmationCode();
         $commande->setAddress($address);
         $client = Client::getOneBy(array('_mail' => "*****@*****.**"));
         $commande->setClient($client);
         $commande->save();
         $restaurant->save();
         $commandes = Commande::getBy(array());
     }
 }
Exemplo n.º 2
0
 public function mesCommandes()
 {
     //If we are not connected as a livreur, send to the login page
     if (!Session::isConnected() || Session::getUser()->getType() != USER_LIVREUR) {
         Session::disconnect();
         return Redirect::to('/livreur/login');
     }
     $commandes = Commande::getBy(array('_livreur' => Session::getUser()->getId()));
     return View::render("livreur/mesCommandes.php", array('commandes' => $commandes));
 }