90 lines
2.6 KiB
PHP
90 lines
2.6 KiB
PHP
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
|
|
<HTML>
|
|
<HEAD>
|
|
<title>Découvrez nos bons de réduction</title>
|
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=Edge">
|
|
<link rel="stylesheet" type="text/css" href="{{'/storage/landings/'.$ref}}/css/style.css">
|
|
<script type="text/javascript" src="https://code.jquery.com/jquery-latest.js"></script>
|
|
<script type="text/javascript">
|
|
function setupLabel() {
|
|
if ($('.input_check input').length) {
|
|
$('.input_check').each(function(){
|
|
$(this).removeClass('check_on');
|
|
});
|
|
$('.input_check input:checked').each(function(){
|
|
$(this).parent('label').addClass('check_on');
|
|
});
|
|
};
|
|
}
|
|
|
|
function envoyer() {
|
|
var tabCheckbox = $("form input:checkbox");
|
|
var nbCheckbox = tabCheckbox.length;
|
|
var nbChoix = 0;
|
|
|
|
for(i=0;i<nbCheckbox;i++){
|
|
if (eval(tabCheckbox[i].checked) == true){
|
|
var regex = /^coupons/;
|
|
var nomInput = tabCheckbox[i].name;
|
|
if(regex.test(nomInput)){
|
|
nbChoix = nbChoix + 1;
|
|
}
|
|
}
|
|
}
|
|
if(nbChoix != 0){
|
|
document.coupons.submit();
|
|
}
|
|
}
|
|
|
|
$(document).ready(function(){
|
|
$('body').addClass('has-js');
|
|
$('.input_check').click(function(){
|
|
setupLabel();
|
|
});
|
|
setupLabel();
|
|
});
|
|
</script>
|
|
|
|
|
|
|
|
</HEAD>
|
|
|
|
<BODY>
|
|
<div class="global">
|
|
<form name="coupons" action="/imprimer" method="post" enctype="multipart/form-data" style="margin-top:20px;">
|
|
@csrf
|
|
<input type="hidden" name="sessionuuid" value="">
|
|
|
|
<div style="padding-bottom: 10px;">
|
|
<div style="float: left;height: 40px;">
|
|
<h3>Vous avez {{ $nb }} coupon disponible</h3>
|
|
</div>
|
|
<div style="float: right;">
|
|
<input type="button" class="print" style="margin-top: 10px; display:@if($nb == 0) none;@else block; @endif" value="J'imprime ma sélection" onclick="envoyer();">
|
|
</div>
|
|
<div style="clear:both;"></div>
|
|
</div>
|
|
|
|
|
|
<div class="clear"></div>
|
|
<div id="choixcoupons">
|
|
@foreach ($coupons as $coupon)
|
|
@if ($coupon->isAvailable)
|
|
<div class="coupon">
|
|
<img style="display:block;" src="{{ $coupon->coupon_thumbnail1 }}" alt="" title=""/>
|
|
<label class="input_check"><input type="checkbox" id="{{$coupon->coupon_code}}" value="{{$coupon->coupon_code}}" name="coupons[]"/> Sélectionner</label>
|
|
</div>
|
|
@else
|
|
<div class="coupon">
|
|
<img style="display:block;" src="{{ $coupon->coupon_thumbnail2 }}" alt="" title=""/>
|
|
</div>
|
|
@endif
|
|
@endforeach
|
|
</div>
|
|
<center><input type="button" style="display: @if($nb == 0) none;@else block; @endif" class="print" value="IMPRIMER MES COUPONS" onclick="envoyer();"></center>
|
|
<br/>
|
|
</form>
|
|
</div>
|
|
</BODY>
|
|
</HTML>
|