Current File : /home/karenpetzb/application/modules/backoffice/views/scripts/promotion/codereduction.phtml
<div class="table-box">
 	<table  class="table">
 		<tr><td><h5>Remises par code de r�duction</h5></td></tr>
		<?php echo $this->render("alert_tr.phtml"); ?>
		<tr>
			<td>
				<form action="<?php  echo $this->baseUrl; ?>/backoffice/promotion/addcodereductionproduit" method="post">
					<table class="table">
						<thead>
							<tr >
								<th>R�f�rence</th>
								<th>Quantit�</th>
								<th>Date d�but</th>
								<th>Date fin</th>
								<th class="text-center">&#8364;</th>
								<th class="text-center">%</th>
								<th></th>
							</tr>
						</thead>
						<tbody>
							<tr>
								<td><input  class="form-control" type="text" size="10" name="codereduc_ref" ></td>
								<td><input  class="form-control" type="text" size="3" name="codereduc_nbr" ></td>
								<td >
									<input class="form-control"  type="text" readonly="readonly" name="sd2Picker" id="sd2Picker" value="" maxlength="10" />
									<input type="hidden"  name="sd2" id="sd2PickerField" value="" maxlength="10" />
								</td>
								<td >
									<input  class="form-control" type="text" readonly="readonly" name="ed2Picker" id="ed2Picker"  value="" maxlength="10" />
									<input type="hidden"  name="ed2" id="ed2PickerField" value="" maxlength="10" />
								</td>
								<td><input  class="form-control" type="text" size="5" name="codereduc_euro" value=""></td>
								<td><input  class="form-control" type="text" size="5" name="codereduc_pour" value="" maxlength="3"></td>
								<td>
								<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-plus"></i>&nbsp;Ajouter</button></td>
							</tr>
						</tbody>
					</table>
				</form>
			</td>
		</tr>
		<tr>
			<td>
				<form action="<?php  echo $this->baseUrl; ?>/backoffice/promotion/addcodereductioncommande" method="post">
				<table class="table">
					<thead>
						<tr>
							<th >Minimum d'achat</th>
							<th>Date d�but</th>
							<th>Date fin</th>
							<th class="text-center">&#8364;</th>
							<th class="text-center">%</th>
							<th></th>
						</tr>
					</thead>
					<tr>
						<td ><input class="form-control" type="text" size="10" name="codereduc_cmdmin" ></td>
						<td>
							<input class="form-control" type="text" readonly="readonly" name="sd1Picker" id="sd1Picker" value="" maxlength="10" />
							<input type="hidden"  name="sd1" id="sd1PickerField" value="" maxlength="10" />
						</td>
						<td>
							<input class="form-control" type="text" readonly="readonly" name="ed1Picker" id="ed1Picker" value="" maxlength="10" />
							<input type="hidden"  name="ed1" id="ed1PickerField" value="" maxlength="10" />
						</td>
						<td><input class="form-control" type="text" size="5" name="codereduc_euro" value=""></td>
						<td><input class="form-control" type="text" size="5" name="codereduc_pour" value="" maxlength="3"></td>
						<td>
								<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-plus"></i>&nbsp;Ajouter</button></td>
					</tr>
				</table>
				</form>
			</td>
		</tr>
	</table>
</div>

<div class="table-box">
	<table class="table">
 		<tr><td colspan="6"><h5>Remises effectives</h5></td></tr>
 		<?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');
			
 		foreach($this->listReduc as $row) { ?>
		<tr  <?php
		$isUsed = false; 
		if (isset($row['NOM']) && !empty($row['NOM']) && 
		isset($row['PRENOM']) && !empty($row['PRENOM'])&& 
		isset($row['IDUSER']) && !empty($row['IDUSER']) && $row['IDUSER'] > 0) {
			$isUsed = true;
		}?> >
			<td >
				<?php echo "CODE : ".$row['CODE']."<br/>  ".$this->escape($row['LIBELLE']); 
				if ($isUsed == true) { ?>
				<br/> 
				Utilis� par : <a href="<?php echo $this->baseUrl; ?>/backoffice/user/edit/id/<?php echo $row['IDUSER']; ?>"><?php echo $row['PRENOM']." ".$row['NOM'];?></a>
				<?php } ?>
			</td>
			<td>
				<?php $myDate1 = new Zend_Date(strtotime($row['DATESTART']));?>
 				<?php echo $myDate1->toString("dd").' '.$mois[(int)$myDate1->toString('MM')].' '.$myDate1->toString("YYYY");?>
 			</td>
			<td>
				<?php $myDate2 = new Zend_Date(strtotime($row['DATESTART']));?>
 				<?php echo $myDate2->toString("dd").' '.$mois[(int)$myDate2->toString('MM')].' '.$myDate2->toString("YYYY");?>
 			</td>
			<td  >
				<?php if ($this->escape($row['EURO']) > 0 ) { echo $this->escape($row['EURO'])."<b>&nbsp;&#8364;</b>"; } ?>
			</td>
			<td  >
				<?php if ($this->escape($row['POUR']) > 0 ) { echo $this->escape($row['POUR'])."<b>&nbsp;%</b>"; } ?>
			</td>
			<td  >
				<span >
				<?php if ($row['isACTIF'] == 1) { ?>
					<a class="btn btn-warning" href="<?php echo $this->baseUrl; ?>/backoffice/promotion/unactivecodereduction/id/<?php echo $row['ID']; ?>" >D�sactiver</a>
				<?php } else { ?>
					<a class="btn btn-warning" href="<?php echo $this->baseUrl; ?>/backoffice/promotion/activecodereduction/id/<?php echo $row['ID']; ?>" >Activer</a>
				<?php } ?>
				</span>
				<span >
				<a class="btn btn-danger" href="<?php echo $this->baseUrl; ?>/backoffice/promotion/delcodereduction/id/<?php echo $row['ID']; ?>" ><span class="glyphicon glyphicon-trash"></span> Supprimer</a>
				</span>
			</td> 
		</tr>
		<?php } ?>
 	</table>
</div>




<script type="text/javascript"> 
$(function(){
	$("#sd2Picker").datepicker({ 
		altFormat: 'yy-mm-dd', 
		altField: "#sd2PickerField",
		dateFormat: 'DD, d MM, yy'
	});
	$("#ed2Picker").datepicker({ 
		altFormat: 'yy-mm-dd', 
		altField: "#ed2PickerField",
		dateFormat: 'DD, d MM, yy'
	});
	$("#sd1Picker").datepicker({ 
		altFormat: 'yy-mm-dd', 
		altField: "#sd1PickerField",
		dateFormat: 'DD, d MM, yy'
	});
	$("#ed1Picker").datepicker({ 
		altFormat: 'yy-mm-dd', 
		altField: "#ed1PickerField",
		dateFormat: 'DD, d MM, yy'
	});
});
</script>