<div class="box-content"> <table class="table table-striped table-bordered bootstrap-datatable datatable"> <thead> <tr> <th>Nom et Prénom</th> <th>Marque et Modèle</th> <th>Date de location</th> <th>Action</th> </tr> </thead> <tbody> <?php while ($data = $req->fetch()) { $nbrj = nbJours(date("Y-m-d"), $data['dater']); //trouve le nombre de jour $reqc = $bdd->query('SELECT * FROM client WHERE id=' . $data['id_cli'] . ' ;'); $datac = $reqc->fetch(); $reqv = $bdd->query('SELECT * FROM vehicule WHERE id=' . $data['id_voi'] . ' ;'); $datav = $reqv->fetch(); echo ' <tr> <td>' . $datac['nom'] . ' ' . $datac['prenom'] . '</td> <td class="center">' . $datav['marque'] . ' ' . $datav['modele'] . '</td> <td class="center">' . date("d-m-Y", strtotime($data['datel'])) . ' </td> <td class="center">
<ul class="breadcrumb"> <li><i class="icon-home"></i> <a href="accueil.php">Accueil</a> <i class="icon-angle-right"></i></li> <li><a href="#">information du client</a> <i class="icon-angle-right"></i></li> <li><a href="#">choix de la voiture</a> <i class="icon-angle-right"></i> </li> <li><a href="#">détail de la location</a> <i class="icon-angle-right"></i></li> <li><a href="#">Facturation</a> <i class="icon-angle-right"></i></li> </ul> <?php $chi = $bdd->query('SELECT * FROM vehicule WHERE id= ' . $_SESSION['id_voit'] . ''); $chaui = $chi->fetch(); $nbrj = nbJours($_SESSION['datel'], $_SESSION['dater']); $prixl = $chaui['prix'] * $nbrj; $_SESSION['prixl'] = $prixl; $dloc = date("d-m-Y", strtotime($_SESSION['datel'])); // inverse le format de la date $dret = date("d-m-Y", strtotime($_SESSION['dater'])); $dfac = date("d-m-Y", strtotime($_SESSION['datef'])); $_SESSION['Nbrj'] = $nbrj; $_SESSION['Dloc'] = $dloc; $_SESSION['Dret'] = $dret; $_SESSION['Dfac'] = $dfac; echo ' <div class="row-fluid sortable"> <div class="box span10"> <div class="box-header" data-original-title> <h2><i class="halflings-icon white edit"></i><span class="break"></span> </h2>
$mo = str_shuffle($chai); $mi = str_shuffle($chai); $p = substr($mo, 0, 3); $mu = substr($mi, 0, 3); $_FILES['photo']['name'] = $p . $mu . '.' . $extension; } function nbJours($debut, $fin) { //60 secondes X 60 minutes X 24 heures dans une journée $nbSecondes = 60 * 60 * 24; $debut_ts = strtotime($debut); $fin_ts = strtotime($fin); $diff = $fin_ts - $debut_ts; return round($diff / $nbSecondes); } $nbrji = nbJours($_POST['assurDateDebut'], $_POST['assurDateFin']); if ($nbrji < 0) { header('Location:supprimer.php?assurance=assurance'); exit; } $req = $bdd->prepare('UPDATE vehicule SET matricule=:mat, marque=:mar,modele=:mod,nbrP=:nbrP,etat=:etat,prix=:prix,status=:status,cate=:cate,energie=:energie, photo=:photo WHERE id = :id'); $req->execute(array(':mat' => $_POST['mat'], ':mar' => $_POST['mar'], ':mod' => $_POST['mod'], ':nbrP' => $_POST['nbrP'], ':etat' => $_POST['etat'], ':prix' => $_POST['prix'], ':status' => $_POST['status'], ':cate' => $_POST['cate'], ':energie' => $_POST['energie'], ':id' => $_POST['id'], ':photo' => $_FILES['photo']['name'])); $reqr = $bdd->query('SELECT * FROM assurance where id_voi=' . $_POST['id'] . ' ;'); $chaudi = $reqr->fetch(); $req = $bdd->prepare('UPDATE assurance SET nom=:nAss, assurDateDebut=:assurDateDebut , assurDateFin=:assurDateFin WHERE id_voi = :id_voi'); $req->execute(array(':nAss' => $_POST['nAss'], ':assurDateDebut' => $_POST['assurDateDebut'], ':assurDateFin' => $_POST['assurDateFin'], ':id_voi' => $chaudi['id_voi'])); //reduire la taillede l'image if (!empty($_FILES['photo']['size'])) { if ($extension == 'jpg' || $extension == 'JPG' || $extension == 'jpeg' || $extension == 'JPEG') { $source = imagecreatefromjpeg($_FILES['photo']['tmp_name']); } else {