. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
| 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/pages/ |
Upload File : |
<?php
include 'class/coupon.class.php';
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include 'header.php';?>
<style>
.title_status {
font-family: 'Oswald', sans-serif;
font-size: 72px;
font-weight: bold;
line-height: 45px;
}
.nav-tabs>.active> a{
background-color:rgba(0, 124, 187, 0.2) !important;
}
.nbdealpannellink:hover{text-decoration:none;}
.revealOnScroll {
opacity: 0;
}
</style>
</head>
<body>
<div id="wrapper">
<?php include 'menu.php'; ?>
<?php if (!(he_can('EDITDEAL'))) {echo "<script>location.href = '403.php';</script>";}?>
<?php
$managerCou = new CouponManager($db);
////////////////// traitement des action sur les deals
$message ='';
$class_msg='';
if((isset ($_POST['op']))||(isset ($_GET['op'])))
{
if($_POST['op'] == "edit")
{
$maj= array();
$maj['id']=(int) $_POST['id'];
$maj['pp']=(int) $_POST['pp'];
$maj['pr']=(int) $_POST['pr'];
$maj['nba']=$_POST['nba'];
$maj['df'] = strtotime($_POST['df1']." ".$_POST['df2']);
if ($message =='')
{$managerCou->fastedit($maj);
echo '<script language="javascript">window.location.href = "'.$_SERVER['PHP_SELF'].'?msg=2&p1='.$maj['id'].'"</script>';
}
}
if($_GET['op'] == "addday")
{
$maj= array();
$maj['id']=(int) $_GET['post'];
$maj['pp']=(int) $_GET['pp'];
$maj['pr']=(int) $_GET['pr'];
$nba_added = 1 + rand(0,2);
$maj['nba']=(int) $_GET['nba']+ $nba_added;
$maj['df'] = strtotime(date('Y-m-d',time()).' 23:59:59')+86400 * (int) $_GET['nb'];
if ($message =='')
{$managerCou->fastedit($maj);
echo '<script language="javascript">window.location.href = "'.$_SERVER['PHP_SELF'].'?msg=1&p1='.$_GET['nb'].'&p2='.$maj['id'].'&p3='.$nba_added.'"</script>';
}
}
if($_POST['op'] == "editall")
{
$deals_id = array_filter(explode('#',$_POST['deals_id']));
$deals_id_modified = array();
foreach ($deals_id as $key => $value)
if($_POST['cb_'.$value])
{
$deals_id_modified[] = $value;
$maj= array();
$maj['id']=(int) $value;
$maj['pp']=(int) $_POST['pp_'.$value];
$maj['pr']=(int) $_POST['pr_'.$value];
$maj['nba']=(int) $_POST['nba_'.$value] + (int) $_POST['add_nba_'.$value];
$maj['df'] = strtotime(date('Y-m-d',time()).' 23:59:59')+86400 * (int) $_POST['add_nbj_'.$value];
$managerCou->fastedit($maj);
}
if ($message =='')
{
echo '<script language="javascript">window.location.href = "'.$_SERVER['PHP_SELF'].'?msg=3&p1='.implode(", ", $deals_id_modified).'"</script>';
}
}
}
$message ='';
if (isset($_GET['msg']))
{
switch ($_GET['msg']) {
case 1:$message = "<i class='fas fa-floppy-o' aria-hidden='true'></i> Vos modifications ont été effectuées avec succès!.(ajout du <b>".$_GET['p1']."</b> jours au deal ".$_GET['p2']." et ".$_GET['p3']." acheteur(s) )";$class_msg="alert alert-success";break;
case 2:$message = "<i class='fas fa-floppy-o' aria-hidden='true'></i> Vos modifications ont été effectuées avec succès!.(Modification du deal ".$_GET['p1'].")";$class_msg="alert alert-success";break;
case 3:$message = "<i class='fas fa-floppy-o' aria-hidden='true'></i> Vos modifications ont été effectuées avec succès!.(Modification des deals ".$_GET['p1'].")";$class_msg="alert alert-success";break;
$class_msg="alert alert-warning";
// case 1:$message = "Le coupon à été supprimée!";$class_msg="alert alert-info";break;
// case 2:$message = "Le client a été informé sur le coupon par mail";$class_msg="alert alert-success";break;
// case 3:$message = "Erreur lors de l'envoi mail";$class_msg="alert alert-danger";break;
// case 4:$message = "Le Paiemenet est validée.";$class_msg="alert alert-success";break;
// case 5:$message = "Coupon reçu avec succès.";$class_msg="alert alert-success";break;
}
}
$listeDeal = $managerCou->getListDeal();
// var_dump($listeDeal);
?>
<!-- Page Content -->
<div id="page-wrapper">
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header">Modification Rapide d'un deal</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<!-- /.row -->
<div class="row">
<div class="col-xs-6 col-md-3">
<a data-toggle="tab" href="#tt" onclick="parent.location='#liste'" class="nbdealpannellink">
<div class="panel panel-info animated fadeInUp" >
<div class="panel-heading">
<h1 class="title_status text-center"><span id="nbdt"></span></h1>
</div>
<div class="panel-body text-center">
<strong>Totale</strong>
<i class="fas fa-arrow-circle-right pull-right"></i>
</div>
</div>
</a>
</div>
<div class="col-xs-6 col-md-3">
<a data-toggle="tab" href="#tabDealEncours" onclick="parent.location='#liste'" class="nbdealpannellink">
<div class="panel panel-success animated fadeInDown" >
<div class="panel-heading">
<h1 class="title_status text-center"><span id="nbdec"></span></h1>
</div>
<div class="panel-body text-center">
<strong>En Cours</strong>
<i class="fas fa-arrow-circle-right pull-right"></i>
</div>
</div>
</a>
</div>
<div class="col-xs-6 col-md-3">
<a data-toggle="tab" href="#tabDealExp24" onclick="parent.location='#liste'" class="nbdealpannellink" >
<div class="panel panel-warning animated fadeInUp">
<div class="panel-heading">
<h1 class="title_status text-center"><span id="nbEndToday"></span></h1>
</div>
<div class="panel-body text-center">
<strong>Expire -24H</strong>
<i class="fas fa-arrow-circle-right pull-right"></i>
</div>
</div>
</a>
</div>
<div class="col-xs-6 col-md-3">
<a data-toggle="tab" href="#tabDealExp" onclick="parent.location='#liste'" class="nbdealpannellink">
<div class="panel panel-danger animated fadeInDown">
<div class="panel-heading">
<h1 class="title_status text-center"><span id="nbdp"></span></h1>
</div>
<div class="panel-body text-center">
<strong>Expiré</strong>
<i class="fas fa-arrow-circle-right pull-right"></i>
</div>
</div>
</a>
</div>
</div>
<div class="tab-content">
<div role="tabpanel" class="tab-pane fade in active" id="deal">
<div class="row hidden-print">
<div class="col-lg-12">
<div class="panel panel-default animated fadeInUp">
<div class="panel-heading">
</div>
<div class="panel-body">
<?php
if ($message !='')
{echo '<div class="'.$class_msg.' animated flash" role="alert"><i class="fas fa-exclamation-circle"></i> '.$message.'</div>';}
?>
<table class="table table-striped">
<form name='frm' id='frm' action='' method='post'>
<input type='hidden' name='action' value='Modifier'>
<?php
?>
<tbody>
<!-- <tr>
<th width='25%'></th>
<td>
<span id='nbdt'></span><i class='fas fa-hourglass'style='color: black;' title="Nombre de deal enregistré" ></i>
<span id='nbdec'></span><i class='fas fa-hourglass-half'style='color: green;' title="Nombre de deal en cours"></i>
<span id='nbEndToday'></span><i class='fas fa-hourglass-end 'style='color: #ff9019;' title="Nombre de deal finira dans moins de 24h"></i>
<span id='nbdp'></span><i class='far fa-hourglass 'style='color: red;' title="Nombre de deal passé"></i>
</td>
</tr>-->
<tr>
<th width='25%'>DEAL <span class="asteriskField">*</span></th>
<td >
<?php
$nbdec = $nbdp = $nbEndToday = 0;
echo "
<select style='width: 90%;' name='id_post'
onchange=\"document.getElementById('infod').innerHTML = document.getElementById('infodeal'+this.options[this.selectedIndex].value).innerHTML;\"
required><option value='' selected>Veuillez choisir un deal</option>";
foreach ($listeDeal as $deal)
{
// $style_option = "style='color: red;'";
// $icon_etat = "";
// if($deal['df'] > time())
// {$style_option = "style='color: green;font-weight: bolder;'";
// $icon_etat = "<i class='fas fa-hourglass-half'style='color: green;'></i>";
// $nbdec++;
// if($deal['df'] <= strtotime('+1 day', time()))
// { $style_option = "style='color: warning;font-weight: bolder;'";
// $icon_etat = "<i class='fas fa-hourglass-end'style='color: #ff9019;'></i>";
// $nbEndToday++;
// }
// }
// else{
// $style_option = "style='color: red;'";
// $icon_etat = "<i class='fas fa-hourglass-half'style='color: green;'></i>";
// $nbdp++;
// }
switch (true) {
case ($deal['df'] < time()):
{
$style_option = "style='color: red;'";
$icon_etat = "zzz<i class='far fa-hourglass 'style='color: red;'></i>";
$nbdp++;
}
break;
case (($deal['df'] > time())&&($deal['df'] <= strtotime('+1 day', time()))):
{
$style_option = "style='color: #ff9019;font-weight: bolder;'";
$icon_etat = "<i class='fas fa-hourglass-end'style='color: #ff9019;'></i>";
$nbEndToday++; $nbdec++;
}
break;
case ($deal['df'] > strtotime('+1 day', time())):
{
$style_option = "style='color: green;font-weight: bolder;'";
$icon_etat = "<i class='fas fa-hourglass-half'style='color: green;'></i>";
$nbdec++;
}
break;
default:
{
$style_option = "style=''";
$icon_etat = "<i class='fas fa-info-circle'></i>";
}
}
echo "<option value='".$deal['id']."' ".$style_option."> ".$deal['id'].' - '.substr($deal['titre'],0,75)."...</option>";}
echo "</select>";
foreach ($listeDeal as $deal)
{echo "<div id='infodeal".$deal['id']."' class='well well-sm' style='width: 90%;display:none;'>
Prix : <b>".$deal['prix_promo']."</b><sup>Dt.</sup> au lieu de <b><s>".$deal['prix_reel']."</s></b><sup>Dt.</sup><br>
Nb Acheteurs : <b>".$deal['nba']."</b><br>
D. Fin : <b>".date('d-m-Y \à H:i ',$deal['df']) ."</b>";
if($deal['df'] > time())
{
if($deal['df'] > strtotime('+1 day', time())) echo "<i class='fas fa-hourglass-half'style='color: green;'></i>";
else echo "<i class='fas fa-hourglass-end'style='color: #ff9019;'></i>";
}
else {echo "<i class='far fa-hourglass 'style='color: red;'></i>";}
$nbjrand25= 2+ rand(0,3);
echo "<br>
<div class='btn-group' role='group'>
<div class='btn-group' role='group'>
<a class='btn btn-primary btn-sm' href='#' data-toggle='modal' data-target='#edit".$deal['id']."' title='Modification Rapide'> <i class='fas fa-bolt'style='color:#fff;'></i><i class='fas fa-edit'style='color:#fff;'></i> </a>
<a class='btn btn-success btn-sm hvr-buzz-out' href='?post=".$deal['id']."&pp=".$deal['prix_promo']."&pr=".$deal['prix_reel']."&nba=".$deal['nba']."&op=addday&nb=".$nbjrand25."' title='Ajouter ".$nbjrand25." jours'><istyle='color:#fff;'>+".$nbjrand25."</i><i class='fas fa-sun animated infinite rotateIn' aria-hidden='true'></i></a>
<a class='btn btn-info btn-sm' href='".$home."/wp-admin/post.php?post=".$deal['id']."&action=edit' target='_blanc' title='Modification Compléte'><i class='fas fa-edit'style='color:#fff;'></i></a>
<a class='btn btn-info btn-sm' href='".$home."/?p=".$deal['id']."' target='_blanc' title='Visualisation'><i class='fas fa-eye' style='color:#fff;'></i></a>
</div>
</div>
</div>";
}
echo "<div style='width: 90%;' id='infod' class='well well-sm'> <font color='red'>Veuillez choisir un deal</font></div>";
?>
<script>
document.getElementById("nbdt" ).innerHTML = '<?php echo $nbdec + $nbdp; ?>';
document.getElementById("nbdec" ).innerHTML = '<?php echo $nbdec; ?>';
document.getElementById("nbEndToday" ).innerHTML = '<?php echo $nbEndToday; ?>';
document.getElementById("nbdp" ).innerHTML = '<?php echo $nbdp; ?>';
</script>
</td>
</tr>
</tbody>
</form>
</table>
</div>
<!-- /.table-responsive -->
</div>
</div>
</div>
</div>
</div>
</div>
<!-- /.container-fluid -->
<!-------------------------------------->
<!-------------------------------------->
<?php
$managerCou = new CouponManager($db);
$listeDeal = $managerCou->getListDeal();
// var_dump($listeDeal);
?>
<div class="container-fluid">
<div class="row">
<div class="col-lg-12">
<h1 class="page-header"id="liste" >Listes Des DEALS</h1>
</div>
<!-- /.col-lg-12 -->
</div>
<ul class="nav nav-tabs">
<li class="active"><a data-toggle="tab" href="#tt"><b style="color: black;">Tous Les deals <span class="badge" style="background-color: black;"><?php echo $nbdec + $nbdp; ?></span></b></a></li>
<li><a data-toggle="tab" href="#tabDealEncours"><b><i class="fas fa-hourglass-half" style="color: green;"> En Cours <span class="badge" style="background-color: green;"><?php echo $nbdec; ?></span></i></b></a></li>
<li><a data-toggle="tab" href="#tabDealExp24"><b><i class="fas fa-hourglass-end" style="color: #ff9019;"> Expire -24H <span class="badge" style="background-color: #ff9019;"><?php echo $nbEndToday; ?></span></i></b></a></li>
<li><a data-toggle="tab" href="#tabDealExp"><b><i class="far fa-hourglass " style="color: red;"> Expiré <span class="badge" style="background-color: red;"><?php echo $nbdp; ?></span></i></b></a></li>
</ul>
<div class="tab-content" id="myTab">
<div id="tt" class="tab-pane fade in active">
<!-- /.row -->
<div class="row">
<?php foreach ($listeDeal as $deal) { ?>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="well well-sm animated fadeInUp" style="font-size: 11px;display: inline-block;margin: 1%;<?php if (($deal['df'] <= strtotime('+1 day', time())) && ($deal['df'] > time())){echo "border-color:rgba(255, 204, 1, 0.5);border-width: medium;" ; }if($deal['df'] < time()){echo "border-color:rgba(212, 63, 58, 0.5);border-width: medium;" ; } ?>">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 text-center">
<img src='<?php echo $deal['image'];?>' width='100%'>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<?php echo $deal['id'].") ";?><a href='<?php echo $home."/?p=".$deal['id']; ?>' target='_blanc'><b><?php echo $deal['titre'];
?></b></a>
<?php
$nbjrand25= 3+ rand(0,3);
echo "<br>
<div class='row'>
<div class='btn-group col-lg-12 col-xs-12' role='group'>
<a class='btn btn-info btn-xs col-xs-3 text-center' href='#' data-toggle='modal' data-target='#edit".$deal['id']."' title='Modification Rapide'> <i class='fas fa-bolt'style='color:#fff;'></i><i class='fas fa-edit'style='color:#fff;'></i> </a>
<a class='btn btn-success btn-xs col-xs-3 text-center hvr-buzz-out' href='?post=".$deal['id']."&pp=".$deal['prix_promo']."&pr=".$deal['prix_reel']."&nba=".$deal['nba']."&op=addday&nb=".$nbjrand25."' title='Ajouter ".$nbjrand25." jours'><istyle='color:#fff;'>+".$nbjrand25."</i><i class='fas fa-sun animated infinite rotateIn' aria-hidden='true'></i></a>
<a class='btn btn-primary btn-xs col-xs-2 text-center' href='".$home."/wp-admin/post.php?post=".$deal['id']."&action=edit' target='_blanc' title='Modification'> <i class='fas fa-edit'style='color:#fff;'></i> </a>
<a class='btn btn-primary btn-xs col-xs-2 text-center' href='".$home."/?p=".$deal['id']."' target='_blanc' title='Visualisation'> <i class='fas fa-eye' style='color:#fff;' ></i> </a>
";
if (($deal['df'] <= strtotime('+1 day', time())) && ($deal['df'] > time())){echo '<a class="btn btn-danger btn-xs col-xs-2 text-center" title="Finira dans moins de 24h"><i class="fas fa-exclamation-triangle animated infinite flash" aria-hidden="true" style="color: #fff;" ></i></a>';}
if ($deal['df'] < time()){echo '<a class="btn btn-default btn-xs col-xs-2 text-center" title="Expiré"><i class="far fa-hourglass " aria-hidden="true" style="color: #d43f3a;" ></i></a>';}
echo "</div></div>";
?>
<?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>
Nb Acheteurs affiché : <b>".$deal['nba']."</b><br>
Partenaire : <b>".$deal['p_nom']."</b><br>
".$deal['p_adresse']." (".$deal['p_tel'].")
";
?>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<div id="tabDealEncours" class="tab-pane fade">
<div class="row">
<?php foreach ($listeDeal as $deal)
if ($deal['df'] > time())
{ ?>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="well well-sm animated fadeInUp" style="font-size: 11px;display: inline-block;margin: 1%;<?php if (($deal['df'] <= strtotime('+1 day', time())) && ($deal['df'] > time())){echo "border-color:rgba(255, 204, 1, 0.5);" ; }if($deal['df'] < time()){echo "border-color:rgba(212, 63, 58, 0.5);" ; } ?>">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 text-center">
<img src='<?php echo $deal['image'];?>' width='100%'>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<?php echo $deal['id'].") ";?><a href='<?php echo $home."/?p=".$deal['id']; ?>' target='_blanc'><b><?php echo $deal['titre'];
?></b></a>
<?php
$nbjrand25= 3+ rand(0,3);
echo "<br>
<div class='row'>
<div class='btn-group col-lg-12 col-xs-12' role='group'>
<a class='btn btn-info btn-xs col-xs-3 text-center' href='#' data-toggle='modal' data-target='#edit".$deal['id']."' title='Modification Rapide'> <i class='fas fa-bolt'style='color:#fff;'></i><i class='fas fa-edit'style='color:#fff;'></i> </a>
<a class='btn btn-success btn-xs col-xs-3 text-center hvr-buzz-out' href='?post=".$deal['id']."&pp=".$deal['prix_promo']."&pr=".$deal['prix_reel']."&nba=".$deal['nba']."&op=addday&nb=".$nbjrand25."' title='Ajouter ".$nbjrand25." jours'><istyle='color:#fff;'>+".$nbjrand25."</i><i class='fas fa-sun animated infinite rotateIn' aria-hidden='true'></i></a>
<a class='btn btn-primary btn-xs col-xs-2 text-center' href='".$home."/wp-admin/post.php?post=".$deal['id']."&action=edit' target='_blanc' title='Modification'> <i class='fas fa-edit'style='color:#fff;'></i> </a>
<a class='btn btn-primary btn-xs col-xs-2 text-center' href='".$home."/?p=".$deal['id']."' target='_blanc' title='Visualisation'> <i class='fas fa-eye' style='color:#fff;' ></i> </a>
";
if (($deal['df'] <= strtotime('+1 day', time())) && ($deal['df'] > time())){echo '<a class="btn btn-danger btn-xs col-xs-2 text-center" title="Finira dans moins de 24h"><i class="fas fa-exclamation-triangle animated infinite flash" aria-hidden="true" style="color: #fff;" ></i></a>';}
if ($deal['df'] < time()){echo '<a class="btn btn-default btn-xs col-xs-2 text-center" title="Expiré"><i class="far fa-hourglass " aria-hidden="true" style="color: #d43f3a;" ></i></a>';}
echo "</div></div>";
?>
<?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>
Nb Acheteurs affiché : <b>".$deal['nba']."</b><br>
Partenaire : <b>".$deal['p_nom']."</b><br>
".$deal['p_adresse']." (".$deal['p_tel'].")
";
?>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
<div id="tabDealExp24" class="tab-pane fade">
<?php if( $nbEndToday >0){?>
<div class="row">
<div class="col-lg-12 col-md-12">
<br>
<?php echo "<a class='btn btn-warning btn-lg col-xs-12 text-center' href='#' data-toggle='modal' data-target='#editall' title='Prolonger les deals'>
<i class='fas fa-bolt'style='color:#fff;'></i> Prolonger les deals -24Heurs
</a>"; ?>
<br>
</div>
</div>
<?php }?>
<div class="row">
<?php foreach ($listeDeal as $deal)
if (($deal['df'] <= strtotime('+1 day', time())) && ($deal['df'] > time()))
{ ?>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="well well-sm animated fadeInUp" style="font-size: 11px;display: inline-block;margin: 1%;<?php if (($deal['df'] <= strtotime('+1 day', time())) && ($deal['df'] > time())){echo "border-color:rgba(255, 204, 1, 0.5);" ; }if($deal['df'] < time()){echo "border-color:rgba(212, 63, 58, 0.5);" ; } ?>">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 text-center">
<img src='<?php echo $deal['image'];?>' width='100%'>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<?php echo $deal['id'].") ";?><a href='<?php echo $home."/?p=".$deal['id']; ?>' target='_blanc'><b><?php echo $deal['titre'];
?></b></a>
<?php
$nbjrand25= 3+ rand(0,3);
echo "<br>
<div class='row'>
<div class='btn-group col-lg-12 col-xs-12' role='group'>
<a class='btn btn-info btn-xs col-xs-3 text-center' href='#' data-toggle='modal' data-target='#edit".$deal['id']."' title='Modification Rapide'> <i class='fas fa-bolt'style='color:#fff;'></i><i class='fas fa-edit'style='color:#fff;'></i> </a>
<a class='btn btn-success btn-xs col-xs-3 text-center hvr-buzz-out' href='?post=".$deal['id']."&pp=".$deal['prix_promo']."&pr=".$deal['prix_reel']."&nba=".$deal['nba']."&op=addday&nb=".$nbjrand25."' title='Ajouter ".$nbjrand25." jours'><istyle='color:#fff;'>+".$nbjrand25."</i><i class='fas fa-sun animated infinite rotateIn' aria-hidden='true'></i></a>
<a class='btn btn-primary btn-xs col-xs-2 text-center' href='".$home."/wp-admin/post.php?post=".$deal['id']."&action=edit' target='_blanc' title='Modification'> <i class='fas fa-edit'style='color:#fff;'></i> </a>
<a class='btn btn-primary btn-xs col-xs-2 text-center' href='".$home."/?p=".$deal['id']."' target='_blanc' title='Visualisation'> <i class='fas fa-eye' style='color:#fff;' ></i> </a>
";
if (($deal['df'] <= strtotime('+1 day', time())) && ($deal['df'] > time())){echo '<a class="btn btn-danger btn-xs col-xs-2 text-center" title="Finira dans moins de 24h"><i class="fas fa-exclamation-triangle animated infinite flash" aria-hidden="true" style="color: #fff;" ></i></a>';}
if ($deal['df'] < time()){echo '<a class="btn btn-default btn-xs col-xs-2 text-center" title="Expiré"><i class="far fa-hourglass " aria-hidden="true" style="color: #d43f3a;" ></i></a>';}
echo "</div></div>";
?>
<?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>
Nb Acheteurs affiché : <b>".$deal['nba']."</b><br>
Partenaire : <b>".$deal['p_nom']."</b><br>
".$deal['p_adresse']." (".$deal['p_tel'].")
";
?>
</div>
</div>
</div>
<?php } ?>
</div>
<?php if( $nbEndToday >0){?>
<div class="row">
<div class="col-lg-12 col-md-12">
<br>
<?php echo "<a class='btn btn-warning btn-lg col-xs-12 text-center' href='#' data-toggle='modal' data-target='#editall' title='Prolonger les deals'>
<i class='fas fa-bolt'style='color:#fff;'></i> Prolonger les deals -24Heurs
</a>"; ?>
<br>
</div>
</div>
<?php } ?>
</div>
<div id="tabDealExp" class="tab-pane fade">
<div class="row">
<?php foreach ($listeDeal as $deal)
if ($deal['df'] < time())
{ ?>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<div class="well well-sm animated fadeInUp" style="font-size: 11px;display: inline-block;margin: 1%;<?php if (($deal['df'] <= strtotime('+1 day', time())) && ($deal['df'] > time())){echo "border-color:rgba(255, 204, 1, 0.5);" ; }if($deal['df'] < time()){echo "border-color:rgba(212, 63, 58, 0.5);" ; } ?>">
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12 text-center">
<img src='<?php echo $deal['image'];?>' width='100%'>
</div>
<div class="col-lg-6 col-md-6 col-sm-12 col-xs-12">
<?php echo $deal['id'].") ";?><a href='<?php echo $home."/?p=".$deal['id']; ?>' target='_blanc'><b><?php echo $deal['titre'];
?></b></a>
<?php
$nbjrand25= 3+ rand(0,3);
echo "<br>
<div class='row'>
<div class='btn-group col-lg-12 col-xs-12' role='group'>
<a class='btn btn-info btn-xs col-xs-3 text-center' href='#' data-toggle='modal' data-target='#edit".$deal['id']."' title='Modification Rapide'> <i class='fas fa-bolt'style='color:#fff;'></i><i class='fas fa-edit'style='color:#fff;'></i> </a>
<a class='btn btn-success btn-xs col-xs-3 text-center hvr-buzz-out' href='?post=".$deal['id']."&pp=".$deal['prix_promo']."&pr=".$deal['prix_reel']."&nba=".$deal['nba']."&op=addday&nb=".$nbjrand25."' title='Ajouter ".$nbjrand25." jours'><istyle='color:#fff;'>+".$nbjrand25."</i><i class='fas fa-sun animated infinite rotateIn' aria-hidden='true'></i></a>
<a class='btn btn-primary btn-xs col-xs-2 text-center' href='".$home."/wp-admin/post.php?post=".$deal['id']."&action=edit' target='_blanc' title='Modification'> <i class='fas fa-edit'style='color:#fff;'></i> </a>
<a class='btn btn-primary btn-xs col-xs-2 text-center' href='".$home."/?p=".$deal['id']."' target='_blanc' title='Visualisation'> <i class='fas fa-eye' style='color:#fff;' ></i> </a>
";
if (($deal['df'] <= strtotime('+1 day', time())) && ($deal['df'] > time())){echo '<a class="btn btn-danger btn-xs col-xs-2 text-center" title="Finira dans moins de 24h"><i class="fas fa-exclamation-triangle animated infinite flash" aria-hidden="true" style="color: #fff;" ></i></a>';}
if ($deal['df'] < time()){echo '<a class="btn btn-default btn-xs col-xs-2 text-center" title="Expiré"><i class="far fa-hourglass " aria-hidden="true" style="color: #d43f3a;" ></i></a>';}
echo "</div></div>";
?>
<?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>
Nb Acheteurs affiché : <b>".$deal['nba']."</b><br>
Partenaire : <b>".$deal['p_nom']."</b><br>
".$deal['p_adresse']." (".$deal['p_tel'].")
";
?>
</div>
</div>
</div>
<?php } ?>
</div>
</div>
</div>
</div>
<!-- /.container-fluid -->
<!-------------------------------------->
<!-------------------------------------->
</div>
<!-- /#page-wrapper -->
</div>
<!-- /#wrapper -->
<?php foreach ($listeDeal as $deal) { ?>
<div class="modal fade modal-primary" id="edit<?php echo $deal['id'];?>" data-easein="flipXIn" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog <?php echo $animated_open_effect[array_rand($animated_open_effect, 1)]; ?> animated" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h4 class="modal-title" id="myModalLabel"><?php echo $deal['id'];?> : <?php echo substr($deal['titre'],0,75);?>
<?php if (($deal['df'] <= strtotime('+1 day', time())) && ($deal['df'] > time())){echo '<i class="fas fa-exclamation-triangle animated infinite flash" aria-hidden="true" style="color: #ff9019;"></i>';} ?>
</h4>
</div>
<div class="modal-body">
<table class="table table-striped">
<form name='frm' id='frm' action='' method='post'>
<?php
echo "<input type='hidden' name='id' value = '".$deal['id']."'>";
echo "<input type='hidden' name='op' value = 'edit'>";
?>
<tbody>
<tr>
<th width='25%'>Prix Promo <span class="asteriskField">*</span> </th>
<td><?php echo "<div class='form-group input-group'><input type='number' value='".$deal['prix_promo']."' class='form-control' name='pp' pattern='^[0-9-]{1,70}$' placeholder='Prix Promo' title='Prix Promo' value='0' required><span class='input-group-addon'> Dt.</span></div>";?></td>
</tr>
<tr>
<th>Prix Réel <span class="asteriskField">*</span> </th>
<td><?php echo "<div class='form-group input-group'><input type='number' value='".$deal['prix_reel']."' class='form-control' name='pr' pattern='^[0-9-]{1,70}$' placeholder='Prix Réel' title='Prix Réel' value='0' required><span class='input-group-addon'> Dt.</span></div>";?></td>
</tr>
<tr>
<th>Nb d'acheteurs <span class="asteriskField">*</span> </th>
<td><?php echo "<div class='form-group input-group'><input type='number' value='".$deal['nba']."' class='form-control' name='nba' pattern='^[0-9-]{1,70}$' placeholder='Nombre d\'acheuters' title='Nombre d\'acheteurs' value='0' required><span class='input-group-addon'> Acheteurs</span></div>";?></td>
</tr>
<tr>
<th>Date d'expiration <span class="asteriskField">*</span> </th>
<td><?php echo "<div class='form-group input-group' ><input type='date' value='".date('Y-m-d',$deal['df'])."' class='form-control' name='df1' placeholder='Date d\'expiration' title='Date d\'expiration' value='0' required>
<input type='time' value='".date('H:i',$deal['df'])."' class='form-control' name='df2' placeholder='Date d\'expiration' title='Date d\'expiration' value='0' required></div>";?></td>
</tr>
<tr>
<th></th>
<td>
<button type="submit" class="btn btn-lg btn-primary btn-block"><i class="fas fa-save"></i> Enregistrer</button>
</td>
</tr>
</tbody>
</form>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button>
</div>
</div>
</div>
</div>
<?php } ?>
<div class="modal fade modal-warning" id="editall" data-easein="flipXIn" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
<div class="modal-dialog <?php echo $animated_open_effect[array_rand($animated_open_effect, 1)]; ?> animated" role="document">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
<h3 class="modal-title text-center" id="myModalLabel">
Prolonger les deals
</h3>
</div>
<div class="modal-body">
<table class="table table-striped">
<form name='frm' id='frm' action='' method='post'>
<?php
// echo "<input type='hidden' name='id' value = ''>";
echo "<input type='hidden' name='op' value = 'editall'>";
?>
<tr>
<th class="text-center" width='10%'><i class="fas fa-check-square" aria-hidden="true"></i></th>
<th class="text-center" width='70%'><i class="fas fa-book" aria-hidden="true"></i></th>
<th class="text-center" width='10%'><i class="fas fa-sun" aria-hidden="true"></i></th>
<th class="text-center" width='10%'><i class="fas fa-users" aria-hidden="true"></i></th>
</tr>
<?php $deals_id = ""?>
<?php foreach ($listeDeal as $deal)
if (($deal['df'] <= strtotime('+1 day', time())) && ($deal['df'] > time()))
{
$deals_id = $deal['id']."#".$deals_id;
?>
<tr>
<th>
<?php
echo "<div class='checkbox checkbox-warning' style='margin: 0;'><input type='checkbox' name='cb_".$deal['id']."' checked><label for='etat'></label></div>";
?>
</th>
<th><?php echo $deal['id'].") ";?><a href='<?php echo $home."/?p=".$deal['id']; ?>' target='_blanc'><b><?php echo substr($deal['titre'],0,40)."...";?></b></a> </th>
<td><input type="number" name="add_nbj_<?php echo $deal['id']?>" value="<?php echo 3+ rand(0,3);?>" style="width: 100%;text-align: center;font-weight: bold;"></td>
<td><input type="number" name="add_nba_<?php echo $deal['id']?>" value="<?php echo 1+ rand(0,2);?>" style="width: 100%;text-align: center;font-weight: bold;"></td>
<input type="hidden" name="nba_<?php echo $deal['id']?>" value="<?php echo $deal['nba'];?>">
<input type="hidden" name="pp_<?php echo $deal['id']?>" value="<?php echo $deal['prix_promo'];?>">
<input type="hidden" name="pr_<?php echo $deal['id']?>" value="<?php echo $deal['prix_reel'];?>">
</tr>
<?php } ?>
<tr>
<td colspan="4">
<?php echo "<input type='hidden' name='deals_id' value = '".$deals_id."'>"; ?>
<button type="submit" class="btn btn-lg btn-warning btn-block"><i class="fas fa-save"></i> Prolonger</button>
</td>
</tr>
</form>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-default" data-dismiss="modal">Fermer</button>
</div>
</div>
</div>
</div>
<script>
$(function(){
$(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) {
e.preventDefault()
$('ul.nav li a[href="' + $(this).attr('href') + '"]').tab('show');
}), $("a[data-tab-destination]").on('click',function() {
var url = document.location.toString();
if (url.match('#')) {
var hash = window.location.hash;
hash && $('ul.nav a[href="' + hash + '"]').tab('show');
$('html, body').animate({scrollTop:$("#liste").offset().top}, 'slow');
}
}),
$( document ).ready(function() {
var url = document.location.toString();
if (url.match('#')) {
var hash = window.location.hash;
hash && $('ul.nav a[href="' + hash + '"]').tab('show');
$('html, body').animate({scrollTop:$("#liste").offset().top}, 'slow');
}
})
;
});
</script>
<!-- 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>
</body>
</html>