. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
| Server IP : 213.186.33.4 / Your IP :
216.73.216.146 [
Web Server : Apache System : Linux webm002.cluster103.gra.hosting.ovh.net 5.15.206-ovh-vps-grsec-zfs-classid #1 SMP Fri May 15 02:41:25 UTC 2026 x86_64 User : dealkatnwc ( 662330) PHP Version : 7.0.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl Domains : 2 Domains MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/dealkatnwc/www/GDEAL/coupon/ |
Upload File : |
<?php
session_start();
require_once '../config.php';
require_once '../class/vendeur.class.php';
require_once '../class/admin.class.php';
require_once '../class/coupon.class.php';
if(!((isset($_SESSION['GDS']['admin']['id']) or isset($_SESSION['GDS']['vendeur']['id']) or isset($_GET['key'])) AND (isset ($_GET['id_coup'])) ))
{echo "<script>window.close();</script>";exit();}
$db = new PDO('mysql:host='.$host.';dbname='.$dbname.'', $user, $passwd);
$db->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_WARNING);
setlocale (LC_TIME, 'fr_FR','fra');
$managerCou = new CouponManager($db);
if ($managerCou->existe((int) $_GET['id_coup']) == 'non')
{echo "<script>window.close();</script>";exit();}
else
{
$deal = $managerCou->getOneDeal((int) $_GET['id_coup']);
if (isset($_GET['key'])){if($_GET['key']!= sha1($deal['dealer_email'])){echo "<script>window.close();</script>";exit();}}
if (isset($_SESSION['GDS']['vendeur']['id'])){if($_SESSION['GDS']['vendeur']['id']!=$deal['id_vendeur']){echo "<script>window.close();</script>";exit();}}
$content = "
<style type='text/css'>
<!--
table.page_header {width: 100%; border: none; background-image: #FFFFFF;background-color: #FFFFFF; border-bottom: solid 1mm #FFFFFF; padding: 2mm }
table.page_footer {width: 100%; border: none; background-color: #FFFFFF; border-top: solid 1mm #FFFFFF; padding: 2mm}
div.note {border: solid 1mm #DDDDDD;background-color: #EEEEEE; padding: 2mm; border-radius: 2mm; width: 100%; }
div.case_dealer {border: solid 1px #000000;background-color: #FFFFFF; padding: 2mm; width: 100%; }
div.case_info {border: solid 1px #000000;background-color: #FFFFFF; width: 100%; }
div.deal_title{border: solid 1px #000000;background-color: #F7941E;color: #FFFFFF;text-align: center; font-size: 5mm; padding: 2mm; width: 100%; }
ul.main { width: 95%; list-style-type: square; }
ul.main li { padding-bottom: 2mm; font-size: 3mm;}
h1 { text-align: center; font-size: 20mm}
h3 { text-align: center; font-size: 14mm}
-->
</style>
<page backtop='14mm' backbottom='14mm' backleft='10mm' backright='10mm' style='font-size: 12pt;font-family:arial'>
<page_header>
<table class='page_header'>
<tr>
<td style='width: 60%; text-align: left'>
<img src='../images/coupon_header_cadeau.jpg' style='width: 113mm'>
</td>
<td style='width: 40%; text-align: right'>
<barcode type='C39' value='".$deal['code_cmd']."' style='color: #000000'></barcode>
<br>".date("d-m-Y \à H:i ", strtotime($deal['date_coupon']))."
</td>
</tr>
<tr>
<td style='width: 100%; text-align: center' colspan='2'>
<img src='../images/coupon_header2.jpg' style='width: 200mm'>
</td>
</tr>
</table>
</page_header>
<page_footer>
<table class='page_footer'>
<tr>
<td style='width: 100%; text-align: left'>
<img src='../images/coupon_footer_cadeau.jpg' style='width: 200mm'>
</td>
</tr>
</table>
</page_footer>
<br><br><br><br><br><br><br><br><br><br>
<div class='case_dealer'>
<table width='100%'>
<tr><td ><font color='red'>N° Commande : </font></td><td >".$deal['code_cmd']."</td><td > </td>
<td >Partenaire : </td><td >".$deal['p_nom']."</td>
</tr>
<tr><td >Dealer: </td><td>".$deal['dealer_nom']." ".$deal['dealer_prenom']."</td><td > </td>
<td >Adresse : </td><td>".$deal['p_adresse']."</td>
</tr>
<tr><td >Tél : </td><td>".$deal['dealer_tel']."</td><td> </td>
<td >Tél : </td><td>".$deal['p_tel']."</td>
</tr>
</table>
</div>
<br><br>
<div class='deal_title'>".$deal['titre']."</div>
<br>";
// $content .="Prix : <b>".$deal['prix_promo']."</b> <sup>Dt.</sup> au lieu de <s><b>".$deal['prix_reel']."</b></s><sup>Dt.</sup>.<br><br>";
if (count($deal['loffrecmprn'])>0)
{
$content .="L'offre comprend :<br>
<table style='width: 100%'>
<tr style='vertical-align: top'>
<td style='width: 50%'>
<ul class='main'>";
for($j=0;$j <ceil(count($deal['loffrecmprn'])/2);$j++)
$content .= "<li>".$deal['loffrecmprn'][$j]."</li>";
$content .="</ul>
</td>
<td style='width: 50%'>
<ul class='main'>";
for($j=ceil(count($deal['loffrecmprn'])/2);$j <count($deal['loffrecmprn']);$j++)
$content .= "<li>".$deal['loffrecmprn'][$j]."</li>";
$content .="</ul>
</td>
</tr>
</table>";
}
if (count($deal['asavoir'])>0)
{
$content .="A Savoir :<br>
<table style='width: 100%'>
<tr style='vertical-align: top'>
<td style='width: 50%'>
<ul class='main'>";
for($j=0;$j <ceil(count($deal['asavoir'])/2);$j++)
$content .= "<li>".$deal['asavoir'][$j]."</li>";
$content .="</ul>
</td>
<td style='width: 50%'>
<ul class='main'>";
for($j=ceil(count($deal['asavoir'])/2);$j <count($deal['asavoir']);$j++)
$content .= "<li>".$deal['asavoir'][$j]."</li>";
$content .="</ul>
</td>
</tr>
</table>";
}
if (count($deal['info'])>0)
{
$content .="<div class='case_info'><ul class='main'>";
foreach($deal['info'] as $key => $val)
$content .= "<li>".$val."</li>";
$content .="</ul></div>";
}
$content .="</page>";
require_once('html2pdf/html2pdf.class.php');
$html2pdf = new HTML2PDF('P','A4','fr');
$html2pdf->WriteHTML($content);
ob_end_clean();
$html2pdf->Output('Coupon-n-'.$deal['code_cmd'].'.pdf','');
}
?>