|
|
@@ -1,17 +1,73 @@ |
|
|
|
<?php |
|
|
|
|
|
|
|
/* |
|
|
|
* To change this license header, choose License Headers in Project Properties. |
|
|
|
* To change this template file, choose Tools | Templates |
|
|
|
* and open the template in the editor. |
|
|
|
*/ |
|
|
|
<h1>Commandes <?php echo $date ; ?></h1> |
|
|
|
|
|
|
|
?> |
|
|
|
<?php |
|
|
|
|
|
|
|
$num_jour_semaine = date('w', strtotime($date)); |
|
|
|
$arr_jour_semaine = [0 => 'dimanche', 1 => 'lundi', 2 => 'mardi', 3 => 'mercredi', 4 => 'jeudi', 5 => 'vendredi', 6 => 'samedi']; |
|
|
|
$champs_horaires_point_vente = 'horaires_' . $arr_jour_semaine[$num_jour_semaine]; |
|
|
|
|
|
|
|
$html = '' ; |
|
|
|
|
|
|
|
// par point de vente |
|
|
|
foreach ($points_vente as $pv) { |
|
|
|
if (count($pv->commandes) && strlen($pv->$champs_horaires_point_vente)) { |
|
|
|
$html .= '<h3>'.$pv->nom.'</h3>' ; |
|
|
|
|
|
|
|
$html .= '<table class="table table-bordered">' |
|
|
|
. '<thead>' |
|
|
|
. '<tr>' |
|
|
|
. '<th>Client</th>' |
|
|
|
. '<th>Produits</th>' |
|
|
|
. '<th>Commentaire</th>' |
|
|
|
. '<th>Montant</th>' |
|
|
|
. '</tr>' |
|
|
|
. '<tbody>'; |
|
|
|
|
|
|
|
foreach ($pv->commandes as $c) { |
|
|
|
$html .= '<tr>' ; |
|
|
|
$str_user = ''; |
|
|
|
|
|
|
|
// username |
|
|
|
if ($c->user) { |
|
|
|
$str_user = $c->user->prenom . " " . $c->user->nom; //.' - '.date('d/m', strtotime($c->date)) ; |
|
|
|
} else { |
|
|
|
$str_user = $c->username; //.' - '.date('d/m', strtotime($c->date)) ; |
|
|
|
} |
|
|
|
|
|
|
|
<h1>Commandes</h1> |
|
|
|
// téléphone |
|
|
|
if (isset($c->user) && strlen($c->user->telephone)) { |
|
|
|
$str_user .= ' (' . $c->user->telephone . ')'; |
|
|
|
} |
|
|
|
|
|
|
|
<p>Aliquam laoreet venenatis ligula, vitae porttitor ante molestie id. Praesent |
|
|
|
eleifend placerat diam. Nullam vel finibus velit. Integer vitae enim vel |
|
|
|
nunc eleifend condimentum. Morbi eu eros efficitur, gravida nibh eu, iaculis |
|
|
|
tortor. Nam venenatis congue lacus, eget posuere mauris ultrices quis. Integer |
|
|
|
tempus est ut felis elementum tincidunt. </p> |
|
|
|
$html .= '<td>'.$str_user.'</td>'; |
|
|
|
|
|
|
|
// produits |
|
|
|
$str_produits = ''; |
|
|
|
foreach ($produits as $p) { |
|
|
|
if (isset($produits_selec[$p->id]['actif']) && $produits_selec[$p->id]['actif']) { |
|
|
|
$add = false; |
|
|
|
foreach ($c->commandeProduits as $cp) { |
|
|
|
if ($p->id == $cp->id_produit) { |
|
|
|
$str_produits .= $cp->quantite . '' . $p->diminutif . ', '; |
|
|
|
$add = true; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
$html .= '<td>'.substr($str_produits, 0, strlen($str_produits) - 2).'</td>'; |
|
|
|
$html .= '<td>'.$c->commentaire.'</td>'; |
|
|
|
$html .= '<td>'.number_format($c->montant, 2) . ' €'.'</td>'; |
|
|
|
|
|
|
|
$html .= '</tr>' ; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
$html .= '</tbody></table>' ; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
echo $html ; |
|
|
|
|
|
|
|
?> |