Current File : /home/karenpetzb/application/modules/backoffice/views/scripts/promotion/product.phtml
<div class="table-box">
 	<table  class="table">
 		<tr><td><h5>Remises associ�es aux produits</h5></td></tr>
		<?php echo $this->render("alert_tr.phtml"); ?>
		<tr>
			<td>
				<form action="<?php echo $this->baseUrl; ?>/backoffice/promotion/productadd" method="post">
					<div class="col-md-12 no-space-top">
						<div class="col-md-2 no-space-top"><label>Sur un produit</label></div>
						<div class="col-md-10 no-space-top"><input type="text" placeholder=" R�f�rence du produit" class="form-control" size="10" name="reference" id="reference" value=""></div>
					</div>
					<div class="col-md-12">
						<div class="col-md-2 no-space-top"></div>
						<div class="col-md-4 no-space-top">
							<div class="col-md-3 no-space-top"><label for="remiseeuro">Remise&nbsp;&#8364;</label></div>
							<div class="col-md-9 no-space-top"><input placeholder="Remise � effectuer en euros" class="form-control" type="text" size="10" name="remiseeuro" id="remiseeuro" value=""></div>
						</div>
						<div class="col-md-4 no-space-top">
							<div class="col-md-3 no-space-top"><label for="remisepour">Remise&nbsp;%</label></div>
							<div class="col-md-9 no-space-top"><input placeholder="Remise � effectuer en pourcentage" class="form-control" type="text" size="10" name="remisepour" id="remisepour" value="" maxlength="3"></div>
						</div>
						<div class="col-md-2 no-space-top text-center">
							<input type="hidden" value="1" name="promo" />
							<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-plus"></i>&nbsp;Ajouter</button>
						</div>
					</div>
				</form>
			</td>
		</tr>
		<tr>
			<td>
				<form action="<?php echo $this->baseUrl; ?>/backoffice/promotion/productadd" method="post">
					<div class="col-md-12 no-space-top">
						<div class="col-md-2 no-space-top"><label>Remise sur X selon Y</label></div>
						<div class="col-md-2 no-space-top"><label>Produit achet� par le client</label></div>
						<div class="col-md-4 no-space-top"><input type="text" placeholder="Quantit� du produit" class="form-control"  size="2" name="referencebuynb" id="referencebuynb" value="" /></div>
						<div class="col-md-4 no-space-top"><input placeholder="R�f�rence du produit" type="text" class="form-control" size="10" name="referencebuy" id="referencebuy" value="" /> </div>
					</div>
					<div class="col-md-12 no-space-top">
						<div class="col-md-2 no-space-top"></div>
						<div class="col-md-2 no-space-top"><label>Produit remis�</label></div>
						<div class="col-md-4 no-space-top"><input type="text" class="form-control" placeholder="Quantit� du produit" size="2" name="referencepromonb" id="referencepromonb" value="" /></div>
						<div class="col-md-4 no-space-top"><input type="text" placeholder="R�f�rence du produit" class="form-control" size="10" name="referencepromo" id="referencepromo" value="" /></div>
					</div>
					<div class="col-md-12">
						<div class="col-md-2 no-space-top"></div>
						<div class="col-md-4 no-space-top">
							<div class="col-md-3 no-space-top"><label for="remiseeuro">Remise&nbsp;&#8364;</label></div>
							<div class="col-md-9 no-space-top"><input placeholder="Remise � effectuer en euros" class="form-control" type="text" size="10" name="remiseeuro" id="remiseeuro" value=""></div>
						</div>
						<div class="col-md-4 no-space-top">
							<div class="col-md-3 no-space-top"><label for="remisepour">Remise&nbsp;%</label></div>
							<div class="col-md-9 no-space-top"><input placeholder="Remise � effectuer en pourcentage" class="form-control" type="text" size="10" name="remisepour" id="remisepour" value="" maxlength="3"></div>
						</div>
						<div class="col-md-2 no-space-top text-center">
							<input type="hidden" value="2" name="promo" />
							<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-plus"></i>&nbsp;Ajouter</button>
						</div>
					</div>
					
				</form>
			</td>
		</tr>
		<tr>
			<td>
				<form action="<?php echo $this->baseUrl; ?>/backoffice/promotion/productadd" method="post">
					<div class="col-md-12 no-space-top">
						<div class="col-md-2 no-space-top"><label>Remise par date</label></div>
						<div class="col-md-2 no-space-top"><label>Date de d�but</label></div>
						<div class="col-md-3 no-space-top"> 
							<input type="text" class="form-control" readonly="readonly" name="sdPicker" id="sdPicker" value="" maxlength="10" />
							<input type="hidden"  name="sd" id="sdPickerField" value="" maxlength="10" />
						</div>
						<div class="col-md-2 no-space-top"><label>Date de fin</label></div>
						<div class="col-md-3 no-space-top">
							<input type="text" class="form-control" readonly="readonly" name="edPicker" id="edPicker" value="" maxlength="10" />
							<input type="hidden"  name="ed" id="edPickerField" value="" maxlength="10" />
						</div>
					 </div>
					<div class="col-md-12">
						<div class="col-md-2 no-space-top"></div>
						<div class="col-md-4 no-space-top">
							<div class="col-md-3 no-space-top"><label for="remiseeuro">Remise&nbsp;&#8364;</label></div>
							<div class="col-md-9 no-space-top"><input placeholder="Remise � effectuer en euros" class="form-control" type="text" size="10" name="remiseeuro" id="remiseeuro" value=""></div>
						</div>
						<div class="col-md-4 no-space-top">
							<div class="col-md-3 no-space-top"><label for="remisepour">Remise&nbsp;%</label></div>
							<div class="col-md-9 no-space-top"><input placeholder="Remise � effectuer en pourcentage" class="form-control" type="text" size="10" name="remisepour" id="remisepour" value="" maxlength="3"></div>
						</div>
						<div class="col-md-2 no-space-top text-center">
							<input type="hidden" value="3" name="promo" />
							<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-plus"></i>&nbsp;Ajouter</button>
						</div>
					</div>
				</form>
			</td>
		</tr>
		<tr>
			<td>
				<form action="<?php echo $this->baseUrl; ?>/backoffice/promotion/productadd" method="post">
					<div class="col-md-12 no-space-top">
						<div class="col-md-2 no-space-top"><label>Sur une cat�gorie</label></div>
						<div class="col-md-10 no-space-top">
							<select name="listcategory" class="form-control">
								<option value="0">Aucun</option>
								<?php 
								$show = array();
								foreach($this->listallcategories as $row) { 
								 	for ($level=0 ; $level<11; $level++) { 
										if ((!isset($show['NOM'.$level]) || $show['NOM'.$level] != $row['NOM'.$level]) && $row['NOM'.$level] != null) {
										?>
											<option value="<?php echo $this->escape($row['ID'.$level]); ?>">
												<?php 
								 				for ($i=0 ; $i<$level; $i++) { 
													echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
												}
												echo $this->escape($row['NOM'.$level]); ?>
											
											</option>
											<?php 
											$show['NOM'.$level] = $row['NOM'.$level];
										}
									 } 
								} ?>
							</select>
						</div>
					</div>
					<div class="col-md-12">
						<div class="col-md-2 no-space-top"></div>
						<div class="col-md-4 no-space-top">
							<div class="col-md-3 no-space-top"><label for="remiseeuro">Remise&nbsp;&#8364;</label></div>
							<div class="col-md-9 no-space-top"><input placeholder="Remise � effectuer en euros" class="form-control" type="text" size="10" name="remiseeuro" id="remiseeuro" value=""></div>
						</div>
						<div class="col-md-4 no-space-top">
							<div class="col-md-3 no-space-top"><label for="remisepour">Remise&nbsp;%</label></div>
							<div class="col-md-9 no-space-top"><input placeholder="Remise � effectuer en pourcentage" class="form-control" type="text" size="10" name="remisepour" id="remisepour" value="" maxlength="3"></div>
						</div>
						<div class="col-md-2 no-space-top text-center">
						<input type="hidden" value="4" name="promo" />
							<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-plus"></i>&nbsp;Ajouter</button>
						</div>
					</div>
				</form>
			</td>
		</tr>
		<tr>
			<td>
				<form action="<?php echo $this->baseUrl; ?>/backoffice/promotion/productadd" method="post">
					<div class="col-md-12 no-space-top">
						<div class="col-md-2 no-space-top"><label>Sur une marque</label></div>
						<div class="col-md-10 no-space-top">
							<select name="listbrend" class="form-control">
								<option value="0">Aucun</option>
									<?php foreach($this->listbrend as $row) { ?>
									<option value="<?php echo $this->escape($row['ID']); ?>" >
										<?php echo $this->escape($row['BREND']); ?>
									</option>
									<?php } ?>
							</select>
						</div>
					</div>
					<div class="col-md-12">
						<div class="col-md-2 no-space-top"></div>
						<div class="col-md-4 no-space-top">
							<div class="col-md-3 no-space-top"><label for="remiseeuro">Remise&nbsp;&#8364;</label></div>
							<div class="col-md-9 no-space-top"><input placeholder="Remise � effectuer en euros" class="form-control" type="text" size="10" name="remiseeuro" id="remiseeuro" value=""></div>
						</div>
						<div class="col-md-4 no-space-top">
							<div class="col-md-3 no-space-top"><label for="remisepour">Remise&nbsp;%</label></div>
							<div class="col-md-9 no-space-top"><input placeholder="Remise � effectuer en pourcentage" class="form-control" type="text" size="10" name="remisepour" id="remisepour" value="" maxlength="3"></div>
						</div>
						<div class="col-md-2 no-space-top text-center">
						<input type="hidden" value="5" name="promo" />
							<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-plus"></i>&nbsp;Ajouter</button>
						</div>
					</div>
				</form>
			</td>
		</tr>
	</table>
</div>
<div class="table-box">
	<table class="table">
 		<tr><td colspan="4"><h5>Remises effectives</h5></td></tr>
 		<?php 
			if ($this->listPromo1) {
			$listPromo1 = $this->listPromo1;
			foreach($listPromo1 as $row) { ?>
			<tr >
				<td > R�f�rence <a  href="<?php echo $this->baseUrl; ?>/backoffice/product/edit/showProduct/<?php echo $this->escape($row['ID']);?>"><?php echo $this->escape($row['REFERENCE']);?></a>
				</td>
				<td >  Produit <a  href="<?php echo $this->baseUrl; ?>/backoffice/product/edit/showProduct/<?php echo $this->escape($row['ID']);?>"><?php echo $this->escape($row['NOM']);?></a>
				</td>
				<td  > Remise de <b>
					<?php if ($this->escape($row['REMISEEURO']) > 0 ) { echo $this->escape($row['REMISEEURO'])."&nbsp;&#8364;"; } ?>
					<?php if ($this->escape($row['REMISEPOUR']) > 0 ) { echo $this->escape($row['REMISEPOUR'])."&nbsp;%"; } ?></b>
				 </td>
				<td class="text-center">
					<a class="btn btn-danger" href="<?php echo $this->baseUrl; ?>/backoffice/promotion/productdel/idref/<?php echo $row['IDPROMO']; ?>" ><span class="glyphicon glyphicon-trash"></span> Supprimer</a>
				</td>
			</tr>
			<?php } } ?>
			
			<?php 
			if ($this->listPromo2) {
			$listPromo2 = $this->listPromo2;
			foreach($listPromo2 as $row) { ?>
			<tr >
				<td > 
						Si <b><?php echo $this->escape($row['CHILDREFBUYNB']);?></b> articles de la reference : <b><?php echo $this->escape($row['CHILDREFBUY']);?></b> sont achetes
				 </td>
				<td   >
					 <b><?php echo $this->escape($row['CHILDREFPROMONB']);?></b> articles de la reference : <b><?php echo $this->escape($row['CHILDREFPROMO']);?></b> ont une remise
				 </td>
				<td  >
					<div >Remise de <b>
					<?php if ($this->escape($row['REMISEEURO']) > 0 ) { echo $this->escape($row['REMISEEURO'])."&nbsp;&#8364;"; } ?>
					<?php if ($this->escape($row['REMISEPOUR']) > 0 ) { echo $this->escape($row['REMISEPOUR'])."&nbsp;%"; } ?></b>
					</div>
				</td>
				<td class="text-center">
			<a class="btn btn-danger" href="<?php echo $this->baseUrl; ?>/backoffice/promotion/productdel/id/<?php echo $row['IDPROMO']; ?>" ><span class="glyphicon glyphicon-trash"></span> Supprimer</a>
				</td>
			</tr>
			<?php } } ?>
			<?php 
			if ($this->listPromo3) {
				$listPromo3 = $this->listPromo3;
				
				foreach($listPromo3 as $row) { 
				$myDate1 = new Zend_Date(strtotime($row['DATEPROMOSTART']));
				$myDate2 = new Zend_Date(strtotime($row['DATEPROMOEND']));
					?>
				<tr >
					<td > 
							Les produits o� la date de promo est comprise entre 
					 </td>
					 <td>
							<?php 
							$mois = array('','Jan.', 'F�v.', 'Mars', 'Avril', 'Mai', 'Juin', 'Juil.', 'Ao�t', 'Sept.', 'Oct.', 'Nov.', 'D�c.');
							$moisComplet = array('','Janvier', 'F�vrier', 'Mars', 'Avril', 'Mai', 'Juin', 'Juillet', 'Ao�t', 'Septembre', 'Octobre', 'Novembre', 'D�cembre');
							?>
	 						<b><?php echo $myDate1->toString("dd").' '.$mois[(int)$myDate1->toString('MM')].' '.$myDate1->toString("YYYY");?></b> et 
							<b><?php echo $myDate2->toString("dd").' '.$mois[(int)$myDate2->toString('MM')].' '.$myDate2->toString("YYYY");?></b> 
					 </td>
					<td >
						 Remise de <b>
						<?php if ($this->escape($row['REMISEEURO']) > 0 ) { echo $this->escape($row['REMISEEURO'])."&nbsp;&#8364;"; } ?>
						<?php if ($this->escape($row['REMISEPOUR']) > 0 ) { echo $this->escape($row['REMISEPOUR'])."&nbsp;%"; } ?></b>
					</td>
					<td class="text-center">
						<a class="btn btn-danger" href="<?php echo $this->baseUrl; ?>/backoffice/promotion/productdel/id/<?php echo $row['IDPROMO']; ?>" ><span class="glyphicon glyphicon-trash"></span> Supprimer</a>
					</td>
				</tr>
			<?php }   } ?>
			
			<?php 
			if ($this->listPromo4) {
			$listPromo4 = $this->listPromo4;
			foreach($listPromo4 as $row) { ?>
			<tr >
				<td  >
					 Les produits associ�s � la cat�gorie 
				 </td>
				 <td><b><?php echo $this->escape($row['NOMCATEGORY']);?></b></td>
				<td  > Remise de <b>
					<?php if ($this->escape($row['REMISEEURO']) > 0 ) { echo $this->escape($row['REMISEEURO'])."&nbsp;&#8364;"; } ?>
					<?php if ($this->escape($row['REMISEPOUR']) > 0 ) { echo $this->escape($row['REMISEPOUR'])."&nbsp;%"; } ?></b>
				</td>
				<td class="text-center">
					<a class="btn btn-danger" href="<?php echo $this->baseUrl; ?>/backoffice/promotion/productdel/id/<?php echo $row['IDPROMO']; ?>" ><span class="glyphicon glyphicon-trash"></span> Supprimer</a>
				</td>
			</tr>
			<?php }   } ?>
			 
			<?php 
			if ($this->listPromo5) {
			$listPromo5 = $this->listPromo5;
			foreach($listPromo5 as $row) { ?>
			<tr >
				<td > 
					 Les produits associ�s � la marque 
				</td>
				<td><?php echo $this->escape($row['BREND']);?> </td>
				<td  > Remise de <b>
					<?php if ($this->escape($row['REMISEEURO']) > 0 ) { echo $this->escape($row['REMISEEURO'])."&nbsp;&#8364;"; } ?>
					<?php if ($this->escape($row['REMISEPOUR']) > 0 ) { echo $this->escape($row['REMISEPOUR'])."&nbsp;%"; } ?>
					</b>
				</td>
				<td class="text-center">
					<a class="btn btn-danger" href="<?php echo $this->baseUrl; ?>/backoffice/promotion/productdel/id/<?php echo $row['IDPROMO']; ?>" ><span class="glyphicon glyphicon-trash"></span> Supprimer</a>
				</td>
			</tr>
			<?php }   } ?>
 	</table>
 </div>


<script type="text/javascript"> 
$(function(){
	$("#sdPicker").datepicker({ 
		altFormat: 'yy-mm-dd', 
		altField: "#sdPickerField",
		dateFormat: 'DD, d MM, yy'
	});

	$("#edPicker").datepicker({ 
		altFormat: 'yy-mm-dd', 
		altField: "#edPickerField",
		dateFormat: 'DD, d MM, yy'
	});
});


</script>