Пример #1
0
 public function API_Compte_Recuperer($id_compte)
 {
     if(!$this->estAuthentifier())
         {throw new ErrorException("Vous n'êtes pas authentifier");}
     if(!$this->estAdmin())
         {
         if($id_compte != $this->compteConnecte()->id_compte)
         {throw new ErrorException("Vous n'êtes pas autoriser à consulter les commandes d'autres clients");} 
         }
     return $this->bdd->Compte_Recuperer($id_compte);
 }
<?php 
require_once('./private/config.php');
require_once('./private/bdd.php');
require_once('./private/api.php');
require_once('./private/layout.php');

$id_commande = (int)$_REQUEST['id_commande'];
$valider_commande = (int)$_REQUEST['valider_commande'];

$bdd = new BDD();

$detail = $bdd->Commande_Recupere($id_commande);
$compte = $bdd->Compte_Recuperer($detail->id_compte);
$elements = $bdd->Commande_lister_Elements($id_commande);

$etat='Validé';
$commandes = $bdd->Commande_Lister(null,$etat,null,null);

?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />

    <script src="libs/jquery-1.11.3.js"></script>
    <script>
        $(function(){
            $('[data-autosubmit]').change(function(){
                    $(this.form).submit();
            });