• File: dec.php
  • Full Path: /home/dealkatnwc/www/GDEAL/pages/dec.php
  • Date Modified: 02/11/2019 2:04 PM
  • File size: 8.42 KB
  • MIME-type: text/x-php
  • Charset: utf-8
<?php
include 'class/coupon.class.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
    <?php include 'header.php';?>
</head>

<body>

    <div id="wrapper">
<?php include 'menu.php'; ?>
	
<?php 
$managerCou = new CouponManager($db);
$listeDeal = $managerCou->getListDealEnCours(); 		   
	// var_dump($listeDeal);
?>
        <!-- Page Content -->
        <div id="page-wrapper">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-lg-12  animated rotateInDownLeft">
                        <h1 class="page-header">DEALS EN COURS</h1>
                    </div>
                    <!-- /.col-lg-12 -->
                </div>
                <!-- /.row -->
				<?php foreach ($listeDeal as $deal) { ?>
				<div class="row well well-sm" style="font-size: 11px;">
			        <div class="col-lg-3 col-md-6 col-sm-12 col-xs-12 text-center">
                       <img src='<?php echo $deal['image'];?>' width='100%'>
                    </div>
					<div class="col-lg-3 col-md-6 col-sm-12 col-xs-12">
						<a href='<?php echo $home."/?p=".$deal['id']; ?>' target='_blanc'><b><?php echo $deal['titre'];?></b></a>
						<?php						  
							echo "<br>Prix : <b>".$deal['prix_promo']."</b><sup>Dt.</sup> au lieu de <b><s>".$deal['prix_reel']."</s></b><sup>Dt.</sup><br>
							Date d'expiration : <b>".date("Y-m-d H:i", $deal['df'])."</b><br>
							Partenaire : <b>".$deal['p_nom']."</b><br>
							".$deal['p_adresse_complet']." (".$deal['p_tel'].")";
						?>
                    </div>

					<div class="col-lg-3 col-md-6 col-sm-12 col-xs-12">
						<b>L'offre comprend :</b><br><ul>
							<?php for($j=0;$j <ceil(count($deal['loffrecmprn'])/2);$j++)echo "<li>".$deal['loffrecmprn'][$j]."</li>"; ?>
						</ul>						
                    </div>

					<div class="col-lg-3 col-md-6 col-sm-12 col-xs-12">
						<ul>
						<?php for($j=ceil(count($deal['loffrecmprn'])/2);$j <count($deal['loffrecmprn']);$j++)echo "<li>".$deal['loffrecmprn'][$j]."</li>"; ?>
						</ul>
                    </div>
										
				</div>
				<?php } ?>

				<div class="row">
	
					<div class="col-lg-12 col-xs-12 text-center">
						<div class="btn-group dropup">
						  <button type="button" class="btn btn-info  dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
							<i class="fa fa-print"></i>&nbsp;Imprimer <span class="caret"></span>
						  </button>
						  <ul class="dropdown-menu">		
							<li><a href="print_publique.php" target='blanc'><i class="fa fa-file-pdf-o" aria-hidden="true"></i>&nbsp;Utilisation publique</a></li>
							<li><a href="print.php" style="color:red;" target='blanc'><i class="fa fa-file-pdf-o" aria-hidden="true"></i>&nbsp;Utilisation privée</a></li>
						  </ul>
						</div>				
					</div>
				</div><br><br><br>
				
				
            </div>
            <!-- /.container-fluid -->
        </div>
        <!-- /#page-wrapper -->

    </div>
    <!-- /#wrapper -->

	
    <!-- jQuery -->
    <script src="../bower_components/jquery/dist/jquery.min.js"></script>

    <!-- Bootstrap Core JavaScript -->
    <script src="../bower_components/bootstrap/dist/js/bootstrap.min.js"></script>

    <!-- Metis Menu Plugin JavaScript -->
    <script src="../bower_components/metisMenu/dist/metisMenu.min.js"></script>

    <!-- Custom Theme JavaScript -->
    <script src="../dist/js/sb-admin-2.js"></script>
    <script src="../js/bootstrap-notify.js"></script>

<?php
$managerCou = new CouponManager($db);
$nb_pal = $managerCou->count(7);
$nb_mm = $managerCou->count(8);
$nb_mustmail = $managerCou->count('mustmail');
if(($nb_pal>0)||($nb_mm>0)||($nb_mustmail>0))
{
echo "<input type='hidden' id='nb_pal' value='".$nb_pal."'>";	
echo "<input type='hidden' id='nb_mm' value='".$nb_mm."'>";	
echo "<input type='hidden' id='nb_mustmail' value='".$nb_mustmail."'>";	
?>	
<script>
if (document.getElementById('nb_pal').value > 0) {
$.notify({
	// options
	icon: 'fa fa-truck',
	title: '<strong>Attention : Demande de Livraison</strong>',
	message: '<br>* <strong>'+document.getElementById('nb_pal').value+'</strong> demande(s) de livraison sont en cours<br>Cliquez pour en savoir plus',
	
	url: '?filtre=showmepal&redirect_to=/pages/coupons.php',
	target: '_self'
},{
	// settings
	element: 'body',
	position: 'fixed',
	type: "warning",
	offset: {x: 50,y: 100},
	allow_dismiss: true,
	newest_on_top: true,
	showProgressbar: true,
	placement: {
		from: "top",
		align: "left"
	},
	offset: 20,
	spacing: 10,
	z_index: 1031,
	delay: 15000,
	timer: 1000,
	url_target: '_self',
	mouse_over: 'pause',
	animate: {
		enter: "animated fadeInDown",
		exit: "animated hinge"
	},
	onShow: null,
	onShown: null,
	onClose: null,
	onClosed: null,
	icon_type: 'class',
	template: '<div data-notify="container" class="col-xs-11 col-sm-3 alert alert-{0}" role="alert">' +
		'<button type="button" aria-hidden="true" class="close" data-notify="dismiss"><i class="fa fa-times  fa-2x" aria-hidden="true"></i></button>' +
		'<span data-notify="icon"></span> ' +
		'<span data-notify="title">{1}</span> ' +
		'<span data-notify="message">{2}</span>' +
		'<div class="progress" data-notify="progressbar">' +
			'<div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' +
		'</div>' +
		'<a href="{3}" target="{4}" data-notify="url"></a>' +
	'</div>' 
});
}

if (document.getElementById('nb_mm').value > 0) {
setTimeout(function() {$.notify({
	// options
	icon: 'fa fa-clock-o',
	title: '<strong>Attention : Mandat Minute</strong>',
	message: '<br>* <strong>'+document.getElementById('nb_mm').value+'</strong>  mandat minute sont en cours<br>Cliquez pour en savoir plus',	
	url: '?filtre=showmemm&redirect_to=/pages/coupons.php',
	target: '_self'
},{
	// settings
	element: 'body',
	position: 'fixed',
	type: "warning",
	offset: {x: 50,y: 100},
	allow_dismiss: true,
	newest_on_top: true,
	showProgressbar: true,
	placement: {
		from: "top",
		align: "left"
	},
	offset: 20,
	spacing: 10,
	z_index: 1031,
	delay: 15000,
	timer: 2000,
	url_target: '_self',
	mouse_over: 'pause',
	animate: {
		enter: "animated fadeInDown",
		exit: "animated hinge"
	},
	onShow: null,
	onShown: null,
	onClose: null,
	onClosed: null,
	icon_type: 'class',
	template: '<div data-notify="container" class="col-xs-11 col-sm-3 alert alert-{0}" role="alert">' +
		'<button type="button" aria-hidden="true" class="close" data-notify="dismiss"><i class="fa fa-times  fa-2x" aria-hidden="true"></i></button>' +
		'<span data-notify="icon"></span> ' +
		'<span data-notify="title">{1}</span> ' +
		'<span data-notify="message">{2}</span>' +
		'<div class="progress" data-notify="progressbar">' +
			'<div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' +
		'</div>' +
		'<a href="{3}" target="{4}" data-notify="url"></a>' +
	'</div>' 
});}, 1500);
}

if (document.getElementById('nb_mustmail').value > 0) {
setTimeout(function() {$.notify({
	// options
	icon: 'fa fa-credit-card',
	title: '<strong>Attention : Paiement En ligne </strong>',
	message: '<br>* <strong>'+document.getElementById('nb_mustmail').value+'</strong> paiement en ligne non-notifié par mail sont en cours<br>Cliquez pour en savoir plus',
	
	url: '?filtre=showmepel&redirect_to=/pages/coupons.php',
	target: '_self'
},{
	// settings
	element: 'body',
	position: 'fixed',
	type: "danger",
	offset: {x: 50,y: 100},
	allow_dismiss: true,
	newest_on_top: true,
	showProgressbar: true,
	placement: {
		from: "top",
		align: "left"
	},
	offset: 20,
	spacing: 10,
	z_index: 1031,
	delay: 15000,
	timer: 3000,
	url_target: '_self',
	mouse_over: 'pause',
	animate: {
		enter: "animated fadeInDown",
		exit: "animated hinge"
	},
	onShow: null,
	onShown: null,
	onClose: null,
	onClosed: null,
	icon_type: 'class',
	template: '<div data-notify="container" class="col-xs-11 col-sm-3 alert alert-{0}" role="alert">' +
		'<button type="button" aria-hidden="true" class="close" data-notify="dismiss"><i class="fa fa-times  fa-2x" aria-hidden="true"></i></button>' +
		'<span data-notify="icon"></span> ' +
		'<span data-notify="title">{1}</span> ' +
		'<span data-notify="message">{2}</span>' +
		'<div class="progress" data-notify="progressbar">' +
			'<div class="progress-bar progress-bar-{0}" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width: 0%;"></div>' +
		'</div>' +
		'<a href="{3}" target="{4}" data-notify="url"></a>' +
	'</div>' 
});}, 3000);
}
</script>
<?php } ?>


</body>

</html>