-
Notifications
You must be signed in to change notification settings - Fork 0
/
commande.php
35 lines (34 loc) · 1019 Bytes
/
commande.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<?php
require_once('common/head.php');
if(isset($_POST['action']))
{
switch($_POST['action']) {
case "insertCommande":
$idCommande = $database->insertCommande($_SESSION['id_joueur'], $comment, $total);
foreach($addedArticles as $aa)
{
$database->insertCommandeArticle($idCommande, $quantite, $idGroupeArticle);
}
break;
case "removeCommande":
if(isset($_POST['idCommande']))
$database->removeCommande($_POST['idCommande']);
break;
case "getCommandes":
$commandesList = $database->getJoueurCommandes($_SESSION['id_joueur']);
foreach($commandesList as $kc=>$commande)
{
$commandesList[$kc]['nom'] = "Commande ".($kc+1);
$commandesList[$kc]['date'] = getRelativeTime($commande['date']);
$commandesList[$kc]['commande'] = $database->getCommande($commande['id_commande']);
}
$smarty->assign('commandes',$commandesList);
$smarty->display('default/commandeList.tpl');
break;
default:
break;
}
} else {
$smarty->display('default/commande.tpl');
}
?>