<style>header.entry-header{display: none;}</style>
<style>.asteriskField{color: red;} .input-group{margin: 5px;} .input-group-addon{width: 44%;text-align: left;} </style>
<?php
if (!( is_user_logged_in() )) {echo "<script>document.location.href='".get_bloginfo('url')."/404.php/?erreur=2';</script>";}
require_once './GDEAL/pages/config.php';
require_once './GDEAL/pages/class/coupon.class.php';
$db = new PDO('mysql:host='.$host.';dbname='.$dbname.'', $user, $passwd);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
global $current_user;
get_currentuserinfo();
$key = sha1($current_user->user_email);
$_SESSION['GDEAL']['filtre']['etat'] = array (2,3,4,5);
// $_SESSION['GDEAL']['filtre']['etat'] = array (7);
$managerCou = new CouponManager($db);
$listeCou = $managerCou->getListTab('client',$current_user->user_email);
// var_dump ($listeCou);
?>
<h1>Mes Coupons</h1>
<?php
if (count ($listeCou)==0){ ?>
<div class="alert alert-info" role="alert" style="width: 99%;margin-top: 40px;margin-bottom: 60px;"><i class="fa fa-exclamation-circle"></i> Vous n'avez pas encore profité de nos offres.</div>
<?php
}else {
?>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<thead>
<tr>
<th width='20%'>N° Commande</th>
<th>Nom Du Deal</th>
<th>Prix</th>
<th>Quantite</th>
<th width='20%'>Date</th>
<th>Coupon</th>
</tr>
</thead>
<tbody>
<?php
foreach ($listeCou as $cou)
{
echo "<tr><td>".$cou['code_cmd']."</td>
<td><a href='".get_bloginfo('url')."/?p=".$cou['deal_id']."' target='_blanc'>".$cou['titre']."</a></td>
<td><b>".$cou['prix']."</b><sup>DT</sup></td>
<td><center>".$cou['quantite']."</center></td>
<td><details><summary>".date("d-m-Y", $cou['date_coupon'])."</summary>
<p>".date("\à H:i:s", $cou['date_coupon'])."</p>
</details></td>
<td>
<a href='".URL_COUPON."coupon-pdf.php?id_coup=".$cou['id']."&key=".$key."' target='_blanc' class='btn btn-info btn-xs'><i class='fa fa-file-pdf-o'></i> Télécharger</a>
</td>";
echo "</tr>";
}
?>
</tbody>
</table>
</div>
<?php } ?>