Current File : /home/k/a/r/karenpetzb/www/items/category/default.zip
PKi$H[=5_��-views/helpers/mail_ajaxdownloaddocument.phtmlnu&1i�<?php header('Content-Type: text/html; charset=ISO-8859-15'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>
<body>
    Bonjour <?php echo $this->user_fullname; ?>,<br /><br />
Voici la fiche technique du produit trouv� sur le site <?php echo $this->site_url; ?> : <br /><br />
<?php echo $this->document_link; ?><br /><br />
Le nom du produit est : <?php echo $this->product_name; ?><br /><br />
Pour y acc�der : <br /><br />
<?php echo $this->product_url; ?><br /><br />
<?php echo $this->site_name; ?> pr�sente toute une gamme de <?php echo $this->category_name; ?>, � d�couvrir en cliquant sur le lien suivant :<br /><br />
<?php echo $this->category_url; ?><br /><br />
</body>
</html>
PKi$H[�Waע�+views/helpers/mail_user_to_commercial.phtmlnu&1i�<?php
$user = $this->user;
$message = $this->message;
$messageNotConnected = $this->messageNotConnected;
?>
<style type="text/css">
.text1 {
	font-family: "Arial";
	font-size: 11px;
	font-weight: bold;
	color: #000000; 
	text-decoration: none; 
	width: 100%;  
	float: left;
	margin: 5px;
	text-align: center;
}
.text2 {
	font-family: "Arial";
	font-size: 11px;
	font-weight: normal;
	color: #000000; 
	text-decoration: none; 
	width: 100%;  
	float: left;
	margin: 5px;
	text-align: center;
}
</style>
<div class="text1">DEMANDE D'INFORMATIONS</div> 
<div class="text1">Client :</div>
<div class="text2">
	<?php if (isset($user) && !empty($user)) { 
		echo $user['nom']." ".$user['prenom'].'<br/><br/>';
		echo 'Email : '.$user['email'].'<br/><br/>';
		echo 'T�l�phone : '.$user['tel']; 
	} else { 
		echo $messageNotConnected; 
	} ?>
</div>
<div class="text1">Message :</div>
<div class="text2">
	<?php echo $message;  ?>
</div>PKi$H[�&�܋�'views/helpers/mail_ajaxsendfriend.phtmlnu&1i�<?php header('Content-Type: text/html; charset=ISO-8859-15'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
</head>
<body>
    <?php echo $this->text_message; ?>
</body>
</html>
PKi$H[�v��\\%views/scripts/commande/paiement.phtmlnu&1i�
<?php 
if (isset($this->verifMessage) && $this->verifMessage == 1) { ?>
<div class="col-xs-6 col-xs-offset-3 alert alert-success text-center hidden-print"  >
	Votre commande a �t� prise en compte
</div>
<div class="col-xs-12  hidden-print" style="margin-top: 20px; margin-bottom: 20px;">
	<div class="col-xs-6 text-center "><a class="btn btn-primary" href="<?php echo $this->baseUrl; ?>/">Retourner � la page d'accueil</a></div>
	<div class="col-xs-6 text-center "><a class="btn btn-default" onclick="window.print();return false;" href="<?php echo $this->baseUrl; ?>/"><span class="fa fa-print"></span> Imprimer</a></div>
</div>
<?php } else { ?>

<div class="col-xs-6 col-xs-offset-3 alert alert-danger text-center hidden-print"  >
	Votre commande n'a pas �t� prise en compte
</div>
<div class="col-xs-12" style="margin-top: 20px; margin-bottom: 20px;">
	<div class="col-xs-12 text-center"><a class="btn btn-primary hidden-print" href="<?php echo $this->baseUrl; ?>/mon-panier-validation.html">Retourner � la page de validation</a></div>
</div>		
<?php }	?>

<?php echo $this->render("/commande/facture.phtml"); ?>PKi$H[b�X�??)views/scripts/commande/facture_mail.phtmlnu&1i�<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
           "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
	<meta name="Identifier-URL" content="<?php echo $this->baseUrl_SiteCommerceUrl;?>" />
	<meta name="Reply-to" content="<?php echo $this->serviceClient_Mail;?>" />
	
	<style type="text/css">
	
img {
	border: none;
	margin: 0 0 0 0;
	padding: 0 0 0 0;
}

body {
	font-family: "Arial";
	font-size: 12px;
	text-align: left;
	margin: 0;
	padding: 0;
	width: 100%;
	height: 100%;
}

.oldPromoPrice {
	font-size: 10px;
	font-weight: normal;
	color: #5e5e59;
	text-decoration: line-through;
}
.link6 a:link,.link6 a:visited,.link6 a:active {
	font-family: "Verdana";
	font-size: 11px;
	font-weight: bold;
	color: #787878;
	text-decoration: none;
}

.link6 a:hover {
	text-decoration: underline;
}

.textTd1 {
	font-family: "Verdana";
	font-size: 11px;
	font-weight: normal;
	color: #000000;
	text-decoration: none;
}

.bill_body {
	clear: both;
	width: 800px;
	margin: 0 auto 0 auto;
}
 

.bill_company {
	float: left;
}
.bill_company_logo {
	margin: 10px 0 10px 10px;
	padding: 10px 0 10px 10px;
	width: 94px;
	height: 121px;
}
.bill_idents {
	float: right;
	width: 550px;
}
.bill_idents_opt1{
	float:left;
	width:120px;
	height:50px;
	margin:0 0 0 10px;
	padding:0 0 0 10px;
}

.bill_idents_opt21{
	float:left;
	width:120px;
	height:25px;
	background-color: #e7e7e7;
	margin:0 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}
.bill_idents_opt31{
	float:left;
	width:120px;
	height:24px;
	margin:1px 0 0 0;
	padding:1px 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}

.bill_idents_opt22{
	float:left;
	width:250px;
	height:25px;
	background-color: #e7e7e7;
	margin:0 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}
.bill_idents_opt32{
	float:left;
	width:250px;
	height:24px;
	margin:1px 0 0 0;
	padding:1px 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}

.bill_text {
	color: #000000;
	font-weight: bold;
}
.bill_text2 {
	color: #000000;
	font-weight: bold;
	line-height:25px;
}
.bill_text3 {
	color: #000000;
	font-size:11px;
}
.bill_address {
	float: left;
	width: 800px; 
	margin:10px 0 0 0;
}

.bill_address_opt {
	float: left;
	width: 300px; 
	margin: 0 0 0 50px;
}
.bill_address_opt1{
	float:left;
	width:300px;
	height:25px;
	background-color: #e7e7e7;
	margin:0 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}




.bill_address_opt2 {
	float:left;
	width:250px;
	margin: 10px 0 0 20px;
	padding: 10px 0 0 20px;
}

.bill_line {
	line-height:25px;
	text-align:center;
	font-weight:bold;
}
.bill_line2 {
	line-height:20px;
}

.bill_caddy {
	float: left;
	width:800px;
	height:auto;
}

.bill_facture{
	float: left;
	width:800px; 
}

.bill_buy{
	float: left;
	width:500px; 
}
 
.bill_user_paiement_box {
	width:450px;
	margin:5px 0 0 0;
	padding: 0 10px 10px 10px;
	border : 2px #000000 solid;
}

.bill_detail{
	float: right;
	width:250px;
	height:130px;
	border: solid 1px black;
	margin: 10px 0 0 0;
	padding :10px 0 0 0;
}
.bill_footer{
	float: left;
	width:800px;
	margin: 20px 0 0 0;
	padding: 20px 0 0 0;
}
.bill_footer2{
	float: left;
	width:800px;
	text-align:center;
	margin: 0 0 20px 0;
	padding: 0 0 20px 0;
}
.bill_linkd a:link,.bill_linkd a:visited,.bill_linkd a:active {
	font-family: "Arial";
	font-size: 12px;
	font-weight: normal;
	color: #000000;
	text-decoration: none;
}

.bill_linkd a:hover {
	text-decoration: underline;
}
</style>
</head>
<body>

<?php
$facture = $this->facture;
?>
<div style="clear: both;	width: 800px;	margin: 0 auto 0 auto;">
	<div style="float: clear;width: 800px;">
		<div class="bill_company">
			<div class="bill_company_logo"> 
				<a href="<?php echo $this->baseUrl_SiteCommerceUrl; ?>/"><img alt="Directement � la source de la qualit�" src="<?php echo $this->baseUrl_SiteCommerceUrl; ?>/business/image/logo.png" style="border: none;"/></a>
			</div>
		</div>
		<div  style="	float: right;	width: 400px;">
			<div class="bill_idents_opt1">
				<div class="bill_idents_opt21">
					<span class="bill_line"><?php if ($facture['STATUT'] == 1 || $facture['STATUT'] == 2 || $facture['STATUT'] == 3) { echo 'Facture';} else {echo 'Devis';} ?></span>
				</div>
				<div class="bill_idents_opt31">
					<span class="bill_line"><?php echo $facture['REFERENCE']; ?></span>
				</div>
			</div>
			<div class="bill_idents_opt1">
				<div class="bill_idents_opt21">
					<span class="bill_line"><?php echo 'Date'; ?></span>
				</div>
				<div class="bill_idents_opt31">
					<span class="bill_line">
					<?php 
					try {
					$myDate = new Zend_Date(strtotime($facture['DATESTART']));
					
					$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');
				
					echo $myDate->toString("dd").' '.$mois[(int)$myDate->toString('MM')].' '.$myDate->toString("YYYY");
					} catch(Zend_Exception $e) { } 
					?>
					</span>
				</div>
			</div>
			<div class="bill_idents_opt1">
				<div class="bill_idents_opt22">
					<span class="bill_line"><?php echo 'Client'; ?></span>
				</div>
				<div class="bill_idents_opt32">
				<span class="bill_line"><?php echo $facture['USER_EMAIL']; ?></span>
				</div>
			</div> 
		</div>
		<div style="	float: left;	width: 350px;">
			<?php if (!empty($facture['USER_NUMCOMPTE'])) {?>
			<span class="bill_text">Compte : <?php echo $facture['USER_NUMCOMPTE']; ?></span><br>
			<?php } ?>
			<span class="bill_text">Tel : <?php echo $this->tel_contact; ?></span><br>
			<span class="bill_text">Email : <?php  echo $this->serviceClient_Mail;?></span>
		</div>
	</div>
	<div class="bill_address">
		<div class="bill_address_opt">
			<div class="bill_address_opt1">
				<span class="bill_line">Adresse de Facturation</span>
			</div>
			<div class="bill_address_opt2">
				<span class="bill_text2"><?php echo $facture['FACT_RAISONSOCIAL']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['FACT_ADRESSE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['FACT_CP'].' '.$facture['FACT_VILLE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['FACT_PAYS']; ?></span>
			</div>
		</div>
		<div class="bill_address_opt">	
			<div class="bill_address_opt1">
				<span class="bill_line">Adresse de Livraison</span>
			</div>
			<div class="bill_address_opt2">
				<span class="bill_text2"><?php echo $facture['LIV_RAISONSOCIAL']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['LIV_ADRESSE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['LIV_CP'].' '.$facture['LIV_VILLE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['LIV_PAYS']; ?></span>
			</div>
		</div>
	</div>
	<div class="bill_caddy">
		<table style="border:1px solid black;"  border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr align="center" style="background-color: #e7e7e7;">
				<th class="bill_line" >R�f�rence</th>
				<th class="bill_line">D�signation</th>
				<th class="bill_line" style="width: 60px">Dispo.</th>
				<th class="bill_line">Quantit�</th>
				<th class="bill_line"  style="text-align: center">P.U. HT</th>
				<th class="bill_line"  style="display: none;">Prix Remis�</th>
				<th class="bill_line" >Montant HT</th>
			</tr>
			<?php 
			$index = 1;
			$i = 0;
			$caddy = $facture['CADDY'];
			foreach($caddy as $row) {
				?>
			<tr >
				<td colspan="6" height="1px" style="background-color: #868686"></td>
			</tr>
			<tr align="center"  height="25px" >
				<td class="textTd1" width="110px" style="text-align:center;white-space: nowrap;">
					<?php echo $this->escape($row['REFERENCE']);?>
				</td>
				<td  width="450px" class="bill_linkd" style="text-align: left;">
					<a target="_blank"  href="<?php echo $this->baseUrl_SiteCommerceUrl; ?>/<?php echo Utils_Tool::getFormattedUrlProduct($row['NAVNOM_URLPARENTS'], $row['NAVPRODUCTNOM'], $row['PRODUCTID']); ?>"><?php echo $row['DESIGNATION'];?></a>
					<?php if (!empty($row['SELECTEDOPTION'])) { 
						echo '<br/>'.$row['SELECTEDOPTION'].'<br/>';
					} ?>
				</td> 
				<td class="textTd1" > 
					<?php if ((int)$row['STOCK'] == 1) { ?>
					<img alt="Disponible" title="Disponible" src="<?php echo $this->baseUrl_SiteCommerceUrl; ?>/business/image/admin/stock11.png" />
					<?php } else if ((int)$row['STOCK'] == 2) { ?>
					<img alt="Disponible sous 8 jours" title="Disponible sous 8 jours" src="<?php echo $this->baseUrl_SiteCommerceUrl; ?>/business/image/admin/stock22.png" />
					<?php } else if ((int)$row['STOCK'] == 3) { ?>
					<img alt="Nous contacter" title="Nous contacter" src="<?php echo $this->baseUrl_SiteCommerceUrl; ?>/business/image/admin/stock33.png" />
					<?php }?> 	
				</td>
				<td class="textTd1" >
					<?php echo $row['QUANTITY']; ?>	
				</td>
				<td class="textTd1" width="150px">
						<?php $this->currentData = $row;
						echo $this->render("../produits/ajaxshowpromoprice.phtml"); ?>
				</td>
				<td width="120px"  style="display: none;">
				<?php if ($row['isPROMO'] == 1 && $row['REMISEPRIX'] > 0) { ?>
					<span class="textTd1" >
						<?php
							if ((int)$row['REMISEPRIXTAUXP'] > 0) {
									echo number_format($row['REMISEPRIX'], 2, ',', ' ').' &#8364; <br>('.$this->escape($row['REMISEPRIXTAUXP']).' %)';
								} else {
									echo number_format($row['REMISEPRIX'], 2, ',', ' ').' &#8364;';
								}
							?>
					</span>
					<?php } ?>
				</td>
				<td width="120px">
					<span class="textTd1" style="float: right;" >
						<?php if ($row['isDEVIS'] == 1) { 
							echo number_format($row['PRIXTOTAL'], 2, ',', ' ').' &#8364;';
						} ?>
					</span>
				</td>
			</tr>
			<?php $i++; } ?>
	
  <?php
	$caddyfidelite = $facture['CADDYFIDELITE'];
	foreach($caddyfidelite as $row) {
		?>
    <tr>
      <td colspan="6">
        <div style="font-weight: bold;margin:10px;">
          <?php echo 'Carte de fid�lit� : '.$row['NOM'].' ('.$row['NBPOINT'].' points)'; ?>
        </div>
      </td>
    </tr>
  <?php } ?>				
		</table>
	</div>
	<div class="bill_facture"> 
		<div class="bill_buy">   
				<?php switch ($facture['USER_MODEPAIEMENT_TYPE']) {
						case 1 : ?>
						<div class="bill_user_paiement_box">
							<div class="bill_text2" style="text-align:center">Mode de paiement : Par ch�que</div>
							<div style="margin-left:10px">- Veuillez libeller votre ch�que � l�ordre de <?php echo $this->siteName; ?></div>
							<div style="margin-left:10px">- Inscrivez le num�ro de votre commande au dos de votre ch�que</div>
							<div style="margin-left:10px">- Puis envoyez votre r�glement � l�adresse suivante :</div>
							<br/>
							<div class="bill_text" style="text-align:center"><?php echo $this->siteName; ?></div>
							<br/>
							<div class="bill_text" style="text-align:center"><?php echo $this->site_addresse3_title; ?></div>
							<div class="bill_text" style="text-align:center"><?php echo $this->site_addresse3_address; ?></div>
							<div class="bill_text" style="text-align:center"><?php echo $this->site_addresse3_cp; ?></div>
							<br/>
							<div style="font-size:10px;text-align:center">A noter : Les produits sont exp�di�s � r�ception du ch�que</div> 
						</div> 
						<?php  break;
							case 2 : ?>  
						<div class="bill_user_paiement_box">
							<div class="bill_text2" style="text-align:center">Mode de paiement : Par virement</div>
							<div >- La commande sera exp�di�e d�s le virement pr�sent sur notre compte bancaire.</div> 
							<div class="bill_text">- Inscrivez votre num�ro de commande sur le formulaire de virement</div> 
							<div >- Vous disposez d�un <span style="font-weight: bold;">d�lai de 15 jours</span> pour effectuer le virement sur notre compte ci-dessous indiqu�, au d�l� de ce d�lai votre commande sera automatiquement annul�e.</div> 
							<br/>
							<div class="bill_text">RIB : <?php echo $this->site_rib_numbers; ?></div> 
							<div class="bill_text">No IBAN : <?php echo $this->site_rib_iban; ?></div> 
							<div class="bill_text">Code BIC : <?php echo $this->site_rib_bic; ?></div> 
							<div class="bill_text">Nom du compte : <?php echo $this->siteName; ?></div> 
							<div class="bill_text">Nom et domiciliation de la banque : <?php echo $this->site_rib_bankname; ?></div>  
						</div> 
				<?php 	break;
						default : ?>
							<span class="bill_text2">
							<?php if (empty($facture['USER_MODEPAIEMENT_LABEL'])) { ?> Mode de reglement :
							<?php 
								switch ($facture['USER_MODEPAIEMENT']) {
									case 1 : echo " Paiement s�curis� en ligne"; break;
									case 2 : echo " Contre remboursement";break;
									case 3 : echo " Paiement diff�r� - 30 jours";break;
									case 4 : echo " Paiement diff�r� - 45 jours";break;
									case 5 : echo " Paiement diff�r� - 60 jours";break;
									case 6 : echo " A r�ception de la facture";break;
								}
							} else { 
								echo $facture['USER_MODEPAIEMENT_LABEL'];
							} ?>
							</span>	 
						<?php 
						break;  
				} ?>  
		</div> 
		<div class="bill_detail">
			<table border="0" cellpadding="0" cellspacing="0" width="100%">
				<tr align="right">
					<td class="bill_line2">Total HT</td>
					<td  class="bill_line2"><?php echo number_format($facture['PRIXTOTALHTHR'], 2, ',', ' '); ?> &#8364;</td>
				</tr>	
				<tr align="right">
					<td  class="bill_line2" >Remise <?php if (isset($facture['CODEREDUCTION']) && !empty($facture['CODEREDUCTION']) ) { echo " ( ".$facture['CODEREDUCTION']." ) "; } ?></td>
					<td  class="bill_line2" ><?php echo number_format($facture['PRIXREMISEEUR'], 2, ',', ' '); ?> &#8364;</td>
				</tr>	
				<tr align="right"> 
					<td  class="bill_line2">
						<?php if (strcasecmp($facture['LIV_PAYS'], "FRANCE") != 0) { ?>
						Prix d�part 	
						<?php } else {
							if (isset($facture['LIV_NOM']) && !empty($facture['LIV_NOM']) ) { echo 'Livraison en '.$facture['LIV_NOM']; } else { echo 'Frais de port'; } 
						} ?>
					</td>
					
					<td class="bill_line2"><?php echo number_format($facture['PRIXFRAISPORT'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
				<tr >
					<td colspan="2" height="1px" style="background-color: #868686"></td>
				</tr>
				<tr align="right">
					<td class="bill_text2">Net HT</td>
					<td class="bill_text2"><?php echo number_format($facture['PRIXTOTALHTFP'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
				<tr align="right">
					<td  class="bill_line2">Total TVA</td>
					<td  class="bill_line2"><?php echo number_format($facture['PRIXTOTALTVA'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
				<tr >
					<td colspan="2" height="1px" style="background-color: #868686"></td>
				</tr>
				<tr align="right">
					<td class="bill_text2">NET A PAYER TTC</td>
					<td class="bill_text2"><?php echo number_format($facture['PRIXTOTALTTC'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
			</table>
		</div>
	</div>
	
	
	<div class="bill_footer">
			<span class="link18">
				<input type="checkbox" checked="checked" disabled="disabled"/>
				J'ai pris connaissance des Conditions G�n�rales de Vente et les accepte sans r�serves.
			</span>
			<br /><br />
			<span class="bill_text3">
			P�nalit�s de retard (taux annuel) : 9,00% 
			</span><br>
			<span class="bill_text3">
			<b>RESERVE DE PROPRIETE</b> : Nous nous r�servons la propri�t� des marchandises jusqu'au paiement du prix par l'acheteur. Notre droit de revendication porte aussi bien sur les marchandises que sur leur prix si elles ont d�j� �t� revendues (Loi du 12 mai 1980). 
			</span><br><br>
	</div>
	
		<div class="bill_footer2" >
				<span class="bill_text3">
			<?php echo $this->site_addresse; ?>
			</span><br>
			<span class="bill_text3">
			<?php echo $this->site_actualshort; ?>
			</span>
		</div >
</div>


</body>
</html>
PKi$H[�s��=�=$views/scripts/commande/facture.phtmlnu&1i�
<?php
$facture = $this->facture;
?>
<script type="text/javascript"> 
	 $(function(){
		 window.print();
	});
</script>
<style type="text/css">
.textTd1 {
	font-family: "Verdana";
	font-size: 11px;
	font-weight: normal;
	color: #000000;
	text-decoration: none;
}
.oldPromoPrice {
	font-size: 10px;
	font-weight: normal;
	color: #5e5e59;
	text-decoration: line-through;
}
.bill_body {
	clear: both;
	width: 800px;
	margin: 0 auto 0 auto;
}

.bill_header {
	float: clear : both;
	width: 800px;
}

.bill_company {
	float: left;
}
.bill_company_logo {
	margin: 10px 0 10px 10px;
	width: 94px;
	height: 121px;
}
.bill_idents {
	float: right;
	width: 550px;
}
.bill_idents_opt1{
	float:left;
	width:120px;
	height:50px;
	margin:0 0 0 10px;
}

.bill_idents_opt21{
	float:left;
	width:120px;
	height:25px;
	background-color: #e7e7e7;
	margin:0 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}
.bill_idents_opt31{
	float:left;
	width:120px;
	height:24px;
	margin:1px 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}

.bill_idents_opt22{
	float:left;
	width:250px;
	height:25px;
	background-color: #e7e7e7;
	margin:0 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}
.bill_idents_opt32{
	float:left;
	width:250px;
	height:24px;
	margin:1px 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}

.bill_text {
	color: #000000;
	font-weight: bold;
}
.bill_text2 {
	color: #000000;
	font-weight: bold;
	line-height:25px;
}
.bill_text3 {
	color: #000000;
	font-size:11px;
}
.bill_address {
	float: left;
	width: 800px; 
	margin:10px 0 0 0;
}

.bill_address_opt {
	float: left;
	width: 300px; 
	margin: 0 0 0 50px;
	
}
.bill_address_opt1{
	float:left;
	width:300px;
	height:25px;
	background-color: #e7e7e7;
	margin:0 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}
 
.bill_address_opt2 {
	float:left;
	width:250px;
	margin: 10px 0 0 20px;
}

.bill_line {
	line-height:25px;
	text-align:center;
	font-weight:bold;
}
.bill_line2 {
	line-height:20px;
}

.bill_caddy {
	float: left;
	width:800px;
	height:auto;
}

.bill_facture{
	float: left;
	width:800px; 
}

.bill_buy{
	float: left;
	width:500px; 
}
 
.bill_user_paiement_box {
	width:450px;
	margin:5px 0 0 0;
	padding: 0 10px 10px 10px;
	border : 2px #000000 solid;
}

.bill_detail{
	float: right;
	width:250px;
	height:130px;
	border: solid 1px black;
	margin: 10px 0 0 0;
}
.bill_footer{
	float: left;
	width:800px;
	margin: 20px 0 0 0;
}
.bill_footer2{
	float: left;
	width:800px;
	text-align:center;
	margin: 0 0 20px 0;
}

.bill_linkd a:link,.bill_linkd a:visited,.bill_linkd a:active {
	font-family: "Arial";
	font-size: 12px;
	font-weight: normal;
	color: #000000;
	text-decoration: none;
}

.bill_linkd a:hover {
	text-decoration: underline;
}
</style>
<div class="bill_body">
	<div class="bill_header">
		<div class="bill_company">
			<div class="bill_company_logo">
        <a href="<?php echo $this->baseUrl_SiteCommerceUrl; ?>/"><img alt="Directement � la source de la qualit�" src="<?php echo $this->baseUrl_SiteCommerceUrl; ?>/business/image/logo.png" style="border: none;"/></a>
			</div>
		</div>
		<div class="bill_idents">
			<div class="bill_idents_opt1">
				<div class="bill_idents_opt21">
					<span class="bill_line"><?php if ($facture['STATUT'] == 1) { echo 'Commande N';} else {echo 'Devis N';} ?></span>
				</div>
				<div class="bill_idents_opt31">
					<span class="bill_line"><?php echo $facture['REFERENCE']; ?></span>
				</div>
			</div>
			<div class="bill_idents_opt1">
				<div class="bill_idents_opt21">
					<span class="bill_line"><?php echo 'Date'; ?></span>
				</div>
				<div class="bill_idents_opt31">
					<span class="bill_line">
					<?php 
					try {
					$myDate = new Zend_Date(strtotime($facture['DATESTART']));
					$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');
				
					echo $myDate->toString("dd").' '.$mois[(int)$myDate->toString('MM')].' '.$myDate->toString("YYYY");
		
					
					} catch(Zend_Exception $e) {
						
					} ?>
					</span>
				</div>
			</div>
			<div class="bill_idents_opt1">
				<div class="bill_idents_opt22">
					<span class="bill_line"><?php echo 'Client'; ?></span>
				</div>
				<div class="bill_idents_opt32">
				<span class="bill_line"><?php echo $facture['USER_EMAIL']; ?></span>
				</div>
			</div> 
		</div>
		<div style="float: left;width:800px ">
			<?php if (!empty($facture['USER_NUMCOMPTE'])) {?>
				<span class="bill_text">Compte : <?php echo $facture['USER_NUMCOMPTE']; ?></span><br>
			<?php } ?>
			<span class="bill_text">Tel : <?php echo $this->tel_contact; ?></span><br>
			<span class="bill_text">Email : <?php echo $this->serviceClient_Mail; ?></span>
		</div>
	</div>
	<div class="bill_address">
		<div class="bill_address_opt">
			<div class="bill_address_opt1">
				<span class="bill_line">Adresse de Facturation</span>
			</div>
			<div class="bill_address_opt2">
				<span class="bill_text2"><?php echo $facture['FACT_RAISONSOCIAL']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['FACT_ADRESSE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['FACT_CP'].' '.$facture['FACT_VILLE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['FACT_PAYS']; ?></span>
			</div>
		</div>
		<div class="bill_address_opt">	
			<div class="bill_address_opt1">
				<span class="bill_line">Adresse de Livraison</span>
			</div>
			<div class="bill_address_opt2">
				<span class="bill_text2"><?php echo $facture['LIV_RAISONSOCIAL']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['LIV_ADRESSE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['LIV_CP'].'  '.$facture['LIV_VILLE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['LIV_PAYS']; ?></span>
			</div>
		</div>
	</div>
	<div class="bill_caddy">
		<table style="border:1px solid black;"  border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr align="center" style="background-color: #e7e7e7;">
				<th class="bill_line" >R�f�rence</th>
				<th class="bill_line">D�signation</th>
				<th class="bill_line" style="width: 60px">Dispo.</th>
				<th class="bill_line">Quantit�</th>
				<th class="bill_line" style="text-align:center">P.U. HT</th> 
				<th class="bill_line" >Montant HT</th>
			</tr>
			<?php 
			$index = 1;
			$i = 0;
			$caddy = $facture['CADDY'];
			foreach($caddy as $row) {
				?>
			<tr >
				<td colspan="6" height="1px" style="background-color: #868686"></td>
			</tr>
			<tr align="center"  height="25px" >
				<td class="textTd1" width="110px" style="text-align:center;white-space: nowrap;">
					<?php echo $this->escape($row->item_reference);?>
				</td>
				<td  width="450px" class="bill_linkd" style="text-align: left;">
					<?php echo $row->item_designation;?>
					<?php if (!empty($row->item_selectedOption)) { 
						echo '<br/>'.$row->item_selectedOption.'<br/>';
					} ?> 
				</td>
				<td class="textTd1" > 
					<?php if ((int)$row->item_stock == 1) { ?>
					<img alt="Disponible" title="Disponible" src="<?php echo $this->baseUrl_SiteCommerceUrl; ?>/business/image/admin/stock11.png" />
					<?php } else if ((int)$row->item_stock == 2) { ?>
					<img alt="Disponible sous 8 jours" title="Disponible sous 8 jours" src="<?php echo $this->baseUrl_SiteCommerceUrl; ?>/business/image/admin/stock22.png" />
					<?php } else if ((int)$row->item_stock == 3) { ?>
					<img alt="Nous contacter" title="Nous contacter" src="<?php echo $this->baseUrl_SiteCommerceUrl; ?>/business/image/admin/stock33.png" />
					<?php }?> 	
				</td>
				<td class="textTd1" >
					<?php echo $row->item_qte; ?>	
				</td>
				<td class="textTd1" width="150px">
						<?php $this->currentData = $row;
						echo $this->render("/produits/ajaxshowpromopricecaddy.phtml"); ?>
				</td> 
				<td width="120px">
					<span class="textTd1" style="float: right;" >
					<?php 
						if (!$row->isSurDevis()) {
							echo number_format($row->getPrixTotalHT(true), 2, ',', ' ').' &#8364;';
						}
					?>
					</span>
				</td>
			</tr>
			<?php $i++; } ?>	
			
  <?php
	$caddyfidelite = $facture['CADDYFIDELITE'];
	foreach($caddyfidelite as $row) {
		?>
    <tr>
      <td colspan="6">
        <div style="font-weight: bold;margin:10px;">
          <?php echo 'Carte de fid�lit� : '.$row->fidelite_nom.' ('.$row->fidelite_nbpoint.' points)'; ?>
        </div>
      </td>
    </tr>
  <?php } ?>
		</table>
	</div>
	<div class="bill_facture">
		<?php if ($facture['STATUT'] == 1) { ?> 
		<div class="bill_buy">   
				<?php switch ($facture['USER_MODEPAIEMENT_TYPE']) {
						case 1 : ?>
						<div class="bill_user_paiement_box">
							<div class="bill_text2" style="text-align:center">Mode de paiement : Par ch�que</div>
							<div style="margin-left:10px">- Veuillez libeller votre ch�que � l�ordre de <?php echo $this->siteName; ?></div>
							<div style="margin-left:10px">- Inscrivez le num�ro de votre commande au dos de votre ch�que</div>
							<div style="margin-left:10px">- Puis envoyez votre r�glement � l�adresse suivante :</div>
							<br/>
							<div class="bill_text" style="text-align:center"><?php echo $this->siteName; ?></div>
							<br/>
						<div class="bill_text" style="text-align:center"><?php echo $this->site_addresse3_title; ?></div>
							<div class="bill_text" style="text-align:center"><?php echo $this->site_addresse3_address; ?></div>
							<div class="bill_text" style="text-align:center"><?php echo $this->site_addresse3_cp; ?></div>
							<br/>
							<div style="font-size:10px;text-align:center">A noter : Les produits sont exp�di�s � r�ception du ch�que</div> 
						</div> 
						<?php  break;
							case 2 : ?>  
						<div class="bill_user_paiement_box">
							<div class="bill_text2" style="text-align:center">Mode de paiement : Par virement</div>
							<div >- La commande sera exp�di�e d�s le virement pr�sent sur notre compte bancaire.</div> 
							<div class="bill_text">- Inscrivez votre num�ro de commande sur le formulaire de virement</div> 
							<div >- Vous disposez d�un <span style="font-weight: bold;">d�lai de 15 jours</span> pour effectuer le virement sur notre compte ci-dessous indiqu�, au d�l� de ce d�lai votre commande sera automatiquement annul�e.</div> 
							<br/>
							<div class="bill_text">RIB : <?php echo $this->site_rib_numbers; ?></div> 
							<div class="bill_text">No IBAN : <?php echo $this->site_rib_iban; ?></div> 
							<div class="bill_text">Code BIC : <?php echo $this->site_rib_bic; ?></div> 
							<div class="bill_text">Nom du compte : <?php echo $this->siteName; ?></div> 
							<div class="bill_text">Nom et domiciliation de la banque : <?php echo $this->site_rib_bankname; ?></div>  
						</div> 
				<?php 	break;
						default : ?> 
							<span class="bill_text2">
							<?php if (empty($facture['USER_MODEPAIEMENT_LABEL'])) { ?> Mode de reglement :
							<?php 
								switch ($facture['USER_MODEPAIEMENT']) {
									case 1 : echo " Paiement s�curis� en ligne"; break;
									case 2 : echo " Contre remboursement";break;
									case 3 : echo " Paiement diff�r� - 30 jours";break;
									case 4 : echo " Paiement diff�r� - 45 jours";break;
									case 5 : echo " Paiement diff�r� - 60 jours";break;
									case 6 : echo " A r�ception de la facture";break;
								}
							} else { 
								echo $facture['USER_MODEPAIEMENT_LABEL'];
							} ?>
							</span>	 
						<?php 
						break;  
				} ?>  
		</div>
		<?php } ?>
		<div class="bill_detail">
			<table border="0" cellpadding="0" cellspacing="0" width="100%">
				<tr align="right">
					<td class="bill_line2">Total HT</td>
					<td  class="bill_line2"><?php echo number_format($facture['PRIXTOTALHTHR'], 2, ',', ' '); ?> &#8364;</td>
				</tr>	
				<tr align="right">
					<td  class="bill_line2" >Remise <?php if (isset($facture['CODEREDUCTION']) && !empty($facture['CODEREDUCTION']) ) { echo " ( ".$facture['CODEREDUCTION']['CODE']." ) "; } ?></td>
					<td  class="bill_line2" ><?php echo number_format($facture['PRIXREMISEEUR'], 2, ',', ' '); ?> &#8364;</td>
				</tr>	
				<tr align="right"> 
					<td  class="bill_line2">
						<?php if (strcasecmp($facture['LIV_PAYS'], "FRANCE") != 0) { ?>
						Prix d�part 	
						<?php } else {
							if (isset($facture['INFOLIV']) && !empty($facture['INFOLIV']) ) { echo 'Livraison en '.$facture['INFOLIV']['NOMLIV']; } else { echo 'Frais de port'; } 
						} ?>
					</td> 
					<td class="bill_line2"><?php echo number_format($facture['PRIXFRAISPORT'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
				<tr >
					<td colspan="2" height="1px" style="background-color: #868686"></td>
				</tr>
				<tr align="right">
					<td class="bill_text2">Net HT</td>
					<td class="bill_text2"><?php echo number_format($facture['PRIXTOTALHTFP'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
				<tr align="right">
					<td  class="bill_line2">Total TVA</td>
					<td  class="bill_line2"><?php echo number_format($facture['PRIXTOTALTVA'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
				<tr >
					<td colspan="2" height="1px" style="background-color: #868686"></td>
				</tr>
				<tr align="right">
					<td class="bill_text2">NET A PAYER TTC</td>
					<td class="bill_text2"><?php echo number_format($facture['PRIXTOTALTTC'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
			</table>
		</div>
	</div>
	
	
	<div class="bill_footer">
			<span class="link18">
				<input type="checkbox" checked="checked" disabled="disabled"/>
				J'ai pris connaissance des Conditions G�n�rales de Vente et les accepte sans r�serves.
			</span>
			<br /><br />
			<span class="bill_text3">
			P�nalit�s de retard (taux annuel) : 9,00% 
			</span><br>
			<span class="bill_text3">
			<b>RESERVE DE PROPRIETE</b> : Nous nous r�servons la propri�t� des marchandises jusqu'au paiement du prix par l'acheteur. Notre droit de revendication porte aussi bien sur les marchandises que sur leur prix si elles ont d�j� �t� revendues (Loi du 12 mai 1980). 
			</span><br><br>
	</div>
	
		<div class="bill_footer2" >
				<span class="bill_text3">
			<?php echo $this->site_addresse; ?>
			</span><br>
			<span class="bill_text3">
			<?php echo $this->site_actualshort; ?>
			</span>
		</div >
</div>
 
<script type="text/javascript">
  
  ga('create', '<?php echo $this->google_analytics; ?>', 'auto', {'name': 'cmdTracker'});
  
  ga('cmdTracker.require', 'ecommerce');
 
  ga('cmdTracker.ecommerce:addTransaction', {
    'id': '<?php echo $facture['ID_COMMAND'];?>', 
	  'affiliation': '<?php echo $this->siteName; ?>',  
	  'revenue': '<?php echo str_replace(" ", "", number_format($facture['PRIXTOTALTTC'], 2, '.', ' ')); ?>', 
	  'shipping': '<?php echo number_format($facture['PRIXFRAISPORT'], 2, '.', ' '); ?>',  
	  'tax': '0',
    'currency': 'EUR'
	});

  <?php $caddy = $facture['CADDY'];
  foreach($caddy as $row) { 
		$unitPrice = "";
		if (!$row->isSurDevis()) {
		 	if ($row->isPromo()) { 
				$unitPrice = number_format($row->getPrixAfterRemise(), 2, '.', ' ');
			} else {
				$unitPrice = number_format($row->item_prix, 2, '.', ' ').' ';
			} 
		}
	?>
	
	ga('cmdTracker.ecommerce:addItem', {
  'id': '<?php echo $facture['ID_COMMAND'];?>',    
  'name': '<?php echo strip_tags($row->item_designation);?>',   
  'sku': '<?php echo $this->escape($row->item_reference);?>',  
  'category': '',  
  'price': '<?php echo str_replace(" ", "", $unitPrice);?>',  
  'quantity': '<?php echo $row->item_qte;?>'  
});

  <?php } ?>

  ga('cmdTracker.ecommerce:send');
</script>
PKi$H[4views/scripts/commande/paypalipnvalidationtest.phtmlnu&1i�PKi$H[��iAA&views/scripts/commande/connexion.phtmlnu&1i�
<script type="text/javascript">
$(function(){
$('#addUserForm').submit(function(e) {  
    e.preventDefault();
		 $.ajax( {
			type : "POST",
			async : true,
			url : '/commande/ajaxenregistrement', 
			data : stringify($(this).serializeArray()),
      contentType:"application/x-www-form-urlencoded; charset=iso-8859-1",
			success : function(data) { 
				 if (data == "SUCCESS") {
					 window.location="/mon-panier-livraison.html";
				} else {
					$('#alertMessage').html(data);
					$('#alertMessage').show();
				} 
			}});
		});

	$('#connexionForm').submit(function() { 
		 $.ajax( {
			type : "POST",
			async : true,
			url : '/commande/ajaxconnexion', 
			data : $(this).serialize(),
			success : function(data) { 
				 if (data == "SUCCESS") {
					 window.location="/mon-panier-livraison.html";
				} else {
					$('#alertMessage').html(data);
					$('#alertMessage').show();
				}
			}});
		  return false;
		});	
	
});

</script>


<div class="col-xs-12 caddy-header-box" style="padding-left: 0;">
	<div class="col-xs-10 col-xs-offset-1 caddy_flux" style="padding-left: 0;">
		<div class="caddy_flux_panier"></div>
		<div class="caddy_flux_separator"></div>
		<div class="caddy_flux_id_over"></div>
		<div class="caddy_flux_separator"></div>
		<div class="caddy_flux_livraison"></div>
		<div class="caddy_flux_separator"></div>
		<div class="caddy_flux_validation"></div>
	</div>
</div>
<div id="alertMessage" style="display: none;" class="col-xs-6 col-xs-offset-3 alert alert-danger text-center"  ></div>

<?php 
$this->showSlide = 1;
echo $this->render("/user/connexion.phtml"); ?>PKi$H[)�^bb"views/scripts/commande/devis.phtmlnu&1i�<div class="col-xs-6 col-xs-offset-3 alert alert-success text-center hidden-print"  >
	Votre devis a �t� prise en compte
</div>
<div class="col-xs-12" style="margin-top: 20px; margin-bottom: 20px;">
	<div class="col-xs-6 text-center "><a class="btn btn-primary hidden-print" href="<?php echo $this->baseUrl; ?>/">Retourner � la page d'accueil</a></div>
	<div class="col-xs-6 text-center "><a class="btn btn-default" onclick="window.print();return false;" href="<?php echo $this->baseUrl; ?>/"><span class="fa fa-print"></span> Imprimer</a></div>
</div>

<?php echo $this->render("/commande/facture.phtml"); ?>
PKi$H[0views/scripts/commande/paypalipnvalidation.phtmlnu&1i�PKi$H[��&views/scripts/commande/livraison.phtmlnu&1i�
<script type="text/javascript">
$(function(){ 
	$('#commandeLivForm').submit(function() { 
		 $.ajax( {
			type : "POST",
			async : true,
			url : '/commande/ajaxlivraison', 
			data : $(this).serialize(),
			success : function(data) { 
				 $('#cmdLivResult').html(data);
			}});
		  return false;
		});

	 $('#validLiv').bind({
	    click: function(e){ 
	 		window.location="/mon-panier-validation.html";
	    }
	});

	 var params = new Array();
	params['route'] = $('#livuser_adresse');
	params['locality'] = $('#livuser_ville');
	params['administrative_area_level_2'] = null;
	params['administrative_area_level_1'] = null;
	params['country'] = $('#livuser_pays');
	params['postal_code'] = $('#livuser_cp');
	
	initEventAddress($('#livuser_adressecomplete'), params);
	
});
</script>

<div class="col-xs-12 caddy-header-box" style="padding-left: 0;">
	<div class="col-xs-10 col-xs-offset-1 caddy_flux" style="padding-left: 0;">
		<div class="caddy_flux_panier"></div>
		<div class="caddy_flux_separator"></div>
		<div class="caddy_flux_id"></div>
		<div class="caddy_flux_separator"></div>
		<div class="caddy_flux_livraison_over"></div>
		<div class="caddy_flux_separator"></div>
		<div class="caddy_flux_validation"></div>
	</div>
</div>
<div class="cmdLiv">
	<div class="cmdLiv_BG1">
		<div class="textA5 titleA1">R�CAPITULATIF DE VOTRE LIVRAISON</div>
	</div>
	<div class="cmdLiv_BG2">
		<div class="col-xs-12 noPadding" style="margin-top: 10px;margin-bottom: 10px;">
		
			<div class="col-xs-6 noPadding caddy-liv-info">
				<form id="commandeLivForm" action="<?php echo $this->baseUrl; ?>/commande/ajaxlivraison/" method="post">	
			
				<div class="textA6" style="float: left;width: 100%;">
					Modifier votre adresse de Livraison
				</div>
			
				<div class="cmdField" style="margin: 10px 0 0 0">
					<div class="textA2 cmdFieldLabel">
						<?php if($this->adresseLiv['type'] == "Professionnel") { 
							echo "* Raison sociale :";
						} else {
							echo "* Pr�nom et Nom :";
						}?>
					</div>
					<div style="float: left;">
						<input type="text" class="form-control" name="livuser_raisonsocial" id="livuser_raisonsocial"  value="<?php echo $this->adresseLiv['raisonsocial']; ?>" />
					</div>
				</div>
				<input type="hidden" id="address_type" name="address_type" value="old">
					
				<div id="adresseNew"  style="display: none;">
					<div class="cmdField" style="margin: 10px 0 0 0">
						<div class="messageError" id="addressError" style="clear: both;display: none;margin: 0 0 0 70px"></div>
						
						<div class="textA2 cmdFieldLabel">* Adresse :</div>
						<div style="float: left;">
							<input type="text" class="form-control" name="livuser_adressecomplete" id="livuser_adressecomplete"  value="<?php echo $this->adresseLiv['adressecomplete']; ?>" />
						</div>
					</div>
					<div class="cmdField" style="margin: 10px 0 0 0">
						<div class="textA2 cmdFieldLabel">Rue :</div>
						<div style="float: left;">
							<input  style="border: none;" readonly="readonly"  type="text" class="form-control" name="livuser_adresse" id="livuser_adresse"  value="<?php echo $this->adresseLiv['adresse']; ?>" />
						</div>
					</div>
					<div class="cmdField" style="margin: 10px 0 0 0">
						<div class="textA2 cmdFieldLabel">Code postal :</div>
						<div style="float: left;">
							<input  style="border: none;" readonly="readonly"  type="text" class="form-control" name="livuser_cp" id="livuser_cp"  value="<?php echo $this->adresseLiv['cp']; ?>" />
						</div>
					</div>
					<div class="cmdField" style="margin: 10px 0 0 0">
						<div class="textA2 cmdFieldLabel">Ville :</div>
						<div style="float: left;">
							<input  style="border: none;" readonly="readonly"  type="text" class="form-control" name="livuser_ville" id="livuser_ville"  value="<?php echo $this->adresseLiv['ville']; ?>" />
						</div>
					</div>
					<div class="cmdField" style="margin: 10px 0 0 0">
						<div class="textA2 cmdFieldLabel">Pays :</div>
						<div style="float: left;">
							<input  style="border: none;" readonly="readonly"  type="text" class="form-control" name="livuser_pays" id="livuser_pays"  value="<?php echo $this->adresseLiv['pays']; ?>" />
						</div>
					</div>
					
					<div class="cmdField" style="margin: 10px 0 0 0"> 
						<div style="float: left;">
							<span class="link7"><a href="javascript:;" onclick="swichAdresse($('#adresseNew'),$('#adresseOld'),$('#address_type'), 'old')">Je ne trouve pas mon adresse !</a></span>
						</div>
					</div>
							
				</div>
				
				<div id="adresseOld" >
					<div class="cmdField" style="margin: 10px 0 0 0">
						<div class="textA2 cmdFieldLabel">* Adresse :</div>
						<div style="float: left;">
							<input type="text" class="form-control" name="livuser_adresse_old"  value="<?php echo $this->adresseLiv['adresse']; ?>" />
						</div>
					</div>
					<div class="cmdField" style="margin: 10px 0 0 0">
						<div class="textA2 cmdFieldLabel">* Code postal :</div>
						<div style="float: left;">
							<input type="text" class="form-control" name="livuser_cp_old"  value="<?php echo $this->adresseLiv['cp']; ?>" />
						</div>
					</div>
					<div class="cmdField" style="margin: 10px 0 0 0">
						<div class="textA2 cmdFieldLabel">* Ville :</div>
						<div style="float: left;">
							<input type="text" class="form-control" name="livuser_ville_old"  value="<?php echo $this->adresseLiv['ville']; ?>" />
						</div>
					</div>
					<div class="cmdField" style="margin: 10px 0 0 0">
						<div class="textA2 cmdFieldLabel">* Pays :</div>
						<div style="float: left;">
							<select name="livuser_pays_old" class="form-control">
								<?php 
								foreach ($this->listPays as $pays) { ?>
								<option value="<?php echo $pays['PAYS']; ?>" <?php if (strcasecmp($pays['PAYS'], "FRANCE") == 0) { echo 'selected'; } ?>><?php echo $pays['PAYS']; ?></option>
								<?php }?>
							</select>
						</div>
					</div>
					<div class="cmdField" style="margin: 10px 0 0 0;display: none;"> 
						<div style="float: left;">
							<span class="link7"><a href="javascript:;" onclick="swichAdresse($('#adresseOld'),$('#adresseNew'),$('#address_type'), 'new')">Trouver mon adresse</a></span>
						</div>
					</div>
				</div>
				</form>
			</div>
			<div class="col-xs-6 noPadding">
				<div class="textA6" style="float: left;width: 100%;">
					Adresse de Livraison 
				</div>
				<div class="col-md-8 col-md-offset-2" id="cmdLivResult">
					<?php echo $this->render("/ajax/ajaxlivraison.phtml"); ?>
				</div>
			</div>
		</div>
	
	</div>
	<div class="cmdLiv_BG3"> 
		<div class="cmdFieldSubmit">
			<input type="button" class="btn btn-primary" onclick="$('#commandeLivForm').submit();" id="editLiv" value="MODIFIER" />
		</div>
		<div class="cmdFieldSubmit2" >
			<input type="button" id="validLiv" class="btn btn-success btn-lg" value="CONTINUER"/>
		</div>
	</div>
</div>
PKi$H[��q�y"y"'views/scripts/commande/validation.phtmlnu&1i�

<div class="col-xs-12 caddy-header-box" style="padding-left: 0;">
	<div class="col-xs-10 col-xs-offset-1 caddy_flux" style="padding-left: 0;">
		<div class="caddy_flux_panier"></div>
		<div class="caddy_flux_separator"></div>
		<div class="caddy_flux_id"></div>
		<div class="caddy_flux_separator"></div>
		<div class="caddy_flux_livraison"></div>
		<div class="caddy_flux_separator"></div>
		<div class="caddy_flux_validation_over"></div>
	</div>
</div>
<?php 
$facture = $this->facture;
?>
<div style="float: left; margin: 0 0 0 150px">
	<span class="text3" >Avant de terminer votre commande, veuillez v�rifier l'exactitude de vos donn�es. </span>
</div>

 <?php echo $this->render("/commande/factureedit.phtml"); ?>

<div class="col-xs-6 col-xs-offset-6 text-right" >
  <div class="checkbox" style="width: 360px;">
	   <label class="link18">
          <input type="checkbox" name="isCGV" id="isCGV" > J'ai pris connaissance des <a href="<?php echo $this->baseUrl; ?>/info-3/conditions-generales-vente.html" target="_blank">Conditions G�n�rales de Vente</a>
	
        </label>
	</div>
  </div>
<div class="col-xs-12 noPadding" style="margin: 20px 0 70px 0;">

	<div  class="col-sm-3 col-xs-12 text-center noPadding" > 
		<a class="btn btn-primary btn-lg caddy-link" href="<?php echo $this->baseUrl; ?>/commande/devis" onclick="return checkCheckBoxes('isCGV');" >
			FAIRE UN DEVIS
		</a> 
	</div> 
	<?php if ($facture['PRIXTOTALTTC'] > 0 && $this->isCommandValid == true) { ?>
		<div class="col-sm-2 col-xs-12 text-center noPadding">
			<a onclick="return checkCheckBoxes('isCGV');"  href="<?php echo $this->baseUrl; ?>/commande/paiement/type/1" class="btn btn-primary caddy-link"   >
				PAYER PAR CHEQUE
			</a>
		</div>
		<div class="col-sm-2 col-xs-12 text-center noPadding">
			<a onclick="return checkCheckBoxes('isCGV');" href="<?php echo $this->baseUrl; ?>/commande/paiement/type/2" class="btn btn-primary caddy-link" >
				FAIRE UN VIREMENT
			</a>
		</div>
		
		<div class="col-sm-2 col-xs-12 text-center noPadding">
			<?php 
				$modepaiement = $facture['USER_MODEPAIEMENT'];
				$isCompte = false;  
				$modepaiement_imgTexte = '';
				if ($this->user['isrecepfacture'] == "Y" || $this->user['iscredit'] == 1) {
					switch ($modepaiement) {
						case 2 : 
							$modepaiement_texte = "Payer � r�ception de la facture";
							$modepaiement_img = "/business/image/inbox.png";
							$modepaiement_imgTexte = "Payer � r�ception de la facture";
							$isCompte = true;
							break;
						case 3 : 
							$modepaiement_texte = "Paiement diff�r� - 30 jours";
							$modepaiement_img = "/business/image/delai_payment.png";
							$modepaiement_imgTexte = "Payer par paiement diff�r� de 30 jours";
							$isCompte = true;
							break;
						case 4 : 
							$modepaiement_texte = "Paiement diff�r� - 45 jours";
							$modepaiement_img = "/business/image/delai_payment.png";
							$modepaiement_imgTexte = "Payer par paiement diff�r� de 45 jours";
							$isCompte = true;
							break;
						case 5 : 
							$modepaiement_texte = "Paiement diff�r� - 60 jours";
							$modepaiement_img = "/business/image/delai_payment.png";
							$modepaiement_imgTexte = "Payer par paiement diff�r� de 60 jours";
							$isCompte = true;
							break;
						case 6 : 
							$modepaiement_texte = "A r�ception de la facture";
							$modepaiement_img = "/business/image/delai_payment.png";
							$modepaiement_imgTexte = "Payer a r�ception de la facture";
							$isCompte = true;
							break;
						default :
							$isCompte = false;
							break;
					} 
				}   
				if ($isCompte) { 
			?>
			<a onclick="return checkCheckBoxes('isCGV');" title="<?php echo $modepaiement_imgTexte; ?>"  href="<?php echo $this->baseUrl; ?>/commande/paiement/type/3" data-placement="bottom" class="tooltips btn btn-danger btn-lg caddy-link" >
					EN COMPTE
				</a>
				<?php } ?>
		</div>
		<div class="col-sm-3 col-xs-12 text-center noPadding" >
				<?php $myDate = new Zend_Date(strtotime($facture['DATESTART'])); ?>
				
					<form action="https://securepayments.paypal.com/acquiringweb?cmd=_hosted-payment" method="post">
						<input type="hidden" name="cmd" value="_hosted-payment">
						<input type="hidden" name="business" value="<?php echo $this->paypal_business; ?>">
						<input type="hidden" name="item_name" value="<?php echo 'Total de la commande du '.$myDate->toString('dd/MM/YYYY').' (TTC)'; ?>" /> 
						<input type="hidden" name="item_number" value="<?php echo $facture['ID_COMMAND']; ?>" />
						<input type="hidden" name="custom" value="<?php echo $facture['ID_COMMAND']; ?>" />
						<input type="hidden" name="no_shipping" value="1">
						<input type="hidden" name="no_note" value="1">
						<input type="hidden" name="return" value="<?php echo $this->baseUrl_SiteCommerceUrl; ?>/commande/paiement">
						<input type="hidden" name="cancel_return" value="<?php echo $this->baseUrl_SiteCommerceUrl; ?>/commande/paiement">
						<input type="hidden" name="page_style" value="PayPalPerso">
						<input type="hidden" name="currency_code" value="EUR">
						
						<input type="hidden" name="subtotal" value="<?php echo $facture['PRIXTOTALTTC']; ?>"> 
						<input class="btn btn-success btn-lg caddy-link btn-paypal-only" data-placement="top" type="submit" name="PayPal2" value="PAYER VIA PAYPAL"  onclick="return checkCheckBoxes('isCGV');" >
						
						<input type="hidden" name="first_name" value="<?php echo utf8_encode($facture['LIV_RAISONSOCIAL']); ?>">
						<input type="hidden" name="address1" value="<?php echo utf8_encode($facture['FACT_ADRESSE']); ?>">
						<input type="hidden" name="city" value="<?php echo utf8_encode($facture['FACT_VILLE']); ?>">
						<input type="hidden" name="zip" value="<?php echo utf8_encode($facture['LIV_CP']); ?>">
						<input type="hidden" name="country" value="<?php echo utf8_encode($facture['LIV_PAYS']); ?>">
						<input type="hidden" name="billing_first_name" value="<?php echo utf8_encode($facture['USER_PRENOM']); ?>">
						<input type="hidden" name="billing_last_name" value="<?php echo utf8_encode($facture['USER_NOM']); ?>">
						<input type="hidden" name="billing_address1" value="<?php echo utf8_encode($facture['FACT_ADRESSE']); ?>">
						<input type="hidden" name="billing_city" value="<?php echo utf8_encode($facture['FACT_VILLE']); ?>">
						<input type="hidden" name="billing_zip" value="<?php echo utf8_encode($facture['FACT_CP']); ?>">
						<input type="hidden" name="billing_country" value="<?php echo utf8_encode($facture['FACT_PAYS']); ?>">
					
						<!-- PERSONNALISATION -->
						<input type="hidden" name="template" value="TemplateA">
						<input type="hidden" name="bodyBgColor" value="#A2A1A1">
						<input type="hidden" name="footerTextColor" value="#000000">
						<input type="hidden" name="headerBgColor" value="#ffffff">
						<input type="hidden" name="headerHeight" value="150">
						<input type="hidden" name="logoImage" value="<?php echo $this->baseUrl_SiteCommerceUrl; ?>/business/image/logo.png">
						<input type="hidden" name="orderSummaryBgColor" value="#D6D6D6">
						<input type="hidden" name="pageButtonBgColor" value="#68B777">
						<input type="hidden" name="pageButtonTextColor" value="#000000">
						
						<input type="hidden" name="pageTitleTextColor" value="#DE021B">
						<input type="hidden" name="sectionBorder" value="#DE021B">
						<input type="hidden" name="showCustomerName" value="true">
						<input type="hidden" name="showBillingAddress" value="true">
						<input type="hidden" name="showShippingAddress" value="true">
						
					</form>
			</div>
			<?php } ?>
	</div>	

	<input type="hidden" id="PRIXTOTALHT" value="<?php echo $facture['PRIXTOTALHT']; ?>">
	<input type="hidden" id="PRIXTOTALTTC" value="<?php echo $facture['PRIXTOTALTTC']; ?>">
	<input type="hidden" id="PRIXFRAISPORT" value="<?php echo $facture['PRIXFRAISPORT']; ?>">
	<input type="hidden" id="PRIXTAX" value="<?php echo $facture['PRIXTOTALTTC'] - $facture['PRIXTOTALHT'] ; ?>">
	<input type="hidden" id="REFERENCE" value="<?php echo $facture['REFERENCE']; ?>">
	<input type="hidden" id="IDUSER" value="<?php echo $facture['IDUSER']; ?>">
	<input type="hidden" id="USER_EMAIL" value="<?php echo $facture['USER_EMAIL']; ?>">
	<input type="hidden" id="USER_NOM" value="<?php echo utf8_encode($facture['USER_NOM']); ?>">
	<input type="hidden" id="USER_PRENOM" value="<?php echo utf8_encode($facture['USER_PRENOM']); ?>">
	<input type="hidden" id="LIV_VILLE" value="<?php echo utf8_encode($facture['LIV_VILLE']); ?>">
	<input type="hidden" id="LIV_PAYS" value="<?php echo utf8_encode($facture['LIV_PAYS']); ?>">
	<input type="hidden" id="USER_TYPE" value="<?php echo $facture['USER_TYPE']; ?>">
	<input type="hidden" id="USER_MODEPAIEMENT_LABEL" value="<?php echo $facture['USER_MODEPAIEMENT_LABEL']; ?>"> 
PKi$H[�Ư>�)�)(views/scripts/commande/factureedit.phtmlnu&1i�
<?php
$facture = $this->facture;
?>
<style type="text/css">
.oldPromoPrice,
.text12 {
font-size: 11px;
}

.bill_body {
	clear: both;
	width: 800px;
	margin: 0 auto 0 auto;
}

.bill_header {
	float: clear : both;
	width: 800px;
}

.bill_company {
	float: left;
}
.bill_company_logo {
	margin: 10px 0 10px 10px;
	width: 94px;
	height: 121px;
}
.bill_idents {
	float: right;
	width: 550px;
	margin: 20px 0 0 0 ;
}
.bill_idents_opt1{
	float:left;
	width:120px;
	height:50px;
	margin:0 0 0 10px;
}

.bill_idents_opt21{
	float:left;
	width:120px;
	height:25px;
	background-color: #e7e7e7;
	margin:0 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}
.bill_idents_opt31{
	float:left;
	width:120px;
	height:24px;
	margin:1px 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}

.bill_idents_opt22{
	float:left;
	width:250px;
	height:25px;
	background-color: #e7e7e7;
	margin:0 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}
.bill_idents_opt32{
	float:left;
	width:250px;
	height:24px;
	margin:1px 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}

.bill_text {
	color: #000000;
	font-weight: bold;
}
.bill_text2 {
	color: #000000;
	font-weight: bold;
	line-height:25px;
}
.bill_text3 {
	color: #000000;
	font-size:11px;
}
.bill_address {
	float: left;
	width: 800px; 
	margin:10px 0 0 0;
}

.bill_address_opt {
	float: left;
	width: 300px; 
	margin: 0 0 0 50px;
}
.bill_address_opt1{
	float:left;
	width:300px;
	height:25px;
	background-color: #e7e7e7;
	margin:0 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}

.bill_address_opt2 {
	float:left;
	width:250px;
	margin: 10px 0 0 20px;
}
.bill_address_opt3 {
	float:left;
	width:300px;
	margin: 10px 0 0 0;
}

.bill_line {
	line-height:25px;
	text-align:center;
	font-weight:bold;
}
.bill_line2 {
	line-height:20px;
}

.bill_caddy {
	float: left;
	width:800px;
	height:auto;
}

.bill_facture{
	float: left;
	width:800px;
	height:150px;
}

.bill_buy{
	float: left;
	width:350px;
	height:30px;
}

.bill_detail{
	float: right;
	width:250px;
	height:130px;
	border: solid 1px black;
	margin: 10px 0 0 0;
}
.bill_footer{
	float: left;
	width:800px;
	margin: 20px 0 0 0;
}
.bill_footer2{
	float: left;
	width:800px;
	text-align:center;
	margin: 0 0 20px 0;
}

.bill_linkd a:link,.bill_linkd a:visited,.bill_linkd a:active {
	font-family: "Arial";
	font-size: 12px;
	font-weight: normal;
	color: #000000;
	text-decoration: none;
}

.bill_linkd a:hover {
	text-decoration: underline;
}
</style>
<div class="bill_body">
	<div class="bill_header">
		<div class="bill_company">
			<div class="bill_company_logo"> 
				<a href="<?php echo $this->baseUrl; ?>/"><img alt="Directement � la source de la qualit�" src="<?php echo $this->baseUrl; ?>/business/image/logo.png" /></a>
			</div>
			<div>
				<?php if (!empty($facture['USER_NUMCOMPTE'])) {?>
				<span class="bill_text">Compte : <?php echo $facture['USER_NUMCOMPTE']; ?></span><br>
				<?php } ?>
				<span class="bill_text">Tel : <?php echo $this->tel_contact; ?></span><br>
				<span class="bill_text">Email : <?php echo $this->serviceClient_Mail; ?></span>
			</div>
		</div>
		<div class="bill_idents">
			<div class="bill_idents_opt1">
				<div class="bill_idents_opt21">
					<span class="bill_line"><?php echo 'Date'; ?></span>
				</div>
				<div class="bill_idents_opt31">
					<span class="bill_line">
					<?php 
					try {
					$myDate = new Zend_Date(strtotime($facture['DATESTART']));
					
					$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');
				
					echo $myDate->toString("dd").' '.$mois[(int)$myDate->toString('MM')].' '.$myDate->toString("YYYY");
		
					} catch(Zend_Exception $e) {
						
					} ?>
					</span>
				</div>
			</div>
			<div class="bill_idents_opt1">
				<div class="bill_idents_opt22">
					<span class="bill_line"><?php echo 'Client'; ?></span>
				</div>
				<div class="bill_idents_opt32">
				<span class="bill_line"><?php echo $facture['USER_EMAIL']; ?></span>
				</div>
			</div>
		
		</div>
	</div>
	<div class="bill_address">
		<div class="bill_address_opt">
			<div class="bill_address_opt1">
				<span class="bill_line">Adresse de Facturation</span>
			</div>
			<div class="bill_address_opt2">
				<span class="bill_text2"><?php echo $facture['FACT_RAISONSOCIAL']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['FACT_ADRESSE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['FACT_CP'].' '.$facture['FACT_VILLE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['FACT_PAYS']; ?></span>
				</div>
			<div class="bill_address_opt3">
				<span class="text3">Pour modifier votre adresse de facturation, <span class="link4"><a href="<?php echo $this->baseUrl; ?>/mon-compte.html">cliquez ici. </a></span></span>
			</div>
		</div>
		<div class="bill_address_opt">	
			<div class="bill_address_opt1">
				<span class="bill_line">Adresse de Livraison</span>
			</div>
			<div class="bill_address_opt2">
				<span class="bill_text2"><?php echo $facture['LIV_RAISONSOCIAL']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['LIV_ADRESSE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['LIV_CP'].' '.$facture['LIV_VILLE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['LIV_PAYS']; ?></span>
			</div>
			<div class="bill_address_opt3">
				<span class="text3">Pour modifier votre adresse de livraison, <span class="link4"><a href="<?php echo $this->baseUrl; ?>/mon-panier-livraison.html">cliquez ici. </a></span></span>
			</div> 
		</div>
	</div>
	<div class="bill_caddy">
		<table style="border:1px solid black;"  border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr align="center" style="background-color: #e7e7e7;">
				<th class="bill_line" >R�f�rence</th>
				<th class="bill_line">D�signation</th>
				<th class="bill_line" style="width: 60px">Dispo.</th>
				<th class="bill_line">Quantit�</th>
				<th class="bill_line"  style="text-align: center">P.U. HT</th> 
				<th class="bill_line" >Montant HT</th>
			</tr>
			<?php 
			$index = 1;
			$i = 0;
			$caddy = $facture['CADDY'];
			foreach($caddy as $row) { 
				?>
			<tr >
				<td colspan="6" height="1px" style="background-color: #868686"></td>
			</tr>
			<tr align="center"  height="25px" >
				<td class="textTd1" width="110px" style="text-align:center;white-space: nowrap;">
					<?php echo $this->escape($row->item_reference);?>
				</td>
				<td  width="450px" class="bill_linkd" style="text-align: left;">
					<a target="_blank"  href="<?php echo $this->baseUrl; ?>/<?php echo Utils_Tool::getFormattedUrlProduct($row->product_navnom_urlparents, $row->product_navnom, $row->product_id); ?>"><?php echo $row->item_designation;?></a>
					<?php if (!empty($row->item_selectedOption)) { 
						echo '<br/>'.$row->item_selectedOption.'<br/>';
					} ?>
				</td>
				<td class="textTd1" > 
					<?php if ((int)$row->item_stock == 1) { ?>
					<img class="tooltips" alt="Disponible imm�diatement" title="Disponible imm�diatement" src="<?php echo $this->baseUrl; ?>/business/image/admin/stock11.png" />
					<?php } else if ((int)$row->item_stock == 2) { ?>
					<img class="tooltips" alt="Disponible sous 8 jours" title="Disponible sous 8 jours" src="<?php echo $this->baseUrl; ?>/business/image/admin/stock22.png" />
					<?php } else if ((int)$row->item_stock == 3) { ?>
					<img class="tooltips" alt="Nous contacter" title="Nous contacter" src="<?php echo $this->baseUrl; ?>/business/image/admin/stock33.png" />
					<?php }?> 	
				</td>
				<td class="textTd1" >
					<?php echo $row->item_qte; ?>	
				</td>
				<td class="textTd1" width="150px">					
						<?php $this->currentData = $row;
						echo $this->render("/produits/ajaxshowpromopricecaddy.phtml"); ?>
				</td> 
				<td width="120px">
					<span class="textTd1" style="float: right;" >
					<?php 
						if (!$row->isSurDevis()) {
							echo number_format($row->getPrixTotalHT(true), 2, ',', ' ').' &#8364;';
						}
					?>
					</span>
				</td>
			</tr>
			<?php $i++; } ?>	
			<?php
	$caddyfidelite = $facture['CADDYFIDELITE'];
	foreach($caddyfidelite as $row) {
		?>
    <tr>
      <td colspan="6">
        <div style="font-weight: bold;margin:10px;">
          <?php echo 'Carte de fid�lit� : '.$row->fidelite_nom.' ('.$row->fidelite_nbpoint.' points)'; ?>
        </div>
      </td>
    </tr>
  <?php } ?>
		</table>
	</div>
	<div class="bill_facture">
		<div class="bill_detail">
			<table border="0" cellpadding="0" cellspacing="0" width="100%">
				<tr align="right">
					<td class="bill_line2">Total HT</td>
					<td  class="bill_line2"><?php echo number_format($facture['PRIXTOTALHTHR'], 2, ',', ' '); ?> &#8364;</td>
				</tr>	
				<tr align="right">
					<td  class="bill_line2" >Remise <?php if (isset($facture['CODEREDUCTION']) && !empty($facture['CODEREDUCTION']) ) { echo " ( ".$facture['CODEREDUCTION']['CODE']." ) "; } ?></td>
					<td  class="bill_line2" ><?php echo number_format($facture['PRIXREMISEEUR'], 2, ',', ' '); ?> &#8364;</td>
				</tr>	
				<tr align="right">
					<td  class="bill_line2">
						<?php if (strcasecmp($facture['LIV_PAYS'], "FRANCE") != 0) { ?>
						Prix d�part 	
						<?php } else {
							if (isset($facture['INFOLIV']) && !empty($facture['INFOLIV']) ) { echo 'Livraison en '.$facture['INFOLIV']['NOMLIV']; } else { echo 'Frais de port'; } 
						} ?>
					</td>
					<td class="bill_line2"><?php echo number_format($facture['PRIXFRAISPORT'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
				<tr >
					<td colspan="2" height="1px" style="background-color: #868686"></td>
				</tr>
				<tr align="right">
					<td class="bill_text2">Net HT</td>
					<td class="bill_text2"><?php echo number_format($facture['PRIXTOTALHTFP'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
				<tr align="right">
					<td  class="bill_line2">Total TVA</td>
					<td  class="bill_line2"><?php echo number_format($facture['PRIXTOTALTVA'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
				<tr >
					<td colspan="2" height="1px" style="background-color: #868686"></td>
				</tr>
				<tr align="right">
					<td class="bill_text2">NET A PAYER TTC</td>
					<td class="bill_text2"><?php echo number_format($facture['PRIXTOTALTTC'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
			</table>
		</div>
	</div>
</div>
PKi$H[���e��views/scripts/index/index.phtmlnu&1i�<script type="text/javascript">var homePage = true;</script>

<!-- Fullscreen gallery start -->
<div class="slider" id="slider">
	<div id="gallery">
		<?php foreach ($this->listAllGalleries as $row) { 
			if (!empty($row['URL'])) { 			
				$info = getimagesize($row['URL']) ;
				list($width_old, $height_old) = $info;
		?>
		<img src="/business/light/img/blank.png" data-original="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 0);?>" width="<?php echo $width_old; ?>" height="<?php echo $height_old; ?>" alt="<?php echo $this->escape($row['CONTENT_SHORT']);?>" />
		<?php } } ?>
		</div>
</div><!-- Slider div end / Fullscreen gallery end -->
<!--
<div id="fullscreen"><div id="fullscreen_icon" title="Plein �cran" class="qtip"></div></div>
<div id="play"><div id="play_icon" title="Lecture automatique" class="qtip"></div></div>
<div id="sound"><div id="sound_icon" title="Son on/off" class="qtip"></div></div>
 
<div id="desc_info"><div id="desc_info_icon" title="Description" class="qtip"></div></div>
-->
<div id="desc_cont">
	<?php foreach ($this->listAllGalleries as $row) { 
		if (!empty($row['URL'])) {
		if (!empty($row['CONTENT_SHORT']) || !empty($row['CONTENT_LONG'])) { ?>
	<div>
		<h2><?php echo $this->escape($row['CONTENT_SHORT']);?></h2>
		<p class="margin_1line"><?php echo $this->escape($row['CONTENT_LONG']);?></p>	
		<div class="desc-one-half float-left margin_1line">	
			<ul class="buy text-left">
				<li>ACHETER LES PHOTOS</li>
				<li>
					<ul>
						<li><a href="<?php echo $this->custom_link_1; ?>" title="JingoO" class="qtip"><img src="/business/light/img/icons/stock/fotolia.png" alt="JingoO" /></a></li>
					</ul>
				</li>
			</ul>
		</div>
	</div>
	<?php } else { ?>
	<div></div>
	<?php  } } } ?>   
</div>
<div id="modal_shadow"></div>

<!-- Big navigation arrows -->
<div id="left"><div id="arrow_left"></div><a href="#" id="scroll_left"></a></div>
<div id="right"><div id="arrow_right"></div><a href="#" id="scroll_right"></a></div>

<!-- Thumbnails
<div id="gallery_hide"></div>
<div id="thumbnails_bg">
	<div id="mini_cont"> 
		<a class="prev" id="mini_prev" href="#"></a>
		<a class="next" id="mini_next" href="#"></a>
		<div id="thumbnails_cont">
			<div id="thumbnails"> 
			<?php foreach ($this->listAllGalleries as $row) { 
				if (!empty($row['URL'])) { ?>
				<a href="#"><img src="/business/light/img/blank.png" data-original="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 100);?>" alt="<?php echo $this->escape($row['CONTENT_SHORT']);?>"/></a>
			<?php } } ?>
			</div> 
		</div> 
		<div id="bottom-line">
			<div id="author">&copy; <?php echo $this->siteName; ?></div>
		</div> 
	
	</div> 
</div> 

<div id="gallery-show"></div>
 -->
<div id="img-pattern"></div>
<!-- audio player -->
<div id="audio">
	<div id="jquery_jplayer_1" class="jp-jplayer"></div>
  <div id="jp_container_1" class="jp-audio"><div class="jp-type-single"></div></div>
</div><!-- end audio div -->
 PKi$H[!views/scripts/contact/empty.phtmlnu&1i�PKi$H[���@!views/scripts/contact/index.phtmlnu&1i�

<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/validate.js"></script>

<!-- page content -->
<div id="page" style="background: transparent !important; border:0 !important;">
<div class="big_header"><h1 class="big_header">Contact</h1></div>

<div id="page_top"></div>
<div class="scroll-pane">
<div class="page_block">
<div class="column_cont">	
		<div class="two-third margin_1line contactpage">		
		<h3>Envoyer un message</h3>
		<div id="comment" class="margin_1line"></div>
			<!-- contactForm -->
			<form name="contactForm" id="contactForm" method="get" action="" class="margin_1line">
				<div class="contact"><label for="name">Nom:</label>
				<input type="text" name="name" id="name" class="required,all" />&nbsp;
				<img name="name" src="/business/light/img/blank.png" alt=""/></div>
				
				<div class="contact margin_1line"><label for="email">Email:</label>
				<input type="text" name="email" id="email" class="required,email" />&nbsp;
				<img name="email" src="/business/light/img/blank.png" alt=""/></div>
				
				<div class="contact margin_1line"><label for="message">Message:</label>
				<textarea name="message" id="message" class="required,all" rows="8" cols="10"></textarea>&nbsp;
				<img name="message" src="/business/light/img/blank.png" alt=""/></div>
				
				<div class="contact"><label for="submit">&nbsp;</label><a href="#" id="submit" class="butt custom_font  margin_3_2line">Envoyer</a></div>
			</form><!-- contacForm end -->
	</div>
	<div class="one-third contactpage">		
	<h3 class="margin_1line"><?php echo $this->custom_text_1; ?></h3>
			<h6 class="margin_1line"><?php echo $this->custom_text_2; ?></h6>
			<p class="margin_1line"><?php echo $this->custom_text_3; ?></p>
			<p class="margin_1line">
				e-mail: <?php echo $this->contact_Mail; ?><br />
				tel: 07-88-97-44-55 <br />
			</p>
	</div>	
</div><!-- column_cont div end -->

<div class="clear"></div>

</div><!-- page-block div end -->
<div class="page-footer">&copy; <?php echo $this->siteName; ?></div>

</div>


</div>PKi$H[�e�l��*views/scripts/produits/ajaxaddpanier.phtmlnu&1i�<span class="messageSuccess"><?php echo $this->messageSuccess; ?></span> 
<span class="messageError"><?php echo $this->messageError; ?></span> PKi$H[@���44*views/scripts/produits/monpaniertype.phtmlnu&1i�

<script  type="text/javascript" >

$(function(){
	initEventsCaddyType();
});

</script>
<div class="spaceBG2" ></div> 
<div >
<?php  
$caddyTypes = $this->caddyType; 

if (empty($caddyTypes)) { ?>
<div class="col-xs-12 text-center" style="margin-top: 20px;">Il n'y a aucun article dans votre panier.</div>
<div class="col-xs-12 text-center" style="margin-top: 20px;">
		<a   data-placement="bottom" class="btn btn-default btn-lg" href="<?php if (isset($this->urlCurrentProduct) && !empty($this->urlCurrentProduct)) { echo $this->urlCurrentProduct; } else { echo $this->baseUrl.'/'; } ?>" >
			CONTINUER MES ACHATS
		</a>
</div>
<?php  } else { ?>
<div class="productAnnexeLabel caddyTypeUp">
	Retrouver les r�f�rences de vos produits
</div>

<form  id="caddyTypeCheckForm" action="<?php echo $this->baseUrl; ?>/mon-panier-type-actualiser.html" method="post">
	<div style="float: left;width: 100%;">
		<table border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr align="center" height="50px" style="background-color: #e7e7e7">
				<th class="textTh1">Produit</th>
				<th class="textTh1">Dispo.</th>
				<th class="textTh1">Prix Unitaire (HT)</th> 
				<th class="textTh1">Quantit�</th>   
			</tr>
			<?php
			$index = 1;
			$i = 0;
			foreach($caddyTypes as $row) {
				?>
			<tr align="center"  height="25px"  style="background-color:<?php  if (!$row->isPromoCaddyType) { if ($index == 0) {echo '#E7E7E7'; $index=1;} else {$index=0; echo '#FFFFFF';} } else { echo "#92B901"; } ?>;">
				<td  >
					<div class="caddyProdImg" >  
						<a target="_blank" href="<?php echo $this->baseUrl; ?>/<?php echo Utils_Tool::getFormattedUrlProduct($row->navnom_urlparents, $row->navnom, $row->idProduit); ?>"
							title="<?php echo $this->escape($row->designation);?>" >
							<img src="<?php echo $this->baseUrl.'/'.$row->url; ?>">
						</a>
					</div>
					<div class="caddyProdTxt" >
						<div class="link17" style="width: auto;clear:both">
							<a target="_blank" href="<?php echo $this->baseUrl; ?>/<?php echo Utils_Tool::getFormattedUrlProduct($row->navnom_urlparents, $row->navnom, $row->idProduit); ?>">
								<?php echo $this->escape($row->designation);?>
							</a>
						</div>
						<div class="textA1 productDetail_ref">
							<?php echo "Ref. ".$this->escape($row->reference);?>
						</div>
					</div>
				</td> 
				<td width="70px">
					<?php if ((int)$row->stock == 1) { ?>
					<img alt="Disponible" title="Disponible" src="<?php echo $this->baseUrl; ?>/business/image/admin/stock11.png">
					<?php } else if ((int)$row->stock == 2) { ?>
					<img alt="Disponible sous 8 jours" title="Disponible sous 8 jours" src="<?php echo $this->baseUrl; ?>/business/image/admin/stock22.png">
					<?php } else if ((int)$row->stock == 3) { ?>
					<img alt="Nous contacter" title="Nous contacter" src="<?php echo $this->baseUrl; ?>/business/image/admin/stock33.png">
					<?php }?> 
				</td>
				<td valign="top" width="150px">
						
						<?php $this->currentData = $row;
						echo $this->render("/produits/ajaxshowpromopricecaddy.phtml"); ?>
				</td> 
				<td align="center">
					<div style="clear:both;width: 90px;margin: 0 auto 0 auto;">
						<input onclick="javascript:clearInput($(this), '0');" type="text" class="input3 caddyQuantity" maxlength="6" name="Quantity[]" value="<?php echo $row->qte; ?>" /> 
					</div>
					
					<input type="hidden" name="Child[]" value="<?php echo $row->idChild; ?>" /> 
					
					<input type="hidden" name="CaddyType[]" value="<?php if ($row->isPromoCaddyType) { echo $row->id; } else { echo '0'; } ?>" />  
					
					<input type="hidden" name="QuantityMin[]" value="<?php echo $row->qte_min; ?>" />  
				</td> 
			</tr>
			<?php $i++; } ?>
		</table>
	</div>
	<div  style="float: left;width: 100%;text-align: center;margin:10px;"><input class="button" type="submit" value="Ajouter"></div>
	</form>  
<?php } ?>
</div> PKi$H[C�t%
%
(views/scripts/produits/nosproduits.phtmlnu&1i�
<?php 
	echo $this->render("/ajax/caddyaccountright.phtml"); 
$listProducts = array();
$listProducts = $this->listAllProducts;
$color = $this->actualDesign['color'];
$listCat = array();
$listCat = $this->listCat;
 
?>
<script type="text/javascript">
$(function(){
	$('#slider-product-id').liquidSlider({
		autoHeight : true,
		minHeight : 0,
		autoSlide: true,
		autoSlideInterval : 5000,
		pauseOnHover : false,
		includeTitle : false,
		dynamicTabs : false
	});
	
    initProductPagination("#productpagination", 1, <?php echo ceil(sizeof($listProducts) / 16); ?>);
});
</script>
 
	<?php if (isset($listCat['CHOICEURL']) && !empty($listCat['CHOICEURL']) && 
				isset($listCat['CHOICEDOC']) && !empty($listCat['CHOICEDOC'])) { ?>
	<span style="display:none;margin: 0 0 0 20px;" > 
		<a href="<?php echo $this->baseUrl; ?>/<?php echo $listCat['CHOICEDOC'];?>" title='Comment choisir "<?php echo $listCat['NOM']; ?>" ?' target="_blank">
			<img alt='Comment choisir "<?php echo $listCat['NOM']; ?>" ?' src="<?php echo $this->basUrl; ?>/<?php echo $listCat['CHOICEURL'];?>">
		</a>
	</span>
	<?php } ?>

<div class="col-xs-12 col-sm-10 col-sm-offset-1 text-center visible-md visible-lg">
	<div class="col-xs-12"  style="margin-top: 10px; margin-bottom: 10px;">
		<span class="product-title-tri">Trier les produits</span>
		<?php $link = $this->baseUrl."/".Utils_Tool::getFormattedUrlCategory($this->currentCategory['NAVNOM_URLPARENTS'], $this->currentCategory['NAVNOM'], $this->currentCategory['ID']); ?>
		<a href="<?php echo $link."?tri=5";?>" class="btn btn-default">Meilleures ventes</a> 
    <a  href="<?php echo $link."?tri=1";?>" class="btn btn-default">Prix croissant</a>
		<a  href="<?php echo $link."?tri=2";?>" class="btn btn-default">Prix d�croissant</a>
		<a  href="<?php echo $link."?tri=3";?>" class="btn btn-default">Nom croissant</a>
		<a  href="<?php echo $link."?tri=4";?>" class="btn btn-default">Nom d�croissant</a>
	</div>  
</div>
<?php 
$paginationPage = 1;
$count = 0;
if (!empty($listProducts)) { 
	foreach ($listProducts as $row) {
		if ($count > 15) {
			$count = 0;
			$paginationPage++;
		}
		$this->currentData = $row;
		$this->currentPaginationPage = $paginationPage;
		$count++;
		echo $this->render("/produits/ajaxshowproductbox.phtml");	
	}
}?>

<div class="col-xs-10 col-xs-offset-1 text-center">
	<div id="productpagination"></div>    
</div>

<?php if (isset($listCat['DESCRIPTIONLONG']) && !empty($listCat['DESCRIPTIONLONG'])) { ?>
<div class="col-xs-12 noPadding" style="margin: 0 0 10px 0;">
    <?php echo $listCat['DESCRIPTIONLONG']; ?>
</div>
<?php } ?>PKi$H[ACEQ��1views/scripts/produits/ajaxdownloaddocument.phtmlnu&1i�
<?php header('Content-Type: text/html; charset=ISO-8859-15'); ?>
 
<?php if (!$this->isSuccess) { ?>

<?php
	$product = $this->detailProduct;
    if (isset($product) && !empty($product)) { 
?>	

    <form id="dialog-form-doc" enctype="multipart/form-data"  class="white-popup-block mfp-hide form-horizontal" action="<?php echo $this->baseUrl.'/produits/ajaxdownloaddocument'; ?>" method="post">
	    <script type="text/javascript">
            $(function() {
                initDetailProductDialogSendDoc();
            });
        </script>
        <span class="indexBox4_title2">Fiche technique � t�l�charger</span>
	    <fieldset style="border:0;">
		    <p>Pour recevoir par mail notre fiche technique, veuillez renseigner le formulaire ci-dessous.</p>
		     
			    <div class="form-group">
				    <label for="civility_doc" class="col-sm-2 control-label">Civilit�</label>
                    <div class="col-sm-10">
                        <label class="radio-inline">
                          <input type="radio" name="civility_doc" value="M." checked="checked"> M.
                        </label>
                        <label class="radio-inline">
                          <input type="radio" name="civility_doc" value="Mme"> Mme
                        </label>
                        <label class="radio-inline">
                          <input type="radio" name="civility_doc" value="Mlle"> Mlle
                        </label>
			        </div>
			    </div>
			     <div class="form-group">
				    <label for="name_doc" class="col-sm-2 control-label">Nom</label>
                     <div class="col-sm-10">
				        <input id="name_doc" name="name_doc" type="text" placeholder="Nom" class="form-control" required="">
			        </div>
			    </div>
			     <div class="form-group">
				    <label for="firstname_doc" class="col-sm-2 control-label">Pr�nom</label>
                     <div class="col-sm-10">
				        <input id="firstname_doc" name="firstname_doc" type="text" placeholder="Pr�nom" class="form-control" required="">
			        </div>
			    </div>
			     <div class="form-group">
				    <label for="email_doc" class="col-sm-2 control-label">Email</label>
                     <div class="col-sm-10">
				        <input id="email_doc" name="email_doc" type="email" placeholder="exemple@domaine.com" class="form-control" required="">
			        </div>
			    </div>
			    <div class="form-group">
                    <div class="col-sm-12 text-center">
                        <input type="submit" class="btn btn-default" value="Recevoir par mail" /> 
                        <input type="hidden" name="product_id_doc" value="<?php echo $product['ID']; ?>" /> 
                     </div> 
			    </div> 
	    </fieldset>
    </form>
<?php } else { ?>
<div class="white-popup-block-medium">
    <div class="text-center">
        <input type="button" class="btn btn-danger" value="Fermer" onclick="$.magnificPopup.close();" /> 
    </div> 
</div> 
<?php } 
} else { ?>
<div class="white-popup-block-medium">
    <div class="text-center">
        <?php echo $this->message ;?><br /><br />
    </div> 
    <div class="text-center">
        <input type="button" class="btn btn-danger" value="Fermer" onclick="$.magnificPopup.close();" /> 
    </div> 
</div> 
<?php }  ?>PKi$H[�f���4views/scripts/produits/ajaxshowpromopricecaddy.phtmlnu&1i�<?php header('Content-type: text/html; charset=iso-8859-1');

if ($this->currentData) {
	$currentData = $this->currentData;
	if (!$currentData->isSurDevis()) {
		 if ($currentData->isPromo()) { ?>
				<div class="productDetail_priceBox" <?php if ($currentData->getPrixAfterRemise() > 999) { echo 'style="width:165px;"'; } ?>>   
		 		<div class="productDetail_promoImag hidden-print" >
					<img class="tooltips" data-placement="bottom" src="<?php echo $this->baseUrl; ?>/business/image/promo.png" alt="Ce produit est en promotion" title="Ce produit est en promotion" >
				</div>
		 		<div class="productDetail_price" >
			 		 <div class="text12" >
					 	<?php echo number_format($currentData->getPrixAfterRemise(), 2, ',', ' ').' ';?>
					 	<span style="color: #000000">&#8364;</span> 
					 </div>
					 <div>
					 	<span class='oldPromoPrice'> <?php echo number_format($currentData->item_prix, 2, ',', ' ').' ';?>&#8364;</span>
					 </div>
		 		</div> 
			</div>
			
		<?php } else { ?>
				<div class="text12" >
					<?php echo number_format($currentData->item_prix, 2, ',', ' ').' ';?>
					<span style="color: #000000">&#8364;</span>
				</div> 
		<?php } 
	} else { ?>
			<div  class="text12">
				<span>sur devis</span>
			</div> 
	<?php }} ?>PKi$H[�4=j"j"&views/scripts/produits/categorie.phtmlnu&1i�<?php  
	$currentCat = array();
	$currentCat = $this->currentCat; 
?> 

<?php if (isset($currentCat['ID_THEME']) && $currentCat['ID_THEME'] == 2) {
	
	echo $this->render("/index/index.phtml");
	
} else { ?>

	<div id="page">

	<?php   
		if (isset($currentCat['NOM']) && !empty($currentCat['NOM'])) { ?>
		<div class="big_header"><h1 class="big_header"><?php echo $currentCat['NOM'];  ?></h1></div>
	<?php } 

	$isGallerie = isset($currentCat['ID_THEME']) && !empty($currentCat['ID_THEME']) && isset($this->listAllGalleries) && !empty($this->listAllGalleries);
	$isGallerieSlide = $isGallerie && $currentCat['ID_THEME'] == 6;
	$isArticles = isset($this->listAllArticles) && !empty($this->listAllArticles);// && !$isGallerieSlide;
	
	$subsCategory = $this->currentCatSubs['SUBS'];
	if (sizeof($subsCategory) > 0) { 
	 ?> 
        <link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/business/light/gamma/css/style.css"/> 
		 <div id="page_top"></div> 
		<div class="scroll-pane">
			<div class="page_block" >   
				<div class="gamma-container " id="gamma-container" >

					<ul class="gamma-gallery">

					<?php
					$isLeft = true; 
					foreach ($subsCategory as $row) { 
							$title = $this->escape($row['NOM']);
							$description = $this->escape($row['DESCRIPTION']);  
							$link_href = $this->baseUrl."/".Utils_Tool::getFormattedUrlCategory($row['NAVNOM_URLPARENTS'], $row['NAVNOM'], $row['ID']);
							
						?>
						<li > 
							<div style="float:left;width:100%;padding:30px 0 30px 0">
								<div style="float:<?php if ($isLeft) { echo "left"; } else {echo "right"; }?>">
									<?php if (!empty($row['URL'])) {  ?> 
										<a href="<?php echo $link_href;?>" alt="<?php echo $title;?>" /> 
											 <img src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 0);?>" alt="<?php echo $this->escape($row['NOM']);?>"/> 
										</a>   
									<?php } else { ?> 
										<a href="<?php echo $link_href;?>" alt="<?php echo $title;?>" />   <?php echo $title;?> </a>   
									<?php }  ?> 
								</div>
								<div style="float:<?php if ($isLeft) { echo "left"; } else {echo "right"; }?>; <?php if ($isLeft) {  echo "margin:0 0 0 30px"; } else {echo "margin:0 30px 0 0";}?> ; width: 350px; text-align: justify;    text-justify: inter-word;">
									<?php if (!empty($row['URL'])) {  ?> 
									<div style="clear:both">
										<a style="float:<?php if ($isLeft) { echo "left"; } else {echo "right"; }?>;" href="<?php echo $link_href;?>" alt="<?php echo $title;?>" />
											<?php echo $title;?>
										</a>
									</div><br /><br />
									<?php }  ?> 
									<a href="<?php echo $link_href;?>" alt="<?php echo $title;?>" style="text-decoration:none;color:#4F4F4F"/><p ><?php echo $description;?> </p>   </a>
								</div>
							</div>
						</li>
					<?php 
					$isLeft = !$isLeft; 
						}  ?> 
					
					</ul>

					<div class="gamma-overlay"></div> 
				</div>   
			</div> <!-- page_block -->
			<div class="page-footer">&copy; <?php echo $this->siteName; ?></div>
		</div> <!-- scroll-pane --> 	
	<?php 
	} else {
		if ($isArticles) { ?>

				<div class="submenu">
				<?php foreach ($this->listAllArticles as $row) { 
					if (!empty($row['CONTENT_SHORT'])) { ?>
					<a href="#article-<?php echo $row['ID'];  ?>" class="custom_font filter"><?php echo $row['CONTENT_SHORT'];  ?></a>
				<?php }
				} ?>
				</div>
				<div class="scroll-pane">
					<div class="page_block">

						<?php foreach ($this->listAllArticles as $row) { ?>
						<div id="article-<?php echo $row['ID'];  ?>">
							<?php echo $row['CONTENT']; ?>
						</div>
						<?php } ?>
						<div class="clear"></div>
					<?php if (!$isGallerie) { ?>
					</div> <!-- page_block -->
					<div class="page-footer">&copy; <?php echo $this->siteName; ?></div>
				</div> <!-- scroll-pane -->
				<?php } ?>
		<?php } 
		
		if ($isGallerie) { ?>

		<?php 
			$currentTheme = (int)$currentCat['ID_THEME'];
			$currentWithThumb = 0;
			if (isset($this->FeatureSiteThemeCms) && !empty($this->FeatureSiteThemeCms)) { 
				foreach ($this->FeatureSiteThemeCms as $row) { 
					if ($row['ID_THEME'] == $currentTheme && isset($row['WIDTH_THUMB']) && $row['WIDTH_THUMB'] > 0) {
						$currentWithThumb = $row['WIDTH_THUMB'];
						break;
					}
				} 
			}
			
			switch ($currentTheme) { 
				case 3: 
				case 4: 
				case 5:
				?>
				
			<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/business/light/gamma/css/style.css"/>
			<script src="<?php echo $this->baseUrl; ?>/business/light/gamma/js/modernizr.custom.70736.js"></script>
			<noscript><link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/business/light/gamma/css/noJS.css"/></noscript>
			<script src="<?php echo $this->baseUrl; ?>/business/light/gamma/js/jquery.masonry.min.js"></script>
			<script src="<?php echo $this->baseUrl; ?>/business/light/gamma/js/js-url.min.js"></script>
			<script src="<?php echo $this->baseUrl; ?>/business/light/gamma/js/jquerypp.custom.js"></script>
			<script src="<?php echo $this->baseUrl; ?>/business/light/gamma/js/gamma.js"></script>
			
			
				<div id="page_top"></div>
				<?php if (!$isArticles) { ?>
				<div class="scroll-pane">
					<div class="page_block" >  
				<?php } ?>
						<div class="gamma-container gamma-loading" id="gamma-container">

							<ul class="gamma-gallery">

							<?php foreach ($this->listAllGalleries as $row) { 
								if (!empty($row['URL'])) { 
									$title = $this->escape($row['NOM']);
									$description = $this->escape($row['CONTENT_SHORT']);
									if (!empty($row['CONTENT_LONG'])) {
										if (!empty($description)) {
											$description .= " - ";
										}
										$description .= $this->escape($row['CONTENT_LONG']);
									}
								?>
								<li>
									<div data-alt="<?php echo $description;?>" data-description="<h3><?php echo $this->escape($row['CONTENT_SHORT']); ?></h3>" data-max-width="1800" data-max-height="1350">
										<div data-src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 0);?>" data-min-width="700"></div>
										<div data-src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 641);?>" data-min-width="600"></div>
										<div data-src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 295);?>" data-min-width="300"></div> 
										<div data-src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 180);?>" data-min-width="140"></div>
										<div data-src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 100);?>"></div> 
										<noscript>
											<img src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 100);?>" alt="<?php echo $description;?>"/>
										</noscript>
									</div>
								</li>
							<?php } } ?> 
							
							</ul>

							<div class="gamma-overlay"></div> 
						</div>  
				<?php if (!$isArticles) { ?>
					</div> <!-- page_block -->
					<div class="page-footer">&copy; <?php echo $this->siteName; ?></div>
				</div> <!-- scroll-pane -->
				<?php } ?>
			
					 
				<script type="text/javascript">
					
					$(function() {  
					
						var GammaSettings = { 
								viewport : [ {
									width : 600,
									columns : 3
								}, { 
									width : 0,
									columns : 2
								} ],
								overlayAnimated : false, 
						};

						Gamma.init( GammaSettings, fncallback );
		  
						function fncallback() { 

							var element = $('.scroll-pane').jScrollPane(); 
							var api = element.data('jsp');  
							api.reinitialise();
							
						}
					});

				</script>	

				<?php
					break;
				case 6:?>
				<div id="page_top"></div>
				<?php if (!$isArticles) { ?>
				<div class="scroll-pane">
					<div class="page_block">
				<?php } ?>
					<div class="col-md-12">
						<p class="margin_1line">&nbsp;</p>
						<p class="margin_1line margin_bottom_1line"><?php echo $currentCat['DESCRIPTION']; ?></p>
						<div class="responsiveslides-div" style="width:641px; height: 404px;">
							<ul class="rslides">
							<?php foreach ($this->listAllGalleries as $row) { 
								if (!empty($row['URL'])) { ?>
								<li><img src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], $currentWithThumb);?>" /></li>
							<?php } } ?>  
							</ul>
						</div>	
						
					</div>
				<?php if (!$isArticles) { ?>
					</div> <!-- page_block -->
					<div class="page-footer">&copy; <?php echo $this->siteName; ?></div>
				</div> <!-- scroll-pane -->
				<?php } ?>
					<?php
					break;
			}
		}
		if ($isArticles && $isGallerie) { ?>
				</div> <!-- page_block -->
			<div class="page-footer">&copy; <?php echo $this->siteName; ?></div>
		</div> <!-- scroll-pane -->
		<?php }
	}	 ?>
	
	</div>
<?php } ?>
		PKi$H[ޔZ�7T7T#views/scripts/produits/detail.phtmlnu&1i�

<?php
	$product = $this->detailProduct;
	$userNamespace = new Zend_Session_Namespace($this->session_variable);
	$myCaddy = $userNamespace->myObjectCaddy;
	$nbOption = 3;

    $auth = Zend_Auth::getInstance();
	$auth->setStorage(new Zend_Auth_Storage_Session($this->session_storage));
	$storage = $auth->getStorage()->read(); 

?>	

<?php if (Utils_Tool::isMobile()) { ?>
	  <?php echo $this->render("/produits/detailmobile.phtml"); ?>
<?php } else { ?>

<?php if ($this->prefixPromoClass == "eco-") { ?>
<style type="text/css">

html, body {
	background: url('/business/image/eco-bg1.jpg') no-repeat top center;
	background-color: #21530d;
	-webkit-background-size: cover; 
    -moz-background-size: cover;   
    -o-background-size: cover;   
    background-size: cover;  
}
.wrapBgContent-l,
.wrapBgContent-r {
	background:none;
}
.wrapBgContent-1 {
  -webkit-box-shadow: 0px 0px 30px rgba(0, 0, 0, 1);
          box-shadow: 0px 0px 30px rgba(0, 0, 0, 1);
}

.wrapBgContent-2 {
  -webkit-box-shadow: 0px 20px 30px rgba(0, 0, 0, 1);
          box-shadow: 0px 20px 30px rgba(0, 0, 0, 1);
}

</style>
<?php } ?>
 
<div >
    
	<?php echo $this->render("/produits/ajaxdownloaddocument.phtml"); ?>
	<?php echo $this->render("/produits/ajaxsendfriend.phtml"); ?>
</div>

<div class="col-xs-12 prod-detail-box" itemscope itemtype="http://schema.org/Product">
	<div class="col-xs-12 prod-detail-title-box noPadding">
		<?php 
		$colTitle = "col-xs-12";
		if (!empty($product['DOCNAME']) && !empty($product['DOCURL'])) { 
			$colTitle = "col-xs-10";
		} ?> 
			
		<div class="<?php echo $colTitle?> noPadding">
			<h1 class="prod-detail-title "  itemprop="name">
				<?php echo $this->escape($product['NOM']); ?>
			</h1>
		</div>

        <?php  if (!empty($product['DOCNAME']) && !empty($product['DOCURL'])) { 
            if (($auth->hasIdentity() && isset($storage['user'])) || !$this->FeatureProductDocumentDownloadGuest) { ?>
			    <div class="col-xs-2 noPadding">
				    <div style="float: left;" class=" hidden-xs hidden-sm">			
					    <div class="prod-detail-document" style="width: 100px;">					
						    <a href="<?php echo $this->baseUrl.'/'.$this->escape($product['DOCURL']); ?>" target="_blank">
							    <span > 
								    <?php echo $this->escape($product['DOCNAME']); ?>
							    </span>
						    </a>
					    </div>
				    </div>
				    <div class="prod-detail-document prod-detail-document-pic">
					    <a style="line-height: 50px;" class="tooltips" data-placement="bottom" title="<?php echo $this->escape($product['DOCNAME']); ?>" href="<?php echo $this->baseUrl.'/'.$this->escape($product['DOCURL']); ?>" target="_blank">
						    <img src="<?php echo $this->baseUrl; ?>/business/image/icon-pdf.png" alt="<?php echo $this->escape($product['DOCNAME']); ?>">	
					    </a>
				    </div>
			    </div>
		    <?php } else if ($this->FeatureProductDocumentDownloadGuest) { ?>
                <div class="col-xs-2 noPadding">
				    <div style="float: left;" class=" hidden-xs hidden-sm">			
					    <div class="prod-detail-document" style="width: 100px;">					
						    <a href="#dialog-form-doc" class="popup-with-form-doc" >
							    <span > 
								    <?php echo $this->escape($product['DOCNAME']); ?>
							    </span>
						    </a>
					    </div>
				    </div>
				    <div class="prod-detail-document prod-detail-document-pic">
					    <a style="line-height: 50px;" class="tooltips popup-with-form-doc"  data-placement="bottom" title="<?php echo $this->escape($product['DOCNAME']); ?>" href="#dialog-form-doc" >
						    <img src="<?php echo $this->baseUrl; ?>/business/image/icon-pdf.png" alt="<?php echo $this->escape($product['DOCNAME']); ?>">	
					    </a>
				    </div>
			    </div>
        <?php } } ?> 
	</div>
	<div class="col-xs-12 noPadding prod-detail-mid-box">
		<div class="col-md-6 col-xs-12 prod-detail-pics-box noPadding">
			<div class="pikachoose" >
				<ul id="pikame" class="jcarousel-skin-pika">
				<?php    foreach ($product['LISTPICS'] as $pic) { ?>
					<li><a data-fancybox-group="prodpicdetail" href="<?php echo $this->baseUrl.'/'.$pic['URL']; ?>" title="<?php echo $this->escape($pic['STRING1'].' '.$pic['STRING2']) ; ?>"><img itemprop="image" src="<?php echo $this->baseUrl.'/'.$pic['URL']; ?>" style="height: 300px"/></a><span><?php if (!empty($pic['STRING1'])) {  
										echo $pic['STRING1'].'<br/>';
									} if (!empty($pic['STRING2'])) {  
										echo $pic['STRING2'] ;
									} ?></span></li>
				<?php } ?>
				</ul>
			</div>
		</div>
		<div class="col-md-6 col-xs-12 noPadding prod-detail-info-box"  >		
			<div class="col-xs-12 prod-detail-info-box-content">
				<input type="hidden" id="isEcoDurable" value="<?php echo $this->prefixPromoClass;?>">
				<div>
  					<a href="#1" class="btn btn-tab-link <?php if(empty($this->prefixPromoClass)) { echo "btn-danger"; } else { echo "btn-success";} ?> btn-tab-default-active" data-liquidslider-ref="prod-info-slider-id">Description</a>
					<?php 
					$count = 2;
					if (!empty($product['DESCTECH'])) { ?>
 					<a href="<?php echo '#'.$count; ?>" class="btn btn-tab-link btn-tab-default-link" data-liquidslider-ref="prod-info-slider-id">Informations techniques</a>
					<?php $count++;} 
					if (!empty($product['DESCNORME'])) { ?>
					<a href="<?php echo '#'.$count; ?>" class="btn btn-tab-link btn-tab-default-link" data-liquidslider-ref="prod-info-slider-id">Normes</a>
					
						<?php } ?>
				</div>
			
				<div class="liquid-slider liquid-slider-product-info" id="prod-info-slider-id">				
				     <div>
	      				<?php echo $product['DESCLONG']; ?>
	      			</div>      			
						<?php if (!empty($product['DESCTECH'])) { ?>
						  <div>
		      				<?php echo $product['DESCTECH']; ?>
		      			</div>
						<?php } if (!empty($product['DESCNORME'])) { ?>
						  <div>
			      				<?php echo $product['DESCNORME']; ?>
			      			</div>
						<?php } ?>
						
				</div>
			</div>
			
			<div class="prod-detail-price"  itemprop="offers" itemscope itemtype="http://schema.org/Offer">
					<?php if ($product['isDEVISPRODUCT'] == 1) { ?>
          <meta itemprop="priceCurrency" content="EUR" />
          <meta itemprop="price" content="<?php echo number_format($product['PRIXLOWEST'], 2, ',', ' '); ?>" /> 
					<div class="productPriceDetailBox" >
						<span class="<?php echo $this->prefixPromoClass; ?>productPriceTitle" style="float: right;" >� partir de</span><br />
						<span class="<?php echo $this->prefixPromoClass; ?>productPriceDetail" ><?php echo number_format($product['PRIXLOWEST'], 2, ',', ' ').' '; ?> &#8364;</span>
						<span class="<?php echo $this->prefixPromoClass; ?>productPriceDetailHT"  style="float: right;" > HT</span>
					</div>
					<?php } else { ?>
					<div class="productPriceDetailBox">
						<span  class="<?php echo $this->prefixPromoClass; ?>productPriceTitle" style="margin-left: 10px; margin-top: 5px">Sur devis</span>
					</div>
					<?php } ?>
			</div>
      
		 	<div class="col-xs-12 " >
				<?php if (!empty($product['STOCK']) && !empty($product['STOCK']) && !$this->isProductOutOfStock) { ?>
				<div class="<?php echo $this->prefixPromoClass; ?>prod-detail-liv-title">D�lais de livraison
					<?php if ((int)$product['STOCK'] == 1) { ?>
					<img class="tooltips" alt="Disponible imm�diatement" title="Disponible imm�diatement" src="<?php echo $this->baseUrl; ?>/business/image/stock111.png">
					<?php } else if ((int)$product['STOCK'] == 2) { ?>
					<img class="tooltips" alt="Disponible sous 8 jours" title="Disponible sous 8 jours" src="<?php echo $this->baseUrl; ?>/business/image/stock222.png">
					<?php } else if ((int)$product['STOCK'] == 3) { ?>
					<img class="tooltips" alt="Nous contacter" title="Nous contacter" src="<?php echo $this->baseUrl; ?>/business/image/stock333.png">
					<?php }?> 
				</div>
				<?php } ?>
			</div>
		</div> 
	</div>
	
		
			<div class="col-xs-12 noPadding" style="margin-bottom: 5px;">	
				<div  class="col-sm-6 col-xs-12 noPadding "> 
					<?php if ($this->escape($product['BRENDURL']) && $product['isSHOWBREND'] == 0) {?>
           <meta itemprop="brand" content="<?php echo $this->escape($product['BREND']); ?>" />

					<img class="prod-detail-brend tooltips" title="<?php echo $this->escape($product['BREND']); ?>" src="<?php echo $this->baseUrl.'/'.$product['BRENDURL']; ?>" alt="<?php echo $product['BREND']; ?>" title="<?php echo $product['BREND']; ?>" />
					<?php } ?> 
					<?php if ($product['isQTEPRIXACTIVE']) { ?>
					<img class="tooltips" data-placement="right" alt="D�couvrez nos prix d�gressif" title="D�couvrez nos prix d�gressif" src="<?php echo $this->baseUrl; ?>/business/image/degressif2.png">
					<?php } ?>
				</div>
				<div  class="col-sm-6 col-xs-12">
          <?php $url = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]; ?>
          <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $url; ?>" class="btn btn-facebook"><i class="fa fa-facebook"></i></a>
          <a target="_blank" href="https://plus.google.com/share?url=<?php echo $url; ?>" class="btn btn-google-plus"><i class="fa fa-google-plus"></i></a>
          <a target="_blank" href="https://twitter.com/home?status=<?php echo $url; ?>" class="btn btn-twitter"><i class="fa fa-twitter"></i></a>
          <a target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo $url; ?>&title=<?php echo utf8_encode($this->escape($product['NOM'])); ?>&summary=<?php echo utf8_encode($this->escape($product['DESCSHORT'])); ?>&source=<?php echo $this->baseUrl_SiteCommerceUrl; ?>" class="btn btn-linkedin"><i class="fa fa-linkedin"></i></a>
        
         <?php  if ($this->FeatureProductSendDetail) { ?>
            <a href="#dialog-form-send-friend" class="btn btn-default popup-with-form-send-friend"><i class="fa fa-envelope"></i> Conseillez cet article</a>
         <?php  } ?>
          
        </div> 
			
			</div>

  <form id="productAddForm" action="<?php echo $this->baseUrl; ?>/produits/ajaxaddpanier/<?php echo $product['NAVNOM']; ?>/p/<?php echo $product['ID']; ?>" method="post">
    
    <div class="col-xs-12 noPadding prod-detail-buy text-right">
      <?php if (!$this->isProductOutOfStock) { ?> 
          <div class=" col-xs-12 noPadding">
            <div id="detailAddInfo" style="display:none" class="detailAddInfoContent"></div>
          </div>
          <button type="submit" class="btn btn-success btn-lg">
            <img id="prod-detail-add-btn" src="<?php echo $this->baseUrl; ?>/business/image/add-caddy.png" class="glyphicon-caddy" /> AJOUTER AU PANIER
          </button>
      <?php } else { ?>
        <span class="btn btn-success btn-lg">Le produit est �puis�</span>
      <?php } ?>
    </div>

  <div class="col-xs-12 noPadding">

			<div class="col-xs-12 noPadding">
				<input type="hidden" name="idProd" id="idProd" value="<?php echo $this->escape($product['ID']); ?>" />
          <h2 class="prod-detail-desc"  itemprop="description">
            <b>Descriptif : </b>
            <?php echo strip_tags($product['DESCSHORT']); ?>
          </h2>
				<table border="0" cellpadding="0" cellspacing="0" width="100%" class="prod-detail-ref-table">
					<thead>
					<tr >
						<th class="textTh1" style="text-align: center;" >Produit</th>
							
						<?php for($i=0 ; $i < $nbOption; $i++) { 
						if (isset($product['LISTOPTION'][$i]) && isset($product['LISTOPTION'][$i]['NOMOPTION']) ) {
							?>
						<th  class="textTh1 productDetail_option" > 
							<?php echo $this->escape($product['LISTOPTION'][$i]['NOMOPTION']); ?>
						</th>
						<?php }
						} ?>
						<?php  if ($product['ONSELECT_IDOPTION'] > 0  && !empty($product['ONSELECT_OPTION'])) { ?>
						<th  class="textTh1 productDetail_option" > 	
						 	<?php $currentOption = $product['ONSELECT_OPTION'];
								echo $currentOption->name;
							 ?>
						</th>
						<?php } ?>
						<th  class="textTh1" style="text-align: center;" width="130px" nowrap="nowrap">Prix Unitaire (HT)</th>
            <?php if (!$this->isProductOutOfStock) { ?>
						<th  class="textTh1 hidden-print" id="qteTableHeader" width="100px" style="text-align: center">Quantit�</th>
            <?php } ?>
					</tr>
					</thead>
					<tbody>
					<?php 
					$index = 1;
					$count = 0; 
					if (sizeof($product['LISTCHILD']) > 0) { 
						foreach($product['LISTCHILD'] as $child) {  ?>
						<tr align="center" class="<?php if ($index == 0) {echo 'trStripOdd'; $index=1;} else {$index=0; echo 'trStripEven';} ?>" >
																
							<td>
								<?php 
									$isFTFDS = false;
									if ($this->listFTFDS) {
									foreach($this->listFTFDS as $rowFTFDS) { 
										if ($rowFTFDS['ID_CHILD'] == $child['ID']) { ?>
									<div class="prod-detail-document" style="float: left;margin: 10px;" >
                                      <?php  if (($auth->hasIdentity() && isset($storage['user'])) || !$this->FeatureProductDocumentDownloadGuest) { ?>
			        					<a class="tooltips" data-placement="bottom" title="Voir la fiche technique et donn�es de s�curit�" href="<?php echo $this->baseUrl.'/'.$rowFTFDS['URL']; ?>" target="_blank">
											<img src="<?php echo $this->baseUrl; ?>/business/image/icon-pdf.png" alt="Voir la fiche technique et donn�es de s�curit�">	
										</a>
                                      <?php  } else if ($this->FeatureProductDocumentDownloadGuest) { ?>
										<a class="tooltips popup-with-form-doc" data-placement="bottom" title="Voir la fiche technique et donn�es de s�curit�" href="#dialog-form-doc" >
											<img src="<?php echo $this->baseUrl; ?>/business/image/icon-pdf.png" alt="Voir la fiche technique et donn�es de s�curit�">	
										</a>
                                      <?php  } ?>
                                         
                                         
									</div>
									<?php }}} ?>
									
									<div style="float: left;">
										<div class="textA1" style="width: auto;"> 
											<?php echo $child['DESIGNATION'];?>
										</div>
										<div class="textA1 productDetail_ref" >
											<div style="float: left;margin: 5px 0 5px 0">
												<?php echo "Ref. ".$this->escape($child['REFERENCE']); ?>
											</div>
											<?php if ($child['isQTEPRIXACTIVE'] && $child['QTEPRIXITEM'] > 0) { ?>
											<div style="float: right;margin: 0 10px 5px 0">
												<a class="btn <?php if(empty($this->prefixPromoClass)) { echo "btn-danger"; } else { echo "btn-success";} ?> tooltips showModalPrice" data-placement="right" href="<?php echo $this->baseUrl; ?>/<?php echo Utils_Tool::getFormattedUrlProduct($product['NAVNOM_URLPARENTS'], $product['NAVNOM'], $product['ID']); ?>" title="Nos prix d�gressif" id="item-<?php echo $child['ID']; ?>-<?php echo $child['QTEPRIXITEM'];?>">
													Prix d�gressif
												</a>
							 				</div>
											<?php } ?>
										</div>
									</div>
							</td>
							<?php for($i=0 ; $i < $nbOption; $i++) { 
							if (isset($product['LISTOPTION'][$i]) && isset($product['LISTOPTION'][$i]['NOMOPTION'])) { ?>
							<td class="textTd1 ">
								<?php 
								 if (isset($child['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']])) {echo $this->escape($child['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']]['OPTIONVALUE']); } 
								?> 
							</td>
							<?php } } ?>
							
							<?php  if ($product['ONSELECT_IDOPTION'] > 0  && !empty($product['ONSELECT_OPTION'])) { ?>
							<td  class="textTh1" > 	
							 	<select name="selectedOption_<?php echo $count; ?>" class="selectedOption form-control">
									<?php 
									$optionsList = $product['ONSELECT_OPTION'];
									foreach($optionsList->values as $currentOption) {  ?>
									<option value="<?php echo $currentOption; ?>">
										<?php echo $currentOption; ?> 
									</option>
									<?php } ?>
								</select> 
							</td>
							<?php } ?>
							
							
							<td align="center" >
							<?php $this->currentData = $child;
								echo $this->render("/produits/ajaxshowpromoprice.phtml"); ?>
							</td>
              <?php if (!$this->isProductOutOfStock) { ?>
							<td class="textTd1  hidden-print" >
								<div class="col-md-8 col-md-offset-2 noPadding">
								<?php  
									if (isset($myCaddy->items))  {
										$myValue = $myCaddy->getQuantity($child['ID']);
									}
								
									?>
									<input onclick="clearById('quantity_<?php echo $this->escape($child['ID']); ?>', '0')" type="text" class="form-control text-center" maxlength="5" name="quantity_<?php echo $this->escape($child['ID']); ?>" id="quantity_<?php echo $this->escape($child['ID']); ?>" value="<?php echo $myValue; ?>" />
									<input type="hidden" name="idChild_<?php echo $count; ?>" value="<?php echo $this->escape($child['ID']); ?>" />
									<input type="hidden" name="qtyMinChild_<?php echo $count; ?>" value="<?php echo $this->escape($child['QUANTITYMIN']); ?>" />
									<input type="hidden" name="isAccessoire_<?php echo $count; ?>" value="N" >
								</div>
							</td>
              <?php } ?>
						</tr>
						<?php $count++; } }
						
						
						
						if (sizeof($product['PRODUCT_ACCESSOIRE']) > 0) {  
					foreach ($product['PRODUCT_ACCESSOIRE']  as $child ) { ?>
					<tr align="center" class="<?php if ($index == 0) {echo 'trStripOdd'; $index=1;} else {$index=0; echo 'trStripEven';} ?>"  >
																
							<td>
									<div style="float: left;">
										<div class="textA1" style="width: auto;"> 
											<?php echo $child['DESIGNATION'];?>
										</div>
										<div class="textA1 productDetail_ref" >
											<div style="float: left;margin: 5px 0 5px 0">
												<?php echo "Ref. ".$this->escape($child['REFERENCE']); ?>
											</div>
											<?php if ($child['isQTEPRIXACTIVE'] && $child['QTEPRIXITEM'] > 0) { ?>
											<div style="float: right;margin: 0 10px 5px 0">
												<a class="btn <?php if(empty($this->prefixPromoClass)) { echo "btn-danger"; } else { echo "btn-success";} ?> tooltips showModalPrice" data-placement="right" href="<?php echo $this->baseUrl; ?>/<?php echo Utils_Tool::getFormattedUrlProduct($product['NAVNOM_URLPARENTS'], $product['NAVNOM'], $product['ID']);?>" title="Nos prix d�gressif" id="item-<?php echo $child['ID']; ?>-<?php echo $child['QTEPRIXITEM'];?>">
													Prix d�gressif
												</a>
							 				</div>
											<?php } ?>
										</div>
									</div>
							</td>
							<?php for($i=0 ; $i < $nbOption; $i++) { 
							if (isset($product['LISTOPTION'][$i]) && isset($product['LISTOPTION'][$i]['NOMOPTION'])) { ?>
							<td class="textTd1">
								<?php 
								 if (isset($child['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']])) {echo $this->escape($child['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']]['OPTIONVALUE']); } 
								?> 
							</td>
							<?php } } ?>
							
							<?php  if ($product['ONSELECT_IDOPTION'] > 0  && !empty($product['ONSELECT_OPTION'])) { ?>
							<td  class="textTh1" > 	
							 	<select name="selectedOption_<?php echo $count; ?>" class="selectedOption form-control">
									<?php 
									$optionsList = $product['ONSELECT_OPTION'];
									foreach($optionsList->values as $currentOption) {  ?>
									<option value="<?php echo $currentOption; ?>">
										<?php echo $currentOption; ?> 
									</option>
									<?php } ?>
								</select> 
							</td>
							<?php } ?>
							
							<td align="center" >
							<?php $this->currentData = $child;
								echo $this->render("/produits/ajaxshowpromoprice.phtml"); ?>
							</td>
            <?php if (!$this->isProductOutOfStock) { ?>
							<td class="textTd1  hidden-print" >
								<div class="col-md-8 col-md-offset-2 noPadding">
								<?php  
									if (isset($myCaddy->items))  {
										$myValue = $myCaddy->getQuantity($child['ID']);
									}
								
									?>
									<input onclick="clearById('quantity_<?php echo $this->escape($child['ID']); ?>', '0')" type="text" class="form-control text-center" maxlength="5" name="quantity_<?php echo $this->escape($child['ID']); ?>" id="quantity_<?php echo $this->escape($child['ID']); ?>" value="<?php echo $myValue; ?>" />
									<input type="hidden" name="idChild_<?php echo $count; ?>" value="<?php echo $this->escape($child['ID']); ?>" />
									<input type="hidden" name="qtyMinChild_<?php echo $count; ?>" value="<?php echo $this->escape($child['QUANTITYMIN']); ?>" />
									<input type="hidden" name="isAccessoire_<?php echo $count; ?>" value="Y" >
								</div>
							</td>
            <?php } ?>
						</tr>
					<?php $count++; }}  ?>
					</tbody>
				</table>
				<input type="hidden" name="nbr" value="<?php echo $count; ?>" />
			</div>
			<div class="col-xs-12 noPadding">
			
				<div class="<?php echo $this->prefixPromoClass; ?>prod-detail-caracs col-sm-6 col-xs-12">
					<a class="showModalDetail tooltips" data-placement="bottom" data-nbrchilds="<?php echo $count;?>" href="<?php echo $this->baseUrl; ?>/<?php echo Utils_Tool::getFormattedUrlProduct($product['NAVNOM_URLPARENTS'], $product['NAVNOM'], $product['ID']);?>" title="Voir toutes les caract�ristiques - <?php echo $this->escape($product['NOM']); ?>">Voir toutes les caract�ristiques</a>
				</div>
				
				
				<div id="productAddFormLog"> </div>
			</div>
  </div>
  </form>
</div>

	<?php echo $this->render("/produits/ajaxannexelist.phtml"); ?>
<script type="text/javascript">
$(function(){
	initEventDetail(); 
}); 
</script> 
<?php } ?>

			PKi$H[��''2views/scripts/produits/ajaxshowchildqteprice.phtmlnu&1i�<?php header('Content-type: text/html; charset=iso-8859-1');
$productQte = $this->detailProductQte; 
if (isset($productQte) && !empty($productQte)) {  
?>  
<link href="<?php echo $this->baseUrl; ?>/business/css/default-bootstrap.css" rel="stylesheet">
    <link href="<?php echo $this->baseUrl; ?>/business/css/default.css" rel="stylesheet">
<style>
html, body {
background-color: white;
}
</style>
<table cellpadding="0" cellspacing="0"   class="prod-detail-ref-table"> 
	<thead>
		<tr align="center"  >
			<th colspan="2"  >Quantit�</th>  
			<th  >Prix unitaire &#8364;</th>  
		</tr> 
		<tr align="center" class="headerQtePrice">
			<th width="70px"   >De</th> 
			<th width="70px"   >�</th> 
			<th width="120px" >HT</th>  
		</tr> 
	</thead>
	<tbody>
	<?php 
		$index = 1;
		foreach($productQte as $row) { ?>
	<tr  class=" <?php if ($index == 0) {echo 'trStripOdd'; $index=1;} else {$index=0; echo 'trStripEven';} ?>" style="height:30px">    
		<td align="center" >
			<span><?php echo $this->escape($row['MIN']);?></span> 
		</td> 
		<td align="center"  >
			<span>
			<?php if ($row['MAX'] <> 999999999) { echo $this->escape($row['MAX']); }
			else {echo "Et Plus"; } ?></span> 
		</td> 
		<td  align="center"  >
			<div class="text12" >
				<?php echo number_format($row['PRIX'], 2, ',', ' ').' ';?>
				<span style="color: #000000">&#8364;</span>
			</div> 
		</td>  
	</tr>
	<?php } ?>
	</tbody>
</table> 
<?php } else { ?>
<div style="clear: both;text-align: center;vertical-align:middle;">Aucun prix d�gressif n'est disponible pour cet article.</div>
<?php } ?>PKi$H[���N
N
.views/scripts/produits/ajaxshowallchilds.phtmlnu&1i�<?php header('Content-type: text/html; charset=iso-8859-1');
$product = $this->detailProduct; 
if (isset($product) && !empty($product)) { 
$nbOption = sizeof($product['LISTOPTION']);
?> 
<link href="<?php echo $this->baseUrl; ?>/business/css/default-bootstrap.css" rel="stylesheet">
    <link href="<?php echo $this->baseUrl; ?>/business/css/default.css" rel="stylesheet">
    <style>
html, body {
background-color: white;
}
</style>
<table border="0" cellpadding="0" cellspacing="0" width="100%" class="prod-detail-ref-table">
	<thead>
	<tr > 
		<th >Produit</th>
			
		<?php for($i=0 ; $i<$nbOption; $i++) { 
		if (isset($product['LISTOPTION'][$i]) && isset($product['LISTOPTION'][$i]['NOMOPTION']) ) {
			?>
		<th  class=" productDetail_option" style="padding: 10px"> 
			<?php echo $this->escape($product['LISTOPTION'][$i]['NOMOPTION']); ?>
		</th>
		<?php }
		} ?>
	</tr>
	</thead>
	<tbody>
	<?php 
	$index = 1;
	$count = 0;
	foreach($product['LISTCHILD'] as $child) { 
		
		?>
	<tr align="center" class="<?php if ($index == 0) {echo 'trStripOdd'; $index=1;} else {$index=0; echo 'trStripEven';} ?>" >
			<td valign="top" >	
			<div class="textA1" style="width: auto;clear:both"> 
				<?php echo $child['DESIGNATION'];?>
			</div>
			<div class="textA1 productDetail_ref" >
				<?php echo "Ref. ".$this->escape($child['REFERENCE']);?>
			</div>
		</td>
		<?php for($i=0 ; $i<$nbOption; $i++) { 
		if (isset($product['LISTOPTION'][$i]) && isset($product['LISTOPTION'][$i]['NOMOPTION'])) { ?>
		<td class="textTd1" >
		
			<?php if ($product['ONSELECT_IDOPTION'] > 0 ) {
					if (($product['LISTOPTION'][$i]['IDOPTION'] == $product['ONSELECT_IDOPTION']) && isset($child['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']])) { ?>
				 	<?php 
					$optionsForChild = explode(";", $this->escape($child['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']]['OPTIONVALUE']));;
					foreach($optionsForChild as $currentOption) {  
						echo $this->escape($currentOption)."<br/><br/>"; 
					} ?> 
			<?php } else {
				if (isset($child['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']])) {echo $this->escape($child['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']]['OPTIONVALUE']); } 
				} 
			} else {
				 if (isset($child['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']])) {echo $this->escape($child['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']]['OPTIONVALUE']); } 
			} ?> 
		</td>
		<?php } } ?> 
	</tr>
	<?php $count++; } ?>	
	 
	<?php  
	foreach ($product['PRODUCT_ACCESSOIRE']  as $childAccessoire ) {  
		?>
	<tr align="center" class="<?php if ($index == 0) {echo 'trStripOdd'; $index=1;} else {$index=0; echo 'trStripEven';} ?>"  >
						 
		<td valign="top" >	
			<div class="textA1" style="width: auto;clear:both"><?php echo $childAccessoire['DESIGNATION'];?></div>

			<div class="textA1 productDetail_ref">
				<?php echo "Ref. ".$this->escape($childAccessoire['REFERENCE']);?>
			</div>
		</td>
		<?php for($i=0 ; $i<$nbOption; $i++) { 
		if (isset($product['LISTOPTION'][$i]) && isset($product['LISTOPTION'][$i]['NOMOPTION'])) { ?>
		<td class="textTd1">
			<?php if (isset($childAccessoire['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']])) {echo $this->escape($childAccessoire['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']]['OPTIONVALUE']); } ?>
		</td>
		<?php } } ?> 
	</tr>
	<?php $count++; }  ?>
	</tbody>
</table>
<?php } ?>PKi$H[�v�oo&views/scripts/produits/monpanier.phtmlnu&1i�

<script  type="text/javascript" >

$(function(){
	initEventsCaddy();
});

</script>
<div class="col-xs-12 caddy-header-box" style="padding-left: 0;">
	<div class="col-xs-10 col-xs-offset-1 caddy_flux" style="padding-left: 0;">
		<div class="caddy_flux_panier_over"></div>
		<div class="caddy_flux_separator"></div>
		<div class="caddy_flux_id"></div>
		<div class="caddy_flux_separator"></div>
		<div class="caddy_flux_livraison"></div>
		<div class="caddy_flux_separator"></div>
		<div class="caddy_flux_validation"></div>
	</div>
</div>
<div id="caddyArea">
<?php echo $this->render("/ajax/ajaxcaddy.phtml"); ?>

</div>PKi$H[����$$+views/scripts/produits/ajaxannexelist.phtmlnu&1i�<?php header('Content-type: text/html; charset=iso-8859-1'); ?>


<?php if (isset($this->listAnnexes) && !empty($this->listAnnexes)) { ?>
<div
	class="col-xs-12 hidden-print <?php echo $this->prefixPromoClass; ?>footer-content-divider"></div>
<div class="col-xs-12 noPadding prod-detail-annexe-box">
<div class="col-xs-12 noPadding">
<div class="productAnnexeLabel" style="color : <?php if(empty($this->prefixPromoClass)) { echo $this->actualDesign['color']; } else { echo "#000";} ?>;">
<h3>Les clients ayant consult� cet article ont �galement regard� ces produits</h3></div>
</div>
<?php
//$color = "none";
$color = $this->actualDesign['color'];
foreach ($this->listAnnexes as $product) {
	$this->currentData = $product;
	echo $this->render("/produits/ajaxshowproductbox.phtml");
}  ?></div>
<?php } ?>PKi$H[ܺP��
�
+views/scripts/produits/ajaxsendfriend.phtmlnu&1i�
 <?php header('Content-Type: text/html; charset=ISO-8859-15'); ?>

<?php if (!$this->isSuccess) { ?>
<?php
	$product = $this->detailProduct;
?>	

    <form id="dialog-form-send-friend" class="white-popup-block-medium mfp-hide form-horizontal" action="<?php echo $this->baseUrl.'/produits/ajaxsendfriend'; ?>" method="post">
	    <script type="text/javascript">
            $(function() {
                initDetailProductDialogSendFriend();
            });
        </script>
        <span class="indexBox4_title2">Conseillez cet article</span>
	    <fieldset style="border:0;">
		    <p>Pour partager cet article, veuillez renseigner le formulaire ci-dessous.</p>
		    
            <?php 
	        $auth = Zend_Auth::getInstance();
	        $auth->setStorage(new Zend_Auth_Storage_Session($this->session_storage));
	        $storage = $auth->getStorage()->read();  
            $currentName = "";
		    if ($auth->hasIdentity() && isset($storage['user'])) {
             $currentName = $storage['user']['prenom'].' '.$storage['user']['nom'];
            }
            ?>
             <div class="form-group">
				<label for="name_friend" class="col-sm-3 control-label">Nom de l'exp�diteur</label>
                 <div class="col-sm-9">
				    <input id="name_friend" name="name_friend" type="text" value="<?php echo $currentName; ?>" placeholder="Nom de l'exp�diteur" class="form-control" required="">
			   </div>
			</div>
			<div class="form-group">
				<label for="email_friend" class="col-sm-3 control-label" >Email de destination</label>
				<div class="col-sm-9">
                     <input id="email_friend" name="email_friend" type="email" placeholder="exemple@domaine.com" class="form-control" required="">
			     </div>
			</div>
             <div class="form-group">
				    <label for="message_friend" class="col-sm-3 control-label">Votre message</label>
                  <div class="col-sm-9">
                    <?php 
                     $linkProd = Utils_Tool::getFormattedUrlProduct($product['NAVNOM_URLPARENTS'], $product['NAVNOM'], $product['ID']);
	                 $linkCat = Utils_Tool::getFormattedUrlCategory($product['NAVNOM_URLPARENTS'], $product['CATNAVNOM'], $product['IDCATEGORY']);
                    
                    ?>
                    <textarea id="message_friend" name="message_friend" class="form-control" rows="10" cols="70">Bonjour,
                      
Voici un produit int�ressant trouv� sur le site <?php echo $this->baseUrl_SiteCommerceUrl; ?> : 

Le nom du produit est : <?php echo $this->escape($product['NOM']); ?>


Pour y acc�der : 

<?php echo $this->baseUrl_SiteCommerceUrl."/".$linkProd; ?>


<?php echo $this->siteName; ?> pr�sente toute une gamme de <?php echo $product['CATNOM'] ?>, � d�couvrir en cliquant sur le lien suivant :

<?php echo $this->baseUrl_SiteCommerceUrl."/".$linkCat; ?>
                    </textarea>
			    </div>
			</div>
			<div class="form-group">
                <div class="col-sm-12 text-center">
                    <input type="submit" class="btn btn-default" value="Envoyer le mail" /> 
                    <input type="hidden" name="product_id_friend" value="<?php echo $product['ID']; ?>" /> 
                    </div> 
			</div> 
	    </fieldset>
    </form>

<?php } else { ?>
<div class="white-popup-block-medium">
    <div class="text-center">
        <?php echo $this->message ;?><br /><br />
    </div> 
    <div class="text-center">
        <input type="button" class="btn btn-danger" value="Fermer" onclick="$.magnificPopup.close();" /> 
    </div> 
</div> 
<?php } ?>PKi$H[��>��,views/scripts/produits/categorie_gamma.phtmlnu&1i�<?xml version="1.0" encoding="Windows-1252"?>

<?php  
	$currentCat = array();
	$currentCat = $this->currentCat;
?> 

<?php if (isset($currentCat['ID_THEME']) && $currentCat['ID_THEME'] == 2) {
	
	echo $this->render("/index/index.phtml");
	
} else { ?>

	<div id="page">

	<?php   
		if (isset($currentCat['NOM']) && !empty($currentCat['NOM'])) { ?>
		<div class="big_header"><h1 class="big_header"><?php echo $currentCat['NOM'];  ?></h1></div>
	<?php } 

	if (isset($currentCat['ID_THEME']) && !empty($currentCat['ID_THEME']) && isset($this->listAllGalleries) && !empty($this->listAllGalleries)) { ?>

	<?php
		$currentTheme = (int)$currentCat['ID_THEME'];
		$currentWithThumb = 0;
		if (isset($this->FeatureSiteThemeCms) && !empty($this->FeatureSiteThemeCms)) { 
			foreach ($this->FeatureSiteThemeCms as $row) { 
				if ($row['ID_THEME'] == $currentTheme && isset($row['WIDTH_THUMB']) && $row['WIDTH_THUMB'] > 0) {
					$currentWithThumb = $row['WIDTH_THUMB'];
					break;
				}
			} 
		}
		
		switch ($currentTheme) { 
			case 3: 
			case 4: 
			case 5:
			?>
			
        <link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/business/light/gamma/css/style.css"/>
		
        <link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/business/light/gamma/css/stylesite.css"/>
		<script src="<?php echo $this->baseUrl; ?>/business/light/gamma/js/modernizr.custom.70736.js"></script>
		<noscript><link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/business/light/gamma/css/noJS.css"/></noscript>
		<script src="<?php echo $this->baseUrl; ?>/business/light/gamma/js/jquery.masonry.min.js"></script>
		<script src="<?php echo $this->baseUrl; ?>/business/light/gamma/js/js-url.min.js"></script>
		<script src="<?php echo $this->baseUrl; ?>/business/light/gamma/js/jquerypp.custom.js"></script>
		<script src="<?php echo $this->baseUrl; ?>/business/light/gamma/js/gamma.js"></script>
		
		
			<div id="page_top"></div>
			<div class="scroll-pane">
				<div class="page_block">
					<div class="gamma-container gamma-loading" id="gamma-container">

						<ul class="gamma-gallery">

						<?php foreach ($this->listAllGalleries as $row) { 
							if (!empty($row['URL'])) { ?>
							<li>
								<div data-alt="<?php echo $this->escape($row['CONTENT_SHORT']);?>" data-max-width="1800" data-max-height="1350">
									<div data-src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 641);?>" data-min-width="700"></div>
									<div data-src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 295);?>" data-min-width="300"></div>
									<div data-src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 0);?>"></div>
									<noscript>
										<img src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 0);?>" alt="<?php echo $this->escape($row['CONTENT_SHORT']);?>"/>
									</noscript>
								</div>
							</li>
						<?php } } ?>
						</ul>

					<div class="gamma-overlay"></div> 
				</div>
			</div>
			

		<script type="text/javascript">
			
			$(function() {

				var GammaSettings = { 
						viewport : [ {
							width : 600,
							columns : 3
						}, { 
							width : 0,
							columns : 2
						} ]
				};

				Gamma.init( GammaSettings, fncallback );
  
				function fncallback() {  }

			});

		</script>	
		
			<?php
				break;
			case 6:?>
			<div id="page_top"></div>
			<div class="scroll-pane">
				<div class="page_block">
					<p class="margin_1line">&nbsp;</p>
					<p class="margin_1line margin_bottom_1line"><?php echo $currentCat['DESCRIPTION']; ?></p>
					<div class="responsiveslides-div" style="width:641px; height: 404px;">
						<ul class="rslides">
						<?php foreach ($this->listAllGalleries as $row) { 
							if (!empty($row['URL'])) { ?>
							<li><img src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], $currentWithThumb);?>" /></li>
						<?php } } ?>  
						</ul>
					</div>	
				</div>
				<div class="page-footer">&copy; <?php echo $this->siteName; ?></div>
			</div>		
				<?php
				break;
		}
	} else if (isset($this->listAllArticles) && !empty($this->listAllArticles)) { ?>

			<div class="submenu">
			<?php foreach ($this->listAllArticles as $row) { 
				if (!empty($row['CONTENT_SHORT'])) { ?>
				<a href="#article-<?php echo $row['ID'];  ?>" class="custom_font filter"><?php echo $row['CONTENT_SHORT'];  ?></a>
			<?php }
			} ?>
			</div>
			<div class="scroll-pane">
				<div class="page_block">

					<?php foreach ($this->listAllArticles as $row) { ?>
					<div id="article-<?php echo $row['ID'];  ?>">
						<?php echo $row['CONTENT']; ?>
					</div>
					<?php } ?>
					<div class="clear"></div>
				</div>
				<div class="page-footer">&copy; <?php echo $this->siteName; ?></div>
			</div>

	<?php } ?>
	</div>
<?php } ?>
		PKi$H[�ceRR'views/scripts/produits/ajaxfacets.phtmlnu&1i�

<?php  
  $listFacets = $this->listSearchFacets;  
  $facetPosition = 0;
if (!empty($listFacets) && !empty($listFacets)) {?>
  <form action="<?php echo $this->baseUrl; ?>/produits/recherche" method="post" id="searchfacet">
    <input type="hidden" value="<?php echo $this->searchKey; ?>>" name="key" />
    <div class="facet-main" id="facet-main">
	    <?php foreach ($listFacets as $row) { 
       $facetPosition++;
        if (isset($row->Values->ProductFacetValue)) { 
          $displayUl = "none";
          if ($facetPosition < 4 || $row->IsSelected) {
            $displayUl="block";
          }
        ?>
        <div class="facet-content">
          <div class="facet-name"><?php echo $row->Name; ?></div>
          <ul style="display:<?php echo $displayUl; ?>">
	        <?php
          
            $facetValue = array();
            if (!is_array($row->Values->ProductFacetValue)) { 
                array_push($facetValue, $row->Values->ProductFacetValue); 
            } else {
                $facetValue = $row->Values->ProductFacetValue;
            }
            
            $count = 1; 
            foreach ($facetValue as $rowValue) { 
              $idFacet =  $row->Id."_".$count;
            ?>
              <li>
                <input type="checkbox" name="facet_<?php echo $idFacet;  ?>" 
                id="facet_<?php echo $idFacet; ?>" 
                onclick="selectCurrentFacetSubmit()" 
                value="<?php echo $rowValue->Value; ?>" 
                <?php if ($rowValue->IsSelected) { echo "checked"; } ?> /> 
                <a href="javascript:;" class="facet-value-link" onclick="selectCurrentFacet('facet_<?php echo $idFacet; ?>');"><?php echo $rowValue->Value; ?></a> 
              </li>
            <?php $count++; } ?>
          
          </ul>
        </div>
      <?php }
      } ?>
    </div>
  </form>
<?php } ?> PKi$H[�q��&views/scripts/produits/catalogue.phtmlnu&1i�Catalogue ou ConnexionPKi$H[
����4views/scripts/produits/categorie_default_theme.phtmlnu&1i�<?xml version="1.0" encoding="Windows-1252"?>


<?php  
	$currentCat = array();
	$currentCat = $this->currentCat;
?> 

<?php if (isset($currentCat['ID_THEME']) && $currentCat['ID_THEME'] == 2) {
	
	echo $this->render("/index/index.phtml");
	
} else { ?>

	<div id="page">

	<?php   
		if (isset($currentCat['NOM']) && !empty($currentCat['NOM'])) { ?>
		<div class="big_header"><h1 class="big_header"><?php echo $currentCat['NOM'];  ?></h1></div>
	<?php } 

	if (isset($currentCat['ID_THEME']) && !empty($currentCat['ID_THEME']) && isset($this->listAllGalleries) && !empty($this->listAllGalleries)) { ?>

	<?php
		$currentTheme = (int)$currentCat['ID_THEME'];
		$currentWithThumb = 0;
		if (isset($this->FeatureSiteThemeCms) && !empty($this->FeatureSiteThemeCms)) { 
			foreach ($this->FeatureSiteThemeCms as $row) { 
				if ($row['ID_THEME'] == $currentTheme && isset($row['WIDTH_THUMB']) && $row['WIDTH_THUMB'] > 0) {
					$currentWithThumb = $row['WIDTH_THUMB'];
					break;
				}
			} 
		}
		
		switch ($currentTheme) { 
			case 3:
			?>
			<div id="page_top"></div>
			<div class="scroll-pane">
				<div class="page_block">
					<ul class="portfolio2c margin_1line" id="portfolio-list">	
						<?php foreach ($this->listAllGalleries as $row) { 
							if (!empty($row['URL'])) { ?>
						<li class="category2 category3">
							<div class="item">
								<img style="width:310px;" src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], $currentWithThumb);?>" alt="<?php echo $this->escape($row['CONTENT_SHORT']);?>"/>
								<a class="gallery_group" rel="gallery_group" href="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 0);?>" title="<?php echo $this->escape($row['CONTENT_LONG']);?>">
								</a>
								<div class="details">
									<div class="mblogfooter2 custom_font"><p><?php echo $this->escape($row['CONTENT_SHORT']);?></p></div>
								</div>				
							</div>
						</li>
						<?php } } ?>
					</ul>
				</div>
				<div class="page-footer">&copy; <?php echo $this->siteName; ?></div>
			</div>
			<?php
				break;
			case 4:
			?>
			<div id="page_top"></div>
			<div class="scroll-pane">
				<div class="page_block">
					<ul class="portfolio3c margin_1line" id="portfolio-list">	
						<?php foreach ($this->listAllGalleries as $row) { 
							if (!empty($row['URL'])) { ?>
						<li class="category2 category3">
							<div class="item">
								<img style="width:200px;" src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], $currentWithThumb);?>" alt="<?php echo $this->escape($row['CONTENT_SHORT']);?>"/>
								<a class="gallery_group" rel="gallery_group" href="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 0);?>" title="<?php echo $this->escape($row['CONTENT_LONG']);?>">
								</a>
								<div class="details">
									<div class="mblogfooter2 custom_font"><p><?php echo $this->escape($row['CONTENT_SHORT']);?></p></div>
								</div>				
							</div>
						</li>
						<?php } } ?>
					</ul>
				</div>
				<div class="page-footer">&copy; <?php echo $this->siteName; ?></div>
			</div>
			<?php
				break;
			case 5:
			?>
			<div id="page_top"></div>
			<div class="scroll-pane">
				<div class="page_block">
					<ul class="portfolio4c margin_1line" id="portfolio-list">	
						<?php foreach ($this->listAllGalleries as $row) { 
							if (!empty($row['URL'])) { ?>
						<li class="category2 category3">
							<div class="item">
								<img style="width:142px;" src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], $currentWithThumb);?>" alt="<?php echo $this->escape($row['CONTENT_SHORT']);?>"/>
								<a class="gallery_group" rel="gallery_group" href="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], 0);?>" title="<?php echo $this->escape($row['CONTENT_LONG']);?>">
								</a>
								<div class="details">
									<div class="mblogfooter2 custom_font"><p><?php echo $this->escape($row['CONTENT_SHORT']);?></p></div>
								</div>				
							</div>
						</li>
						<?php } } ?>
					</ul>
				</div>
				<div class="page-footer">&copy; <?php echo $this->siteName; ?></div>
			</div>
			<?php
				break;
			case 6:?>
			<div id="page_top"></div>
			<div class="scroll-pane">
				<div class="page_block">
					<p class="margin_1line">&nbsp;</p>
					<p class="margin_1line margin_bottom_1line"><?php echo $currentCat['DESCRIPTION']; ?></p>
					<div class="responsiveslides-div" style="width:641px; height: 404px;">
						<ul class="rslides">
						<?php foreach ($this->listAllGalleries as $row) { 
							if (!empty($row['URL'])) { ?>
							<li><img src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($row['URL'], $currentWithThumb);?>" /></li>
						<?php } } ?>  
						</ul>
					</div>	
				</div>
				<div class="page-footer">&copy; <?php echo $this->siteName; ?></div>
			</div>		
				<?php
				break;
		}
	} else if (isset($this->listAllArticles) && !empty($this->listAllArticles)) { ?>

			<div class="submenu">
			<?php foreach ($this->listAllArticles as $row) { 
				if (!empty($row['CONTENT_SHORT'])) { ?>
				<a href="#article-<?php echo $row['ID'];  ?>" class="custom_font filter"><?php echo $row['CONTENT_SHORT'];  ?></a>
			<?php }
			} ?>
			</div>
			<div class="scroll-pane">
				<div class="page_block">

					<?php foreach ($this->listAllArticles as $row) { ?>
					<div id="article-<?php echo $row['ID'];  ?>">
						<?php echo $row['CONTENT']; ?>
					</div>
					<?php } ?>
					<div class="clear"></div>
				</div>
				<div class="page-footer">&copy; <?php echo $this->siteName; ?></div>
			</div>

	<?php } ?>
	</div>
<?php } ?>
		PKi$H[8Tlq��/views/scripts/produits/ajaxshowpromoprice.phtmlnu&1i�<?php header('Content-type: text/html; charset=iso-8859-1');

if ($this->currentData) {
	$currentData = $this->currentData;
if ($currentData['isDEVIS'] == 1) { 
			if ($currentData['isPROMO'] == 0) { ?> 
			<div class="productDetail_priceBox" <?php if ($currentData['PROMOPRIX'] > 999) { echo 'style="width:165px;"'; } ?>>   
		 		<div class="productDetail_promoImag hidden-print" >
					<img class="tooltips" data-placement="bottom" src="<?php echo $this->baseUrl; ?>/business/image/promo.png" alt="Ce produit est en promotion" title="Ce produit est en promotion" >
				</div>
		 		<div class="productDetail_price" >
			 		 <div class="text12" >
					 	<?php echo number_format($currentData['PROMOPRIX'], 2, ',', ' ').' ';?>
					 	<span style="color: #000000">&#8364;</span> 
					 </div>
					 <div>
					 	<span class='oldPromoPrice'> <?php echo number_format($currentData['PRIX'], 2, ',', ' ').' ';?>&#8364;</span>
					 </div>
		 		</div> 
			</div>
		<?php } else { ?> 
				<div class="text12" >
					<?php echo number_format($currentData['PRIX'], 2, ',', ' ').' ';?>
					<span style="color: #000000">&#8364;</span>
				</div> 
		<?php } 
	 } else { ?> 
			<div  class="text12">
				<span>sur devis</span>
			</div> 
	<?php }} ?>PKi$H[x��-views/scripts/produits/nosmarquesdetail.phtmlnu&1i�
<?php $brend = $this->brends; ?>
<div class="page-header">
  <div class="col-xs-6 col-md-3">
    <a href="#" class="thumbnail">
      <img src="<?php echo $this->baseUrl."/".$brend["URL"]; ?>" alt="<?php echo $brend["BREND"]; ?>" />
    </a>
  </div>
  <h1><?php echo $brend["BREND"]; ?><small><?php echo $brend["DESCRIPTIONSHORT"]; ?></small></h1>
  <p><?php echo $brend["DESCRIPTIONLONG"]; ?></p>
</div>PKi$H[��9\\&views/scripts/produits/recherche.phtmlnu&1i�

<div id="productContainer" class="col-md-12 noPadding">

<?php 
$listProducts = array();
$listProducts = $this->listSearchPages;
$listCat = array();
$listCat = $this->listCat;

echo $this->render("/produits/ajaxfacets.phtml");
?>

<div class="col-md-12 prod-detail-title-box noPadding" id="prod-search-title">
	<h1 class="prod-detail-title ">
		<?php if (sizeof($listProducts) == 0) { 
			if (strlen($this->searchKey) > 0) { ?>
			<span >Votre recherche de "<span ><?php echo $this->searchKey; ?></span>" n'a retourn�e aucun r�sultats </span>
			<?php } else { ?>
			<span >Votre recherche n'a retourn�e aucun r�sultats </span>
			<?php }
		} else { ?>
			<span>R�SULTATS DE LA RECHERCHE : "<span ><?php echo $this->searchKey; ?></span>"</span>
		<?php } ?>
	</h1>
</div>


  <div id="productContents">
    <?php
  if (!empty($listProducts)) { 
	  foreach ($listProducts as $row) {
		  $this->currentData = $row;
		  echo $this->render("/produits/ajaxshowproductbox.phtml");
	  } 
  } 
  ?>
  </div>

  <script type="text/javascript">
  $(document).ready(function() {
    initSearch();
    });
  </script>

</div>
PKi$H[~$��4�4)views/scripts/produits/detailmobile.phtmlnu&1i�
<?php
$product = $this->detailProduct;
$userNamespace = new Zend_Session_Namespace($this->session_variable);
$myCaddy = $userNamespace->myObjectCaddy;
$nbOption = 3;
?>
 <style>
   .productPriceDetailBox {
    position:relative;
   }
 </style>

  <div class="col-xs-12 prod-detail-box noPadding">
    <div class="col-xs-12 prod-detail-title-box noPadding"> 
      <div class="noPadding">
        <h1 class="prod-detail-title "><?php echo $this->escape($product['NOM']); ?></h1>
      </div>
    </div>
    
    <div class="col-xs-12 noPadding">
      <div class='prod-detailimg-mobile-content'>
          <div class='prod-detailimg-mobile-main' style='<?php $width = 300 * sizeof($product['LISTPICS']); echo 'width:'.$width.'px';  ?>'>
            <ul >
              <?php    foreach ($product['LISTPICS'] as $pic) { ?>
	                <li class='prod-detailimg-mobile-content-li'>
                      <div class="col-xs-12">
                        <?php if (!empty($pic['STRING1'])) {  
			                    echo $pic['STRING1'].'<br/>';
		                    } if (!empty($pic['STRING2'])) {
			                    echo $pic['STRING2'] ;
		                    } ?>
                      </div>
                      <div class="col-xs-12 prod-detailimg-mobile noPadding">
                        <center><a href="<?php echo $this->baseUrl.'/'.$pic['URL']; ?>" title="<?php echo $this->escape($pic['STRING1'].' '.$pic['STRING2']) ; ?>">
                          <img src="<?php echo $this->baseUrl.'/'.$pic['URL']; ?>" alt="<?php echo $this->escape($pic['STRING1']) ; ?>" />
                        </a></center>
                      </div>
                  </li>
		            <?php } ?>
            </ul>
          </div>
      </div>
      
      <div  class="col-xs-12">
          <?php $url = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]; ?>
          <a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=<?php echo $url; ?>" class="btn btn-facebook"><i class="fa fa-facebook"></i></a>
          <a target="_blank" href="https://plus.google.com/share?url=<?php echo $url; ?>" class="btn btn-google-plus"><i class="fa fa-google-plus"></i></a>
          <a target="_blank" href="https://twitter.com/home?status=<?php echo $url; ?>" class="btn btn-twitter"><i class="fa fa-twitter"></i></a>
          <a target="_blank" href="https://www.linkedin.com/shareArticle?mini=true&url=<?php echo $url; ?>&title=<?php echo utf8_encode($this->escape($product['NOM'])); ?>&summary=<?php echo utf8_encode($this->escape($product['DESCSHORT'])); ?>&source=<?php echo $this->baseUrl_SiteCommerceUrl; ?>" class="btn btn-linkedin"><i class="fa fa-linkedin"></i></a>
        
          <?php  if ($this->FeatureProductSendDetail) { ?>
            <a href="#dialog-form-send-friend" class="btn btn-default popup-with-form-send-friend"><i class="fa fa-envelope"></i> Conseillez cet article</a>
          <?php  } ?>
      </div>
  </div>
  
    
  <div class="col-xs-12 prod-detail-title ">Nos R�f�rences</div>
    
  <div class="col-xs-12">
      <form id="productAddForm" action="<?php echo $this->baseUrl; ?>/produits/ajaxaddpanier/<?php echo $product['NAVNOM']; ?>/p/<?php echo $product['ID']; ?>" method="post">
        <input type="hidden" name="idProd" id="idProd" value="<?php echo $this->escape($product['ID']); ?>" />
          <?php
	        $index = 1;
	        $count = 0;
	        if (sizeof($product['LISTCHILD']) > 0) {
		        foreach($product['LISTCHILD'] as $child) {  
						    if (isset($child['DESIGNATION']) && !empty($child['DESIGNATION'])) { ?>
			    <div class="col-xs-12"><?php echo $child['DESIGNATION'];?> ( Ref. <?php echo $this->escape($child['REFERENCE']); ?> )</div>
          
          <?php for($i=0 ; $i<$nbOption; $i++) {
				    if (isset($product['LISTOPTION'][$i]) && isset($product['LISTOPTION'][$i]['NOMOPTION']) && isset($child['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']])) { ?>
			      <div class="col-xs-12 noPadding" style="margin-top:10px;">
              <div class="col-xs-6 noPadding"><b><?php echo $this->escape($product['LISTOPTION'][$i]['NOMOPTION']); ?> : </b></div>
              <div class="col-xs-6 noPadding">
                <?php echo $this->escape($child['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']]['OPTIONVALUE']);  ?>
              </div>
            </div>
			    <?php } } ?>
          
          
			    <?php  if ($product['ONSELECT_IDOPTION'] > 0  && !empty($product['ONSELECT_OPTION'])) { ?>
			    <div class="col-xs-12 noPadding"  style="margin-top:10px;">
            <div class="col-xs-6 noPadding"><b><?php  $optionsList = $product['ONSELECT_OPTION']; echo $optionsList->name; ?> : </b></div>
            <div class="col-xs-6 noPadding">
              <select name="selectedOption_<?php echo $count; ?>" class="selectedOption form-control">
				        <?php
				            foreach($optionsList->values as $currentOption) {  ?>
				            <option value="<?php echo $currentOption; ?>"><?php echo $currentOption; ?></option>
				        <?php } ?>
			        </select>
             </div>
          </div>
			    <?php } ?>
          
          <div class="col-xs-12 noPadding"  style="margin-top:10px;">
            <?php if (!$this->isProductOutOfStock) { ?>
			        <div class="col-xs-6 noPadding">
                <div class="col-xs-6 noPadding"><b>Quantit� : </b></div>
                <div class="col-xs-6 noPadding">
                    <?php  if (isset($myCaddy->items))  { $myValue = $myCaddy->getQuantity($child['ID']); } ?> 
                  <input onclick="clearById('quantity_<?php echo $this->escape($child['ID']); ?>', '0')"
				          type="text" class="form-control text-center" maxlength="5" name="quantity_<?php echo $this->escape($child['ID']); ?>"
				          id="quantity_<?php echo $this->escape($child['ID']); ?>" value="<?php echo $myValue; ?>" /> 
                  <input type="hidden" name="idChild_<?php echo $count; ?>" value="<?php echo $this->escape($child['ID']); ?>" /> 
                  <input type="hidden" name="qtyMinChild_<?php echo $count; ?>" value="<?php echo $this->escape($child['QUANTITYMIN']); ?>" /> 
                  <input type="hidden" name="isAccessoire_<?php echo $count; ?>" value="N">
                </div>
              </div>
            <?php } ?>
            <div>
              <?php $this->currentData = $child; echo $this->render("/produits/ajaxshowpromoprice.phtml"); ?>
            </div>
          </div>
          
          <div class="col-xs-12 noPadding">
            <div class="col-xs-12 noPadding">
              <?php if (!$this->isProductOutOfStock) { ?>
                <div class="col-xs-12 noPadding text-center">
                  <button type="submit" class="btn btn-success btn-lg">
                    <img id="prod-detail-add-btn" src="<?php echo $this->baseUrl; ?>/business/image/add-caddy.png" class="glyphicon-caddy" /> AJOUTER AU PANIER
                  </button> 
                </div> 
              <?php } else { ?>
                <span class="btn btn-success btn-lg">Le produit est �puis�</span>
              <?php } ?>
            </div>
          </div>
		  <?php $count++; } } } ?>
    
    <?php
	        if (sizeof($product['PRODUCT_ACCESSOIRE']) > 0) {
		        foreach($product['PRODUCT_ACCESSOIRE'] as $child) {  
						    if (isset($child['DESIGNATION']) && !empty($child['DESIGNATION'])) { ?>
			    <div class="col-xs-12"><?php echo $child['DESIGNATION'];?> ( Ref. <?php echo $this->escape($child['REFERENCE']); ?> )</div>
          
          <?php for($i=0 ; $i<$nbOption; $i++) {
				    if (isset($product['LISTOPTION'][$i]) && isset($product['LISTOPTION'][$i]['NOMOPTION']) && isset($child['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']])) { ?>
			      <div class="col-xs-12 noPadding" style="margin-top:10px;">
              <div class="col-xs-6 noPadding"><b><?php echo $this->escape($product['LISTOPTION'][$i]['NOMOPTION']); ?> : </b></div>
              <div class="col-xs-6 noPadding">
                <?php echo $this->escape($child['OPTION_VALUES'][$product['LISTOPTION'][$i]['IDOPTION']]['OPTIONVALUE']);  ?>
              </div>
            </div>
			    <?php } } ?>
          
          
			    <?php  if ($product['ONSELECT_IDOPTION'] > 0  && !empty($product['ONSELECT_OPTION'])) { ?>
			    <div class="col-xs-12 noPadding"  style="margin-top:10px;">
            <div class="col-xs-6 noPadding"><b><?php  $optionsList = $product['ONSELECT_OPTION']; echo $optionsList->name; ?> : </b></div>
            <div class="col-xs-6 noPadding">
              <select name="selectedOption_<?php echo $count; ?>" class="selectedOption form-control">
				        <?php
				            foreach($optionsList->values as $currentOption) {  ?>
				            <option value="<?php echo $currentOption; ?>"><?php echo $currentOption; ?></option>
				        <?php } ?>
			        </select>
             </div>
          </div>
			    <?php } ?>
          
          <div class="col-xs-12 noPadding"  style="margin-top:10px;">
            <?php if (!$this->isProductOutOfStock) { ?>
			        <div class="col-xs-6 noPadding">
                <div class="col-xs-6 noPadding"><b>Quantit� : </b></div>
                <div class="col-xs-6 noPadding">
                    <?php  if (isset($myCaddy->items))  { $myValue = $myCaddy->getQuantity($child['ID']); } ?> 
                  <input onclick="clearById('quantity_<?php echo $this->escape($child['ID']); ?>', '0')"
				          type="text" class="form-control text-center" maxlength="5" name="quantity_<?php echo $this->escape($child['ID']); ?>"
				          id="quantity_<?php echo $this->escape($child['ID']); ?>" value="<?php echo $myValue; ?>" /> 
                  <input type="hidden" name="idChild_<?php echo $count; ?>" value="<?php echo $this->escape($child['ID']); ?>" /> 
                  <input type="hidden" name="qtyMinChild_<?php echo $count; ?>" value="<?php echo $this->escape($child['QUANTITYMIN']); ?>" /> 
                  <input type="hidden" name="isAccessoire_<?php echo $count; ?>" value="Y">
                </div>
              </div>
            <?php } ?>
            <div>
              <?php $this->currentData = $child; echo $this->render("/produits/ajaxshowpromoprice.phtml"); ?>
            </div>
          </div>
          
          <div class="col-xs-12 noPadding">
            <div class="col-xs-12 noPadding">
              <?php if (!$this->isProductOutOfStock) { ?>
                <div class="col-xs-12 noPadding text-center">
                  <button type="submit" class="btn btn-success btn-lg">
                    <img id="prod-detail-add-btn" src="<?php echo $this->baseUrl; ?>/business/image/add-caddy.png" class="glyphicon-caddy" /> AJOUTER AU PANIER
                  </button> 
                </div> 
              <?php } else { ?>
                <span class="btn btn-success btn-lg">Le produit est �puis�</span>
              <?php } ?>
            </div>
          </div>
		  <?php $count++; } } } ?>
          
      <input type="hidden" name="nbr" value="<?php echo $count; ?>" />
      <div id="productAddFormLog"></div>
    </form>
  </div> 
    
  <div class="col-xs-12 noPadding"> 
      <div class="col-xs-12">
        <?php if ($this->escape($product['BRENDURL']) && $product['isSHOWBREND'] == 0) {?>
          <img class="prod-detail-brend tooltips" title="<?php echo $this->escape($product['BREND']); ?>"
	          src="<?php echo $this->baseUrl.'/'.$product['BRENDURL']; ?>"
	          alt="<?php echo $product['BREND']; ?>"
	          title="<?php echo $product['BREND']; ?>" /> 
        <?php } 
        if ($product['isQTEPRIXACTIVE']) { ?>
          <img class="tooltips" data-placement="right"
	          alt="D�couvrez nos prix d�gressif" title="D�couvrez nos prix d�gressif"
	          src="<?php echo $this->baseUrl; ?>/business/image/header/degressif2.png">
	      <?php } ?>
        <div class="prod-detail-price">
          <?php if ($product['isDEVISPRODUCT'] == 1) { ?>
            <div class="productPriceDetailBox"><span class="productPriceTitle" style="float: right;">� partir de</span><br />
              <span class="productPriceDetail"><?php echo number_format($product['PRIXLOWEST'], 2, ',', ' ').' '; ?> &#8364;</span> <span class="productPriceDetailHT" style="float: right;"> HT</span></div>
	        <?php } else { ?>
            <div class="productPriceDetailBox"><span class="productPriceTitle" style="margin-left: 10px; margin-top: 5px">Sur devis</span></div>
	        <?php } ?>
        </div>
      
        <h2 class="prod-detail-desc"><?php echo strip_tags($product['DESCSHORT']); ?></h2>
      </div> 
      <?php if (!empty($product['DESCLONG'])) { ?>
      <div class="col-xs-12 prod-detail-title ">Description</div>
      <div class="col-xs-12"> 
          <?php echo $product['DESCLONG']; ?>
      </div>
      <?php } ?>
      <?php if (!empty($product['DESCTECH'])) { ?>
      <div class="col-xs-12 prod-detail-title ">Informations techniques</div>
      <div class="col-xs-12"> 
          <?php echo $product['DESCTECH']; ?>
      </div>
      <?php } ?>
      <?php if (!empty($product['DESCNORME'])) { ?>
      <div class="col-xs-12 prod-detail-title ">Normes</div>
      <div class="col-xs-12"> 
          <?php echo $product['DESCNORME']; ?>
      </div>
      <?php } ?>
  </div>
  <script type="text/javascript">
  $(function(){
	  initEventDetail(); 
  }); 
  </script> PKi$H[�J����/views/scripts/produits/ajaxshowproductbox.phtmlnu&1i�<?php header('Content-type: text/html; charset=iso-8859-1');

$prefixClass = $this->prefixPromoClass;

if ($this->currentData) {
	$row = $this->currentData;
	$paginationPage = "";
	if (!empty($this->currentPaginationPage)) {
		$paginationPage = "prod-pagination prod-pagination-".$this->currentPaginationPage;
	}
	$link = "";
	if(isset($row['PRODUCT_URL'])) {
		$link = $this->baseUrl."/".$row['PRODUCT_URL'];
	} else if (isset($row['NAVNOM'])) {
		$link = $this->baseUrl."/".Utils_Tool::getFormattedUrlProduct($row['NAVNOM_URLPARENTS'], $row['NAVNOM'], $row['ID']);
	} else if (isset($row['PRODNAVNOM'])){
		$link = $this->baseUrl."/".Utils_Tool::getFormattedUrlProduct($row['NAVNOM_URLPARENTS'], $row['PRODNAVNOM'], $row['ID']);
	}
		$name = $this->escape($row['NOM']);
		$desc = $row['DESCSHORT'];
		$nametitle = $name;
		$brendurl= '';
		if ($row['isSHOWBREND'] == 0) {
			$nametitle =  strtoupper($row['BREND'].' - ').$name;
			$brendurl = $row['BRENDURL'];
		} 
		$nametitle = $this->escape($nametitle);

		$filter = new Zend_Filter();
		$filter	->addFilter(new Zend_Filter_StripTags())
		->addFilter(new Zend_Filter_StringTrim());
		$descFiltered = $filter->filter($desc);
	?>	
 
 <div class="col-md-3 col-sm-4 col-xs-12 categorieBoxContent  <?php echo $paginationPage; ?>">
		<div class="productBox text-center">
			<div class="col-xs-12 productHeader noPadding">
				<?php  if ($row['isSHOWBREND'] == 0) { ?>
					<img src="<?php echo '/'.$this->escape($row['BRENDURL']); ?>" alt="<?php echo $nametitle; ?>"/>
				<?php } ?>
				<?php if ($row['isPROMO'] == 0) { ?>
					<div >
						<img class="tooltips" data-placement="top" alt="Ce produit est en promotion" title="Ce produit est en promotion" src="<?php echo $this->baseUrl; ?>/business/image/promo.png" />
					</div>
				<?php } else if ($row['isPRIXDEGRESSIF']) { ?>
					<div>
						<img alt="Les prix sont d�gressifs" src="<?php echo $this->baseUrl; ?>/business/image/prixdeg.png" />
					</div>
				<?php } ?>
			
				<?php if ($row['isDEVISPRODUCT'] == 1) { ?>
					<div class="productPriceBox">
						<span class="<?php echo $prefixClass; ?>productPriceTitle" >� partir de</span><br />
						<span class="<?php echo $prefixClass; ?>productPrice" ><?php echo number_format($row['PRIXLOWEST'], 2, ',', ' ').' '; ?> &#8364;</span>
						<span class="<?php echo $prefixClass; ?>productPriceHT">HT</span>
					</div>
				<?php } else { ?>
					<div class="productPriceBox">
						<span  class="productPrice" style="margin-left: 10px; margin-top: 5px">Sur devis</span>
					</div>
				<?php } ?>
			</div>
			<div class="col-xs-12 noPadding">
				<center><a title="<?php echo $descFiltered;?>" class="tooltips" data-placement="bottom" href="<?php echo $link;?>" >
					<span class="categorieBoxImg">
						<img src="<?php echo '/'.$this->escape($row['URL']); ?>" alt="<?php echo $nametitle; ?>"/>
					</span>
				</a></center>
			</div>
			<div class="col-xs-12 noPadding  text-left">
				<div class="productBoxTitleContent">
					<a class="productBoxTitle"  href="<?php echo $link;?>" >
						<?php echo $name; ?>
					</a>
				</div>
			</div>
			<div class="col-xs-12 productBoxDesc text-left">
				<?php echo $desc; ?>
			</div>
			<div class="col-xs-12 productBoxTitleSubContent">
				<a class="col-xs-12 <?php echo $prefixClass; ?>productBoxTitleGo tooltips" data-placement="bottom" title="<?php echo $nametitle;?>" href="<?php echo $link;?>" >
					Voir la fiche produit
					<?php 
						$filter = new Zend_Filter();
						$filter	->addFilter(new Zend_Filter_StripTags())
						->addFilter(new Zend_Filter_StringTrim());
					?>
					<img src="/business/image/<?php echo $prefixClass; ?>category-icon.png" alt="<?php echo $descFiltered; ?>"  style="margin-left: 15px;">
				</a>	
			</div>
		</div>
	</div>

<?php } ?>PKi$H[f�	33'views/scripts/produits/nosmarques.phtmlnu&1i�
<div>
  <div class="col-xs-12 prod-detail-title-box noPadding">
      <h1 class="prod-detail-title ">
        Nos marques
      </h1>
  </div>
  
  <?php
  foreach ($this->brends as $row) { 
  $link = $this->baseUrl."/nos-marques/".Utils_Tool::generateNavigationString($row['BREND'])."-".$row['IDBREND'].".html";
  ?>
  <div class="col-md-3 col-sm-4 col-xs-6 categorieBoxContent nolink">
    <a href="<?php echo $link; ?>">
    <div class="productBox text-center">
      <div class="col-xs-10 col-xs-offset-1 noPadding">
          <span class="categorieBoxImg">
            <img src="<?php echo $this->baseUrl; ?>/<?php echo $this->escape($row['URL']); ?>" alt="<?php echo $row['BREND']; ?>"/>
          </span>
      </div>
      <div class="col-xs-12 noPadding  text-left">
        <div class="productBoxTitleContent">
            <?php echo $row['BREND']; ?>
        </div>
      </div>
      <div class="col-xs-12 productBoxDesc text-left" style="height:auto">
        <?php echo $row['DESCRIPTIONSHORT']; ?>
      </div>
    </div>
    </a>
  </div>
  <?php } ?>
</div>PKi$H[��Lpp0views/scripts/produits/ajaxshowallproducts.phtmlnu&1i�<?php header('Content-type: text/html; charset=iso-8859-1'); ?>  
<?php if (isset($this->listAllProducts) && !empty($this->listAllProducts)) { 
	 //$color = "none";
	 $color = $this->actualDesign['color']; 
		foreach ($this->listAllProducts as $row) { 
			$link = $this->baseUrl."/".Utils_Tool::getFormattedUrlProduct($row['NAVNOM_URLPARENTS'], $row['PRODNAVNOM'], $row['ID']);
			$desc = $this->escape($row['DESCSHORT']);
			$name = $this->escape($row['NOM']);
		?>  
	 <div class="col-md-3 categorieBoxContent">
		<div class="categorieBox text-center">
			<div class="col-md-10 col-md-offset-1 noPadding">
				<a class="tooltips" data-placement="bottom" title="<?php echo $desc;?>" href="<?php echo $link;?>" >
					<span class="categorieBoxImg">
						<img src="<?php echo '/'.$this->escape($row['URL']); ?>" alt="<?php echo $name; ?>"/>
					</span>
				</a>
			</div>
			<div class="col-md-12 noPadding categorieBoxTitleContent">
				<a class="categorieBoxTitle tooltips" data-placement="bottom" title="<?php echo $desc;?>" href="<?php echo $link;?>" >
					<?php echo $name; ?>
				</a>
			</div>
		</div>
	</div>
<?php } }?>		
	 PKi$H[ց�4 views/scripts/services/faq.phtmlnu&1i�<!--[if IE]>
<style type="text/css">
.textA16, .textA15 {
  filter: glow(color=#ffffff,strength=1);
}
.linkA16, .linkA15 {
  filter: glow(color=#ffffff,strength=1);
}
</style>
<![endif]-->
<div class="spaceBG2" style="clear: both;"></div>
<div class="faq_container">
	<div class="faq_container1">
		<div class="faq_containerType">
			<div class="linkA16" style="clear:both;margin: 5px 0 0 10px; text-align:left;"><a href="<?php echo $this->baseUrl; ?>/services/faq/" title="Foire aux questions">FAQ</a></div>
			<div class="linkA15" style="clear:both;margin: 0 0 0 10px; text-align:left;"><a href="<?php echo $this->baseUrl; ?>/services/faq/" title="Foire aux questions">La solution <br/>� vos questions</a></div>
		</div>
			<?php $i = 0; foreach($this->faqType as $row) { ?>
				<div class="faq_typeLink"><div class="linkA4" style="margin: 5px 0 0 0;"><a href="javascript:;" onclick="javascript:showFAQ('<?php echo $row['ID']; ?>');"><?php echo $row['NOM'];?></a></div></div>
			<?php } ?>
	</div>
	<div class="faq_container2">
	<?php $lastType = ""; 
		foreach($this->faqs as $row) { 
		if ($lastType != $row['IDTYPE']) { $lastType = $row['IDTYPE'];?>
			<div class="faq_type faq_typeV_<?php echo $row['IDTYPE']; ?> textA14" >
				<span><?php echo $row['NOMTYPE'];?></span>
			</div>
		<?php } ?>
		<div class="faq_content faq_contentV_<?php echo $row['IDTYPE']; ?>" >
			<div class="faq_contentOpt">
				<div class="textA4" style="float: left;width: 30px;">Q :</div>
				<div class="textA3" style="float: left;width: 470px"><?php echo $row['QUESTION'];?></div>
			</div>
			<div class="faq_contentOpt">
				<div class="textA4" style="float: left;width: 30px;">R :</div>
				<div class="textA3" style="float: left;width: 470px;"><?php echo $row['REPONSE'];?></div>
			</div>
		</div>
		<?php } ?>
	</div>
</div>PKi$H[0��''(views/scripts/services/information.phtmlnu&1i�<?php $service = $this->service; ?>
<div class="col-xs-12 indexBox3_title" style="margin-top: 10px;"><?php echo $service['TITRE']; ?></div>
<div class="col-md-12" style="padding-top: 10px; padding-bottom: 10px;border: 1px solid #ccc;margin-top: 10px;">
	<?php echo $service['CONTENT']; ?>
</div>PKi$H[Y�X_��views/scripts/pagination.phtmlnu&1i�<?php if ($this->pageCount): ?>
<table border="0" cellspacing="0" cellpadding="0" width="100%" style="margin-top:15px;">
	<tr>
		<td width="200" style="text-align:right;">
			<span class="footer_menus" >
				<!-- Previous page link --> 
				<?php if (isset($this->previous)) { ?> 
				  <a href="<?php echo $this->url(array('page' => $this->previous)); ?>">&lt; <?php echo "Pr�c�dent"; ?></a> 
				<?php } ?> 
			</span>								
		</td>
		<td style="text-align:center;">
			<span class="link2">
				<!-- Numbered page links -->
				<?php foreach ($this->pagesInRange as $page) { ?> 
				  <?php if ($page != $this->current) { ?>
				    <a href="<?php echo $this->url(array('page' => $page)); ?>"><?php echo $page; ?></a> 
				  <?php  } else { ?>
				    <span ><?php echo $page; ?></span>
				  <?php } 
				   if ($this->last != $page) { echo '|';} 
				    } ?>
			</span>								
		</td>
		<td width="200">
			<span class="footer_menus">
				<!-- Next page link --> 
				<?php if (isset($this->next)) { ?> 
				  <a href="<?php echo $this->url(array('page' => $this->next)); ?>"><?php echo "Suivant" ?> &gt;</a>
				<?php } ?> 
			</span>								
		</td>
	</tr>
</table>
<?php endif; ?>PKi$H[t�Gdd"views/scripts/ajax/ajaxvalue.phtmlnu&1i�<?php header('Content-type: text/html; charset=iso-8859-1'); ?>
<?php echo $this->messageSuccess; ?>PKi$H[��``&views/scripts/ajax/ajaxlivraison.phtmlnu&1i�<?php header('Content-type: text/html; charset=iso-8859-1'); ?>
<?php 
$marginTop = 30;
if (isset($this->messageSuccess) && !empty($this->messageSuccess)) {?>
<div class="alert alert-success  text-center"><?php echo $this->messageSuccess; ?></div>
<?php $marginTop = 0; } 
 if (isset($this->messageError) && !empty($this->messageError)) { ?>
<div class="alert alert-danger  text-center"><?php echo $this->messageError; ?></div>
<?php $marginTop = 0; }?>

<div class="cmdLivResultOpt textA7" style="margin: <?php echo $marginTop.'px'; ?> 0 0 10px;"><?php echo $this->adresseLiv['raisonsocial']; ?></div>
<div class="cmdLivResultOpt"><?php echo $this->adresseLiv['adresse']; ?></div>
<div class="cmdLivResultOpt"><?php echo $this->adresseLiv['cp']." ".$this->adresseLiv['ville'];  ?></div>
<div class="cmdLivResultOpt"><?php echo $this->adresseLiv['pays']; ?></div>
PKi$H[a]���$views/scripts/ajax/ajaxaccount.phtmlnu&1i�<?php header('Content-type: text/html; charset=iso-8859-1'); ?>

<?php 
	$auth = Zend_Auth::getInstance();
	$auth->setStorage(new Zend_Auth_Storage_Session($this->session_storage));
	$storage = $auth->getStorage()->read(); 

if (isset($this->messageError) && !empty($this->messageError)) { ?> 
<script type="text/javascript"> 
	 $(function(){
		 $('#leftUserMessage').css({'display':'block'}).html('<?php echo $this->messageError; ?>');
	});
</script>
<?php }
 
 if ($auth->hasIdentity() && isset($storage['user'])) { ?>
<div class="leftUserDeconnecte" >
	<a href="javascript:;" id ="accountLeftLogout" title="Pour vous déconnecter" class="tooltips" data-placement="top"><img src="<?php echo $this->baseUrl; ?>/business/image/deconnexion.png" /></a>
	
</div>
<div class="leftUserContent"> 
	<div class="leftUserFormText" <?php if ($auth->hasIdentity() && isset($storage['user'])) {  echo 'style="display: block"';  } else {  echo 'style="display: none"'; } ?>>
		Bonjour,<br/>
		<span id="ajaxNameUser" ><?php 
			if ($auth->hasIdentity() && isset($storage['user'])) {
				echo $storage['user']['prenom'].' '.$storage['user']['nom']; 
			 }?>	
		</span>
	</div> 
</div>
<div class="leftUserAccountBtn">
	<a href="<?php echo $this->baseUrl; ?>/mon-compte.html" title="Accéder à votre espace"><img alt="" style="margin: 0; padding: 0" src="<?php echo $this->baseUrl; ?>/image/header/my_space.png" /></a>
</div>
<?php } else { ?>
<div class="leftUserTitleForm"><span class="link_shadow18_r" ><a href="javascript:;" onclick="javascript:sendUserLeftConnect();" title="Me connecter à mon compte">Mon Compte</a></span></div>
<div class="leftUserContent leftUserFormText" >
	<div class="leftUserForm">
		<form id="connexionFormLeft" method="post" >	  
			<div class="leftUserFormInput">
				<input type="text" name="connexionleft_login" id="connexionleft_login" value="Identifiant" onfocus="clearById('connexionleft_login',new Array('Identifiant'));"/>
			</div>
			<div class="leftUserFormInput">
				<input type="password" name="connexionleft_mdp" id="connexionleft_mdp" value="Mot de passe" onfocus="clearById('connexionleft_mdp',new Array('Mot de passe'));"/>
			</div>
		</form>
	</div>  
</div>
<?php } ?> 
			PKi$H[W���n3n3"views/scripts/ajax/ajaxcaddy.phtmlnu&1i�
<?php header('Content-type: text/html; charset=iso-8859-1');  
$myFacture = $this->myFacture;  
if (isset($myFacture) && $myFacture->getNbArticles() == 0) { ?>
<div class="col-xs-12 text-center" style="margin-top: 20px;">Il n'y a aucun article dans votre panier.</div>
<div class="col-xs-12 text-center" style="margin-top: 20px;">
		<a   data-placement="bottom" class="btn btn-default btn-lg" href="<?php if (isset($this->urlCurrentProduct) && !empty($this->urlCurrentProduct)) { echo $this->urlCurrentProduct; } else { echo $this->baseUrl.'/'; } ?>" >
			CONTINUER MES ACHATS
		</a>
</div>
<?php  } else { ?>
<div class="col-xs-12">

<form id="caddyCheckForm" action="<?php echo $this->baseUrl; ?>/produits/ajaxcheckcaddy/" method="post">
	<div style="float: left;width: 100%;">
		<table border="0" cellpadding="0" cellspacing="0" width="100%" class="prod-detail-ref-table">
			<thead>
			<tr align="center" height="50px" style="background-color: #e7e7e7">
				<th class="text-center" style="width: 55%">Produit</th>
				<th class="text-center" style="width: 10%">Dispo.</th>
				<th class="text-center" style="width: 15%">Prix Unitaire (HT)</th> 
				<th class="text-center"  style="width: 10%">Quantit�</th>
				<th class="text-center" style="width: 10%">Prix Total</th>
			</tr>
			</thead>
			<tbody>
			<?php
			$index = 1;
			$i = 0;
			$caddyType_first = true; 
			$isHaveItems = false;
			foreach($myFacture->facture_lines as $row) { 
				if (!$isHaveItems && !$row->isCaddyTypeActif()) { $isHaveItems = true;}
				if (($caddyType_first && $row->isCaddyTypeActif()) && $isHaveItems) { $caddyType_first = false;?>
					<tr>
						<td colspan="5"><div  style="background-color: red;clear:both;width: 500px; height: 1px;margin: 5px auto 5px auto;"></div></td>
					</tr>
				<?php } ?>
			<tr align="center"  height="25px"  style="background-color:<?php if ($index == 0) {echo '#E7E7E7'; $index=1;} else {$index=0; echo '#FFFFFF';} ?>;">
				<td width="400px">
					<div class="caddyProdImg" > 
						<?php if (isset($row->item_isAccessoire) && $row->item_isAccessoire == "N") { ?>
							<a href="<?php echo $this->baseUrl; ?>/<?php Utils_Tool::getFormattedUrlProduct($row->product_navnom_urlparents, $row->product_navnom, $row->product_id); ?>"
								>
								<img src="<?php echo $this->baseUrl.'/'.$row->product_url; ?>">
							</a>
						<?php } ?>
					</div>
					<div class="caddyProdTxt" >
						<div class="link17" style="width: auto;clear:both">
							<a href="<?php echo $this->baseUrl; ?>/<?php echo Utils_Tool::getFormattedUrlProduct($row->product_navnom_urlparents, $row->product_navnom, $row->product_id); ?>">
								<?php echo $row->item_designation;?>
							</a>
						</div>
						<div class="textA1 productDetail_ref">
							<div class="productDetail_ref_label">
								<?php echo "Ref. ".$this->escape($row->item_reference); ?>
							</div>
							<div class="productDetail_ref_selected">
								<?php 
								 if (!empty($row->item_selectedOption) && !empty($row->item_optionsByList)) { 
								  $optionsByList = $row->item_optionsByList;
								 	?>
								 	<select name="selectedOption[]" class="selectedOption form-control">
										<?php foreach($optionsByList->values as $currentOption) {  ?>
										<option value="<?php echo $currentOption; ?>" <?php if ($row->item_selectedOption == $currentOption) { echo 'selected="selected"'; } ?> >
											<?php echo $currentOption; ?> 
										</option>
										<?php } ?>
									</select>   
									<input type="hidden" name="selectedOptionName[]" value="<?php echo $optionsByList->name; ?>" /> 
								<?php } else { ?> 
								<input type="hidden" name="selectedOption[]" value="" /> 
								<input type="hidden" name="selectedOptionName[]" value="" /> 
								<?php } ?>
							</div>
						</div>
					</div>
				</td> 
				<td >
					<?php if ((int)$row->item_stock == 1) { ?>
					<img class="tooltips" alt="Disponible imm�diatement" title="Disponible imm�diatement" src="<?php echo $this->baseUrl; ?>/business/image/admin/stock11.png" class="tooltips">
					<?php } else if ((int)$row->item_stock == 2) { ?>
					<imgclass="tooltips" alt="Disponible sous 8 jours" title="Disponible sous 8 jours" src="<?php echo $this->baseUrl; ?>/business/image/admin/stock22.png" class="tooltips" >
					<?php } else if ((int)$row->item_stock == 3) { ?>
					<img class="tooltips" alt="Nous contacter" title="Nous contacter" src="<?php echo $this->baseUrl; ?>/business/image/admin/stock33.png" class="tooltips">
					<?php }?> 
				
				</td>
				<td valign="middle">
						<?php $this->currentData = $row;
						echo $this->render("/produits/ajaxshowpromopricecaddy.phtml"); ?>
				</td>
				<td valign="middle" align="center">
					<div style="clear:both;width: 90px">
						<div class="col-xs-8 noPadding">
							<input type="text" class="form-control text-center caddyQuantity" maxlength="6" name="Quantity[]" id="Quantity_<?php echo $row->item_id.'_'.$i; ?>" value="<?php echo $row->item_qte; ?>" /> 
						</div>
						<div class="col-xs-4 noPadding">
							<a href="javascript:;" onclick="caddyDeleteByModify($(this), '<?php echo $row->item_id.'_'.$i; ?>')">
								<img alt="Supprimer" class="tooltips" data-placement="right"  title="Supprimer" src="<?php echo $this->baseUrl; ?>/business/image/admin/suppcaddy.png">
							</a>
						</div>
					</div>
					
					<input type="hidden" name="Child[]" value="<?php echo $row->item_id; ?>" /> 
					<input type="hidden" name="QuantityMin[]"  value="<?php echo $row->item_qte_min; ?>" />
					<input type="hidden" name="Accessoire[]" value="<?php echo $row->item_isAccessoire; ?>" /> 
					<input type="hidden" name="CaddyType[]" value="<?php echo $row->caddytype_id; ?>" /> 
				</td>
				<td width="120px" valign="middle">
					<div class="textPriceBox" style="margin: 10px 0 0 0; " >
						<span>
						<?php if (!$row->isSurDevis()) { echo number_format($row->getPrixTotalHT(true), 2, ',', ' ').' &#8364;'; }	 ?>
						</span>
					</div>
				</td>
			</tr>
			<?php $i++; } ?>
			<?php foreach($myFacture->facture_fidelite_lines as $row) { 
		  if ($row->isFideliteGift()) {  ?>
    <tr>
      <td colspan="3">
        <div style="font-weight: bold;margin:10px;">
          <?php echo 'Carte de fid�lit� : '.$row->fidelite_nom.' ('.$row->fidelite_nbpoint.' points)'; ?>
        </div>
      </td>
      <td style="text-align:right">
          <a href="<?php echo $this->baseUrl; ?>/user/deletecaddyfidelitypoint/id/<?php echo $row->fidelite_id; ?>" >
            <img alt="Supprimer" class="tooltips" data-placement="right" title="Supprimer" src="<?php echo $this->baseUrl; ?>/business/image/admin/suppcaddy.png">
          </a>
      </td>
      <td></td>
    </tr>
    <?php }  } ?>
			</tbody>
		</table>
	</div>
</form>
</div>
	<div class="col-xs-12" >
		<div class="col-sm-6 col-xs-12">
		<?php if (!isset($this->isCommandValid)) { ?>
			<div class="textA4" style="clear: both;margin: 20px 0 0 0;">
				Vous b�n�ficiez d'un code de r�duction ?
			</div>
			
			<div id="labelCodeReduc" class="caddyLabelReduc">
				<?php if (isset($this->messageSuccessReduc)) { 
					 if ($this->messageSuccessReduc == "OK") { ?>
					 	<span class="messageSuccess"><?php echo $this->messageMessReduc ?></span>
					 <?php } else { ?>
					 	<span class="messageError"><?php echo $this->messageMessReduc; ?></span>
					<?php }
				} ?>
			</div>
			<div style="clear: both;text-align: center;width: 100%">
				<div class="textA2" style="float: left;margin: 15px 0 0 30px">Saisissez-le ici : </div>
				<div style="float: left; margin: 10px 0 0 10px"><input class="form-control" type="text" name="caddyCodeReduc" id="caddyCodeReduc"></div>
				<div style="float: left;margin: 0 0 0 10px">
					<?php if (isset($myFacture->code_reduction) && !empty($myFacture->code_reduction)) { ?>
					<input type="image" id="submitCodeReduc" src="<?php echo $this->baseUrl; ?>/business/image/admin/btnok.png" >
					<?php } else { ?>
					<input type="image" id="submitCodeReduc" src="<?php echo $this->baseUrl; ?>/business/image/admin/btnnon.png" >
					<?php } ?>
				</div>
			</div>
		<?php }  ?>
	    </div>
		<div class="col-sm-6 col-xs-12" style="padding-right: 0;">
			<div style="float: right;">
				<div class="caddyPrice1 textA3" >Total HR / HT</div>
				<div class="caddyPrice2" >
					<div class="textPriceBox">
						<span><?php echo number_format($myFacture->total_HT_HR, 2, ',', ' '); ?> &#8364;</span>
					</div> 
				</div>
			</div>
			<div style="float: right;">
				<div class="caddyPrice1 textA3" style="color: #1d7f0d; ">Remises sp�cifiques <?php if (isset($myFacture->code_reduction) && !empty($myFacture->code_reduction) ) { echo " ( ".$myFacture->code_reduction['CODE']." ) "; } ?></div>
				<div class="caddyPrice2" >
					<div class="textPriceBox" >
						<span><?php echo number_format($myFacture->getPrixRemise(), 2, ',', ' ') ; ?> &#8364;</span>
					</div>
				</div>
			</div>
			<div style="float: right;">
				<div class="caddyPrice1 textA3" >
					Frais de port
				</div>
				<div class="caddyPrice3" >
					<div class="textPriceBox">
						<span id="showLivraison" > <?php echo number_format($myFacture->total_frais_port, 2, ',', ' '); ?> &#8364;</span>
					</div>
				</div>
			</div>
			
			<div style="float: right;">
				<div class="caddyPrice1 textA3" style="color: #ff0000; height: 31px">TOTAL HT</div>
				<div class="caddyPrice2 textA3" style="color: #ff0000; height: 31px;padding: 5px 0 5px 0; ">
					<div class="textPriceBoxHT" >
						<span id="showTotalHT"><?php echo number_format($myFacture->total_HT_FP, 2, ',', ' '); ?> &#8364;</span>
					</div>
				</div>
			</div>
		</div>
		</div>
	<?php  if (isset($this->isCommandValid)) { ?>
	<div class="col-xs-6 col-xs-offset-3 alert alert-danger text-center" style="margin-bottom: 0px;" >
		<?php echo $this->isCommandValid;  ?>
	</div>
	<?php }
	if (isset($this->resteFrancoLiv)) { ?>
	<div class="col-xs-6 col-xs-offset-3 alert alert-danger text-center" style="margin-bottom: 0px;" >
		<?php   echo $this->resteFrancoLiv; ?>
	</div>
	<?php } ?>
	<div id="caddyCheckFormLog" class="col-xs-12"  style="min-height: 72px;"> </div>
	<div class="col-xs-12"  style="margin-bottom: 40px;">
		<div class="col-md-3 col-sm-6 text-center">
			<input type="button" style="margin-top: 5px; margin-bottom: 5px" class="btn btn-default btn-block" data-placement="bottom" value="CALCULER MON PANIER" id="caddySubmitValid" />
		</div>
		<div class="col-md-3 col-sm-6 text-center">
			<a style="margin-top: 5px; margin-bottom: 5px"  data-placement="bottom" class="btn btn-default btn-block" href="<?php if (isset($this->urlCurrentProduct) && !empty($this->urlCurrentProduct)) { echo $this->urlCurrentProduct; } else { echo $this->baseUrl.'/'; } ?>" >
				CONTINUER MES ACHATS
			</a>
			
		</div> 
		<div class="col-md-3 col-sm-6 text-center">
			<a title="Pour r�aliser un devis"  data-placement="bottom" class="tooltips btn btn-primary btn-lg btn-block caddy-link" href="<?php echo $this->baseUrl; ?>/mon-panier-livraison.html"  >
				DEVIS
			</a>
		</div>
		<?php if (!isset($this->isCommandValid)) { ?>
		<div class="col-md-3 col-sm-6 text-center">
			<a title="Pour passer une commande"  data-placement="bottom" class="tooltips btn btn-success btn-lg btn-block caddy-link" href="<?php echo $this->baseUrl; ?>/mon-panier-livraison.html" >
				COMMANDER
			</a>
		</div>
		<?php } ?>
	</div>


<?php } ?>


<?php if ($this->isCarteFideliteEnable && isset($this->myCaddyFideliteAvailable)) { ?>
<div class="col-xs-12" style="padding-bottom:150px;">
  <h3>Carte de fid�lit�  <a class="btn btn-primary"  href="<?php echo $this->baseUrl; ?>/mon-compte.html#cartefidelite" ><span class="fa fa-user"></span> MES POINTS<?php if (isset($this->myUserFideliteInfo)) {echo ' : '.$this->myUserFideliteInfo['POINTFIDELITETOTAL']; }?></a></h3><hr/>
 	     
  <?php
    foreach($this->myCaddyFideliteAvailable as $row)  { ?>
        <div class="col-md-12">
          <h4><?php echo $row['TITRE'];?> : <?php echo $row['POINTFIDELITE'];?> points</h4>
        </div>
        <div class="col-md-12" style="padding:10px">
          <div class="col-md-10">
            <?php echo $row['CONTENT'];?>
          </div> 
          <div class="col-md-2">
            <a class="btn btn-success"  href="<?php echo $this->baseUrl; ?>/user/addcaddyfidelitypoint/id/<?php echo $row['ID']; ?>" ><span class="fa fa-plus-circle"></span> AJOUTER AU PANIER</a>
		      </div>
        </div>
  <?php }?>
  <?php
    foreach($this->myCaddyFideliteAllExceptCurrents as $row)  { ?>
        <div class="col-md-12">
          <h4><?php echo $row['TITRE'];?> : <?php echo $row['POINTFIDELITE'];?> points</h4>
        </div>
        <div class="col-md-12" style="padding:10px">
          <div class="col-md-10">
            <?php echo $row['CONTENT'];?>
          </div> 
          <div class="col-md-2">
            <a class="btn btn-success" disabled="disabled" href="<?php echo $this->baseUrl; ?>/user/addcaddyfidelitypoint/id/<?php echo $row['ID']; ?>" ><span class="fa fa-plus-circle"></span> AJOUTER AU PANIER</a>
		      </div>
        </div>
  <?php }?>
</div>
<?php } ?>PKi$H[m�Qixx1views/scripts/ajax/caddyaccountrightnoslide.phtmlnu&1i�
<style type="text/css">
    .text-title-slide-red {
        color: #bd2f2c; 
        font-weight:bold;
        font-size: 15px;
    }
    .text-title-slide-gray  {
        color: #5B595A;
    }
    .text-title-slide-gray a:link, .text-title-slide-gray a:visited, .text-title-slide-gray a:active   {
        color: #5B595A;
        text-decoration:underline;
        font-weight:bold;
        font-size: 15px;
    }
    .text-title-slide-gray a:hover {
        color: #5B595A;
        text-decoration:underline;
    }
    .box-right-title-slide-right {
        border: 1px solid #cccccc;
        border-left:none;
    }
    .box-right-border-mid {
        border-top:none;
        border-bottom:none;
    }
    .box-right-vertical-align {
        height:90px;
        text-align:center;
        display: table-cell;
        vertical-align: middle;
        width:250px;
    }
</style>
 

<?php  
  $listProducts = array();
  $listProducts = $this->listAllProductsBestSeller;
  if (!empty($listProducts)) {   ?>
<div class="col-md-3 col-xs-12  noPadding">
  <div class="col-xs-12 noPadding box-bottom-command-title">Meilleures ventes</div>
  <ul>
    <?php  
        $count = 0;
        foreach ($listProducts as $row) {  
          if ($count < 4) {
            if ($row['BOOSTED_BESTSELLER'] > 0) { 
            
	            $nametitle = $this->escape($row['NOM']);
	            $link = "";
	            if (isset($row['NAVNOM'])) {
		            $link = $this->baseUrl."/".Utils_Tool::getFormattedUrlProduct($row['NAVNOM_URLPARENTS'], $row['NAVNOM'], $row['ID']);
	            } else if (isset($row['PRODNAVNOM'])){
		            $link = $this->baseUrl."/".Utils_Tool::getFormattedUrlProduct($row['NAVNOM_URLPARENTS'], $row['PRODNAVNOM'], $row['ID']);
	            }
  ?>
		         <li>
               <a  href="<?php echo $link;?>" >
               <div class="col-xs-6 noPadding">
                 <div  class="col-xs-12 noPadding">
                   <?php  if ($row['isDEVISPRODUCT'] == 1) { ?>
				              <div class="productPriceBox">
					              <span class="productPriceTitle">� partir de</span><br />
					              <span class="productPrice" style="font-size:15px"><?php echo number_format($row['PRIXLOWEST'], 2, ',', ' ').' '; ?>&nbsp;&#8364;</span>&nbsp;<span class="productPriceHT">HT</span>
				              </div>
			              <?php } else { ?>
				              <div class="productPriceBox"><span class="productPrice" style="margin-left: 10px; margin-top: 5px">Sur devis</span></div>
			              <?php } ?>
                 </div>
                 <div  class="col-xs-12 noPadding productBoxImgPreviewContent">
                   <center>
                      <div class="productBoxImgPreview">
                        <img src="<?php echo '/'.$this->escape($row['URL']); ?>" alt="<?php echo $nametitle; ?>" />
                       </div>
                   </center>
                 </div>
               </div>
               </a>
             </li>
    <?php $count++;
            }
          } else {
              break;
          }
        }
      ?>
  </ul>
</div>
<?php  
} else { ?>


<div class="col-md-3 col-xs-12 indexBoxContent" >
    <div class="col-xs-12 text-title-slide-gray box-right-title-slide-right noPadding">
      <a href="<?php echo $this->baseUrl; ?>/blog.html"><img src="/business/image/blog.png" width="250" /></a>
    </div>
    <div class="col-xs-12 text-title-slide-gray box-right-title-slide-right box-right-border-mid" >
        <div class="box-right-vertical-align">
             <a href="mailto:<?php echo $this->serviceClient_Mail;?>?subject=<?php echo 'DEMANDE DE DEVIS EXPRESS';?>&body=Bonjour, " >DEMANDE DE DEVIS EXPRESS</a>
        </div>
    </div>
    <div class="col-xs-12 text-title-slide-gray box-right-title-slide-right text-center noPadding" style="max-height:98px; height:98px;">
		<div class="indexBox4_title1" style="margin: 3px 0 0 0">PAIEMENT <span class="indexBox4_title2">S�CURIS�</span></div>
        <div class="indexBox4_title4" style="margin:6px 0 6px 0">
            <a class="tooltips" placement="bottom" title="" href="/info-14/paiement-securise-et-conditions-de-reglement.html" data-original-title="Paiement s�curis� et conditions de r�glement"></a><a href="http://www.afidistribution.com/info-2/paiement-securise.html" title="" class="tooltips" data-original-title="Paiement s�curis� et conditions de r�glement">
                <img src="/business/image/cardicons.png" alt="Paiement s�curis�" style="height: 30px; vertical-align: middle;" />
            </a>
        </div>
        <div class="indexBox4_title3" style="margin: 0 0 0 0">En partenariat avec la Banque Populaire</div>
    </div>
</div>

<?php } ?>
	PKi$H["Yɋ��*views/scripts/ajax/caddyaccountright.phtmlnu&1i�	<script type="text/javascript"> 
	 $(function(){
		 initEventUserConnectAccountSlide();
	});
</script>
<style type="text/css">
     
        .index-big-box-img {
        display: table-cell;
        vertical-align: middle;
        text-align: right;
        height: 278px;
        width: 764px;
        padding : 0 0 0 0;
        margin : 0 0 0 0;
    }

        .index-big-box-img img {
            max-height: 275px;
            /*max-width: 763px;*/
            padding: 0 0 0 0;
            margin: 0 0 0 0;
        }  

    .slide-category-box-text {
        text-shadow: 1px 1px #fff;
        font-size: 14px;
        line-height: 21px;
        max-width : 650px;
    }

    .slide-category-box-title {
        padding: 15px 15px 15px 15px;
    }

    .slide-category-box-title h1 {
        font-weight: normal;
        font-size: 21px;
        text-transform: uppercase;
        font-weight : bold;
        margin : 0 0 0 0;
        padding: 0 0 0 0;
    }
    .slide-category-box-picture {
        position: absolute;
        bottom: 0;
    }

    .slide-category-box-content {
        position: absolute;
        top: 50px;
        min-width:760px;
    }
      .slide-category-box-content div {
          background-color: rgba(255,255,255,0.8);
          float: left;
          min-width:760px;
      }
    .slide-category-box-bot {
        padding: 5px 15px 5px 15px;
    }

    .slide-category-box-mid {
        padding: 5px 15px 5px 15px;
    }
    .slide-clear {
        clear:both;
    }
</style>
<div class="col-md-12 visible-md visible-lg sliderPanelTop noPadding ">
	<div class="col-md-9 col-xs-12  indexBigBox noPadding">		
		<?php  if ($this->listads) {		?>		
		<div class="liquid-slider liquid-slider-ads" id="slider-category-id">	
		<?php } else { ?>		
		<div class="liquid-slider liquid-slider-ads" >		
		<?php }  
						if ($this->listCat) {
							$listCat = array();
							$listCat = $this->listCat; ?>
			<div class="col-xs-12 index-big-box noPadding" style="overflow: hidden;overflow-y: hidden; ">
				<div class="col-xs-12 noPadding slide-category-box-picture" >
                    
					<div class="index-big-box-img" >
                        <?php if (isset($listCat['URL_SLIDE']) && !empty($listCat['URL_SLIDE'])) { ?>
						    <img src="<?php echo $this->baseUrl."/".$this->escape($listCat['URL_SLIDE']); ?>" class="tooltips" title="<?php echo $this->escape($listCat['NOM']); ?>">
					    <?php } else if (isset($listCat['URL']) && !empty($listCat['URL'])) { ?>		
		                    <img src="<?php echo $this->baseUrl."/".$this->escape($listCat['URL']); ?>" class="tooltips" title="<?php echo $this->escape($listCat['NOM']); ?>">
					    <?php } ?>
                    </div>
				</div>
				<div class="col-xs-12 noPadding slide-category-box-content">
                    <div class="slide-category-box-title">
                            <h1><?php echo $listCat['NOM']; ?></h1>
                    </div>
                        <?php 
						if (isset($listCat['CHOICEDOC']) && !empty($listCat['CHOICEDOC'])) { ?>
                    <div class="slide-clear"></div>
                    <div class="noPadding ">
					    <div class="col-xs-12 index-big-box-title3 text-left slide-category-box-mid" style="background-color : transparent;">
						    <a href="<?php echo $this->baseUrl; ?>/<?php echo $listCat['CHOICEDOC'];?>" target="_blank">
							    <span class="col-xs-12 text-left">Comment choisir le bon produit ?</span>
						    </a>
					    </div>
                    </div>
					    <?php } ?>
                    <div class="slide-clear"></div>
                    <div  class="noPadding text-left slide-category-box-bot"><p class="slide-category-box-text"><?php echo $listCat['DESCRIPTION']; ?></p></div>
				</div>
			</div>
		<?php } 
		 if ($this->listads) {
					$listAnnonce = $this->listads;
					foreach ($listAnnonce as $row) {  ?> 
						<div class="col-xs-12 noPadding"><?php echo $row['CONTENT'];?></div>
			<?php }} ?>
		</div>		
	</div>
	<?php echo $this->render("/ajax/caddyaccountrightnoslide.phtml");?>
</div>
	PKi$H[rH����$views/scripts/ajax/ajaxmessage.phtmlnu&1i�<?php header('Content-type: text/html; charset=iso-8859-1'); ?>
<div class="col-xs-6 col-xs-offset-3">
<?php if (isset($this->messageSuccess) && !empty($this->messageSuccess)) {?>
<div class="alert alert-success  text-center"><?php echo $this->messageSuccess; ?></div>
<?php } 
      if (isset($this->messageError) && !empty($this->messageError)) { ?>
<div class="alert alert-danger  text-center"><?php echo $this->messageError; ?></div>
<?php }?>
</div>PKi$H[l�z��1views/scripts/produitspromotion/nosproduits.phtmlnu&1i�
<?php
$prefixClass = $this->prefixPromoClass;
if ($prefixClass == "eco-") { ?>
<style type="text/css">
  .footer-content-divider{
  background: url('/business/image/eco-line.png') repeat-x top left;
  height: 15px;
  margin: 10px 0 0 0;
  }
  html, body {
  background: url('/business/image/eco-bg.jpg') no-repeat top center;
  background-color: #21530d;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  }
  .wrapBgContent-l,
  .wrapBgContent-r {
  background:none;
  }
  .wrapBgContent-1 {
  -webkit-box-shadow: 0px 0px 30px rgba(0, 0, 0, 1);
  box-shadow: 0px 0px 30px rgba(0, 0, 0, 1);
  }

  .wrapBgContent-2 {
  -webkit-box-shadow: 0px 20px 30px rgba(0, 0, 0, 1);
  box-shadow: 0px 20px 30px rgba(0, 0, 0, 1);
  }

</style>
<?php } ?>
<script  type="text/javascript" >

$(function(){
	initEventsPromotionCats();
});

</script>
<?php

$listProducts = array();
$listProducts = $this->listAllProducts;
$listCat = array();
$listCat = $this->listCat;
?>
 
<div class="hidden-xs col-md-12 sliderPanelTop noPadding">
	<div class="col-md-9 col-xs-12  indexBigBox">		
		<?php
			$colPromo = "col-xs-12";
			 if ($prefixClass == "eco-") { ?>
			<div class="col-xs-12 index-big-box noPadding <?php echo $prefixClass; ?>bg" style="overflow: hidden;overflow-y: hidden; ">
				<div class="<?php echo $prefixClass; ?>title1">D�couvrer notre</div>
				<div class="<?php echo $prefixClass; ?>title2">Gamme</div>
				<div class="<?php echo $prefixClass; ?>title3">D�veloppement Durable</div>
				<?php 
						if (isset($listCat['CHOICEDOC']) && !empty($listCat['CHOICEDOC'])) { 
						$colPromo = "col-xs-7";?>
					<div class="col-xs-5 <?php echo $prefixClass; ?>choicedoc text-right noPadding">
						<a href="<?php echo $this->baseUrl; ?>/<?php echo $listCat['CHOICEDOC'];?>" target="_blank">
							<span class="col-xs-12 text-center">Comment choisir le bon produit ?</span>						
						</a>
					</div>
					<?php } ?>
				<?php if ($listCat['ID'] != 3) { ?>
				<div class="<?php echo $colPromo;?> <?php echo $prefixClass; ?>title4"><?php echo $listCat['NOM']; ?></div>
				<?php } ?>
			</div>
		<?php }
		if ($prefixClass == "") { ?>
			<div class="col-xs-12 index-big-box noPadding promo-bg" style="overflow: hidden;overflow-y: hidden; ">
				<?php 
					if (isset($listCat['CHOICEDOC']) && !empty($listCat['CHOICEDOC'])) { 
					?>
					<div class="col-xs-5 promo-choicedoc text-right noPadding">
						<a href="<?php echo $this->baseUrl; ?>/<?php echo $listCat['CHOICEDOC'];?>" target="_blank">
							<span class="col-xs-12 text-center">Comment choisir le bon produit ?</span>						
						</a>
					</div>
					<?php } ?>
			</div>
		<?php } ?>
	</div>
	
	<?php echo $this->render("/ajax/caddyaccountrightnoslide.phtml"); ?>
</div>

<?php if ($prefixClass == "") { ?>
<div class="col-xs-12 indexBox3_title" style="margin-top: 10px;margin-bottom: 10px">
  <h1 class="eco-title-h1">
    <?php echo $listCat['NOM']; ?>
  </h1>
</div>
<?php } ?>

<div class="col-xs-12 noPadding">
<?php if (!empty($listProducts)) {  
foreach ($listProducts as $row) {
		$this->currentData = $row;
		echo $this->render("/produits/ajaxshowproductbox.phtml");	
	}
}
	?>	  
</div>PKi$H[�Z
(��/views/scripts/produitspromotion/categorie.phtmlnu&1i�
<script  type="text/javascript" >

$(function(){
	initEventsPromotionCats();
});

</script>
<?php
$listCat = array();
$listCat = $this->listCat;

$prefixClass = $this->prefixPromoClass;
?>

<?php if ($prefixClass == "eco-") { ?>
<style type="text/css">
.footer-content-divider{
	background: url('/business/image/eco-line.png') repeat-x top left;
	 height: 15px;
	 margin: 10px 0 0 0;
}
<?php if ($listCat['IDPARENT'] == 0) { ?>
  html, body {
  background: url('/business/image/eco-bg2.jpg') no-repeat top center;
  background-color: #21530d;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  }
  <?php } else { ?>
  html, body {
  background: url('/business/image/eco-bg1.jpg') no-repeat top center;
  background-color: #21530d;
  -webkit-background-size: cover;
  -moz-background-size: cover;
  -o-background-size: cover;
  background-size: cover;
  }
  <?php } ?>
.wrapBgContent-l,
.wrapBgContent-r {
	background:none;
}
.wrapBgContent-1 {
  -webkit-box-shadow: 0px 0px 30px rgba(0, 0, 0, 1);
          box-shadow: 0px 0px 30px rgba(0, 0, 0, 1);
}

.wrapBgContent-2 {
  -webkit-box-shadow: 0px 20px 30px rgba(0, 0, 0, 1);
          box-shadow: 0px 20px 30px rgba(0, 0, 0, 1);
}

</style>
<?php } ?>

<div class="hidden-xs col-md-12 sliderPanelTop noPadding">
	<div class="col-md-9 col-xs-12  indexBigBox">		
		<?php
			$colPromo = "col-xs-12";
			 if ($prefixClass == "eco-") { ?>
			<div class="col-xs-12 index-big-box noPadding <?php echo $prefixClass; ?>bg" style="overflow: hidden;overflow-y: hidden; ">
				<div class="<?php echo $prefixClass; ?>title1">D�couvrer notre</div>
				<div class="<?php echo $prefixClass; ?>title2">Gamme</div>
				<div class="<?php echo $prefixClass; ?>title3">D�veloppement Durable</div>
				<?php 
						if (isset($listCat['CHOICEDOC']) && !empty($listCat['CHOICEDOC'])) { 
						$colPromo = "col-xs-7";?>
					<div class="col-xs-5 <?php echo $prefixClass; ?>choicedoc text-right noPadding">
						<a href="<?php echo $this->baseUrl; ?>/<?php echo $listCat['CHOICEDOC'];?>" target="_blank">
							<span class="col-xs-12 text-center">Comment choisir le bon produit ?</span>						
						</a>
					</div>
					<?php } ?>
				<?php if ($listCat['ID'] != 3) { ?>
				<div class="<?php echo $colPromo;?> <?php echo $prefixClass; ?>title4"><?php echo $listCat['NOM']; ?></div>
				<?php } ?>
			</div>
		<?php }
		if ($prefixClass == "") { ?>
			<div class="col-xs-12 index-big-box noPadding promo-bg" style="overflow: hidden;overflow-y: hidden; ">
				<?php 
					if (isset($listCat['CHOICEDOC']) && !empty($listCat['CHOICEDOC'])) { 
					?>
					<div class="col-xs-5 promo-choicedoc text-right noPadding">
						<a href="<?php echo $this->baseUrl; ?>/<?php echo $listCat['CHOICEDOC'];?>" target="_blank">
							<span class="col-xs-12 text-center">Comment choisir le bon produit ?</span>						
						</a>
					</div>
					<?php } ?>
			</div>
		<?php } ?>
	</div>
	
	<?php echo $this->render("/ajax/caddyaccountrightnoslide.phtml"); ?>
</div>

<?php if ($prefixClass == "") { ?>
<div class="col-xs-12 indexBox3_title" style="margin-top: 10px;margin-bottom: 10px">
  <h1 class="eco-title-h1">
    <?php echo $listCat['NOM']; ?>
  </h1>
</div>
<?php } ?>

<div class="col-xs-12 noPadding">
	<?php 
	$i = 0;
	$filter = new Zend_Filter_StringToUpper();
	if (!empty($listCat['SUBS'])) {
		
	foreach ($listCat['SUBS'] as $row) {
		$nbProducts = $row['NBPRODUCT'];
		$link = $this->baseUrl."/".Utils_Tool::getFormattedUrlCategory2($row['NAVNOM_URLPARENTS'], $row['NAVNOM'], $row['ID']);
    
		$desc = $this->escape($row['DESCRIPTION']);
		$name = $this->escape($row['NOM']);
		$filter = new Zend_Filter();
		$filter	->addFilter(new Zend_Filter_StripTags())
		->addFilter(new Zend_Filter_StringTrim());
		$descFiltered = $filter->filter($desc);
		?>
		<div class="col-md-3 col-sm-4 col-xs-12 categorieBoxContent">
			<div class="categorieBox text-center">
				<?php if ($prefixClass == "eco-") { ?>
					<div class="eco-tree"></div>
				<?php } ?>
				<div class="col-xs-10 col-xs-offset-1 noPadding">
					<center><a class="tooltips" data-placement="bottom" title="<?php echo $descFiltered;?>" href="<?php echo $link;?>" >
						<span class="categorieBoxImg">
							<img src="<?php echo '/'.$this->escape($row['URL']); ?>" alt="<?php echo $name; ?>"/>
						</span>
					</a></center>
				</div>
				<div class="col-xs-12 <?php echo $prefixClass; ?>categorieBoxTitleContent" >
					<div>
						<a class="<?php echo $prefixClass; ?>categorieBoxTitle" href="<?php echo $link;?>" >
							<?php echo $name; ?>
						</a>
					</div>
				</div>
				<div class="col-xs-12 categorieBoxTitleSubContent">
					<a class="<?php echo $prefixClass; ?>categorieBoxTitle2 tooltips" data-placement="bottom" title="<?php echo $descFiltered;?>" href="<?php echo $link;?>">
						<?php if ($nbProducts > 1) { ?>
						Voir les <?php echo $nbProducts;?> mod�les disponibles
						<?php } else if ($nbProducts == 1) { ?>
						Voir le mod�le disponible
						<?php } else if ($nbProducts == 0) { ?>
						Voir la gamme
						<?php } 
						?>
						<img src="/business/image/<?php echo $prefixClass; ?>category-icon.png" alt="<?php echo $descFiltered; ?>" style="margin-left: 10px;">
					</a>			
				</div>
			</div>
		</div>
	<?php } 
	}
	?>
</div>PKi$H[��Pk/	/	&views/scripts/user/ajaxlistdevis.phtmlnu&1i�<?php header('Content-type: text/html; charset=iso-8859-1'); 
 
	$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');
if (!empty($this->messageError) || !empty($this->messageSuccess)) { ?>
<div class="userAccount_MessageDevis"> 
	<span class="messageError2" ><?php echo $this->messageError; ?></span>
	<span class="messageSuccess2" ><?php echo $this->messageSuccess; ?></span>
</div>
<?php } ?>
<div class="userAccount_Panel">	
<table class="user-cmd-table" cellpadding="0" cellspacing="0">
	<thead>
	<tr>
		<th class="col-xs-2">Date du devis</th> 
		<th class="col-xs-2">R�f�rence</th> 
		<th class="col-xs-2">Statut</th> 
		<th class="col-xs-2">Prix TTC</th>
		<th style="width: 300px;"></th>
	</tr>
	</thead>
	<tbody>
	<?php 
		$myCommands = $this->myDevis;  
		if (sizeof($myCommands) > 0) {
			foreach ($myCommands as $command) {
			$myDate = new Zend_Date(strtotime($command['DATESTART']));
	?>
	<tr align="center">
		<td ><?php 
		echo $myDate->toString("dd").' '.$mois[(int)$myDate->toString('MM')].' '.$myDate->toString("YYYY");
		?></td>
		<td ><?php echo $command['REFERENCE']; ?></td>
		<td>
		<?php 
			switch ($this->escape($command['STATUT'])) { 
				case 10 : echo 'En cours'; break;
				case 11 : echo 'Termin�'; break;
			}
		?>
		</td>
		<td class="text-right">
			<span style="margin-right:10px;">
			<?php echo number_format($command['PRIXTOTALTTC'], 2, ',', ' ').' &#8364;'; ?>  
			</span>
		</td>
		<td >
				<a target="_blank"  href="<?php echo $this->baseUrl; ?>/user/commande/ref/<?php echo $command['REFERENCE']; ?>" title="Voir le d�tail du devis" class="tooltips btn btn-primary" data-placement="left">
					<i class="fa fa-search"></i> VISUALISER
				</a> 
				<a href="javascript:;" onclick="javascript:retrieveCommandToCaddy('<?php echo $command['REFERENCE']; ?>');"  title="Mettre le devis dans mon panier" class="tooltips btn btn-success" data-placement="left" >
					<span class="fa fa-plus-circle"></span> AJOUTER AU PANIER
				</a>
		</td>
	</tr>
	<?php 
			}		
	} else { ?>
	<tr>
		<td colspan="5" align="center" class="text3" height="50px">Aucun devis</td>
	</tr>
	<?php } ?>
	</tbody>
</table>
</div>PKi$H[DZ�mTKTK"views/scripts/user/connexion.phtmlnu&1i�

<script type="text/javascript">
  $(function(){
  var currentUrl = document.location.href;
  var currentUrlAncre = currentUrl.split('#');
  if (currentUrlAncre.length > 1) {
  $('#current_con_ancre').attr('value', currentUrlAncre[1]);
  $('#current_save_ancre').attr('value', currentUrlAncre[1]);
  }
  });
</script>
<?php if ($this->showSlide == 1) {
	$showslide = 1;
} else {
	$showslide = 2;
}
?>
<script type="text/javascript">
  $(function(){
  initEventConnexion(<?php echo $showslide; ?>);

  var params = new Array();
  params['route'] = $('#adduser_adresse');
  params['locality'] = $('#adduser_ville');
  params['administrative_area_level_2'] = $('#adduser_departement');
  params['administrative_area_level_1'] = $('#adduser_region');
  params['country'] = $('#adduser_pays');
  params['postal_code'] = $('#adduser_cp');

  initEventAddress($('#adduser_adressecomplete'), params);
  });
</script>

<div class="col-xs-12 text-center caddy-header-box"
	style="margin-bottom: 10px; margin-top: 10px;">
  <span
	class="user-con-title col-xs-6 col-xs-offset-3  ">
    Identifiez-vous ! <img
	src="<?php echo $this->baseUrl; ?>/business/image/lock.png"
    alt="Identifiez-vous !" />
  </span>
</div>
<div class="col-xs-12" style="margin-bottom: 10px; margin-top: 10px;">
  <div class="col-xs-6 noPadding text-center">
    <a href="javascript:;"
	id="connexion1" class="btn btn-primary btn-lg">J'ai d�j� command�</a>
  </div>
  <div class="col-xs-6 noPadding text-center">
    <a href="javascript:;"
	id="connexion2" class="btn btn-danger btn-lg">Je suis un nouveau client</a>
  </div>
</div>

<div id="v-connexion1">
  <div class="col-xs-6 col-xs-offset-3 col-border-default">
    <form class="form-horizontal" role="form" name="connexionForm"
      id="connexionForm"
      action="<?php echo $this->baseUrl; ?>/connectez-vous.html"
      method="post">

      <div class="form-group">
        <div class="col-sm-12 text-center">
          <span class="messageError2">
            <?php echo $this->messageErrorConnect; ?>
          </span>
        </div>
      </div>

      <div class="form-group">
        <label for="connexion_login"
	class="col-sm-4 noPadding control-label">Identifiant (Email)</label>
        <div class="col-sm-8">
          <input type="text" class="form-control"
	name="connexion_login" id="connexion_login"
	value="<?php echo $this->populateFormConnect['LOGIN']; ?>" /> <input
	type="hidden" name="current_con_ancre" id="current_con_ancre"
	value="<?php if (isset($this->current_con_ancre)) {echo $this->current_con_ancre; } ?>" />
        </div>
      </div>

      <div class="form-group">
        <label for="connexion_mdp"
	class="col-sm-4  noPadding control-label">Mot de passe</label>
        <div class="col-sm-8">
          <input type="password" class="form-control"
	name="connexion_mdp" id="connexion_mdp" />
        </div>
      </div>
      <div class="form-group text-center">
        <input type="submit"
	class="btn btn-primary" value="ME CONNECTER" />
      </div>

    </form>
  </div>
  <div class="col-xs-6 col-xs-offset-3 col-border-default">
    <span
	class="text3">
      Pour r�cup�rer votre mot de passe veuillez indiquer
      l'adresse e-mail avec laquelle vous vous �tes inscrit.
    </span>

    <form class="form-horizontal" role="form" name="passwordForgetForm"
      id="passwordForgetForm"
      action="<?php echo $this->baseUrl; ?>/retrouver-mon-mot-de-passe.html"
      method="post">

      <div class="form-group">
        <div class="col-sm-12 text-center">
          <span class="messageError2">
            <?php echo $this->messageErrorPass; ?>
          </span>
          <span class="messageSuccess2">
            <?php echo $this->messageSuccessPass; ?>
          </span>
        </div>
      </div>

      <div class="form-group">
        <label for="emailpassword"
	class="col-sm-4 noPadding control-label">Votre e-mail</label>
        <div class="col-sm-8">
          <input type="email" class="form-control"
	name="emailpassword" id="emailpassword" />
        </div>
      </div>
      <div class="form-group text-center">
        <input type="submit"
	class="btn btn-primary" value="RECUPERER MON MOT DE PASSE" />
      </div>
    </form>
  </div>

</div>

<div id="v-connexion2">
  <form name="addUserForm" id="addUserForm" class="form-horizontal"
    role="form"
    action="<?php echo $this->baseUrl; ?>/enregistrez-vous.html"
    method="post">

    <div class="form-group">
      <div class="col-sm-12 text-center">
        <span class="messageError2">
          <?php echo $this->messageErrorAddUser; ?>
        </span>
      </div>
    </div>

    <div class="col-xs-6 col-xs-offset-3 col-border-default">
      <div class="form-group ">
        <div class="col-xs-12 text-center">
          <span class="text6">
            Vos Identifiants
          </span>
        </div>
      </div>

      <div class="form-group">
        <label for="adduser_login"
	class="col-sm-4 noPadding control-label">* Identifiant (Email)</label>
        <div class="col-sm-8">
          <input type="email" class="form-control"
	name="adduser_login" id="adduser_login"
	value="<?php echo $this->populateFormAdd['LOGIN']; ?>" /> <input
	type="hidden" name="current_save_ancre" id="current_save_ancre"
	value="<?php if (isset($this->current_save_ancre)) {echo $this->current_save_ancre; } ?>" />
          <span class="text3">(4 caract�res minimum)</span>
        </div>
      </div>

      <div class="form-group">
        <label class="col-sm-4  noPadding control-label">
          *
          Mot de passe
        </label>
        <div class="col-sm-8">
          <input type="password" class="form-control"
	name="adduser_mdp" id="adduser_mdp" />
          <span class="text3">
            (4
            caract�res minimum)
          </span>
        </div>
      </div>
      <div class="form-group">
        <label class="col-sm-4  noPadding control-label">
          *
          Confirmation du mot de passe
        </label>
        <div class="col-sm-8">
          <input type="password" class="form-control"
	name="adduser_mdp2" id="adduser_mdp2" />
          <span class="text3">
            (4
            caract�res minimum)
          </span>
        </div>
      </div>
    </div>

    <div class="col-sm-12 col-border-default">
      <div class="col-sm-6 ">
        <div class="form-group">
          <div class="col-xs-12 text-center">
            <span class="text6">Vos coordonn�es </span>
          </div>
        </div>

        <div class="form-group">
          <label class="col-sm-4  noPadding control-label">
            *
            Civilit�
          </label>
          <div class="col-sm-8">
            <select class="form-control"
	name="adduser_civility" id="adduser_civility">
              <option value="Mr"
                <?php if ($this->populateFormAdd['CIVILITE'] == 'Mr') { echo 'selected'; } ?>>Monsieur
              </option>
              <option value="Mme"
                <?php if ($this->populateFormAdd['CIVILITE'] == 'Mme') { echo 'selected'; } ?>>Madame
              </option>
              <option value="Mlle"
                <?php if ($this->populateFormAdd['CIVILITE'] == 'Mlle') { echo 'selected'; } ?>>Mademoiselle
              </option>
            </select>
          </div>
        </div>

        <div class="form-group">
          <label class="col-sm-4  noPadding control-label">
            *
            Nom
          </label>
          <div class="col-sm-8">
            <input type="text" class="form-control"
	name="adduser_nom" id="adduser_nom"
	value="<?php echo $this->populateFormAdd['NOM']; ?>" />
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-4  noPadding control-label">
            *
            Pr�nom
          </label>
          <div class="col-sm-8">
            <input type="text" class="form-control"
	name="adduser_prenom" id="adduser_prenom"
	value="<?php echo $this->populateFormAdd['PRENOM']; ?>" />
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-4  noPadding control-label">Fonction</label>
          <div class="col-sm-8">
            <input type="text" class="form-control"
	name="adduser_fct" id="adduser_fct"
	value="<?php echo $this->populateFormAdd['FONCTION']; ?>" />
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-4  noPadding control-label">
            *
            T�l�phone
          </label>
          <div class="col-sm-8">
            <input type="text" class="form-control"
	name="adduser_tel" id="adduser_tel" maxlength="10"
	value="<?php echo $this->populateFormAdd['TEL']; ?>" /> <span
	class="text3">(Exemple : 0810120007)</span>
          </div>
        </div>
        <div class="form-group">
          <label class="col-sm-4  noPadding control-label">
            Fax
          </label>
          <div class="col-sm-8">
            <input type="text" class="form-control"
	name="adduser_fax" id="adduser_fax" maxlength="10"
	value="<?php echo $this->populateFormAdd['FAX']; ?>" /> <span
	class="text3">(Exemple : 0810120007)</span> <input type="hidden"
	id="address_type" name="address_type" value="old">
          </div>
        </div>

      </div>
      <div class="col-sm-6">
        <div class="form-group">
          <div class="col-xs-12 text-center">
            <span class="text6">Votre adresse </span>
          </div>
        </div>
        <div class="col-sm-12 text-center messageError" id="addressError"
          style="clear: both; display: none;"></div>

        <div id="adresseNew" style="display: none;">
          <div class="form-group">
            <label class="col-sm-4  noPadding control-label">
              *
              Adresse
            </label>
            <div class="col-sm-8">
              <input type="text" class="form-control"
	name="adduser_adressecomplete" id="adduser_adressecomplete"
	value="<?php echo $this->populateFormAdd['ADRESSECOMPLETE']; ?>" />
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-4  noPadding control-label">* Rue</label>
            <div class="col-sm-8">
              <input type="text" style="border: none;"
	readonly="readonly" class="form-control" name="adduser_adresse"
	id="adduser_adresse"
	value="<?php echo $this->populateFormAdd['ADRESSE']; ?>" /> <input
	type="hidden" name="adduser_departement" id="adduser_departement"
	value="<?php echo $this->populateFormAdd['DEPARTEMENT']; ?>" /> <input
	type="hidden" name="adduser_region" id="adduser_region"
	value="<?php echo $this->populateFormAdd['REGION']; ?>" />
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-4  noPadding control-label">
              * Code postal
            </label>
            <div class="col-sm-8">
              <input readonly="readonly" style="border: none;"
	type="text" class="form-control" name="adduser_cp" id="adduser_cp"
	value="<?php echo $this->populateFormAdd['CP']; ?>" />
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-4  noPadding control-label">* Ville</label>
            <div class="col-sm-8">
              <input readonly="readonly" style="border: none;"
	type="text" class="form-control" name="adduser_ville"
	id="adduser_ville"
	value="<?php echo $this->populateFormAdd['VILLE']; ?>" />
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-4  noPadding control-label">* Pays</label>
            <div class="col-sm-8">
              <input readonly="readonly" style="border: none;"
	type="text" class="form-control" name="adduser_pays" id="adduser_pays"
	value="<?php echo $this->populateFormAdd['PAYS']; ?>" />
            </div>
          </div>
          <div class="form-group text-right">
            <span class="link7">
              <a
	href="javascript:;"
	onclick="swichAdresse($('#adresseNew'),$('#adresseOld'),$('#address_type'), 'old')">
                Je
                ne trouve pas mon adresse !
              </a>
            </span>
          </div>
        </div>

        <div id="adresseOld">
          <div class="form-group">
            <label class="col-sm-4  noPadding control-label">
              *
              Adresse
            </label>
            <div class="col-sm-8">
              <input type="text" class="form-control"
	name="adduser_adresse_old"
	value="<?php echo $this->populateFormAdd['ADRESSE']; ?>" />
            </div>
          </div>

          <div class="form-group">
            <label class="col-sm-4  noPadding control-label">
              * Code postal
            </label>
            <div class="col-sm-8">
              <input type="text" class="form-control"
	name="adduser_cp_old"
	value="<?php echo $this->populateFormAdd['CP']; ?>" />
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-4  noPadding control-label">* Ville</label>
            <div class="col-sm-8">
              <input type="text" class="form-control"
	name="adduser_ville_old"
	value="<?php echo $this->populateFormAdd['VILLE']; ?>" />
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-4  noPadding control-label">* Pays</label>
            <div class="col-sm-8">
              <select class="form-control"
	name="adduser_pays_old">
                <?php
	foreach ($this->listPays as $pays) { ?>
                <option value="
                  <?php echo $pays['PAYS']; ?>"
                  <?php if (strcasecmp($this->populateFormAdd['PAYS'], $pays['PAYS']) == 0) { echo 'selected'; } else if ($pays['PAYS'] == "FRANCE") { echo 'selected'; } ?>><?php echo $pays['PAYS']; ?>
                </option>
                <?php }?>
              </select>
            </div>
          </div>
          <div class="form-group text-right">
            <span class="link7">
              <a
	href="javascript:;"
	onclick="swichAdresse($('#adresseOld'),$('#adresseNew'),$('#address_type'), 'new')">
                Trouver
                mon adresse
              </a>
            </span>
          </div>
        </div>

      </div>
    </div>


    <div class="col-sm-12  col-border-default">
      <div class="form-group">
        <label class="col-sm-3 noPadding control-label">
          *
          Vous �tes ?
        </label>
        <div class="col-sm-8">
          <label class="checkbox-inline">
            <INPUT type="radio"
	name="adduser_typeuser" id="adduser_typeuserPart" value="Particulier"
	<?php if ($this->populateFormAdd['TYPE'] == 'Particulier') { echo 'checked="checked"'; } ?>>Particulier
          </label>
          <label class="checkbox-inline">
            <INPUT type="radio"
	name="adduser_typeuser" id="adduser_typeuserPro" value="Professionnel"
	<?php if ($this->populateFormAdd['TYPE'] == 'Professionnel') { echo 'checked="checked"'; } ?>>Professionnel
          </label>
        </div>
      </div>
      <div class="col-sm-12" id="v-UserInfo">
        <div class="col-xs-7 col-xs-offset-2  col-border-default"
          style="margin-bottom: 10px;">
          <div class="form-group">
            <div class="col-sm-12 text-center">
              <span class="text6">
                Informations
                compl�mentaire
              </span>
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3  noPadding control-label">
              *
              Raison sociale
            </label>
            <div class="col-sm-8">
              <input type="text" class="form-control"
	name="adduser_raisonsocial" id="adduser_raisonsocial"
	value="<?php echo $this->populateFormAdd['RAISONSOCIAL']; ?>" />
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3  noPadding control-label">
              *
              Num�ro SIRET
            </label>
            <div class="col-sm-8">
              <input type="text" class="form-control"
	name="adduser_siret" id="adduser_siret"
	value="<?php echo $this->populateFormAdd['SIRET']; ?>" />
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3  noPadding control-label">
              *
              Num�ro T.V.A. Intra Communautaire
            </label>
            <div class="col-sm-8">
              <input type="text" class="form-control"
	name="adduser_numidfisc" id="adduser_numidfisc"
	value="<?php echo $this->populateFormAdd['NUMIDFISC']; ?>" />
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3  noPadding control-label">
              *
              Code A.P.E.
            </label>
            <div class="col-sm-8">
              <input type="text" class="form-control"
	name="adduser_codeape" id="adduser_codeape"
	value="<?php echo $this->populateFormAdd['CODEAPE']; ?>" />
            </div>
          </div>
          <div class="form-group">
            <label class="col-sm-3  noPadding control-label">
              Secteur
              d'activit�
            </label>
            <div class="col-sm-8">
              <input type="text" class="form-control"
	name="adduser_sectactivite" id="adduser_sectactivite"
	value="<?php echo $this->populateFormAdd['SECTACTIVITE']; ?>" />
            </div>
          </div>
        </div>
      </div>

      <div class="form-group">
        <label class="col-sm-4  noPadding control-label">Commentaires</label>
        <div class="col-sm-8">
          <textarea class="form-control" name="adduser_comm"
	id="adduser_comm">
            <?php echo $this->populateFormAdd['COMMENTAIRE']; ?>
          </textarea>
        </div>
      </div>
    </div>



    <div class="col-sm-12">
      <label class="checkbox-inline text-right">
        <input
	type="checkbox" name="adduser_newsletter" id="adduser_newsletter"
	<?php //if (!empty($this->populateFormAdd['newsletter'])) { echo 'checked'; } ?>
        checked="checked" /> Oui, je souhaite m'abonner � la newsletter afin
        d'�tre inform� des promotions exclusives et de l'actualit� de <?php echo $this->siteName; ?>.
      </label>
    </div>

    <div class="col-sm-12 text-center"
      style="margin-bottom: 20px; margin-top: 20px;">
      <input
	id="submitSaveConnexion" class="btn btn-success btn-lg" type="submit"
	value="CREER MON COMPTE" />
    </div>
    <div class="col-sm-12">
      <span class="text3 text-left">
        * Champs
        obligatoires
      </span>
      <br />
      <span class="text3" style="font-style: italic">
        Ces informations sont
        n�cessaires au traitement de votre commande et � la gestion de nos
        relations commerciales. Conform�ment � la Loi Informatique et Libert� du
        6 janvier 1978, vous disposez d'un droit d'acc�s, de rectification et
        d'opposition aux informations vous concernant. Vous pouvez demander � ne
        pas recevoir nos offres en cliquant sur le lien de d�sinscription
        pr�sent sur toutes les newsletters envoy�es par <?php echo $this->siteName; ?>.
      </span>
    </div>

  </form>
</div>
PKi$H[��RYoo(views/scripts/user/ajaxlistcommand.phtmlnu&1i�
<?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');
?> 
<table class="user-cmd-table" cellpadding="0" cellspacing="0" >
	<thead>
			<tr align="center"  >
				<th class="col-xs-2">Date de la commande</th> 
				<th class="col-xs-2">R�f�rence</th> 
				<th class="col-xs-2">Statut</th> 
				<th class="col-xs-2">Prix TTC</th>
				<th style="width: 300px;"></th> 
			</tr>
		</thead>
		<tbody>
			<?php 
				$myCommands = $this->myCommands; 
			
				if (sizeof($myCommands) > 0) {
					foreach ($myCommands as $command) {
					$myDate = new Zend_Date(strtotime($command['DATESTART']));
			?>
			<tr align="center" >
				<td><?php 
				echo $myDate->toString("dd").' '.$mois[(int)$myDate->toString('MM')].' '.$myDate->toString("YYYY");
				?></td>
				<td ><?php echo $command['REFERENCE']; ?></td>
				<td>
				<?php 
					switch ($this->escape($command['STATUT'])) {
						case 1 : echo 'En cours'; break;
						case 2 : echo 'En livraison'; break;
						case 3 : echo 'Termin�e'; break; 
					}
				?>
				</td>
				<td align="right" >
					<span style="margin-right:10px;">
					<?php echo number_format($command['PRIXTOTALTTC'], 2, ',', ' ').' &#8364;'; ?>
					</span>
				</td>
				<td >
						<a target="_blank" href="<?php echo $this->baseUrl; ?>/user/commande/ref/<?php echo $command['REFERENCE']; ?>" title="Voir le d�tail de la commande" class="tooltips btn btn-primary" data-placement="left">
							<i class="fa fa-search"></i> VISUALISER
						</a> 
						<a href="javascript:;" onclick="javascript:retrieveCommandToCaddy('<?php echo $command['REFERENCE']; ?>');" title="Mettre la commande dans mon panier" class="tooltips btn btn-success" data-placement="left">
							<span class="fa fa-plus-circle"></span> AJOUTER AU PANIER
						</a>
				</td>
			</tr>
			<?php 
					}		
			} else { ?>
			<tr>
				<td colspan="5" align="center" class="text3" height="50px">Aucune commande</td>
			</tr>
			<?php } ?>
			</tbody>
		</table>PKi$H[�	�;�; views/scripts/user/facture.phtmlnu&1i�
<?php
$facture = $this->facture;
?>
<style type="text/css">
.textTd1 {
	font-family: "Verdana";
	font-size: 11px;
	font-weight: normal;
	color: #000000;
	text-decoration: none;
}
.oldPromoPrice {
	font-size: 10px;
	font-weight: normal;
	color: #5e5e59;
	text-decoration: line-through;
}

.bill_body {
	clear: both;
	width: 800px;
	margin: 0 auto 0 auto;
}

.bill_header {
	float: clear : both;
	width: 800px;
}

.bill_company {
	float: left;
}
.bill_company_logo {
	margin: 10px 0 10px 10px;
	width: 94px;
	height: 121px;
}
.bill_idents {
	float: right;
	width: 550px;
}
.bill_idents_opt1{
	float:left;
	width:120px;
	height:50px;
	margin:0 0 0 10px;
}

.bill_idents_opt21{
	float:left;
	width:120px;
	height:25px;
	background-color: #e7e7e7;
	margin:0 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}
.bill_idents_opt31{
	float:left;
	width:120px;
	height:24px;
	margin:1px 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}

.bill_idents_opt22{
	float:left;
	width:250px;
	height:25px;
	background-color: #e7e7e7;
	margin:0 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}
.bill_idents_opt32{
	float:left;
	width:250px;
	height:24px;
	margin:1px 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}

.bill_text {
	color: #000000;
	font-weight: bold;
}
.bill_text2 {
	color: #000000;
	font-weight: bold;
	line-height:25px;
}
.bill_text3 {
	color: #000000;
	font-size:11px;
}
.bill_address {
	float: left;
	width: 800px; 
	margin:10px 0 0 0;
}

.bill_address_opt {
	float: left;
	width: 300px; 
	margin: 0 0 0 50px;
	
}
.bill_address_opt1{
	float:left;
	width:300px;
	height:25px;
	background-color: #e7e7e7;
	margin:0 0 0 0;
	text-align:center;
	border: solid 1px black;
	color: #000000;
	font-weight: bold;
}




.bill_address_opt2 {
	float:left;
	width:250px;
	margin: 10px 0 0 20px;
}

.bill_line {
	line-height:25px;
	text-align:center;
	font-weight:bold;
}
.bill_line2 {
	line-height:20px;
}

.bill_caddy {
	float: left;
	width:800px;
	height:auto;
}

.bill_facture{
	float: left;
	width:800px; 
}


.bill_buy{
	float: left;
	width:500px; 
}
 
.bill_user_paiement_box {
	width:450px;
	margin:5px 0 0 0;
	padding: 0 10px 10px 10px;
	border : 2px #000000 solid;
}


.bill_detail{
	float: right;
	width:250px;
	height:130px;
	border: solid 1px black;
	margin: 10px 0 0 0;
}
.bill_footer{
	float: left;
	width:800px;
	margin: 20px 0 0 0;
}
.bill_footer2{
	float: left;
	width:800px;
	text-align:center;
	margin: 0 0 20px 0;
}

.bill_linkd a:link,.bill_linkd a:visited,.bill_linkd a:active {
	font-family: "Arial";
	font-size: 12px;
	font-weight: normal;
	color: #000000;
	text-decoration: none;
}

.bill_linkd a:hover {
	text-decoration: underline;
}
</style>

<div class="spaceBG2" style="clear: both;"></div>
	<div class="col-xs-12 text-center hidden-print" style="margin-top: 20px; margin-bottom: 20px"><a class="btn btn-default" onclick="window.print();return false;" href="<?php echo $this->baseUrl; ?>/"><span class="fa fa-print"></span> Imprimer</a></div>
<div class="bill_body">
	<div class="bill_header">
		<div class="bill_company">
			<div class="bill_company_logo"> 
				<a href="<?php echo $this->baseUrl; ?>/"><img alt="Directement � la source de la qualit�" src="<?php echo $this->baseUrl; ?>/business/image/logo.png" style="border: none;"/></a>
			</div>
		</div>
		<div class="bill_idents">
			<div class="bill_idents_opt1">
				<div class="bill_idents_opt21">
					<span class="bill_line"><?php if ($facture['STATUT'] == 1 || $facture['STATUT'] == 2 || $facture['STATUT'] == 3) { echo 'Facture';} else {echo 'Devis';} ?></span>
				</div>
				<div class="bill_idents_opt31">
					<span class="bill_line"><?php echo $facture['REFERENCE']; ?></span>
				</div>
			</div>
			<div class="bill_idents_opt1">
				<div class="bill_idents_opt21">
					<span class="bill_line"><?php echo 'Date'; ?></span>
				</div>
				<div class="bill_idents_opt31">
					<span class="bill_line">
					<?php 
					try {
					$myDate = new Zend_Date(strtotime($facture['DATESTART']));
					
					$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');
				
					echo $myDate->toString("dd").' '.$mois[(int)$myDate->toString('MM')].' '.$myDate->toString("YYYY");
					} catch(Zend_Exception $e) { } 
					?>
					</span>
				</div>
			</div>
			<div class="bill_idents_opt1">
				<div class="bill_idents_opt22">
					<span class="bill_line"><?php echo 'Client'; ?></span>
				</div>
				<div class="bill_idents_opt32">
				<span class="bill_line"><?php echo $facture['USER_EMAIL']; ?></span>
				</div>
			</div> 
		</div>
		<div style="float: left;width:800px ">
			<?php if (!empty($facture['USER_NUMCOMPTE'])) {?>
			<span class="bill_text">Compte : <?php echo $facture['USER_NUMCOMPTE']; ?></span><br>
			<?php } ?>
			<span class="bill_text">Tel : <?php echo $this->tel_contact; ?></span><br>
			<span class="bill_text">Email : <?php  echo $this->serviceClient_Mail;?></span>
		</div>
	</div>
	<div class="bill_address">
		<div class="bill_address_opt">
			<div class="bill_address_opt1">
				<span class="bill_line">Adresse de Facturation</span>
			</div>
			<div class="bill_address_opt2">
				<span class="bill_text2"><?php echo $facture['FACT_RAISONSOCIAL']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['FACT_ADRESSE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['FACT_CP'].' '.$facture['FACT_VILLE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['FACT_PAYS']; ?></span>
			</div>
		</div>
		<div class="bill_address_opt">	
			<div class="bill_address_opt1">
				<span class="bill_line">Adresse de Livraison</span>
			</div>
			<div class="bill_address_opt2">
				<span class="bill_text2"><?php echo $facture['LIV_RAISONSOCIAL']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['LIV_ADRESSE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['LIV_CP'].' '.$facture['LIV_VILLE']; ?></span><br>
				<span class="bill_text2"><?php echo $facture['LIV_PAYS']; ?></span>
			</div>
		</div>
	</div>
	<div class="bill_caddy">
		<table style="border:1px solid black;"  border="0" cellpadding="0" cellspacing="0" width="100%">
			<tr align="center" style="background-color: #e7e7e7;">
				<th class="bill_line" >R�f�rence</th>
				<th class="bill_line">D�signation</th>
				<th class="bill_line" style="width: 60px">Dispo.</th>
				<th class="bill_line">Quantit�</th>
				<th class="bill_line"  style="text-align: center">P.U. HT</th>
				<th class="bill_line"  style="display: none;">Prix Remis�</th>
				<th class="bill_line" >Montant HT</th>
			</tr>
			<?php 
			$index = 1;
			$i = 0;
			$caddy = $facture['CADDY'];
			foreach($caddy as $row) {
				?>
			<tr >
				<td colspan="6" height="1px" style="background-color: #868686"></td>
			</tr>
			<tr align="center"  height="25px" >
				<td class="textTd1" width="110px" style="text-align:center;white-space: nowrap;">
					<?php echo $this->escape($row['REFERENCE']);?>
				</td>
				<td  width="450px" class="bill_linkd" style="text-align: left;">
					<a target="_blank"  href="<?php echo $this->baseUrl; ?>/<?php echo Utils_Tool::getFormattedUrlProduct($row['NAVNOM_URLPARENTS'], $row['NAVPRODUCTNOM'], $row['PRODUCTID']); ?>"><?php echo $row['DESIGNATION'];?></a>
					<?php if (!empty($row['SELECTEDOPTION'])) { 
						echo '<br/>'.$row['SELECTEDOPTION'].'<br/>';
					} ?>
				</td> 
				<td class="textTd1" > 
					<?php if ((int)$row['STOCK'] == 1) { ?>
					<img alt="Disponible" title="Disponible" src="<?php echo $this->baseUrl; ?>/business/image/admin/stock11.png" />
					<?php } else if ((int)$row['STOCK'] == 2) { ?>
					<img alt="Disponible sous 8 jours" title="Disponible sous 8 jours" src="<?php echo $this->baseUrl; ?>/business/image/admin/stock22.png" />
					<?php } else if ((int)$row['STOCK'] == 3) { ?>
					<img alt="Nous contacter" title="Nous contacter" src="<?php echo $this->baseUrl; ?>/business/image/admin/stock33.png" />
					<?php }?> 	
				</td>
				<td class="textTd1" >
					<?php echo $row['QUANTITY']; ?>	
				</td>
				<td class="textTd1" width="150px">
						<?php $this->currentData = $row;
						echo $this->render("/produits/ajaxshowpromoprice.phtml"); ?>
				</td>
				<td width="120px"  style="display: none;">
				<?php if ($row['isPROMO'] == 1 && $row['REMISEPRIX'] > 0) { ?>
					<span class="textTd1" >
						<?php
							if ((int)$row['REMISEPRIXTAUXP'] > 0) {
									echo number_format($row['REMISEPRIX'], 2, ',', ' ').' &#8364; <br>('.$this->escape($row['REMISEPRIXTAUXP']).' %)';
								} else {
									echo number_format($row['REMISEPRIX'], 2, ',', ' ').' &#8364;';
								}
							?>
					</span>
					<?php } ?>
				</td>
				<td width="120px">
					<span class="textTd1" style="float: right;" >
						<?php if ($row['isDEVIS'] == 1) { 
							echo number_format($row['PRIXTOTAL'], 2, ',', ' ').' &#8364;';
						} ?>
					</span>
				</td>
			</tr>
			<?php $i++; } ?>
<?php
	$caddyfidelite = $facture['CADDYFIDELITE'];
	foreach($caddyfidelite as $row) {
		?>
    <tr>
      <td colspan="6">
        <div style="font-weight: bold;margin:10px;">
          <?php echo 'Carte de fid�lit� : '.$row['NOM'].' ('.$row['NBPOINT'].' points)'; ?>
        </div>
      </td>
    </tr>
  <?php } ?>			
		</table>
	</div>
	<div class="bill_facture"> 
		<div class="bill_buy">   
				<?php switch ($facture['USER_MODEPAIEMENT_TYPE']) {
						case 1 : ?>
						<div class="bill_user_paiement_box">
							<div class="bill_text2" style="text-align:center">Mode de paiement : Par ch�que</div>
							<div style="margin-left:10px">- Veuillez libeller votre ch�que � l�ordre de <?php echo $this->siteName; ?></div>
							<div style="margin-left:10px">- Inscrivez le num�ro de votre commande au dos de votre ch�que</div>
							<div style="margin-left:10px">- Puis envoyez votre r�glement � l�adresse suivante :</div>
							<br/>
							<div class="bill_text" style="text-align:center"><?php echo $this->siteName; ?></div>
							<br/>
							<div class="bill_text" style="text-align:center"><?php echo $this->site_addresse3_title; ?></div>
							<div class="bill_text" style="text-align:center"><?php echo $this->site_addresse3_address; ?></div>
							<div class="bill_text" style="text-align:center"><?php echo $this->site_addresse3_cp; ?></div>
							<br/>
							<div style="font-size:10px;text-align:center">A noter : Les produits sont exp�di�s � r�ception du ch�que</div> 
						</div> 
						<?php  break;
							case 2 : ?>  
						<div class="bill_user_paiement_box">
							<div class="bill_text2" style="text-align:center">Mode de paiement : Par virement</div>
							<div >- La commande sera exp�di�e d�s le virement pr�sent sur notre compte bancaire.</div> 
							<div class="bill_text">- Inscrivez votre num�ro de commande sur le formulaire de virement</div> 
							<div >- Vous disposez d�un <span style="font-weight: bold;">d�lai de 15 jours</span> pour effectuer le virement sur notre compte ci-dessous indiqu�, au d�l� de ce d�lai votre commande sera automatiquement annul�e.</div> 
							<br/>
							<div class="bill_text">RIB : <?php echo $this->site_rib_numbers; ?></div> 
							<div class="bill_text">No IBAN : <?php echo $this->site_rib_iban; ?></div> 
							<div class="bill_text">Code BIC : <?php echo $this->site_rib_bic; ?></div> 
							<div class="bill_text">Nom du compte : <?php echo $this->siteName; ?></div> 
							<div class="bill_text">Nom et domiciliation de la banque : <?php echo $this->site_rib_bankname; ?></div>  
						</div> 
				<?php 	break;
						default : ?>
							<span class="bill_text2">
							<?php if (empty($facture['USER_MODEPAIEMENT_LABEL'])) { ?> Mode de reglement :
							<?php 
								switch ($facture['USER_MODEPAIEMENT']) {
									case 1 : echo " Paiement s�curis� en ligne"; break;
									case 2 : echo " Contre remboursement";break;
									case 3 : echo " Paiement diff�r� - 30 jours";break;
									case 4 : echo " Paiement diff�r� - 45 jours";break;
									case 5 : echo " Paiement diff�r� - 60 jours";break;
									case 6 : echo " A r�ception de la facture";break;
								}
							} else { 
								echo $facture['USER_MODEPAIEMENT_LABEL'];
							} ?>
							</span>	 
						<?php 
						break;  
				} ?>  
		</div> 
		<div class="bill_detail">
			<table border="0" cellpadding="0" cellspacing="0" width="100%">
				<tr align="right">
					<td class="bill_line2">Total HT</td>
					<td  class="bill_line2"><?php echo number_format($facture['PRIXTOTALHTHR'], 2, ',', ' '); ?> &#8364;</td>
				</tr>	
				<tr align="right">
					<td  class="bill_line2" >Remise <?php if (isset($facture['CODEREDUCTION']) && !empty($facture['CODEREDUCTION']) ) { echo " ( ".$facture['CODEREDUCTION']." ) "; } ?></td>
					<td  class="bill_line2" ><?php echo number_format($facture['PRIXREMISEEUR'], 2, ',', ' '); ?> &#8364;</td>
				</tr>	
				<tr align="right"> 
					<td  class="bill_line2">
						<?php if (strcasecmp($facture['LIV_PAYS'], "FRANCE") != 0) { ?>
						Prix d�part 	
						<?php } else {
							if (isset($facture['LIV_NOM']) && !empty($facture['LIV_NOM']) ) { echo 'Livraison en '.$facture['LIV_NOM']; } else { echo 'Frais de port'; } 
						} ?>
					</td>
					
					<td class="bill_line2"><?php echo number_format($facture['PRIXFRAISPORT'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
				<tr >
					<td colspan="2" height="1px" style="background-color: #868686"></td>
				</tr>
				<tr align="right">
					<td class="bill_text2">Net HT</td>
					<td class="bill_text2"><?php echo number_format($facture['PRIXTOTALHTFP'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
				<tr align="right">
					<td  class="bill_line2">Total TVA</td>
					<td  class="bill_line2"><?php echo number_format($facture['PRIXTOTALTVA'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
				<tr >
					<td colspan="2" height="1px" style="background-color: #868686"></td>
				</tr>
				<tr align="right">
					<td class="bill_text2">NET A PAYER TTC</td>
					<td class="bill_text2"><?php echo number_format($facture['PRIXTOTALTTC'], 2, ',', ' '); ?> &#8364;</td>
				</tr>
			</table>
		</div>
	</div>
	
	
	<div class="bill_footer">
			<span class="link18">
				<input type="checkbox" checked="checked" disabled="disabled"/>
				J'ai pris connaissance des Conditions G�n�rales de Vente et les accepte sans r�serves.
			</span>
			<br /><br />
			<span class="bill_text3">
			P�nalit�s de retard (taux annuel) : 9,00% 
			</span><br>
			<span class="bill_text3">
			<b>RESERVE DE PROPRIETE</b> : Nous nous r�servons la propri�t� des marchandises jusqu'au paiement du prix par l'acheteur. Notre droit de revendication porte aussi bien sur les marchandises que sur leur prix si elles ont d�j� �t� revendues (Loi du 12 mai 1980). 
			</span><br><br>
	</div>
	
		<div class="bill_footer2" >
				<span class="bill_text3">
			<?php echo $this->site_addresse; ?>
			</span><br>
			<span class="bill_text3">
			<?php echo $this->site_actualshort; ?>
			</span>
		</div >
</div>
PKi$H[]s��WW+views/scripts/user/ajaxcaddyselection.phtmlnu&1i�

<script  type="text/javascript" >

$(function(){
	initEventsCaddyType();
});

</script>  

<?php $caddyTypes = $this->caddyType; ?>
<div class="userAccount_Panel">	
	<?php if (isset($caddyTypes) && !empty($caddyTypes)) { ?>
	<form  id="caddyTypeCheckForm" action="<?php echo $this->baseUrl; ?>/mon-panier-type-actualiser.html" method="post"> 
	<table class="user-cmd-table"cellpadding="0" cellspacing="0" width="100%">
		<thead >
		<tr align="center" >
			<th >Produit</th> 
			<th >Prix Unitaire (HT)</th> 
			<th >Prix remis�</th> 
			<th style="width: 100px;">Quantit�</th>
			<th>Prix Total</th> 
		</tr>  
		</thead>
		<tbody>
		<?php foreach($caddyTypes as $row) { ?>
		<tr align="center" >
			<td  >
				<div class="caddyProdImg" >  
					<a target="_blank" class="tooltips" data-placement="right" href="<?php echo $this->baseUrl; ?>/<?php echo Utils_Tool::getFormattedUrlProduct($row->navnom_urlparents, $row->navnom, $row->idProduit); ?>"
						title="<?php echo $this->escape($row->designation);?>" >
						<img src="<?php echo $this->baseUrl.'/'.$row->url; ?>">
					</a>
				</div>
				<div class="caddyProdTxt" >
					<div class="link17" style="width: auto;clear:both">
						<a target="_blank" class="tooltips"  data-placement="top" href="<?php echo $this->baseUrl; ?>/<?php echo Utils_Tool::getFormattedUrlProduct($row->navnom_urlparents, $row->navnom, $row->idProduit); ?>"
						title="<?php echo $this->escape($row->designation);?>">
							<?php echo $row->designation;?>
						</a>
					</div>
					<div class="textA1 productDetail_ref">
						<?php echo "Ref. ".$this->escape($row->reference);?>
					</div>
				</div>
			</td>  
			<td >
				<?php if (!$row->isSurDevis()) { ?>
					<div class="textA2" >
						<?php echo number_format($row->prix, 2, ',', ' ').' ';?>
						<span style="color: #000000">&#8364;</span>
					</div> 
				<?php } else { ?>
					<div >
						<span class="textA2" >sur devis</span>
					</div>
				<?php } ?>
			</td> 
			<td  >
				<?php if (!$row->isSurDevis()) { 
					if ($row->isPromoCaddyType) { ?>
				 	<div class="textA2">
					 	<?php echo number_format($row->getPrixAfterRemise(), 2, ',', ' ').' ';?>
					 	<span style="color: #000000">&#8364;</span> 
					 </div>  
				<?php } else { echo '&nbsp;'; }
					} else { ?>
					<div >
						<span class="textA2" >sur devis</span>
					</div>
				<?php } ?>
			</td>
			<td>
				<div class="col-xs-12 noPadding">  
					<div class="col-xs-8 noPadding">
						<input  onclick="javascript:clearInput($(this), '0');" type="text" class="form-control input-sm text-center caddyQuantity" maxlength="6" name="Quantity[]" value="<?php echo $row->qte; ?>" /> 
					</div>
					<div class="col-xs-4 noPadding" style="margin-top: 5px; ">
						<a href="javascript:;" onclick="changeValueOfCaddyTypeQte($(this), 0)">
							<img alt="Supprimer" class="tooltips" data-placement="right" title="Supprimer" src="<?php echo $this->baseUrl; ?>/business/image/mini_trash.png">
						</a>  
					</div>
				</div> 				
				<input type="hidden" name="selectedOption[]" value="<?php echo $row->selectedOption; ?>" /> 
				<input type="hidden" name="Child[]" value="<?php echo $row->idChild; ?>" /> 
				<input type="hidden" name="CaddyType[]" value="<?php if ($row->isPromoCaddyType) { echo $row->id; } else { echo '0'; } ?>" />  
				<input type="hidden" name="QuantityMin[]" value="<?php echo $row->qte_min; ?>" />  
			</td> 
			<td  >
				<?php if (!$row->isSurDevis()) { 
					if ($row->isPromoCaddyType) { ?>
				 	<div class="textA2">
					 	<?php echo number_format($row->getPrixAfterRemise(), 2, ',', ' ').' ';?>
					 	<span style="color: #000000">&#8364;</span> 
					 </div>  
				<?php } else { ?>
					<div class="textA2" >
						<?php echo number_format($row->prix, 2, ',', ' ').' ';?>
						<span style="color: #000000">&#8364;</span>
					</div>  
				<?php }
				} else { ?>
					<div >
						<span class="textA2" >sur devis</span>
					</div>
				<?php } ?>
			</td>
		</tr>
		<?php } ?>
		</tbody>
		</table> 
		<div class="col-xs-12 text-center" style="margin-top: 10px;"> 
			<button type="submit" class="tooltips btn btn-success" data-placement="left" title="Mettre la s�lection dans mon panier" >
			  <span class="fa fa-plus-circle"></span> AJOUTER AU PANIER
			</button>
		</div>  
	</form> 
	<?php } else { ?>
	<div class="userAccount_NoCaddyType">
		<span>Vous n�avez pas encore de s�lection,</span>
		<span>Contactez-nous le plus vite possible !</span>
		<span><?php echo $this->siteName; ?></span>
		<?php echo $this->site_addresse2; ?>		
		<span>N� Azur : <?php echo $this->tel_contact; ?></span>
		<span><?php echo $this->contact_Mail; ?></span> 
	</div>
	<?php } ?>
</div>  PKi$H[D:�==-views/scripts/user/sendmailtoconseiller.phtmlnu&1i�<form action="<?php echo $this->baseUrl; ?>/contacter-un-conseiller.html" method="post">
	<div class="user_mail_field_component_textarea">	
		<span class="messageError2"><?php echo $this -> messageErrorAskConseiller; ?></span>
		<span class="messageSuccess2"><?php echo $this -> messageSuccessAskConseiller; ?></span>
	</div>
	<?php if (!$this->isConnected) { ?>
	<div class="user_mail_field_title text6">Vous contacter par :</div>
	<div class="user_mail_field_component">
		<div class="user_mail_field_text"><span>Email</span></div>
		<div class="user_mail_field_text2">
			<input type="text" class="input4" name="user_email" value="<?php echo $this->messageMail; ?>"/>
		</div>
	</div>
	<div class="user_mail_field_component">
		<div class="user_mail_field_text"><span>T�l�phone</span></div>
		<div class="user_mail_field_text2">	
			<input type="text" class="input4" name="user_tel" value="<?php echo $this->messageTel; ?>"/>
		</div>
	</div>
	<?php } ?>
	<div class="user_mail_field_title text6">Votre message :</div>
	<div class="user_mail_field_component_textarea"><textarea cols="80" rows="10" name="user_message" ><?php echo $this->messageBody; ?></textarea></div>
	<div class="user_mail_field_component_textarea" >
		<input type="submit" class="button" style="margin: 20px;" value="Envoyer" title="Envoyer le mail">
	</div> 
</form>PKi$H[#views/scripts/user/newsletter.phtmlnu&1i�PKi$H[views/scripts/user/index.phtmlnu&1i�PKi$H[	2rf��.views/scripts/user/ajaxlistcartefidelite.phtmlnu&1i�
<?php $carteFidelite = $this->carteFidelite; ?>
<div class="userAccount_Panel"  style="padding-bottom:150px;">
  <div class="col-md-12 text-center">
    <h3>Nombre de points : <?php echo $carteFidelite['POINTFIDELITETOTAL']; ?></h3><hr/>
  </div>

  <?php foreach($this->listfidelitegift as $row)  { ?>
  <div class="col-md-12">
    <h4><?php echo $row['TITRE'];?> : <?php echo $row['POINTFIDELITE'];?> points</h4>
  </div>
  <div class="col-md-12" style="padding:10px">
    <div class="col-md-10">
      <?php echo $row['CONTENT'];?>
    </div> 
    <div class="col-md-2">
      <a class="btn btn-success" <?php if ($carteFidelite['POINTFIDELITETOTAL'] < $row['POINTFIDELITE']) { echo "disabled"; }?> href="<?php echo $this->baseUrl; ?>/user/addcaddyfidelitypoint/id/<?php echo $row['ID']; ?>" ><span class="fa fa-plus-circle"></span> AJOUTER AU PANIER</a>
		</div>
  </div>
  <?php } ?>
</div>PKi$H[�	ƃ�=�="views/scripts/user/moncompte.phtmlnu&1i�
<script>  
$(function(){
	initEventUser();
	
	var params = new Array();
	params['route'] = $('#edituser_adresse');
	params['locality'] = $('#edituser_ville');
	params['administrative_area_level_2'] = $('#edituser_departement');
	params['administrative_area_level_1'] = $('#edituser_region');
	params['country'] = $('#edituser_pays');
	params['postal_code'] = $('#edituser_cp');
	
	initEventAddress($('#edituser_adressecomplete'), params);

	
});
</script>
<style>
.form-group { 
margin: 0 0 10px 0;	
}
.help-block {
	margin-bottom: 0;
}
.form-horizontal .control-label {
font-size: 13px;
}
</style>
<?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');
?>
<div class="userAccount_TitleContent">
	<div class="userAccount_Title"></div>
	<div class="col-xs-12 noPadding">
    <div class="btn-group btn-group-justified" role="group" >
      <div class="btn-group" role="group">
        <button type="button" id="userAccount_InfosTrigger" class="btn btn-primary user-btn-tab">Mes Informations</button>
      </div>
      <div class="btn-group" role="group">
        <button type="button" id="userAccount_CmdTrigger" class="btn btn-primary user-btn-tab">Mes Commandes</button>
      </div>
      <div class="btn-group" role="group">
        <button type="button" id="userAccount_DevisTrigger" class="btn btn-primary user-btn-tab">Mes Devis</button>
      </div>
      <div class="btn-group" role="group">
        <button type="button" id="userAccount_CaddyTrigger" class="btn btn-primary user-btn-tab">Ma S�lection</button>
      </div>
      <?php  if ($this->isCarteFideliteEnable) {  ?>
      <div class="btn-group" role="group">
        <button type="button" id="userAccount_CarteFideliteTrigger" class="btn btn-primary user-btn-tab">Ma carte de fid�lit�</button>
      </div>
      <?php } ?>
    </div>
	</div>
</div>	
<div class="userAccount_Content"> 
	<div id="userAccount_Caddy"  class="userAccount_Panel">	
		<?php echo $this->render("/user/ajaxcaddyselection.phtml"); ?>
	</div>
	<div id="userAccount_Cmd"  class="userAccount_Panel">	
		<?php echo $this->render("/user/ajaxlistcommand.phtml"); ?>
	</div>	
	<div id="userAccount_Devis"  class="userAccount_Panel">	
		<?php echo $this->render("/user/ajaxlistdevis.phtml"); ?>
	</div>
  <?php  if ($this->isCarteFideliteEnable) { ?>
  <div id="userAccount_CarteFidelite" class="userAccount_Panel">
    <?php echo $this->render("/user/ajaxlistcartefidelite.phtml"); ?>
  </div>
  <?php } ?>
		
	<div id="userAccount_Infos" class="userAccount_Panel">  
		<div class="userAccount_Message"> 
			<span class="messageError2" ><?php echo $this->messageErrorEditUser; ?></span>
			<span class="messageSuccess2" ><?php echo $this->messageSuccessEditUser; ?></span>
		</div>
		<div class="userAccount_InfosLogin">
		
		
		<form class="form-horizontal" name="editUserIdentForm" action="<?php echo $this->baseUrl; ?>/mon-compte-modification-des-identifiants.html" method="POST">	
			<div class="col-xs-6 col-xs-offset-3">					
					<div class="form-group">
				    	<label   class="col-sm-4 col-sm-offset-4 control-label text6">Vos Identifiants</label>
				  	</div>
					  
				  <div class="form-group">
				    <label for="edituser_login" class="col-sm-5 control-label">* Identifiant (Email)</label>
				    <div class="col-sm-5">
				    	<input type="text" class="form-control input-sm" name="edituser_login" id="edituser_login" value="<?php echo $this->populateFormEdit['login']; ?>"/>
					</div>
				  </div>
					  
				  <div class="form-group">
				    <label for="edituser_mdp" class="col-sm-5 control-label">* Mot de passe</label>
				    <div class="col-sm-5">
				    	<input type="password" class="form-control input-sm" name="edituser_mdp" id="edituser_mdp" />
				    	<span class="help-block">4 caract�res minimum</span>
					</div>
				  </div>
					  
				  <div class="form-group">
				    <label for="edituser_mdp2" class="col-sm-5 control-label">* Confirmation du mot de passe</label>
				    <div class="col-sm-5">
						<input type="password" class="form-control input-sm" name="edituser_mdp2" id="edituser_mdp2" />
						<span class="help-block">4 caract�res minimum</span>
					</div>
				  </div>
			</div>
			<div style="clear:both;margin: 5px auto 5px auto; text-align: center;" >
				<input type="submit" value="CHANGER MON MOT DE PASSE" class="btn btn-primary" />
			</div>
		</form>
		</div>
		<div class="lineBG2" ><!-- --></div>
		
		
		<form class="form-horizontal" role="form" name="editUserForm" action="<?php echo $this->baseUrl; ?>/mon-compte-modification-des-informations.html" method="POST">
			<div class="col-xs-12">
				<div class="col-xs-6">
					<div class="form-group">
				    	<label   class="col-sm-4 control-label text6">Vos Identifiants</label>
				  	</div>
				  
				  <div class="form-group">
				    <label for="edituser_civility" class="col-sm-3 control-label">* Civilit�</label>
				    <div class="col-sm-9">
				    	<select class="form-control input-sm" name="edituser_civility" id="edituser_civility">
							<option value="Mr" <?php if ($this->populateFormEdit['civilite'] == 'Mr') { echo 'selected'; } ?>>Monsieur</option>
							<option value="Mme" <?php if ($this->populateFormEdit['civilite'] == 'Mme') { echo 'selected'; } ?>>Madame</option>
							<option value="Mlle" <?php if ($this->populateFormEdit['civilite'] == 'Mlle') { echo 'selected'; } ?>>Mademoiselle</option>
						</select>
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="edituser_nom" class="col-sm-3 control-label">* Nom</label>
				    <div class="col-sm-9">
				      	<input type="text" class="form-control input-sm" name="edituser_nom" id="edituser_nom" value="<?php echo $this->populateFormEdit['nom']; ?>" />
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="edituser_prenom" class="col-sm-3 control-label">* Pr�nom</label>
				    <div class="col-sm-9">
				     	<input type="text" class="form-control input-sm" name="edituser_prenom" id="edituser_prenom"  value="<?php echo $this->populateFormEdit['prenom']; ?>"/>
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="edituser_fct" class="col-sm-3 control-label">Fonction</label>
				    <div class="col-sm-9">
				     	<input type="text" class="form-control input-sm" name="edituser_fct" id="edituser_fct"  value="<?php echo $this->populateFormEdit['fonction']; ?>"/>
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="edituser_tel" class="col-sm-3 control-label">* T�l�phone</label>
				    <div class="col-sm-9">
				     	<input type="text" class="form-control input-sm" name="edituser_tel" id="edituser_tel" value="<?php echo $this->populateFormEdit['tel']; ?>"/>
				   		<span class="help-block">(Exemple : 0810120007)</span>
				    </div>
				  </div>
				  <div class="form-group">
				    <label for="edituser_fax" class="col-sm-3 control-label">Fax</label>
				    <div class="col-sm-9">
				     	<input type="text" class="form-control input-sm" name="edituser_fax" id="edituser_fax" value="<?php echo $this->populateFormEdit['fax']; ?>"/>
				   		<span class="help-block">(Exemple : 0810120007)</span>
				   	 </div>
				  </div>		
				  <div class="form-group">
				    <label for="edituser_email" class="col-sm-3 control-label">* Email</label>
				    <div class="col-sm-9">
				     	<input type="email" class="form-control input-sm" name="edituser_email" id="edituser_email"  value="<?php echo $this->populateFormEdit['email']; ?>"/>
						<input type="hidden" id="address_type" name="address_type" value="old">
				    </div>
				  </div>		
				</div>  
			  
				 <div class="col-xs-6" id="adresseOld">
					<div class="form-group">
				    	<label   class="col-sm-4 control-label text6">Votre adresse</label>
				  	</div>
				  	<div class="form-group">
				    	<label for="edituser_adresse_old" class="col-sm-3 control-label">* Adresse</label>
				    	<div class="col-sm-9">
				     		<input type="text" class="form-control input-sm" name="edituser_adresse_old"  value="<?php echo $this->populateFormEdit['adresse']; ?>"/>
						</div>
				  	</div>
				  	<div class="form-group">
				    	<label for="edituser_cp_old" class="col-sm-3 control-label">* Code postal</label>
				    	<div class="col-sm-9">
				     		<input type="text" class="form-control input-sm" name="edituser_cp_old"   value="<?php echo $this->populateFormEdit['cp']; ?>"/>
						</div>
				  	</div>
				  	<div class="form-group">
				    	<label for="edituser_ville_old" class="col-sm-3 control-label">* Ville</label>
				    	<div class="col-sm-9">
				     		<input type="text" class="form-control input-sm" name="edituser_ville_old"  value="<?php echo $this->populateFormEdit['ville']; ?>"/>
						</div>
				  	</div>
				  	<div class="form-group">
				    	<label for="edituser_pays_old" class="col-sm-3 control-label">* Pays</label>
				    	<div class="col-sm-9">
				     		<select class="form-control input-sm" name="edituser_pays_old" >
								<?php  
								foreach ($this->listPays as $pays) { ?>
								<option value="<?php echo $pays['PAYS']; ?>" <?php if (strcasecmp($this->populateFormEdit['pays'], $pays['PAYS']) == 0) { echo 'selected'; } ?>><?php echo $pays['PAYS']; ?></option>
								<?php }?>
							</select>
						</div>
				  	</div>
				</div>
			</div>	 
					
			<div style="float: left;display: none;"  id="adresseNew">
					<table cellpadding="0" cellspacing="5" border="0" width="380px" >
						<tr style="display: none;">
							<td  colspan="2">
								<span  class="link7"><a href="javascript:;" onclick="swichAdresse($('#adresseOld'),$('#adresseNew'),$('#address_type'), 'new')">Trouver mon adresse</a></span>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<span class="text6">Votre adresse</span>
								<div class="messageError" id="addressError" style="clear: both;display: none;"></div>
							</td>
						</tr>
						<tr>
							<td>
								* Adresse :  	
							</td>
							<td>
								<input type="text" class="input4" name="edituser_adressecomplete" id="edituser_adressecomplete"  value="<?php echo $this->populateFormEdit['adressecomplete']; ?>"/>
							</td>
						</tr>
						
						<tr>
							<td >
								Rue :  	
							</td>
							<td>
								<input type="text" style="border: none;" readonly="readonly" class="input4" name="edituser_adresse" id="edituser_adresse"  value="<?php echo $this->populateFormEdit['adresse']; ?>"/>
								<input type="hidden" name="edituser_departement" id="edituser_departement"  value="<?php echo $this->populateFormEdit['departement']; ?>"/>
								<input type="hidden" name="edituser_region" id="edituser_region"  value="<?php echo $this->populateFormEdit['region']; ?>"/>
							</td>
						</tr> 
						<tr>
							<td>
								Code postal :  	
							</td>
							<td>
								<input readonly="readonly"  style="border: none;" type="text"  name="edituser_cp" id="edituser_cp"  value="<?php echo $this->populateFormEdit['cp']; ?>"/>
							</td>
						</tr>
						<tr>
							<td>
								Ville :  	
							</td>
							<td>
								<input readonly="readonly"  style="border: none;" type="text"  name="edituser_ville" id="edituser_ville"  value="<?php echo $this->populateFormEdit['ville']; ?>"/>
							</td>
						</tr>
						<tr>
							<td>
								Pays : 	
							</td>
							<td>
								<input readonly="readonly"  style="border: none;"  type="text" class="input4" name="edituser_pays" id="edituser_pays"  value="<?php echo $this->populateFormEdit['pays']; ?>"/>
							</td>
						</tr>
						<tr>
							<td colspan="2">
								<span class="link7"><a href="javascript:;" onclick="swichAdresse($('#adresseNew'),$('#adresseOld'),$('#address_type'), 'old')">Je ne trouve pas mon adresse !</a></span>
							</td>
						</tr>
					</table>
				</div>
				
				
			<div class="lineBG2"><!-- --></div>
			
			<div class="col-xs-6 col-xs-offset-3">	
				  <div class="col-sm-6 col-xs-12">
				    	<label   class="control-label text6">* Vous etes ?</label>
				  </div>
				  <div class="col-sm-3 col-xs-6">
				  	<div class="radio">
					  <label>
					    <INPUT type=radio name="edituser_typeuser" id="edituser_typeuserPart" value="Particulier" <?php if ($this->populateFormEdit['type'] == 'Particulier') { echo 'checked="checked"'; } ?>  >
					    Particulier
					  </label>
					</div>				   
				  </div>
				  <div class="col-sm-3 col-xs-6">
				  
				  	<div class="radio">
					  <label>
					    <INPUT type=radio name="edituser_typeuser" id="edituser_typeuserPro" value="Professionnel" <?php if ($this->populateFormEdit['type'] == 'Professionnel') { echo 'checked="checked"'; } ?> >
					    Professionnel
					  </label>
					</div>
				    
				  </div>
			</div>
			
			<div class="col-xs-7 col-xs-offset-2" id ="v-UserInfo">	
					<div class="form-group">
				    	<label  class="col-sm-5 control-label text6">+ d'informations</label>
				  	</div>
			  	<div class="form-group">
			    	<label for="edituser_raisonsocial" class="col-xs-5 control-label">* Raison sociale</label>
			    	<div class="col-xs-7">
			     		<input type="text" class="form-control input-sm" name="edituser_raisonsocial" id="edituser_raisonsocial"  value="<?php echo $this->populateFormEdit['raisonsocial']; ?>"/>
					</div>
			  	</div>
			  	<div class="form-group">
			    	<label for="edituser_siret" class="col-xs-5 control-label">* Num�ro SIRET</label>
			    	<div class="col-xs-7">
			     		<input type="text" class="form-control input-sm" name="edituser_siret" id="edituser_siret"  value="<?php echo $this->populateFormEdit['siret']; ?>"/>
					</div>
			  	</div>
			  	<div class="form-group">
			    	<label for="edituser_numidfisc" class="col-xs-5 control-label">* Num�ro T.V.A. Intra Communautaire</label>
			    	<div class="col-xs-7">
			     		<input type="text" class="form-control input-sm" name="edituser_numidfisc" id="edituser_numidfisc"  value="<?php echo $this->populateFormEdit['numidfisc']; ?>"/>
					</div>
			  	</div>
			  	<div class="form-group">
			    	<label for="edituser_codeape" class="col-xs-5 control-label">* Code A.P.E.</label>
			    	<div class="col-xs-7">
			     		<input type="text" class="form-control input-sm" name="edituser_codeape" id="edituser_codeape"  value="<?php echo $this->populateFormEdit['codeape']; ?>"/>
					</div>
			  	</div>
			  	<div class="form-group">
			    	<label for="edituser_sectactivite" class="col-xs-5 control-label">Secteur d'activit�</label>
			    	<div class="col-xs-7">
			     		<input type="text" class="form-control input-sm" name="edituser_sectactivite" id="edituser_sectactivite"  value="<?php echo $this->populateFormEdit['sectactivite']; ?>"/>
					</div>
			  	</div>
			
			</div>
						
			<div class="lineBG2"><!-- --></div>
			
			<div class="col-xs-7 col-xs-offset-2">				
			  	<div class="form-group">
			    	<label for="edituser_comm" class="col-xs-5 control-label">Commentaires</label>
			    	<div class="col-xs-7"> 
			     		<textarea class="form-control  input-sm" name="edituser_comm" id="edituser_comm" ><?php echo $this->populateFormEdit['commentaire']; ?></textarea>
					</div>
			  	</div>
			</div>
			 
			<div style="clear: both;text-align: right;">
				<div style="margin: 10px 0 10px 0"><span class="text3">* Champs obligatoires</span></div>
			</div> 
			<div style="clear: both;margin : 0 auto 0 auto;text-align: center;" >
				<input type="submit" value="MODIFIER MES INFORMATIONS"  class="btn btn-primary"  />
			</div>
		</form>
		<div style="clear: both; height: 10px;"></div>
	</div>
</div>PKi$H[;YP=aaviews/scripts/error/error.phtmlnu&1i�
<div id="page">
	<div class="big_header"><h1 class="big_header">Page non trouv�e</h1></div>	
	<div class="submenu">
		<a href="/" class="custom_font filter">Accueil</a>
	</div>
	<div class="scroll-pane">
		<div class="page_block">
			<blockquote class="error margin_1line">
			Chez visiteur, la page que vous d�sirez visualiser n'existe pas ou plus. <br/> <br/>Veuillez <a href="/" role="button">cliquer ici</a> pour revenir � la page d'accueil, afin de rechercher ce que vous voulez
			</blockquote> 
			<div class="clear"></div>

		</div>
		<div class="page-footer">&copy; Karen Petit</div>
	</div>
</div>
PKi$H[����#views/scripts/blog/actualites.phtmlnu&1i�
<?php echo $this->render("/blog/_blogHeader.phtml"); ?>
<div class="col-md-12">
  <div class="row">
    <div class="col-lg-8 noPadding">
      <h1 class="blog-title"><?php echo $this->currentCategory['title']; ?></h1> 
      <p><?php echo $this->currentCategory['sub_title']; ?></p>
      <hr>
        <?php  
        $posts = $this->listSubjects;
        if (!empty($posts)) {
          foreach ($posts as $post) {  
		        $this->currentPost = $post;
            echo $this->render("/blog/_blogShortDetail.phtml"); 
           } 
        }?>
    </div>
    
    <div class="col-md-4">
      <?php echo $this->render("/blog/_blogCategories.phtml");  ?> 
    </div>

  </div>
</div>PKi$H[��		views/scripts/blog/sujet.phtmlnu&1i�
<?php echo $this->render("/blog/_blogHeader.phtml"); ?>
<div class="col-md-12">
  <div class="row">
    <div class="col-lg-8 noPadding">
      <h1 class="blog-title"><?php echo $this->currentSubject['title']; ?></h1> 
      <p><?php echo $this->currentSubject['sub_title']; ?></p>
      <p><?php echo $this->currentSubject['message']; ?></p>

      <div class="col-md-12">
        <?php if($this->currentCategory['is_close'] == 0 && $this->currentSubject['is_close'] == 0) { 
              echo $this->render("/blog/_blogAddPost.phtml"); 
        } ?>
      </div>
      <div class="col-md-12">
        <hr>
          <?php  
          $posts = $this->listComments;
          if (!empty($posts)) {
            foreach ($posts as $post) {  
		          $this->currentPost = $post;
              echo $this->render("/blog/_blogShortDetailComment.phtml"); 
             } 
          }?>
      </div>
    </div>
 
    <div class="col-md-4">
      <?php echo $this->render("/blog/_blogCategories.phtml");  ?> 
    </div>

  </div>
</div>PKi$H[�h�Mjj)views/scripts/blog/_blogShortDetail.phtmlnu&1i�
 <?php $post = $this->currentPost; ?>
  <div class="media"> 
    <div class="media-body">
      <div class="col-md-9">
        <a class="pull-left" href="<?php echo $this->baseUrl."/blog/sujet/id/".$post['id']; ?>">
          <?php echo $post['title']; ?>
        </a>
        <small>&nbsp;
          <?php 
					  try {
					    $myDate = new Zend_Date(strtotime($post['date_updated']));
					    $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');
				
					    echo $myDate->toString("dd").' '.$mois[(int)$myDate->toString('MM')].' '.$myDate->toString("YYYY"); 
					  } catch(Zend_Exception $e) {
						
					  } ?></small>
      </div> 
      <div class="col-md-3 text-right">
        <a href="<?php echo $this->baseUrl."/blog/sujet/id/".$post['id']; ?>" class="btn btn-primary">Voir</a>
      </div> 
      <div class="col-md-12"><p><?php echo $post['sub_title']; ?></p></div>
    </div>
  </div>
<hr />PKi$H[A���;;$views/scripts/blog/_blogHeader.phtmlnu&1i�
<div class="col-md-12 blog-header" >
  <div class="col-md-12 text-center">
    <a href="<?php echo $this->baseUrl; ?>/blog/actualites.html" class="btn btn-info">Blog</a>
  </div>
</div>
<?php if (!empty($this->messageSuccess)) {  ?>
  <div class="col-md-12 text-center no-space-top">
		<span class="alert alert-success"><?php echo $this->messageSuccess; ?></span>
	</div>
<?php } else if (!empty($this->messageError)) { ?>
  <div class="col-md-12 text-center no-space-top">
		<span class="alert alert-danger"><?php echo $this->messageError; ?></span>
	</div>
<?php }  ?>PKi$H[ �Ss��(views/scripts/blog/_blogCategories.phtmlnu&1i�
<?php  
  $posts = $this->listCategories;
    if (!empty($posts)) { ?>
      <div class="well">
        <div class="row">
          <div class="col-xs-12">
            <ul class="list-unstyled">
              <?php  foreach ($posts as $post) {  ?>
              <li>
                <a href="<?php echo $this->baseUrl."/blog/actualites/id/".$post['id'] ?>"><?php echo $post['title'];?></a>
              </li>
              <?php } ?>
            </ul>
          </div>
        </div>
      </div>
<?php } ?>PKi$H[wUI�views/scripts/blog/forum.phtmlnu&1i�
<?php echo $this->render("/blog/_blogHeader.phtml"); ?>
<div class="col-md-12">
  <div class="row">
    <div class="col-lg-8 noPadding">
      <h1  class="blog-title"> <?php echo $this->currentCategory['title']; ?></h1>
      <p><?php echo $this->currentCategory['message']; ?></p>
      <hr>
        <?php  
        $posts = $this->listNewPosts;
        if (!empty($posts)) {
        foreach ($posts as $post) {  
		      $this->currentPost = $post;
          echo $this->render("/blog/_blogShortDetail.phtml"); 
         } } ?>
      </div>

    <div class="col-md-4">
      <?php echo $this->render("/blog/_blogSubjects.phtml"); 
      
      $sidePosts = $this->listPostsSide;
      if (!empty($sidePosts)) {
        foreach ($sidePosts as $post) {  
		      $this->currentPost = $post;
          echo $this->render("/blog/_blogSide.phtml");
        }} ?>
    </div>

  </div>
</div>
<?php if($this->currentCategory['id'] > 0 && $this->currentCategory['is_close'] == 0) { 
    echo $this->render("/blog/_blogAddPost.phtml"); 
} ?>PKi$H[f�Բ��"views/scripts/blog/_blogSide.phtmlnu&1i�
<?php $post = $this->currentPost; ?>
<div class="well">
  <a class="pull-left" href="#"> 
      <?php echo $post['pseudo']; ?> 
  </a>
  <br/>
  <p><?php echo $post['message']; ?></p> 
</div>PKi$H[��'.��&views/scripts/blog/_blogSubjects.phtmlnu&1i�

 <div class="well">
    <div class="row">
      <div class="col-xs-12">
        <ul class="list-unstyled">
          <?php  
            $posts = $this->listSubjects;
            if (!empty($posts)) {
              foreach ($posts as $post) {  ?>
              <li>
                <a href="<?php echo $this->baseUrl."/blog/sujet/id/".$post['id'] ?>"><?php echo $post['title'];?></a>
              </li>
            <?php } } ?>
        </ul>
      </div>
    </div> 
  </div> PKi$H[ּG���views/scripts/blog/detail.phtmlnu&1i�
<?php echo $this->render("/blog/_blogHeader.phtml"); ?>
<div class="col-md-12">
  <div class="row">

    <!-- Blog Post Content Column -->
    <div class="col-lg-8">

      <!-- Blog Post -->

      <!-- Title -->
      <h1>Blog Post Title</h1>

      <!-- Author -->
      <p class="lead">
        by <a href="#">Start Bootstrap</a>
      </p>

      <hr>

        <!-- Date/Time -->
        <p>
          <span class="glyphicon glyphicon-time"></span> Posted on August 24, 2013 at 9:00 PM
        </p>

        <hr>

          <!-- Preview Image -->
          <img class="img-responsive" src="http://placehold.it/900x300" alt="">

            <hr>

              <!-- Post Content -->
              <p class="lead">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ducimus, vero, obcaecati, aut, error quam sapiente nemo saepe quibusdam sit excepturi nam quia corporis eligendi eos magni recusandae laborum minus inventore?</p>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ut, tenetur natus doloremque laborum quos iste ipsum rerum obcaecati impedit odit illo dolorum ab tempora nihil dicta earum fugiat. Temporibus, voluptatibus.</p>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Eos, doloribus, dolorem iusto blanditiis unde eius illum consequuntur neque dicta incidunt ullam ea hic porro optio ratione repellat perspiciatis. Enim, iure!</p>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Error, nostrum, aliquid, animi, ut quas placeat totam sunt tempora commodi nihil ullam alias modi dicta saepe minima ab quo voluptatem obcaecati?</p>
              <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Harum, dolor quis. Sunt, ut, explicabo, aliquam tenetur ratione tempore quidem voluptates cupiditate voluptas illo saepe quaerat numquam recusandae? Qui, necessitatibus, est!</p>

              <hr>

                <!-- Blog Comments -->

                <!-- Comments Form -->
                <div class="well">
                  <h4>Leave a Comment:</h4>
                  <form role="form">
                    <div class="form-group">
                      <textarea class="form-control" rows="3"></textarea>
                    </div>
                    <button type="submit" class="btn btn-primary">Submit</button>
                  </form>
                </div>

                <hr>

                  <!-- Posted Comments -->

                  <!-- Comment -->
                  <div class="media">
                    <a class="pull-left" href="#">
                      <img class="media-object" src="http://placehold.it/64x64" alt="">
                    </a>
                    <div class="media-body">
                      <h4 class="media-heading">
                        Start Bootstrap
                        <small>August 25, 2014 at 9:30 PM</small>
                      </h4>
                      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
                    </div>
                  </div>

                  <!-- Comment -->
                  <div class="media">
                    <a class="pull-left" href="#">
                      <img class="media-object" src="http://placehold.it/64x64" alt="">
                    </a>
                    <div class="media-body">
                      <h4 class="media-heading">
                        Start Bootstrap
                        <small>August 25, 2014 at 9:30 PM</small>
                      </h4>
                      Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
                      <!-- Nested Comment -->
                      <div class="media">
                        <a class="pull-left" href="#">
                          <img class="media-object" src="http://placehold.it/64x64" alt="">
                            </a>
                        <div class="media-body">
                          <h4 class="media-heading">
                            Nested Start Bootstrap
                            <small>August 25, 2014 at 9:30 PM</small>
                          </h4>
                          Cras sit amet nibh libero, in gravida nulla. Nulla vel metus scelerisque ante sollicitudin commodo. Cras purus odio, vestibulum in vulputate at, tempus viverra turpis. Fusce condimentum nunc ac nisi vulputate fringilla. Donec lacinia congue felis in faucibus.
                        </div>
                      </div>
                      <!-- End Nested Comment -->
                    </div>
                  </div>

                </div>

    <!-- Blog Sidebar Widgets Column -->
    <div class="col-md-4">

      <!-- Blog Search Well -->
      <div class="well">
        <h4>Blog Search</h4>
        <div class="input-group">
          <input type="text" class="form-control">
            <span class="input-group-btn">
              <button class="btn btn-default" type="button">
                <span class="glyphicon glyphicon-search"></span>
              </button>
            </span>
          </div>
        <!-- /.input-group -->
      </div>

      <!-- Blog Categories Well -->
      <div class="well">
        <h4>Blog Categories</h4>
        <div class="row">
          <div class="col-lg-6">
            <ul class="list-unstyled">
              <li>
                <a href="#">Category Name</a>
              </li>
              <li>
                <a href="#">Category Name</a>
              </li>
              <li>
                <a href="#">Category Name</a>
              </li>
              <li>
                <a href="#">Category Name</a>
              </li>
            </ul>
          </div>
          <div class="col-lg-6">
            <ul class="list-unstyled">
              <li>
                <a href="#">Category Name</a>
              </li>
              <li>
                <a href="#">Category Name</a>
              </li>
              <li>
                <a href="#">Category Name</a>
              </li>
              <li>
                <a href="#">Category Name</a>
              </li>
            </ul>
          </div>
        </div>
        <!-- /.row -->
      </div>

      <!-- Side Widget Well -->
      <div class="well">
        <h4>Side Widget Well</h4>
        <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Inventore, perspiciatis adipisci accusamus laudantium odit aliquam repellat tempore quos aspernatur vero.</p>
      </div>

    </div>

  </div>
</div>PKi$H[��y��%views/scripts/blog/_blogAddPost.phtmlnu&1i�

<div class="col-md-12">
<form id="dialog-add-post" class="form-horizontal" action="<?php echo $this->baseUrl; ?>/blog/addpost" method="post">
	  <span class="indexBox4_title2">R�diger un commentaire</span>
	  <fieldset style="border:0;">

      <?php 
       $storage = null;
       try {
	        $auth = Zend_Auth::getInstance();
	        $auth->setStorage(new Zend_Auth_Storage_Session($this->session_storage));
	        $storage = $auth->getStorage()->read(); 
	      } catch (Zend_Exception $e) {
	      }
      
      if ($storage != null && $auth->hasIdentity() && isset($storage['user'])) { ?>
			  <div class="form-group">
				  <label for="pseudo" class="col-sm-12 text-left"><?php echo $storage['user']['prenom']; ?></label> 
				  <input name="pseudo" type="hidden" value="<?php echo $storage['user']['prenom']; ?>"> 
			  </div>
      <?php } else { ?>
			  <div class="form-group">
				  <label for="pseudo" class="col-sm-2 control-label">Pseudo</label>
            <div class="col-sm-10">
				      <input name="pseudo" type="text" class="form-control" required="">
			      </div>
			  </div>
      <?php } ?>
			    <div class="form-group">
				  <label for="commentaire" class="col-sm-2 control-label">Commentaire</label>
            <div class="col-sm-10">
              <textarea name="commentaire" class="form-control" rows="5" required=""></textarea> 
			      </div>
			  </div>
			  <div class="form-group">
            <div class="col-sm-12 text-center">
                <input type="submit" class="btn btn-default" value="Publier le commentaire" />
                <input type="hidden" name="subject_id" value="<?php echo $this->currentSubject['id']; ?>"/>
              </div> 
			  </div> 
	  </fieldset>
  </form>
</div>PKi$H[�~����0views/scripts/blog/_blogShortDetailComment.phtmlnu&1i�
 <?php $post = $this->currentPost; ?>
  <div class="media"> 
    <div class="media-body">
      <div class="col-md-9">
        <a class="pull-left" href="#">
          <?php echo $post['pseudo']; ?>
        </a>
        <small>&nbsp;
          <?php 
					  try {
					    $myDate = new Zend_Date(strtotime($post['date_updated']));
					    $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');
				
					    echo $myDate->toString("dd").' '.$mois[(int)$myDate->toString('MM')].' '.$myDate->toString("YYYY"); 
					  } catch(Zend_Exception $e) {
						
					  } ?></small>
      </div> 
      <?php if ($this->currentCategory['is_close'] == 0 && $this->currentSubject['is_close'] == 0) { ?>
        <div class="col-md-3 text-right">
          <a href="#" class="btn btn-success" onclick="scrollTo('#dialog-add-post')">R�pondre&nbsp;<i class="fa fa-reply"></i></a>
        </div>
      <?php } ?>
      <div class="col-md-12"><p><?php echo $post['message']; ?></p></div>
    </div>
  </div>
<hr />PKi$H[hپ

views/layouts/menuLayout.phtmlnu&1i�<div class="menuLayoutBorder">
	<?php if ($this->listallannonces) { ?>	
	<div class="annonce_container">	 
			<div id="annonce-slider" class="coda-slider preload">
				<?php 
				$i = 1;
				$listAnnonce = $this->listallannonces;
				foreach ($listAnnonce as $row) { ?> 
					<div class="panel annonce_boxPanel"> 
						<div class="panel-wrapper">
							<div class="title-panel"><?php echo $i; ?></div> 
							<?php echo $row['CONTENT'];?>
						</div>
					</div>
				<?php $i++; } ?> 
			</div>
	</div>
	<?php } ?>
</div>PKi$H[�9V��views/layouts/layout.phtmlnu&1i�<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<?php header('Content-type: text/html; charset=iso-8859-1'); ?>
<head itemscope itemtype="http://schema.org/WebSite"> 
	<title><?php echo $this->title; ?></title>
	<meta http-equiv="content-type" content="text/html; charset=iso-8859-1" />
	<meta name="description" content="<?php echo $this->metadescription; ?>" />
	<meta name="keywords" content="<?php if (isset($this->metakeywords) && !empty($this->metakeywords)) {echo $this->metakeywords;}   ?>" />	
	<link rel="icon" type="image/png" href="<?php echo $this->baseUrl; ?>/favicon.ico" /> 	 
	<meta name="google-site-verification" content="<?php echo $this->google_site_verification; ?>" />
	<meta name="Reply-to" content="<?php echo $this->serviceClient_Mail; ?>" />
	<meta name="Copyright" content="<?php echo $this->siteName; ?>" />
 
<?php 
	$product = $this->detailProduct;
  if (isset($product) && !empty($product)) {
    $url = "http://".$_SERVER["HTTP_HOST"].$_SERVER["REQUEST_URI"]; ?>
    <meta property="og:url" content="<?php echo $url; ?>" />
    <meta property="og:type" content="article" />
    <meta property="og:title" content="<?php echo strip_tags($this->escape($product['NOM'])); ?>" />
    <meta property="og:description" content="<?php echo strip_tags($product['DESCSHORT']); ?>" />
	
	<meta name="twitter:card" content="summary" />
    <meta name="twitter:url" content="<?php echo $url; ?>" />
	<meta name="twitter:title" content="<?php echo strip_tags($this->escape($product['NOM'])); ?>" />
	<meta name="twitter:description" content="<?php echo strip_tags($product['DESCSHORT']); ?>" />
	
    <?php if (isset($product['LISTPICS']) && isset($product['LISTPICS'][0])) { 
	$urlPic = "http://".$_SERVER["HTTP_HOST"].'/'.$product['LISTPICS'][0]['URL'];?>
    <meta property="og:image" content="<?php echo $urlPic; ?>" />
	<meta name="twitter:image" content="<?php echo $urlPic; ?>" />
<?php } }?> 

	<!-- Google Analytics -->
	<script type="text/javascript" >
	(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
	m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
	})(window,document,'script','//www.google-analytics.com/analytics.js','ga');

	ga('create', '<?php echo $this->google_analytics; ?>', 'auto');
	ga('send', 'pageview');
	</script>
	<!-- End Google Analytics -->
	
	<script type="application/ld+json">
    {
      "@context": "http://schema.org",
      "@type": "Organization",
      "url": "<?php echo $this->baseUrl_SiteCommerceUrl; ?>",
      "logo": "<?php echo $this->baseUrl_SiteCommerceUrl; ?>/business/image/logo.png"
    }
    </script>
	
	
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>

<link href='http://fonts.googleapis.com/css?family=Oswald' rel='stylesheet' type='text/css'/> 
<!--[if lte IE 8]>
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/business/light/css/css_ie.css" />
<![endif]-->
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/business/light/css/css.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/business/light/css/responsive.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/business/light/css/css_default.css" media="screen" />
<link rel="stylesheet" type='text/css' href='<?php echo $this->baseUrl; ?>/business/light/js/simplemodal/css/basic.css' media='screen' />
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/business/light/js/superfish/css/superfish.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/business/light/js/superfish/css/superfish-vertical.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/business/light/js/fancybox/fancybox/jquery.fancybox-1.3.4.css" media="screen" />
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/business/light/js/jScrollPane/style/jquery.jscrollpane.css" media="all" />
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl; ?>/business/light/js/video-js/video-js.css" media="all" />

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/carouFredSel/jquery.carouFredSel-3.2.1-packed.js"></script>
<script type='text/javascript' src='<?php echo $this->baseUrl; ?>/business/light/js/debouncedresize/jquery.debouncedresize.js'></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/timer/jquery.timers.js"></script>
<script type="text/javascript" src='<?php echo $this->baseUrl; ?>/business/light/js/simplemodal/js/jquery.simplemodal.js'></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/superfish/js/hoverIntent.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/superfish/js/superfish.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/fancybox/fancybox/jquery.mousewheel-3.0.4.pack.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/fancybox/fancybox/jquery.fancybox-1.3.4.pack.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/qtip/jquery.qtip-1.0.0-rc3.min.js"></script> 
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/tweetie/tweetie.js"></script>  
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/filterable/js/filterable.js" ></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/config.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/big_gallery.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/jScrollPane/script/jquery.jscrollpane.min.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/jScrollPane/script/jquery.mousewheel.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/video-js/video.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/jPlayer/jquery.jplayer.min.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/TinyNav/tinynav.min.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/touchSwipe/jquery.touchSwipe.min.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/lazyload/jquery.lazyload.min.js"></script>
<script type="text/javascript" src="<?php echo $this->baseUrl; ?>/business/light/js/responsiveslides/responsiveslides.min.js"></script>
 
</head>
<body  id="body"> 
	<?php echo $this->render("headerLayout.phtml"); ?>

	<?php echo $this->layout()->content; ?>	
</body> 
</html>
PKi$H[��r'��views/layouts/rightLayout.phtmlnu&1i�
	
<!--[if IE]>
<style type="text/css">
.textA10, .textA9, .textA8b, .textA11 , .textA12, .textA13 {
  filter: glow(color=#000000,strength=1);
}
.linkA10, .linkA9, .linkA8b, .linkA11 , .linkA12, .linkA13 {
  filter: glow(color=#000000,strength=1);
}
</style>
<![endif]-->

<div class="rightPubContent">
	<?php if ($this->listannoncesright) {
		$listAnnonceRight = $this->listannoncesright;
		
		$idCat = $this->listannoncesrightCategory;
		foreach ($listAnnonceRight as $row) {
		$tabCategorie = explode(';',$row['ID_CATS']); 
		if (in_array($idCat, $tabCategorie) || in_array('0', $tabCategorie)) {
			
	?>
	<div class="menuExtraRightOpt"><?php echo $row['CONTENT'];?></div>
	<?php } } } ?>
</div>PKi$H[%views/layouts/extraHeaderLayout.phtmlnu&1i�PKi$H[�����views/layouts/leftLayout.phtmlnu&1i�
<div class="leftLogo"> 
	<a title="Accueil" href="<?php echo $this->baseUrl; ?>/"><img alt="Directement � la source de la qualit�" src="<?php echo $this->baseUrl; ?>/business/image/logo.png" /></a>
</div> 
<div class="rightPromotion" > 
	<span class="link_shadow18_y2" > 
		<a href="<?php echo $this->baseUrl; ?>/nos-promotions.html" title="D�couvrez nos promotions">Promotions</a> 
	</span>
</div>
<div class="menuOngletsTitle"><span class="text_shadow18_w">Nos Produits</span></div>
 


<?php if ( strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 6' ) !== FALSE || strpos($_SERVER['HTTP_USER_AGENT'], 'MSIE 7' ) !== FALSE ) { ?>
<div class="menuOnglets">
	<div  class="menuOnglet_1 <?php if ( $this->actualDesign['idCategory'] == 1 ) { echo 'menuOnglet_1_hover'; } ?>" ><a style="margin: 2px 0 0 60px;" id="onglet_1" href="<?php echo $this->baseUrl; ?>/industrie/1-manutention-levage.html" <?php if ( $this->actualDesign['idCategory'] == 1 ) { echo 'class="selected"'; } ?> >Manutention, levage</a></div>
	<div  class="menuOnglet_2 <?php if ( $this->actualDesign['idCategory'] == 2 ) { echo 'menuOnglet_2_hover'; } ?>" ><a style="margin: 0 0 0 60px;" id="onglet_2" href="<?php echo $this->baseUrl; ?>/industrie/2-prevention-environnement.html" <?php if ( $this->actualDesign['idCategory'] == 2 ) { echo 'class="selected"'; } ?>>Pr�vention de<br/> l'environnement</a></div>
	<div  class="menuOnglet_3 <?php if ( $this->actualDesign['idCategory'] == 3 ) { echo 'menuOnglet_3_hover'; } ?>" ><a style="margin: 0 0 0 60px;" id="onglet_3" href="<?php echo $this->baseUrl; ?>/industrie/3-stockage-rayonnage.html" <?php if ( $this->actualDesign['idCategory'] == 3 ) { echo 'class="selected"'; } ?>>Stockage,<br/> rayonnage</a></div>
	<div  class="menuOnglet_4 <?php if ( $this->actualDesign['idCategory'] == 4 ) { echo 'menuOnglet_4_hover'; } ?>" ><a style="margin: 0 0 0 60px;" id="onglet_4" href="<?php echo $this->baseUrl; ?>/industrie/4-entretien-proprete.html" <?php if ( $this->actualDesign['idCategory'] == 4 ) { echo 'class="selected"'; } ?>>Entretien,<br/> propret�</a></div>
	<div  class="menuOnglet_5 <?php if ( $this->actualDesign['idCategory'] == 5 ) { echo 'menuOnglet_5_hover'; } ?>" ><a style="margin: 0 0 0 60px;" id="onglet_5" href="<?php echo $this->baseUrl; ?>/industrie/5-protection-securite.html" <?php if ( $this->actualDesign['idCategory'] == 5 ) { echo 'class="selected"'; } ?>>Protection, s�curit�</a></div>
	<div  class="menuOnglet_6 <?php if ( $this->actualDesign['idCategory'] == 6 ) { echo 'menuOnglet_6_hover'; } ?>" ><a style="margin: 10px 0 0 60px;" id="onglet_6" href="<?php echo $this->baseUrl; ?>/industrie/6-emballage.html" <?php if ( $this->actualDesign['idCategory'] == 6 ) { echo 'class="selected"'; } ?>>Emballage</a></div>
	<div  class="menuOnglet_7 <?php if ( $this->actualDesign['idCategory'] == 7 ) { echo 'menuOnglet_7_hover'; } ?>" ><a style="margin: 10px 0 0 60px;" id="onglet_7" href="<?php echo $this->baseUrl; ?>/industrie/7-outillage.html" <?php if ( $this->actualDesign['idCategory'] == 7 ) { echo 'class="selected"'; } ?>>Outillage</a></div>
	<div  class="menuOnglet_8 <?php if ( $this->actualDesign['idCategory'] == 8 ) { echo 'menuOnglet_8_hover'; } ?>" ><a style="margin: 10px 0 0 60px;" id="onglet_8" href="<?php echo $this->baseUrl; ?>/industrie/8-mobilier-atelier.html" <?php if ( $this->actualDesign['idCategory'] == 8 ) { echo 'class="selected"'; } ?>>Mobilier d'atelier</a></div>
	<div  class="menuOnglet_9 <?php if ( $this->actualDesign['idCategory'] == 9 ) { echo 'menuOnglet_9_hover'; } ?>" ><a style="margin: 10px 0 0 45px;" id="onglet_9" href="<?php echo $this->baseUrl; ?>/industrie/9-mobilier-bureau-collectivite.html" <?php if ( $this->actualDesign['idCategory'] == 9 ) { echo 'class="selected"'; } ?>>Mobilier de bureau</a></div>
</div> 
<?php } else { echo $this->render("menuajax.phtml");  } ?> 
		
<div class="leftPubContent">
	<?php if ($this->listannoncesleft) {
		$listAnnonceLeft = $this->listannoncesleft;
		
		$idCat = $this->listannoncesleftCategory;
		foreach ($listAnnonceLeft as $row) {
		$tabCategorie = explode(';',$row['ID_CATS']); 
		if (in_array($idCat, $tabCategorie) || in_array('0', $tabCategorie)) {
			
	?>
	<div class="menuExtraRightOpt"><?php echo $row['CONTENT'];?></div>
	<?php } } } ?>
</div>

PKi$H[���
AAviews/layouts/breadcrumb.phtmlnu&1i�
<?php if ($this->breadcrumb) { ?>
	<div class="col-xs-12 noPadding bread-crumb-box hidden-print">	
	<ol class="breadcrumb" itemscope="" itemtype="http://schema.org/BreadcrumbList">
	  <li><a href="<?php echo $this->baseUrl; ?>/">Accueil</a></li>
	  <?php 
		$breadcrumb = $this->breadcrumb;
  $currentType = "";
  $position = 0;
		  foreach ($breadcrumb as $row) {
      $link = "";
	     if (isset($this->isPromoPage) && $this->isPromoPage) {
		      $link = $this->baseUrl."/".Utils_Tool::getFormattedUrlCategory2($row['NAVNOM_URLPARENTS'], $row['NAVNOM'], $row['ID']);
	      } else {
		      $link = $this->baseUrl."/".Utils_Tool::getFormattedUrlCategory($row['NAVNOM_URLPARENTS'], $row['NAVNOM'], $row['ID']);
	      }
				$name =  $row['NOM'];
    $position++;
				?>
		  <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem">
        <a itemprop="item" href="<?php echo $link;?>"><span itemprop="name"><?php echo $name; ?></span></a>
        <meta itemprop="position" content="<?php echo $position; ?>" />
      </li>
		  <?php }?>
	</ol>
</div>
<?php }?>
PKi$H[ ׃�

 views/layouts/headerLayout.phtmlnu&1i�
<div id="loader"><img src="<?php echo $this->baseUrl; ?>/business/light/img/loader2.gif" alt="Chargement du site en cours ..."/></div>

<?php  
	$currentCat = array();
	$currentCat = $this->currentCat;
	if (isset($currentCat) && !empty($currentCat['URL'])) { ?>
	<div id="background"><img src="<?php echo $this->baseUrl; ?>/<?php echo $currentCat['URL']; ?>" alt=""/></div>
<?php } ?>

<div id="logo"><a href="<?php echo $this->baseUrl; ?>/" title="<?php echo $this->siteName; ?>"><img class="logoimg" alt="Karen petit" src="<?php echo $this->baseUrl; ?>/business/light/img/logo.svg" /></a></div>

<div id="menu-show"><div id="menu-show-arrow"></div></div>
<div id="menu-hide"><div id="menu-hide-arrow"></div></div> 

<div id="menu">

<?php  
$params = array(
		'CATEGORIE_CURRENT' => 1, 
		'BASE_URL' => $this->baseUrl,
		'RESULT_MENUS' =>array(),
		'COLORS' => $this->designColors
);
if (isset($this->actualDesign) && !empty($this->actualDesign)) {
	$params['CATEGORIE_CURRENT'] = $this->actualDesign['idCategory'];
} 
function generateHTMLResponsiveMenu($data, $params) {
	$result = '';
	$counter = 0;
    $rowcount = 0;
	foreach ($data as $row) {
		if (isset($row['CATEGORIE']) && !empty($row['CATEGORIE'])) {
			$link_href = $params['BASE_URL']."/".Utils_Tool::getFormattedUrlCategory($row['CATEGORIE']['NAVNOM_URLPARENTS'], $row['CATEGORIE']['NAVNOM'], $row['CATEGORIE']['ID']);
			
			if (!empty($row['CATEGORIE']['URLREDIRECT'])) {
				$link_href = $row['CATEGORIE']['URLREDIRECT'];
			}
			
			if (isset($row['CHILDS']) && !empty($row['CHILDS'])) {
				$result .= '<li>';
				$result .= '<a href="'.$link_href.'">'.$row['CATEGORIE']['NOM'].'</a>';
				
				if ($link_href == "#") {
				$result .= '<ul>';
				$result .= generateHTMLResponsiveMenu($row['CHILDS'], $params);
				$result .= '</ul >';
				} 
			} else {
				$result .= '<li >';
				$result .= '<a  href="'.$link_href.'" >'.$row['CATEGORIE']['NOM'].'</a>';
				$result .= '</li >';
			}
		} 
	}
	return $result;
}

?>

        <?php if (isset($this->listallcategories)) { ?> 
		<ul class="sf-menu sf-vertical"> 
            <?php echo generateHTMLResponsiveMenu($this->listallcategories, $params);?>  
			<li>
				<a href="<?php echo $this->baseUrl; ?>/contact">CONTACT</a>
			</li>	
		</ul>
        <?php } ?> 
		
		<ul class="buy">
			<li>&nbsp;</li>
			<li>ESPACE CLIENT</li>
			<li>
				<ul>
					<li><a href="<?php echo $this->custom_link_1; ?>" title="JingoO" class="qtip"><img src="/business/light/img/icons/stock/fotolia.png" alt="JingoO" /></a></li>
				</ul>
			</li>
		</ul>
		<ul class="follow">
			<li>+</li>
			<li>
				<ul>
					<li><a href="<?php echo $this->link_media_facebook; ?>" title="Facebook" class="qtip"><img src="/business/light/img/icons/social/facebook.png" alt="Facebook" /></a></li>
					<li><a href="<?php echo $this->link_media_flickr; ?>" title="Printerest" class="qtip"><img src="/business/light/img/icons/social/pinterest.png" alt="Printerest" /></a></li>
					<li><a href="<?php echo $this->link_media_rss; ?>" title="500px" class="qtip"><img src="/business/light/img/icons/social/sharethis.png" alt="500px" /></a></li>
					<li><a href="<?php echo $this->custom_link_2; ?>" title="Instagram" class="qtip"><img src="/business/light/img/icons/social/instagram.png" alt="Instagram" /></a></li>
				</ul>
			</li>
		</ul> 
</div> PKi$H[����
�
views/layouts/menuajax.phtmlnu&1i�

<script type="text/javascript"> 
	$(function(){
		ddsmoothmenu.init({
			mainmenuid: "smoothMenu", //menu DIV id
			orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
			classname: 'ddsmoothmenu', //class added to menu's outer DIV
			contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
		});
	});
</script>
<?php  
$params = array(
		'CATEGORIE_CURRENT' => 0, 
		'BASE_URL' => $this->baseUrl,
		'RESULT_MENUS' =>array(),
		'COLORS' => $this->designColors
);
if (isset($this->actualDesign) && !empty($this->actualDesign)) {
	$params['CATEGORIE_CURRENT'] = $this->actualDesign['idCategory'];
}

function generateHTMLMenu($data, $params) {
	$result = '';
	foreach ($data as $row) {
		if (isset($row['CATEGORIE']) && !empty($row['CATEGORIE'])) {

			$link_href = $params['BASE_URL']."/".Utils_Tool::getFormattedUrlCategory($row['CATEGORIE']['NAVNOM_URLPARENTS'], $row['CATEGORIE']['NAVNOM'], $row['CATEGORIE']['ID']);
				
			if ($row['CATEGORIE']['ID'] < 10) {
				
				if ($row['CATEGORIE']['ID'] == 1) {
					$result .= '<ul>'; 
				}
			
				$params['CATEGORIE_PARENT'] = $row['CATEGORIE']['ID'];

				$stringClass = "";
				if ($params['CATEGORIE_CURRENT'] == $row['CATEGORIE']['ID'] ) {
					$stringClass = "Selected";
				}
				 
				$result .= '<li class="linkOngletFirst">';
				$result .= '<a class="linkOnglet'.$stringClass.'_'.$row['CATEGORIE']['ID'].'" href="'.$link_href.'" id="fg-menu-category-'.$row['CATEGORIE']['ID'].'" >';
				
				if ($row['CATEGORIE']['ID'] == 1) {
					$result .= '<span>Manutention, levage</span>';
				} else  if ($row['CATEGORIE']['ID'] == 2) {
					$result .= "<span>Pr�vention de l'environnement</span>";
				} else if ($row['CATEGORIE']['ID'] == 3) {
					$result .= '<span>Stockage, rayonnage</span>';
				} else if ($row['CATEGORIE']['ID'] == 4) {
					$result .= '<span>Entretien et propret�</span>';
				} else if ($row['CATEGORIE']['ID'] == 5) {
					$result .= '<span>Protection, s�curit�</span>';
				} else if ($row['CATEGORIE']['ID'] == 6) {
					$result .= '<span>Emballage</span>';
				} else if ($row['CATEGORIE']['ID'] == 7) {
					$result .= '<span>Outillage</span>';
				} else if ($row['CATEGORIE']['ID'] == 8) {
					$result .= "<span>Mobilier d'atelier</span>";
				} else if ($row['CATEGORIE']['ID'] == 9) {
					$result .= '<span>Mobilier de bureau</span>';
				} else {
					$result .= '<span>'.$row['CATEGORIE']['NOM'].'</span>';
				}
			
				$result .= '</a>';

				$result .= '<ul style="border:1px solid '.$params['COLORS'][$params['CATEGORIE_PARENT']].';">';

				if (isset($row['CHILDS']) && !empty($row['CHILDS'])) {
					$result .= generateHTMLMenu($row['CHILDS'], $params);
				}
			}  else { 
				$result .= '<li >';
				$result .= '<a href="'.$link_href.'" class="linkSubOnglet_'.$params['CATEGORIE_PARENT'].'">';
				$result .= $row['CATEGORIE']['NOM'];
				$result .= '</a>';
				if ($row['LEVEL'] < 2) {
					if (isset($row['CHILDS']) && !empty($row['CHILDS'])) {
						$result .= '<ul style="border:1px solid '.$params['COLORS'][$params['CATEGORIE_PARENT']].';">';
						$result .= generateHTMLMenu($row['CHILDS'], $params);
						$result .= '</ul>';
					}
				}
				$result .= '</li>';
				
			}

			if ($row['CATEGORIE']['ID'] < 10) {
				$result .= '</ul></li>';  
			}
		} 
	}
	return $result;
}
?>

<noscript>
<?php $listMenu = generateHTMLMenu($this->listallcategories, $params);?>
</noscript> 
 <div class="menuOnglets">
	 <div id="smoothMenu" class="ddsmoothmenu" >
	<?php echo $listMenu;?>
	</div>  
 </div>
 







PKi$H[#����views/layouts/extraLayout.phtmlnu&1i�<?php if ($this->listallannoncesfooter) { ?>
<div class="extraLayoutOpt">
<?php 
	$listAnnonce = $this->listallannoncesfooter;
	foreach ($listAnnonce as $row) {
		$tabCategorie = explode(';',$row['CAT_ID']); 
		$selectedCategorie = array();
		for ($i=0;$i<sizeof($tabCategorie);$i++) {
			if ($this->breadcrumb[0]['ID'] == $tabCategorie[$i]) {
			?>
			<div  class="menuExtraOpt"> <?php echo $row['CONTENT'];?> </div>
	<?php } } } ?>
</div>
<?php }  ?>PKi$H[o���Y
Y
 views/layouts/footerLayout.phtmlnu&1i�
<div class="footerBg col-sm-12 visible-sm visible-md visible-lg hidden-print">
	<div class="footerBgContent">
	
		<div class="col-sm-9">
		<?php 
			$custom_info_id = 4; 
			$listFooters = $this->listFooters;
      if (isset($listFooters)) {
      
			foreach ($listFooters as $footer) { ?>
	  			<div class="col-sm-4 footerTitle" >
			<?php if (empty($footer['URL'])) { ?>
						<a href="<?php echo $this->baseUrl; ?>/info<?php echo "-".$footer['ID']; ?>/<?php echo str_replace("page/","",$footer['TITRENAV']).".html"; ?>">
						
						<?php if ($footer['ID'] == $custom_info_id) {?>
							<img src="<?php echo $this->baseUrl; ?>/business/image/box-devdurable.png">
						<?php }
						echo $footer['TITRE']; ?></a>
					<?php } else { ?>
						<a target="_blank" href="http://<?php echo $footer['URL']; ?>"><?php echo $footer['TITRE']; ?></a>
			<?php } ?> 
  			</div>
		<?php }} ?>
      <div class="col-sm-4 footerTitle" >
        <a href="<?php echo $this->baseUrl; ?>/nos-marques.html">Nos marques</a>
      </div>
		</div>
  			<div class="col-sm-3" >
  				<div class="col-sm-12 footerMediaBoxTitle">Nous suivre sur :</div>
  				<div class="col-sm-12 footerMediaBox"><a target="_blank" href="<?php echo $this->link_media_facebook; ?>" data-placement="right" class="tooltips" title="Notre Facebook"><img src="<?php echo $this->baseUrl; ?>/business/image/icon-facebook.png"/> <span>Facebook</span></a></div>
  				<div class="col-sm-12 footerMediaBox"><a target="_blank" href="<?php echo $this->link_media_google; ?>" data-placement="right" class="tooltips" title="Notre page Google"><img src="<?php echo $this->baseUrl; ?>/business/image/icon-google.png"/> <span>Google +</span></a></div>
  				<div class="col-sm-12 footerMediaBox"><a target="_blank" href="<?php echo $this->link_media_twitter; ?>" data-placement="right" class="tooltips" title="Suivez nous sur Twitter"><img src="<?php echo $this->baseUrl; ?>/business/image/icon-twitter.png"/> <span>Twitter</span></a></div>
  				<div class="col-sm-12 footerMediaBox"><a target="_blank" href="<?php echo $this->link_media_viadeo; ?>"  data-placement="right" class="tooltips" title="Contactez nous via Viadeo"><img src="<?php echo $this->baseUrl; ?>/business/image/icon-viadeo.png"/> <span>Viadeo</span></a></div>
  			</div>
  			<div class="col-sm-12 text-center" >
  				<?php echo $this->custom_text_1; ?>
  			</div>
  	</div>
  	
  	
  	<div class="footerTitleRealised col-sm-12 visible-sm visible-md visible-lg hidden-print text-center">
  		<a href="http://www.web-entreprise.net" title="Web Entreprise" target="_blank">Site r�alis� par Web Entreprise</a>
  	</div>
  	
</div>PKi$H[|�
f��%views/layouts/extraFooterLayout.phtmlnu&1i�
<style type="text/css">
    .box-bottom-command {
        background: url('/business/image/bon-de-commande.jpg') bottom;
        height: 138px;
    }
    .box-bottom-command a {
        height: 140px;
        display:block;
    }
    .box-bottom-command a:link, .box-bottom-command a:visited, .box-bottom-command a:active {
        text-decoration: none;
        color: #bd2f2c;
    }
    .box-bottom-command a:hover {
        text-decoration: none;
    }
    .box-bottom-command-title {
        color: #5B595A;
        font-weight: bold;
        text-align: center;
        font-size: 20px;
        text-decoration: none;
    }
    .box-bottom-command-link {
        color: #bd2f2c;
        margin-top: 30px;
        font-size: 15px;
        text-align: right;
    }
    .box-bottom-command a:hover .box-bottom-command-link {
        text-decoration: underline;
    }
</style>
<div class="col-xs-12 hidden-print <?php echo $this->prefixPromoClass; ?>footer-content-divider"></div>
<div class="col-xs-12 noPadding footer-content-container hidden-print" >
	<?php 
		$extraFooter = $this->listallannoncesfooter;
		if (isset($extraFooter)) {		
			$counter = 0;
			foreach ($extraFooter as $row) { 
				if ($counter < 2) { ?>
					<div class="col-md-4 col-sm-6 col-xs-12 indexBox4 visible-md visible-lg noPadding" style="overflow: hidden; overflow-y:auto; ">	
						 <?php 	echo $row['CONTENT']; ?>
					</div>
			<?php } 
			$counter++;
		}
	} ?>
	<div class="col-md-4 col-sm-6 col-xs-12 indexBox4 noPadding footer-content-box-last noMargin visible-md visible-lg" style="margin-top: 10px;">
		<div  class="box-bottom-command">
            <a href="<?php echo $this->baseUrl; ?>/doc/bondecommande.pdf" target="_blank">
                <div class="box-bottom-command-title">T�l�charger un bon de commande</div>
                <div class="box-bottom-command-link">T�l�charger <br />& imprimer</div>
            </a>
	    </div> 
	</div> 
    
</div>PKi$H[��g��controllers/BlogController.phpnu&1i�<?php

class BlogController  extends Modules_Default_Controllers_MainController
{

	public function init()
	{
		$this->view->baseUrl = $this->getBaseUrl();
		$this->checkMaintenance();
	}
    
	public function actualitesAction()
	{ 
		try {
            $blogCategory = new BlogCategory();
            $blogSubject = new BlogSubject(); 
            $id = 1;
            $this->view->type_name = "actualites"; 
            if ($this->getRequest()->getParam('id')) {
			    $id = (int)$this->getRequest()->getParam('id');  
		    } 

            $currentCategory = $blogCategory->fetchRow('ID = '.$id); 
            $this->view->currentCategory = $currentCategory; 
            $this->view->title = $currentCategory['title'];  
             
            $this->view->listSubjects = $blogSubject->AllSubjectsBy($id); 
            $this->view->listCategories = $blogCategory->getAllActivesCategories(1);  
        }
        catch (Zend_Exception $e) { 
			$this->view->messageError = $e->getMessage();
			$this->log($e->getMessage(),'err');
		}
	} 

    
	public function sujetAction()
	{ 
		try {
            $blogCategory = new BlogCategory();
            $blogSubject = new BlogSubject(); 
            $blogComment = new BlogComment(); 
            $id = 0; 
            if ($this->getRequest()->getParam('id')) {
			    $id = (int)$this->getRequest()->getParam('id');  
                
			    $added = (int)$this->getRequest()->getParam('a'); 
                if ($added == 1) {
                    $this->view->messageSuccess = "Le commentaire a �t� ajout�";
                } else if ($added == 2) {
                    $this->view->messageError = "Le commentaire n'a pas �t� ajout�";
                }
                
                $currentSubject = $blogSubject->fetchRow('ID = '.$id); 
			    $currentCategory = $blogCategory->fetchRow('ID = '.$currentSubject['id_category']); 
                $this->view->listSubjects = $blogSubject->AllSubjectsBy($currentSubject['id_category']); 
                $this->view->listComments = $blogComment->AllCommentsBy($id); 
                
                $this->view->listCategories = $blogCategory->getAllActivesCategories(1); 
                
                $this->view->currentCategory = $currentCategory; 
                $this->view->currentSubject = $currentSubject; 
                $this->view->title = $currentSubject['title'];  
		    }  
        }
        catch (Zend_Exception $e) { 
			$this->view->messageError = $e->getMessage();
			$this->log($e->getMessage(),'err');
		}
	}  
	public function addpostAction()
	{ 
		try {
		    if ($this->_request->isPost()) {
                $filter = new Zend_Filter();
			    $filter	->addFilter(new Zend_Filter_StripTags())
			    ->addFilter(new Zend_Filter_StringTrim());

			    $validator = new Zend_Validate();
			    $validator -> addValidator(new Zend_Validate_NotEmpty());

			    $params = array();
			    $params = $this->getRequest()->getPost();
			    $id = (int)$params['subject_id'];  
			    $pseudo = $filter->filter($params['pseudo']);
			    $message = $filter->filter($params['commentaire']);

                if ($validator->isValid($pseudo) && $validator->isValid($message) && $id > 0) {
                
                    $data = array (  
                                'id_subject' => $id,
                                'is_publish' =>  1,   
                                'pseudo' => $pseudo,
                                'message' => $message, 
                                'date_updated' => date('Y-m-d H:i:s') 
                    );

                    $blogComment = new BlogComment();
                    $blogComment->insert($data);
                    $this->_redirect('/blog/sujet/id/'.$id.'/a/1');
                }  else {
                    $this->_redirect('/blog/sujet/id/'.$id.'/a/2');
                }
            }
		} catch (Zend_Exception $e) { 
			$this->log($e->getMessage(),'err');
		}  
        $this->_redirect('/');
    }
}

?>PKi$H[��\L	L	controllers/ErrorController.phpnu&1i�<?php

class ErrorController  extends Zend_Controller_Action
{

	public function errorAction()
	{
		$errors = $this->_getParam('error_handler');
		$this->initLog();
		$exception = $errors->exception;
		$message = "Une erreure est survenue : ".$exception->getMessage().";<br/>URL : ".$this->getRequest()->getRequestUri();

		switch ($errors->type) {
			case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_CONTROLLER:
				$message .= "<br/>TYPE : Le controller n'existe pas";
				break;
			case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_NO_ACTION:
				$message .= "<br/>TYPE : Page introuvable";
				break;
			case Zend_Controller_Plugin_ErrorHandler::EXCEPTION_OTHER:
				switch ($exception) {
					case 'Zend_View_Exception' :
						$message = "<br/>TYPE : 500 : Erreur de traitement d'une vue";
						break;
					case 'Zend_Db_Exception' :
						$message.= "<br/>TYPE : 503 : Erreur de traitement dans la base de donn�es";
						break;
					case 'Metier_Exception' :
						$message.= "<br/>TYPE : 200 : Erreur metier";
						break;
					default:
						$message.= "<br/>TRACE : ".$exception->getTraceAsString();
						break;
				}
				break;
		}
		$message .= "<br/>USER AGENT : ".getenv("HTTP_USER_AGENT");
		$botDetector = new BotDetector();
		$isBot = $botDetector->isBot(getenv("HTTP_USER_AGENT"));
		if ($isBot != 'ERROR') {
			$message .= "<br/>Bot : ".$isBot;
			$this->log($message,'warn');
		} else {
			$this->log($message,'err');
		} 
		$this->view->title = 'Un probl�me est survenu';
        $this->_response->clearBody();
        $this->_response->clearHeaders();
        $this->_response->setHttpResponseCode(404);
	}

	private function initLog() {
		$registry = Zend_Registry::getInstance();
		$loggerDefault = $registry->get('loggerDefault');

		$controller = Zend_Controller_Front::getInstance()->getRequest();
		$loggerDefault->setEventItem('controller', $controller->getControllerName().'::'.$controller->getActionName());
			
		$registry->set('loggerDefault', $loggerDefault);
	}

	private function log($message , $level) {
		$loggerDefault = Zend_Registry::get('loggerDefault');
		if ($level == 'info') {
			$loggerDefault->info($message);
		} elseif ($level == 'err') {
			$loggerDefault->err($message);
		} elseif ($level == 'warn') {
			$loggerDefault->warn($message);
		} elseif ($level == 'crit') {
			$loggerDefault->crit($message);
		}
	}

}
?>PKi$H[R�n � �"controllers/CommandeController.phpnu&1i�<?php

class CommandeController  extends Modules_Default_Controllers_MainController
{
	public function init()
	{
		$this->view->baseUrl = $this->getBaseUrl();
		$this->checkMaintenance();
	}

	public function indexAction()
	{
		$this->_redirect('/mon-panier.html');
	}
	public function livraisonAction()
	{
		$this->view->title = 'Livraison';
		$auth = Zend_Auth::getInstance();
		$auth->setStorage($this->getSessionStorage());
		$storage = $auth->getStorage()->read();

		if ($auth->hasIdentity() && isset($storage['user'])) {

			$usernamespace = $this->getSession();
			$myFacture = $usernamespace->myFactureValidate;

			if (isset($myFacture) && $myFacture->isFactureValid(1)) {

				$this->view->etapeCommande = 3;
				$this->view->linksMenu = $this->generateLinksMenu(3);

				$dataLiv = array();

				if (isset($usernamespace->addresseLiv) && !empty($usernamespace->addresseLiv)) {
					$dataLiv = $usernamespace->addresseLiv;
				} else {
					$raisonsocial = "";
					if ($storage['user']['type'] == "Professionnel") {
						$raisonsocial = $storage['user']['raisonsocial'];
					} else {
						$raisonsocial = $storage['user']['prenom']." ".$storage['user']['nom'];
					}
					$dataLiv = array('raisonsocial' => $raisonsocial,
                                  'adresse' => $storage['user']['adresse'], 
                                  'adressecomplete' => $storage['user']['adressecomplete'], 
                                  'cp' => $storage['user']['cp'], 
                                  'ville' => $storage['user']['ville'], 
                                  'pays' => $storage['user']['pays'],
                                  'type' => $storage['user']['type']);
					$usernamespace->addresseLiv = $dataLiv;
				}

				$this->view->adresseLiv = $dataLiv;
					
			} else {
				$this->_redirect('/mon-panier.html');
			}
		}  else {
			$this->_redirect('/mon-panier-connexion.html');
		}
	}
	public function ajaxlivraisonAction()
	{
		$auth = Zend_Auth::getInstance();
		$auth->setStorage($this->getSessionStorage());
		$storage = $auth->getStorage()->read();

		if ($auth->hasIdentity() && isset($storage['user'])) {

			$usernamespace = $this->getSession();
			$myFacture = $usernamespace->myFactureValidate;
			if (isset($myFacture) && $myFacture->isFactureValid(1)) {
				if ($this->getRequest()->isPost()) {
					$filter = new Zend_Filter();
					$filter	->addFilter(new Zend_Filter_StripTags())
					->addFilter(new Zend_Filter_StringTrim())
					->addFilter(new Zend_Filter_HtmlEntities(ENT_COMPAT, 'UTF-8')); //for mootools

					$validator = new Zend_Validate();
					$validator -> addValidator(new Zend_Validate_NotEmpty());

					$livuser_raisonsocial = $filter->filter(strtoupper($this->getRequest()->getPost('livuser_raisonsocial')));

					$adresse_type = $this->getRequest()->getPost('address_type');
					if ($adresse_type == 'new') {
						$livuser_adresse = $filter->filter($this->getRequest()->getPost('livuser_adresse'));
						$livuser_cp = $filter->filter($this->getRequest()->getPost('livuser_cp'));
						$livuser_ville = $filter->filter($this->getRequest()->getPost('livuser_ville'));
						$livuser_pays = $filter->filter($this->getRequest()->getPost('livuser_pays'));
						$livuser_adressecomplete = $filter->filter($this->getRequest()->getPost('livuser_adressecomplete'));
					} else {
						$livuser_adresse = $filter->filter($this->getRequest()->getPost('livuser_adresse_old'));
						$livuser_cp = $filter->filter($this->getRequest()->getPost('livuser_cp_old'));
						$livuser_ville = $filter->filter($this->getRequest()->getPost('livuser_ville_old'));
						$livuser_pays = $filter->filter($this->getRequest()->getPost('livuser_pays_old'));
						$livuser_adressecomplete = $filter->filter($this->getRequest()->getPost('livuser_adresse_old'));
					}

					if ($validator->isValid($livuser_raisonsocial) &&
					$validator->isValid($livuser_adresse) &&
					$validator->isValid($livuser_ville) &&
					$validator->isValid($livuser_pays) &&
					$validator->isValid($livuser_cp)
					) {
						$dataLiv = array(
	                                  'raisonsocial' =>$livuser_raisonsocial, 
	                                  'adresse' => $livuser_adresse, 
									  'adressecomplete' => $livuser_adressecomplete,
	                                  'cp' => $livuser_cp, 
	                                  'ville' => $livuser_ville, 
	                                  'pays' => $livuser_pays, 
	                                  'type' => $storage['user']['type']);
							
						$usernamespace->addresseLiv = $dataLiv;
						$this->view->adresseLiv = $dataLiv;
						$this->view->messageSuccess = "Votre adresse a �t� modifi�e";
					} else {
						foreach ($validator->getErrors() as $errorCode) {
							$this->view->messageError =  $this->getErrorValidator($errorCode);
						}
					}
				}
			}
		}
		$this->_forward('ajaxlivraison','ajax');
	}

	public function connexionAction() {
		$this->view->title = 'Connexion';
		$auth = Zend_Auth::getInstance();
		$auth->setStorage($this->getSessionStorage());
		$storage = $auth->getStorage()->read();

		if ($auth->hasIdentity() && isset($storage['user'])) {
			$this->_redirect('/mon-panier-livraison.html');
		} else {
			$this->view->linksMenu = $this->generateLinksMenu(2);
		}
	}

	public function ajaxconnexionAction() {
		if ($this->getRequest()->isPost()) {
			$filter = new Zend_Filter();
			$filter	->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim());

			$validator = new Zend_Validate();
			$validator -> addValidator(new Zend_Validate_NotEmpty())
			-> addValidator(new Zend_Validate_StringLength(4));

			$login = $filter->filter($this->getRequest()->getPost('connexion_login'));
			$mdp = $filter->filter($this->getRequest()->getPost('connexion_mdp'));

			if ($validator->isValid($login) && $validator->isValid($mdp)) {
				$this->view->messageSuccess = $this->connectMe($login, $mdp);
			} else {
				foreach ($validator->getErrors() as $errorCode) {
					$this->view->messageSuccess =  $this->getErrorValidator($errorCode);
				}
			}
		}
		$this->_forward('ajaxvalue','ajax');
	}

	public function ajaxenregistrementAction() {
		$isAdd = false;
		if ($this->getRequest()->isPost()) {

			$filter = new Zend_Filter();
			$filter	->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim());
			$filter2 = new Zend_Filter();
			$filter2->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim())
			->addFilter(new Zend_Filter_Digits());

			$filterMaj = new Zend_Filter();
			$filterMaj->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim())
			->addFilter(new Zend_Filter_StringToUpper());

			$validator = new Zend_Validate();
			$validator -> addValidator(new Zend_Validate_NotEmpty())
			-> addValidator(new Zend_Validate_StringLength(4));

			$validatorTel = new Zend_Validate();
			$validatorTel -> addValidator(new Zend_Validate_NotEmpty())
			-> addValidator(new Zend_Validate_StringLength(10));

			$validator2 = new Zend_Validate();
			$validator2 -> addValidator(new Zend_Validate_NotEmpty());
 
			$validatorEmail = new Zend_Validate_EmailAddress();

			$adduser_login = $filter->filter($this->getRequest()->getPost('adduser_login'));
			$adduser_mdp = $filter->filter($this->getRequest()->getPost('adduser_mdp'));
			$adduser_mdp2 = $filter->filter($this->getRequest()->getPost('adduser_mdp2'));

			$adduser_civility = $filter->filter($this->getRequest()->getPost('adduser_civility'));
			$adduser_nom = $filterMaj->filter($this->getRequest()->getPost('adduser_nom'));
			$adduser_prenom = $filter->filter($this->getRequest()->getPost('adduser_prenom'));
             
			$adduser_fct = $filter->filter($this->getRequest()->getPost('adduser_fct'));
			$adduser_tel = $filter2->filter($this->getRequest()->getPost('adduser_tel'));
			$adduser_fax = $filter2->filter($this->getRequest()->getPost('adduser_fax'));
			$adduser_email = $adduser_login;// $filter->filter($this->getRequest()->getPost('adduser_email'));


			$adduser_adresse = $filter->filter($this->getRequest()->getPost('adduser_adresse'));
			$adduser_cp = $filter->filter($this->getRequest()->getPost('adduser_cp'));
			$adduser_ville = $filter->filter($this->getRequest()->getPost('adduser_ville'));
			$adduser_pays = $filter->filter($this->getRequest()->getPost('adduser_pays'));
			$adduser_departement = $filter->filter($this->getRequest()->getPost('adduser_departement'));
			$adduser_region = $filter->filter($this->getRequest()->getPost('adduser_region'));
			$adduser_adressecomplete = $filter->filter($this->getRequest()->getPost('adduser_adressecomplete'));

			$adresse_type = $this->getRequest()->getPost('address_type');
			if ($adresse_type == 'new') {
				$adduser_adresse = $filter->filter($this->getRequest()->getPost('adduser_adresse'));
				$adduser_cp = $filter->filter($this->getRequest()->getPost('adduser_cp'));
				$adduser_ville = $filter->filter($this->getRequest()->getPost('adduser_ville'));
				$adduser_pays = $filter->filter($this->getRequest()->getPost('adduser_pays'));
				$adduser_departement = $filter->filter($this->getRequest()->getPost('adduser_departement'));
				$adduser_region = $filter->filter($this->getRequest()->getPost('adduser_region'));
				$adduser_adressecomplete = $filter->filter($this->getRequest()->getPost('adduser_adressecomplete'));
			} else {
				$adduser_adresse = $filter->filter($this->getRequest()->getPost('adduser_adresse_old'));
				$adduser_cp = $filter->filter($this->getRequest()->getPost('adduser_cp_old'));
				$adduser_ville = $filter->filter($this->getRequest()->getPost('adduser_ville_old'));
				$adduser_pays = $filter->filter($this->getRequest()->getPost('adduser_pays_old'));
				$adduser_departement = '';
				$adduser_region = '';
				$adduser_adressecomplete = $filter->filter($this->getRequest()->getPost('adduser_adresse_old'));
			}

			$adduser_raisonsocial = $filterMaj->filter($this->getRequest()->getPost('adduser_raisonsocial'));
			$adduser_siret = $filterMaj->filter($this->getRequest()->getPost('adduser_siret'));
			$adduser_numidfisc = $filterMaj->filter($this->getRequest()->getPost('adduser_numidfisc'));
			$adduser_codeape = $filterMaj->filter($this->getRequest()->getPost('adduser_codeape'));
			$adduser_sectactivite = $filterMaj->filter($this->getRequest()->getPost('adduser_sectactivite'));

			$adduser_comm = $filter->filter($this->getRequest()->getPost('adduser_comm'));

			$adduser_newsletter = $filter->filter($this->getRequest()->getPost('adduser_newsletter'));

			$typeUser = $filter->filter($this->getRequest()->getPost('adduser_typeuser'));

			$date = new Zend_Date();
			$dateinsc = $date->toString('YYYY-MM-dd HH:mm:ss');

			$data = array(
                                  'LOGIN' => utf8_decode($adduser_login), 
                                  'MDP' => md5($adduser_mdp), 
                                  'ROLE' => 0, 
                                  'NOM' => utf8_decode($adduser_nom), 
                                  'PRENOM' => utf8_decode($adduser_prenom),
                                  'CIVILITE' => $adduser_civility, 
                                  'FONCTION' => utf8_decode($adduser_fct), 
                                  'RAISONSOCIAL' => utf8_decode($adduser_raisonsocial), 
                                  'ADRESSE' => utf8_decode($adduser_adresse), 
                                  'CP' => utf8_decode($adduser_cp), 
                                  'VILLE' => utf8_decode($adduser_ville), 
                                  'DEPARTEMENT' => utf8_decode($adduser_departement), 
                                  'REGION' => utf8_decode($adduser_region), 
								  'ADRESSECOMPLETE' => utf8_decode($adduser_adressecomplete),
                                  'PAYS' => utf8_decode($adduser_pays), 
                                  'EMAIL' => utf8_decode($adduser_email), 
                                  'TEL' => $adduser_tel, 
                                  'FAX' => $adduser_fax, 
                                  'SIRET' => utf8_decode($adduser_siret), 
								  'NUMIDFISC' => utf8_decode($adduser_numidfisc),
                                  'CODEAPE' => utf8_decode($adduser_codeape), 
                                  'SECTACTIVITE' => utf8_decode($adduser_sectactivite), 
                                  'COMMENTAIRE' => utf8_decode($adduser_comm),  
                                  'TYPE' => $typeUser, 
                                  'DATEINSC' => $dateinsc);

			$isTypeOk = false;
			if ($validator2->isValid($typeUser)) {
				$isTypeOk = true;
			}

			$errorType = 0;
			if ($validator->isValid($adduser_mdp) && $validator->isValid($adduser_mdp2) &&
			$validator2->isValid($adduser_civility) &&
			$validator2->isValid($adduser_nom) && $validator2->isValid($adduser_adresse) &&
			$validator2->isValid($adduser_prenom) && $validator2->isValid($adduser_ville) &&
			$validator2->isValid($adduser_pays) &&
			$validatorEmail->isValid($adduser_login) && $validator2->isValid($adduser_cp)
			) {
				if ($isTypeOk) {
					if ($typeUser == "Professionnel") {
						if ($validator2->isValid($adduser_raisonsocial) &&
						$validator2->isValid($adduser_siret) &&
						$validator2->isValid($adduser_numidfisc) &&
						$validator2->isValid($adduser_codeape)) {

						} else { 
							$errorType = 3;
							foreach ($validator2->getErrors() as $errorCode) {
								$this->view->messageSuccess =  $this->getErrorValidator($errorCode);
							}
						}
					}
				} else {
					$errorType = 2;
					$this->view->messageSuccess =  "Vous devez choisir entre Particulier et Professionnel. ";
				}
			} else {
				$errorType = 1; 
				foreach ($validator->getErrors() as $errorCode) {
					$this->view->messageSuccess =  $this->getErrorValidator($errorCode);
				}
				foreach ($validator2->getErrors() as $errorCode) {
					$this->view->messageSuccess =  $this->getErrorValidator($errorCode);
				}
				foreach ($validatorEmail->getErrors() as $errorCode) {
					$this->view->messageSuccess =  $this->getErrorValidator($errorCode);
				}
			}


			if ($errorType == 0) {
				if ($validatorTel->isValid($adduser_tel)) {
					if ($adduser_mdp2 == $adduser_mdp) {

						try {
							$user = new User();

							$isExistLogin = $user->fetchRow("LOGIN = '".$adduser_login."'");

							if (!$isExistLogin) {

								$isExistEmail = $user->fetchRow("EMAIL = '".$adduser_email."'");
								if (!$isExistEmail) {
									$isAdd = $user->insert($data);
									$this->log("Nouveau client : ".$adduser_email,'info');
									if ($adduser_newsletter) {
										$user_newsletter = new UserNewsletter();
										$code = md5($dateinsc.'_'.$adduser_email);
											
										$isExistNL = $user_newsletter->fetchRow("EMAIL = '".$adduser_email."'");

										if(!$isExistNL) {
											$dataNL = array(
						 	 					'EMAIL' => $adduser_email,
						 	 					'DATEINS' => $dateinsc,
						 	 					'CODE' => $code
											);
											$user_newsletter->insert($dataNL);
										}
									}

									$this->view->messageSuccess = $this->connectMe($adduser_login, $adduser_mdp);
								} else {
									$this->view->messageSuccess =  "L'email est d�j� utilis�.";
								}
							} else {
								$this->view->messageSuccess =  "L'identifiant existe d�j�";
							}
						} catch (Zend_Exception $e) {
							$this->log($e->getMessage(),'err');
							$this->view->messageSuccess =  "Une erreur est survenue, v�rifier vos informations.";
						}
					} else {
						$this->view->messageSuccess =  "V�rifier votre mot de passe";
					}
				} else {
					$this->view->messageSuccess =  "V�rifier votre num�ro de t�l�phone";
				}
			}
		}
		$this->_forward('ajaxvalue','ajax');
	}


	private function computeBill($statut,$reference,$id,$facture,$addresseLiv, $user) {
		$fact_raisonsociale = $user['prenom']." ".strtoupper($user['nom']);
		if ($user['type'] == "Professionnel") {
			$fact_raisonsociale = $user['raisonsocial'];
		} 
		$USER_MODEPAIEMENT_LABEL = " Paiement s�curis� en ligne";
		switch ($user['modepaiement']) {
			case 1 : $USER_MODEPAIEMENT_LABEL = " Paiement s�curis� en ligne"; break;
			case 2 : $USER_MODEPAIEMENT_LABEL = " Contre remboursement";break;
			case 3 : $USER_MODEPAIEMENT_LABEL = " Paiement diff�r� - 30 jours";break;
			case 4 : $USER_MODEPAIEMENT_LABEL = " Paiement diff�r� - 45 jours";break;
			case 5 : $USER_MODEPAIEMENT_LABEL = " Paiement diff�r� - 60 jours";break;
			case 6 : $USER_MODEPAIEMENT_LABEL = " A r�ception de la facture";break;
		}
        
        if($statut == 10) {
            $USER_MODEPAIEMENT_LABEL = "Devis";
        }

		$data = array (
						'REFERENCE' => $reference, 
						'PRIXTOTALHTHR' => $facture->total_HT_HR,
						'PRIXREMISEEUR' => $facture->total_remise,
						'PRIXTOTALHT' => $facture->total_HT,
						'PRIXFRAISPORT' => $facture->total_frais_port,
						'PRIXFRAISPORTPOUR' => $facture->total_frais_port_pour,
						'PRIXTOTALHTFP' => $facture->total_HT_FP,
						'PRIXTOTALTTC' => $facture->total_TTC,
						'PRIXTOTALTVA' => $facture->total_TVA,
						'DATESTART' => $facture->date_start, 
						'IDUSER' => $user['id'],
						'STATUT' => $statut,
						'LIV_RAISONSOCIAL' => $addresseLiv['raisonsocial'],
						'LIV_ADRESSE' => $addresseLiv['adresse'],
						'LIV_CP' => $addresseLiv['cp'],
						'LIV_VILLE' => $addresseLiv['ville'],
						'LIV_PAYS' => $addresseLiv['pays'],
						'FACT_RAISONSOCIAL' => $fact_raisonsociale,
						'FACT_ADRESSE' => $user['adresse'],
						'FACT_CP' => $user['cp'],
						'FACT_VILLE' => $user['ville'],
						'FACT_PAYS' => $user['pays'],
						'USER_NOM' =>$user['nom'],
						'USER_PRENOM' =>$user['prenom'],
						'USER_TEL' =>$user['tel'],
						'USER_FAX' =>$user['fax'],
						'USER_NUMCOMPTE' =>$user['numcompte'],
						'USER_EMAIL' =>$user['email'],
						'USER_MODEPAIEMENT' =>$user['modepaiement'],
						'USER_TYPE' =>$user['type'],
						'USER_MODEPAIEMENT_LABEL' =>$USER_MODEPAIEMENT_LABEL,
						'CADDY' => $facture->facture_lines,
						'INFOLIV' => $facture->livraison,
						'CODEREDUCTION' => $facture->code_reduction,
						'ID_COMMAND' => $id
		);
        $data['CADDYFIDELITE'] = array();
        if($statut != 10) {
            $data['CADDYFIDELITE'] = $facture->facture_fidelite_lines;
        } else {
            $facture->facture_fidelite_lines = array();            
        }
		return $data;
	}
 
	public function validationAction()
	{
		try {
			$this->view->title = 'Confirmation de votre commande';
			$auth = Zend_Auth::getInstance();
			$auth->setStorage($this->getSessionStorage());
			$storage = $auth->getStorage()->read();

			if ($auth->hasIdentity() && isset($storage['user'])) {
				
				$this->view->user = $storage['user'];

				$usernamespace = $this->getSession();
				$addresseLiv = $usernamespace->addresseLiv;
				$facture = $usernamespace->myFactureValidate;

				if ($this->isExisteArray($addresseLiv) && $facture->isFactureValid(2)) {
					$this->view->etapeCommande = 4;
					$this->view->linksMenu = $this->generateLinksMenu(4); 
					$usernamespace->myFactureValidate = $facture;

					$data = $this->insertNewCommand(0,'Validating','',$facture, $addresseLiv,$storage['user']);
					$usernamespace->commandAdded = $data;

					$facture = $this->computeBill(0,$data['REFERENCE'],$data['ID'],$facture, $addresseLiv, $storage['user']);
					$this->view->facture = $facture;

					$promo = new PromoCalculator();
					$this->view->isCommandValid = $promo->isCommandValid($facture['PRIXTOTALHT']);

				} else {
					$this->_redirect('/mon-panier.html');
				}
			}  else {
				$this->_redirect('/connectez-vous.html');
			}
		} catch (Zend_Exception $e) {
			$this->log("Erreur : validationAction() ".$e->getMessage(),'err');
			$this->_redirect('/');
		}
	}

	private function isExisteArray($array) {
		if (isset($array) && sizeof($array) > 0) {
			return true;
		} else {
			return false;
		}
	}
	public function paiementAction() {
		try {

			$auth = Zend_Auth::getInstance();
			$auth->setStorage($this->getSessionStorage());
			$storage = $auth->getStorage()->read();
			$ispaiementOk = false;
            $sendmail = true;
			
			if ($auth->hasIdentity() && isset($storage['user'])) {
				$modepaiement = $storage['user']['modepaiement']; 
				$payment_status = 'Pending';
				$txn_id = '';
				
				$type_paiement = '';
				$type = 0;
				$type_prefix = 'Mode de paiement : ';
				switch ($modepaiement) {
					case 1 :
						$type_paiement = $type_prefix.'Paiement s�curis� en ligne';
						$ispaiementOk = true;
                        $sendmail = false;
						if ($this->ipnPaypalListenerValidate()) {
							$payment_status = $this->_request->getParam('payment_status');
							$txn_id = $this->_request->getParam('txn_id');
						} 
						break;
					default :
						$ispaiementOk = false;
						break;
				}
				
				if ((int)$this->getRequest()->getParam('type') > 0) {
					$type = (int)$this->getRequest()->getParam('type'); 
					switch ($type) {
						case 1 : 
							$ispaiementOk = true; 
							$type_paiement = $type_prefix.'Par ch�que';
							break;
						case 2 : 
							$ispaiementOk = true; 
							$type_paiement = $type_prefix.'Par virement';
							break;
						case 3 : 
							$ispaiementOk = true; 
							switch ($modepaiement) { 
								case 2 : $type_paiement = $type_prefix."Contre remboursement";break;
								case 3 : $type_paiement = $type_prefix."Paiement diff�r� - 30 jours";break;
								case 4 : $type_paiement = $type_prefix."Paiement diff�r� - 45 jours";break;
								case 5 : $type_paiement = $type_prefix."Paiement diff�r� - 60 jours";break;
								case 6 : $type_paiement = $type_prefix."A r�ception de la facture";break;
							} 
							break; 
					}
				} 
			} else {
			    $this->log("Erreur : paiementAction() No user",'warn');
            }

			if ($ispaiementOk) {
			    $this->log("Erreur : paiementAction() Paiement Ok",'warn');
				$this->finishandclosepaiement($payment_status, $txn_id, $type_paiement, $type, $sendmail);				
			}  else {
			    $this->log("Erreur : paiementAction() Redirect Home",'warn');
				$this->_redirect('/');
			}

		}catch (Zend_Exception $e) {
			$this->log("Erreur : paiementAction() ".$e->getMessage(),'err');
			$this->_redirect('/');
		}
	}

	private function sendMailCommande($facture, $to) {


		$view = new Zend_View();
		$view->addScriptPath('../application/modules/default/views/scripts/commande/');
		$view->assign("facture",$facture);
		$view->assign("baseUrl", "http://".$this->site_actualshort);
		$view->assign("baseUrl_SiteCommerceUrl", $this->baseUrl_SiteCommerceUrl);
		$view->assign("serviceClient_Mail", $this->serviceClient_Mail);
		
		$view->assign("siteName", $this->siteName);
		$view->assign("site_addresse3_title", $this->site_addresse3_title);
		$view->assign("site_addresse3_address", $this->site_addresse3_address);
		$view->assign("site_addresse3_cp", $this->site_addresse3_cp);
		$view->assign("site_addresse", $this->site_addresse);
		$view->assign("site_actualshort", $this->site_actualshort);
		
		$view->assign("site_rib_numbers", $this->site_rib_numbers);
		$view->assign("site_rib_iban", $this->site_rib_iban);
		$view->assign("site_rib_bic", $this->site_rib_bic);
		$view->assign("site_rib_bankname", $this->site_rib_bankname);

		$body = $view->render("facture_mail.phtml");

		$from =  $this->serviceClient_Mail;

		if ($facture['STATUT'] == 1) { $objet = "Votre commande : ".$facture['REFERENCE']; } else {$objet = "Votre devis : ".$facture['REFERENCE'];}

		$mail = new Zend_Mail();
		$mail->setBodyHtml($body);
		$mail->setFrom($from, $this->siteName);
		$mail->addTo($to);
		$mail->setSubject($objet);
		try {
			$mail->send();
			$this->log("L'email de commande a �t� envoy� a : ".$to,'info');
		} catch (Zend_Exception $e) {
			$this->log($e->getMessage(),'err');
		}
	}

	private function referencegen() {
		$chaine ="mnoTUzS5678kVvwxy9WXYZRNCDEFrslq41GtuaHIJKpOPQA23LcdefghiBMbj0";
		srand((double)microtime()*1000000);
		for($i=0; $i<10; $i++){
			@$pass .= $chaine[rand()%strlen($chaine)];
		}
		return $pass;
	}

	private function generateLinksMenu($etapeCommande){
		$linksMenu = array();
		switch ($etapeCommande) {
			case 2 :
				$linksMenu[0]['NAVURL'] = '/mon-panier.html';
				$linksMenu[0]['NAVNOM'] = 'Mon Panier';
				$linksMenu[1]['NAVURL'] = '/mon-panier-connexion.html';
				$linksMenu[1]['NAVNOM'] = 'Identification';
				break;

			case 3 :
				$linksMenu[0]['NAVURL'] = '/mon-panier.html';
				$linksMenu[0]['NAVNOM'] = 'Mon Panier';
				$linksMenu[1]['NAVURL'] = '/mon-panier-livraison.html';
				$linksMenu[1]['NAVNOM'] = 'Livraison';
				break;

			case 4 :
				$linksMenu[0]['NAVURL'] = '/mon-panier.html';
				$linksMenu[0]['NAVNOM'] = 'Mon Panier';
				$linksMenu[1]['NAVURL'] = '/mon-panier-livraison.html';
				$linksMenu[1]['NAVNOM'] = 'Livraison';
				$linksMenu[2]['NAVURL'] = '/mon-panier-validation.html';
				$linksMenu[2]['NAVNOM'] = 'Validation';
				break;

		}

		return $linksMenu;
	}
    
	private function updateCommandFidelite($id, $facture) {
        $commandFidelite = new CommandFidelite();
        $commandFidelite->delete('IDCOMMAND = '.$id); 
		foreach ($facture->facture_fidelite_lines as $row) {
			$dataCaddyFidelite = array (
						'IDFIDELITE' => $row->fidelite_id,
						'NBPOINT' => $row->fidelite_nbpoint,                  
						'NOM' => $row->fidelite_nom,
						'IDCOMMAND' => $id
			);
			$commandFidelite->insert($dataCaddyFidelite);
		}
    }

	private function updateCommand($id, $payment_status,$txn, $statut) {

		try {
			$command = new Command();
			$data = array(
			'PAYMENT_STATUS' => $payment_status,
			'TXN_ID' => $txn,
			'STATUT' => $statut
			);
			$command->update($data,'ID = '.$id);
            
            if ($statut != 10 && $this->carte_fidelite_enabled) {
                 $facture = $command->getCommandAsFacture($id);
			     $commandProduct = new CommandProduct();
			     $productChild = new ProductChild();
                 foreach($facture['CADDY'] as $row) {
                    $child = $productChild->fetchRow('ID = '.$row['ID']);
                    $dataProd = array(
			            'POINTFIDELITE' => $child['POINTFIDELITE'],
			            'POINTFIDELITESUM' => $child['POINTFIDELITE'] * $row['QUANTITY']
			        );
			        $commandProduct->update($dataProd,'ID = '.$row['IDLINE']);
                }
            }
		} catch(Zend_Exception $e) {
			$this->log('Erreur lors de la mise a jour de la commande : '.$id.' Message : '.$e->getMessage(),'err');
			return false;
		}
		return true;
	}

	private function updateCommandByID($id, $payment_status,$txn, $statut) {
		try {
			$command = new Command();
			$data = array(
			'PAYMENT_STATUS' => $payment_status,
			'TXN_ID' => $txn,
			'STATUT' => $statut
			);
			$command->update($data,'ID = '.$id);

			$currentCommand = $command->fetchRow('ID = '.$id);
			if (isset($currentCommand) && !empty($currentCommand) && !empty($currentCommand['CODEREDUCTION'])) {
				$codeReduction = new CodeReduction();
				$date = new Zend_Date();
				$data = array(
					"isACTIF" => 0,
					"NOM" => $currentCommand['USER_NOM'],
					"PRENOM" => $currentCommand['USER_PRENOM'],
					"IDUSER" => $currentCommand['IDUSER'],
					"ID" => $id,
					"DATEUSE" => $date->toString('YYYY-MM-dd HH:mm:ss')
				);
				$codeReduction->update($data,"CODE = '".$currentCommand['CODEREDUCTION']."'");
			}

		} catch(Zend_Exception $e) {
			$this->log('Erreur lors de la mise a jour de la commande ID : '.$id.' Message : '.$e->getMessage(),'err');
			return false;
		}
		return true;
	}


	private function updateCommandByIDUNVERIFIED($id, $paymentStat) {
		try {
			$command = new Command();
			$data = array(
			'PAYMENT_STATUS' => $paymentStat,
			'STATUT' => 1
			);
			$command->update($data,'ID = '.$id);
		} catch(Zend_Exception $e) {
			$this->log('Erreur lors de la mise a jour de la commande ID : '.$id.' Message : '.$e->getMessage(),'err');
			return false;
		}
		return true;
	}

	private function deleteNewCommand($id) {
		try {
			$command = new Command();
			$commandProduct = new CommandProduct();

			$commandProduct->delete('IDCOMMAND = '.$id);
			$command->delete('ID = '.$id);
		} catch(Zend_Exception $e) {
			$this->log('Erreur lors de la suppression de la commande : '.$id.' Message : '.$e->getMessage(),'err');
			return false;
		}
		return true;
	}


	private function insertNewCommand($statut,$payment_status,$txn, $myFacture, $addresseLiv, $user) {
		$command = new Command();
		$fact_raisonsociale = $user['prenom']." ".strtoupper($user['nom']);
		if ($user['type'] == "Professionnel") {
			$fact_raisonsociale = $user['raisonsocial'];
		}
		$codereduction = "";
		$codereductioneuro = 0;
		$livnom = "";
		if (isset($myFacture->code_reduction) && !empty($myFacture->code_reduction)) {
			$codereductioneuro = $myFacture->code_reduction['EURO'];
			$codereduction = $myFacture->code_reduction['CODE'];
		}
		if (isset($myFacture->livraison) && !empty($myFacture->livraison)) {
			$livnom = $myFacture->livraison['NOMLIV'];
		}
			
		$data = array (
						'REFERENCE' => 'REF-'.$this->referencegen(),
						'PRIXTOTALHTHR' => $myFacture->total_HT_HR,
						'PRIXREMISEEUR' => $myFacture->total_remise,
						'PRIXTOTALHT' => $myFacture->total_HT,
						'PRIXFRAISPORT' => $myFacture->total_frais_port,
						'PRIXFRAISPORTPOUR' => $myFacture->total_frais_port_pour,
						'PRIXTOTALHTFP' => $myFacture->total_HT_FP,
						'PRIXTOTALTTC' => $myFacture->total_TTC,
						'DATESTART' => $myFacture->date_start,
						'STATUT' => $statut,
						'PAYMENT_STATUS' => $payment_status,
						'TXN_ID' => $txn,
						'IDUSER' => $user['id'],
						'LIV_RAISONSOCIAL' => $addresseLiv['raisonsocial'],
						'LIV_ADRESSE' => $addresseLiv['adresse'],
						'LIV_CP' => $addresseLiv['cp'],
						'LIV_VILLE' => $addresseLiv['ville'],
						'LIV_PAYS' => $addresseLiv['pays'],
						'FACT_RAISONSOCIAL' => $fact_raisonsociale,
						'FACT_ADRESSE' => $user['adresse'],
						'FACT_CP' => $user['cp'],
						'FACT_VILLE' => $user['ville'],
						'FACT_PAYS' => $user['pays'],
						'USER_NOM' =>$user['nom'],
						'USER_PRENOM' =>$user['prenom'],
						'USER_TEL' =>$user['tel'],
						'USER_FAX' =>$user['fax'],
						'USER_EMAIL' =>$user['email'],
						'USER_NUMCOMPTE' =>$user['numcompte'],
						'USER_MODEPAIEMENT' =>$user['modepaiement'],
						'USER_MODEPAIEMENT_TYPE' => 0,
						'LIV_NOM' =>$livnom,
						'CODEREDUCTIONEURO' => $codereductioneuro,
						'CODEREDUCTION' => $codereduction
		);

		$command->insert($data);

		$lastID = $command->getAdapter()->lastInsertId($command,'ID');

		$date = new Zend_Date();
		$myReference = $this->lpad_zero($lastID, 5)."-".$date->toString('YY');
		$dataRef = array ( 'REFERENCE' => $myReference );
		$command->update($dataRef,"ID = ".$lastID);
			
		$commandProduct = new CommandProduct();
		$userCaddyType = new UserCaddyType();

		foreach ($myFacture->facture_lines as $row) {
			$dataCaddy = array (
						'CHILDID' => $row->item_id,
						'CHILDREF' => $row->item_reference,
						'CHILDisPROMO' => $row->item_isPromo,
						'CHILDisDEVIS' => $row->item_isDevis,
						'CHILDPRIX' => $row->item_prix,
						'CHILDQUANTITY' => $row->item_qte,
						'CHILDPROMOPRIX' => $row->getPrixAfterRemise(),
						'CHILDPRIXTOTAL' => $row->getPrixTotalHT(true),
						'CHILDPRIXREMISE' => $row->getPrixRemise(),
						'CHILDREMISEPRIXTAUXE' => $row->remise_euro,
						'CHILDREMISEPRIXTAUXP' => $row->remise_pour,
						'PRODUCTID' => $row->product_id,
						'IDCOMMAND' => $lastID,
						'SELECTEDOPTION' => $row->item_selectedOption,
                        'POINTFIDELITE' => 0,
                        'POINTFIDELITESUM' => 0
			);
			$userCaddyType->addNewUserItem($row->item_reference, $user['id']);
			$commandProduct->insert($dataCaddy);
		}

		$dataReturn = array(
			'REFERENCE' => $myReference,
			'ID' => $lastID
		);
		return $dataReturn;
	}

	public function paypalipnvalidationtestAction() {
		$resultPaypal = $this->ipnPaypalListener();
		$this->_redirect('/');
	}

	public function paypalipnvalidationAction() {
		$resultPaypal = $this->ipnPaypalListener();
		$this->_redirect('/');
	}

	private function sendMail($body, $from, $to, $objet) {
		$mail = new Zend_Mail();
		$mail->setBodyHtml($body);
		$mail->setFrom($from, $this->siteName.' : PAYPAL');
		$mail->addTo($to);
		$mail->setSubject($objet);
		try {
			$mail->send();
			$this->log("L'email a �t� envoy� a : ".$to,'info');
		} catch (Zend_Exception $e) {
			$this->log($e->getMessage(),'err');
		}
	}

	private function ipnPaypalListener() {
		
		$idCommand = $this->_request->getParam('item_number');
		if (empty($idCommand)) {
			$idCommand = $this->_request->getParam('custom');			
		}
		
		$dataIPN = array(
			'transaction_subject' => $this->_request->getParam('transaction_subject'),
			'txn_type' => $this->_request->getParam('txn_type'),
			'payment_date' => $this->_request->getParam('payment_date'),
			'last_name' => $this->_request->getParam('last_name'),
			'residence_country' => $this->_request->getParam('residence_country'),
			'pending_reason' => $this->_request->getParam('pending_reason'),
			'item_name' => $this->_request->getParam('item_name'),
			'payment_gross' => $this->_request->getParam('payment_gross'),
			'payment_currency' => $this->_request->getParam('mc_currency'),
			'business' => $this->_request->getParam('business'),
			'payment_type' => $this->_request->getParam('payment_type'),
			'protection_eligibility' => $this->_request->getParam('protection_eligibility'),
			'payer_status' => $this->_request->getParam('payer_status'),
			'verify_sign' => $this->_request->getParam('verify_sign'),
			'txn_id' => $this->_request->getParam('txn_id'),
			'payer_email' => $this->_request->getParam('payer_email'),
			'tax' => $this->_request->getParam('tax'),
			'test_ipn' => $this->_request->getParam('test_ipn'),
			'first_name' => $this->_request->getParam('first_name'),
			'receiver_email' => $this->_request->getParam('receiver_email'),
			'quantity' => $this->_request->getParam('quantity'),
			'payer_id' => $this->_request->getParam('payer_id'),
			'receiver_id' => $this->_request->getParam('receiver_id'),
			'item_number' => $idCommand,
			'payment_status' => $this->_request->getParam('payment_status'),
			'handling_amount' => $this->_request->getParam('handling_amount'),
			'shipping' => $this->_request->getParam('shipping'),
			'payment_amount' => $this->_request->getParam('mc_gross'),
			'custom' => $this->_request->getParam('custom'),
			'charset' => $this->_request->getParam('charset'),
			'notify_version' => $this->_request->getParam('notify_version'),
			'merchant_return_link' => $this->_request->getParam('merchant_return_link')
		);

		// read the post from PayPal system and add 'cmd'
		$req = 'cmd=_notify-validate';

		foreach ($_POST as $key => $value) {
			$value = urlencode(stripslashes($value));
			$req .= "&$key=$value";
		}
		
		$this->log('PAYPAL : IPN INCOMING : req : '.$req,'info');

		// post back to PayPal system to validate
		$header  = "POST /cgi-bin/webscr HTTP/1.0\r\n";
		$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
		$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";

		//If testing on Sandbox use:
		$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);

		$notify_email = $this->reglement_Mail;

		if (!$fp) {
			return false;
		} else {
			fputs ($fp, $header . $req);
			while (!feof($fp)) {
				$res = fgets ($fp, 1024);
				if (strcmp ($res, "VERIFIED") == 0) {
					if ($this->isTxnidUnique($dataIPN)) {

						if ($dataIPN['payment_status'] == 'Completed' && $dataIPN['receiver_id'] == $this->paypal_business) {
							$paypal_payment = new PaypalPaiement();
							$paypal_payment->insert($dataIPN);

							$this->updateCommandByID($idCommand,$dataIPN['payment_status'],$dataIPN['txn_id'],1);
		                    $this->log('PAYPAL : IPN-VERIFIED : res : '.$res.' : req : '.$req,'info');
							$this->sendMail("$res\n $req \n", $notify_email, $notify_email, 'PAYPAL : IPN-VERIFIED');

				            $command = new Command();                            
                            $facture = $command->getCommandAsFacture($idCommand);
                            $this->finishandclosepaiementsendmail($facture, $idCommand, true, "Mode de paiement : Paiement s�curis� en ligne", 0);
                            
							return true;

						} else {
							$this->updateCommandByIDUNVERIFIED($idCommand, 'Incorrect');
							$this->sendMail("$res\n $req \n", $notify_email, $notify_email, 'PAYPAL : IPN-VERIFIED INCORRECT');
							$this->log('PAYPAL : IPN-VERIFIED INCORRECT : res : '.$res.' : req : '.$req,'warn');
						}
					} else {
						$this->updateCommandByIDUNVERIFIED($idCommand, 'Duplicated');
						$this->sendMail("$res\n $req \n", $notify_email, $notify_email, 'PAYPAL : IPN-VERIFIED DUPLICATED TRANSACTION');
						$this->log('PAYPAL : IPN-VERIFIED DUPLICATED TRANSACTION : res : '.$res.' : req : '.$req,'warn');
					}

				} else if (strcmp ($res, "INVALID") == 0) {
					$this->updateCommandByIDUNVERIFIED($idCommand, 'Invalid');
					$this->sendMail("$res\n $req \n", $notify_email, $notify_email, 'PAYPAL : IPN-INVALID');
					$this->log('PAYPAL : IPN-INVALID : res : '.$res.' : req : '.$req,'warn');
				}

			}
			fclose ($fp);
		}
		return false;
	}
    
    private function finishandclosepaiementsendmail($facture, $idCommand, $sendmail, $type_paiement, $type) {
		$command = new Command();
		$dataTemp = array(
				'USER_MODEPAIEMENT_LABEL' => $type_paiement,
				'USER_MODEPAIEMENT_TYPE' => $type
		);
		$command->update($dataTemp,'ID = '.$idCommand);
        
        if ($sendmail) {
            $facture['USER_MODEPAIEMENT_LABEL'] = $type_paiement;
		    $facture['USER_MODEPAIEMENT_TYPE'] = $type;                
		    $this->sendMailCommande($facture,$this->devisCommande_Mail);
		    $this->sendMailCommande($facture,$facture['USER_EMAIL']);
        }                
	    /*
        if (isset($this->ekomi_email) && !empty($this->ekomi_email)) {
		    $this->sendMailCommande($factureDevis,$this->ekomi_email);
        }*/                
    }

	private function ipnPaypalListenerValidate() {
	
		$idCommand = $this->_request->getParam('item_number');
		if (empty($idCommand)) {
			$idCommand = $this->_request->getParam('custom');			
		}
		
		$dataIPN = array(
			'transaction_subject' => $this->_request->getParam('transaction_subject'),
			'txn_type' => $this->_request->getParam('txn_type'),
			'payment_date' => $this->_request->getParam('payment_date'),
			'last_name' => $this->_request->getParam('last_name'),
			'residence_country' => $this->_request->getParam('residence_country'),
			'pending_reason' => $this->_request->getParam('pending_reason'),
			'item_name' => $this->_request->getParam('item_name'),
			'payment_gross' => $this->_request->getParam('payment_gross'),
			'payment_currency' => $this->_request->getParam('mc_currency'),
			'business' => $this->_request->getParam('business'),
			'payment_type' => $this->_request->getParam('payment_type'),
			'protection_eligibility' => $this->_request->getParam('protection_eligibility'),
			'payer_status' => $this->_request->getParam('payer_status'),
			'verify_sign' => $this->_request->getParam('verify_sign'),
			'txn_id' => $this->_request->getParam('txn_id'),
			'payer_email' => $this->_request->getParam('payer_email'),
			'tax' => $this->_request->getParam('tax'),
			'test_ipn' => $this->_request->getParam('test_ipn'),
			'first_name' => $this->_request->getParam('first_name'),
			'receiver_email' => $this->_request->getParam('receiver_email'),
			'quantity' => $this->_request->getParam('quantity'),
			'payer_id' => $this->_request->getParam('payer_id'),
			'receiver_id' => $this->_request->getParam('receiver_id'),
			'item_number' => $idCommand,
			'payment_status' => $this->_request->getParam('payment_status'),
			'handling_amount' => $this->_request->getParam('handling_amount'),
			'shipping' => $this->_request->getParam('shipping'),
			'payment_amount' => $this->_request->getParam('mc_gross'),
			'custom' => $this->_request->getParam('custom'),
			'charset' => $this->_request->getParam('charset'),
			'notify_version' => $this->_request->getParam('notify_version'),
			'merchant_return_link' => $this->_request->getParam('merchant_return_link')
		);

		$notify_email = $this->reglement_Mail;

		// read the post from PayPal system and add 'cmd'
		$req = 'cmd=_notify-validate';

		foreach ($_POST as $key => $value) {
			$value = urlencode(stripslashes($value));
			$req .= "&$key=$value";
		}

		$this->log('PAYPAL : IPN INCOMING : req : '.$req,'info');
		
		// post back to PayPal system to validate
		$header  = "POST /cgi-bin/webscr HTTP/1.0\r\n";
		$header .= "Content-Type: application/x-www-form-urlencoded\r\n";
		$header .= "Content-Length: " . strlen($req) . "\r\n\r\n";

		//If testing on Sandbox use:
		$fp = fsockopen ('ssl://www.paypal.com', 443, $errno, $errstr, 30);

		if (!$fp) {
			return false;
		} else {
			fputs ($fp, $header . $req);
			while (!feof($fp)) {
				$res = fgets ($fp, 1024);
				if (strcmp ($res, "VERIFIED") == 0) {
					if (!$this->isTxnidUnique($dataIPN)) {
						if ($dataIPN['payment_status'] == 'Completed' && $dataIPN['receiver_id'] == $this->paypal_business) {
							return true;
						}
					}
				} else if (strcmp ($res, "INVALID") == 0) {
					return false;
				}
			}
			fclose ($fp);
		}
		return false;
	}
	private function isTxnidUnique($data) {
		$paypal_payment = new PaypalPaiement();
		$row = $paypal_payment->fetchRow("txn_id = '".$data['txn_id']."'");
		if($row) { return false; } else { return true; }
	}


	public function devisAction() {
		$this->view->title = 'Confirmation de votre devis';
			
		try {
			$auth = Zend_Auth::getInstance();
			$auth->setStorage($this->getSessionStorage());
			$storage = $auth->getStorage()->read();
			if ($auth->hasIdentity() && isset($storage['user'])) {
				$usernamespace = $this->getSession();
				$addresseLiv = $usernamespace->addresseLiv;
				$facture = $usernamespace->myFactureValidate;
				if ($this->isExisteArray($addresseLiv) && $facture->isFactureValid(2) && isset($usernamespace->commandAdded)) {

					$dataReturn = $usernamespace->commandAdded;
					$this->updateCommand($dataReturn['ID'],'Pending','',10);

					if (isset($facture->code_reduction) && !empty($facture->code_reduction)) {
						$codeReduction = new CodeReduction();
						$date = new Zend_Date();
						$data = array(
						"isACTIF" => 0,
						"NOM" => $storage['user']['nom'],
						"PRENOM" => $storage['user']['prenom'],
						"IDUSER" => $storage['user']['id'],
						"REFERENCE" => $dataReturn['REFERENCE'],
						"DATEUSE" => $date->toString('YYYY-MM-dd HH:mm:ss')
						);
						$codeReduction->update($data,"CODE = '".$facture->code_reduction['CODE']."'");
					}

					$factureDevis = $this->computeBill(10,$dataReturn['REFERENCE'],$dataReturn['ID'], $facture,$addresseLiv, $storage['user']);
					$this->view->facture = $factureDevis;
                    
                    $command = new Command();                            
                    $facture = $command->getCommandAsFacture($dataReturn['ID']);
					$this->sendMailCommande($facture,$this->devisCommande_Mail);
					$this->sendMailCommande($facture,$facture['USER_EMAIL']);
                    
					$this->view->linksMenu = $this->generateLinksMenu(4);
					$usernamespace->addresseLiv = array();
					$usernamespace->myFactureValidate = array();

					unset($usernamespace->addresseLiv);
					unset($usernamespace->myFactureValidate);
					unset($usernamespace->commandAdded);

					$usernamespace->myObjectCaddy =array();
					unset($usernamespace->myObjectCaddy);
                    
				    $usernamespace->myObjectCaddyFidelite = array();
				    unset($usernamespace->myObjectCaddyFidelite);
				} else { $this->_redirect('/'); }
			} else { $this->_redirect('/connectez-vous.html'); }
		} catch (Zend_Exception $e) {
			$this->log('Erreur : devisAction() : '.$e->getTraceAsString(),'err');
			$this->_redirect('/');
		}
	}

	private function lpad_zero($chaine,$taille) {
		return str_pad($chaine,$taille,"0",STR_PAD_LEFT);
	}
	
	private function finishandclosepaiement($payment_status, $txn_id, $type_paiement, $type, $sendmail) {
		if (!isset($this->site_rib_numbers)) {
			$this->initVariables();
		}
		$auth = Zend_Auth::getInstance();
		$auth->setStorage($this->getSessionStorage());
		$storage = $auth->getStorage()->read();
		
		if ($auth->hasIdentity() && isset($storage['user'])) {
		
			$usernamespace = $this->getSession();
			$addresseLiv = $usernamespace->addresseLiv;
			$myFacture = $usernamespace->myFactureValidate;
		
			if ($this->isExisteArray($addresseLiv) && $myFacture->isFactureValid(2) && isset($usernamespace->commandAdded)) {
		
				$this->view->title = 'Confirmation de votre commande';
		
				$data = $usernamespace->commandAdded;
				$this->updateCommand($data['ID'],$payment_status,$txn_id,1);
                
				$this->updateCommandFidelite($data['ID'], $myFacture);
        
				$facture = $this->computeBill(1,$data['REFERENCE'],$data['ID'], $myFacture,$addresseLiv,$storage['user']);
                
                $facture['USER_MODEPAIEMENT_LABEL'] = $type_paiement;
		        $facture['USER_MODEPAIEMENT_TYPE'] = $type; 
                $this->view->facture = $facture;
                
				$command = new Command();                            
                $factureMail = $command->getCommandAsFacture($data['ID']);
                $this->finishandclosepaiementsendmail($factureMail, $data['ID'], $sendmail, $type_paiement, $type);
                            
				$this->view->linksMenu = $this->generateLinksMenu(4);
		
				$this->log("Nouvelle commande : ".$data['REFERENCE'],'info');
				$this->view->verifMessage = 1;
		
				$usernamespace->addresseLiv = array();
				$usernamespace->myFactureValidate = array();
		
				unset($usernamespace->addresseLiv);
				unset($usernamespace->myFactureValidate);
				unset($usernamespace->commandAdded);
		
				$usernamespace->myObjectCaddy = array();
				unset($usernamespace->myObjectCaddy);
                
				$usernamespace->myObjectCaddyFidelite = array();
				unset($usernamespace->myObjectCaddyFidelite);
			} else {
				$this->_redirect('/mon-panier.html');
			}
		}   else {
			$this->_redirect('/connectez-vous.html');
		}
	}
	public function citelispaiementAction() {
		require_once('../library/citelis/configuration/identification.php');
		require_once('../library/citelis/configuration/options.php');
		require_once('../library/citelis/lib/lib_debug.php');
				
		$array = array();
		$payline = new paylineSDK(MERCHANT_ID, ACCESS_KEY, PROXY_HOST, PROXY_PORT, PROXY_LOGIN, PROXY_PASSWORD, PRODUCTION);
		$payline->returnURL = RETURN_URL;
		$payline->cancelURL = CANCEL_URL;
		$payline->notificationURL = NOTIFICATION_URL;
		
		// PAYMENT
		$array['payment']['amount'] = $_POST['amount'];
		$array['payment']['currency'] = PAYMENT_CURRENCY;
		$array['payment']['action'] = PAYMENT_ACTION;
		$array['payment']['mode'] = PAYMENT_MODE;
		
		// ORDER
		$array['order']['ref'] = $_POST['ref'];
		$array['order']['amount'] = $_POST['amount'];
		$array['order']['currency'] = PAYMENT_CURRENCY;
		
		// CONTRACT NUMBERS
		$array['payment']['contractNumber'] = CONTRACT_NUMBER;
		$contracts = explode(";",CONTRACT_NUMBER_LIST);
		$array['contracts'] = $contracts;
		$secondContracts = explode(";",SECOND_CONTRACT_NUMBER_LIST);
		$array['secondContracts'] = $secondContracts;
		
		// EXECUTE
		$result = $payline->doWebPayment($array);
		
		if(isset($result) && $result['result']['code'] == '00000'){		
			//Sauvegarde du token
			$usernamespace = $this->getSession();
			$usernamespace->commandAddedLastTokenCitelis = $result["token"];
			$this->_redirect($result["redirectURL"]);
		} elseif(isset($result)) {
			$this->log("Erreur commande citelis : ".$result['result']['code']. ' '.$result['result']['longMessage'],'err');
			$this->_redirect('/mon-panier-validation.html');
		}
	}
	
	public function paiementcitelisAction() {
		try {
			$auth = Zend_Auth::getInstance();
			$auth->setStorage($this->getSessionStorage());
			$storage = $auth->getStorage()->read();
			$ispaiementOk = false;
				
			if ($auth->hasIdentity() && isset($storage['user'])) {
				$usernamespace = $this->getSession();
				$this->log("Token recu : ".$this->_request->getParam("token"). ' / Token sauvegard� : '.$usernamespace->commandAddedLastTokenCitelis,'info');
				if ($usernamespace->commandAddedLastTokenCitelis == $this->_request->getParam("token")) {				
					$ispaiementOk = true;
				}
			}

			if ($ispaiementOk) {
				$this->finishandclosepaiement("Pending",$this->_request->getParam("token"), "Mode de paiement : Paiement s�curis� en ligne", 0, true);
			 	$this->render('paiement');
			}  else {
				$this->_redirect('/');
			}
	
		}catch (Zend_Exception $e) {
			$this->log("Erreur : paiementcitelisAction() ".$e->getMessage(),'err');
			$this->_redirect('/');
		}
	}
	
	public function citelisipnvalidationAction() {
		$this->ipnCitelisListener();
		$this->_redirect('/');
	}
	
	private function ipnCitelisListener() { 
		require_once('../library/citelis/configuration/identification.php');
		require_once('../library/citelis/configuration/options.php');
		require_once('../library/citelis/lib/lib_debug.php');
		try {	
			// GET TOKEN
			$token = $this->_request->getParam("token");
			if(isset($token)){
				$this->log("WebPaymentDetailsRequest - Token : ".$token,'info');
				$array = array();
				$payline = new paylineSDK(MERCHANT_ID, ACCESS_KEY, PROXY_HOST, PROXY_PORT, PROXY_LOGIN, PROXY_PASSWORD, PRODUCTION);
					
				$array['token'] = $token;
	    		$array['version'] = '3';
				// EXECUTE
				$result = $payline->getWebPaymentDetails($array);
				if(isset($result)){
					$command = new Command();
					$currentCommand = $command->fetchRow('TXN_ID = "'.$token.'"');
					$idCommand = $currentCommand["ID"];
					
					$output = print_a($result, 1, true);
					if ($result['result']['code'] == "00000" || $result['result']['code'] == "01001" ) {
						$this->updateCommandByID($idCommand,"Completed", $token,1);
						
						$this->log('CITELIS : IPN-VERIFIED : res : '.$output,'info');
						$this->sendMail($output." \n", $notify_email, $notify_email, 'CITELIS : IPN-VERIFIED');
					} else {
						$this->updateCommandByIDUNVERIFIED($idCommand, 'Incorrect');
						$this->log('CITELIS : IPN-VERIFIED INCORRECT : res : '.$output,'warn');
						$this->sendMail($output." \n"." \n", $notify_email, $notify_email, 'CITELIS : IPN-VERIFIED INCORRECT');
					}
				} else {
					$this->log("WebPaymentDetailsRequest - No results",'info');
				}
			} else {
				$this->log("WebPaymentDetailsRequest - Token Missing ",'info');
			}
		} catch (Zend_Exception $e) {
			$this->log('Erreur : ipnCitelisListener() : '.$e->getTraceAsString(),'err');
		}
  	}
}?>
PKi$H[4&?�controllers/IndexController.phpnu&1i�<?php

class IndexController  extends Modules_Default_Controllers_MainController
{

	public function init()
	{
		$this->view->baseUrl = $this->getBaseUrl();
	}

	public function indexAction()
	{
        $this->setCanonicalUrl($this->baseUrl_SiteCommerceUrl."/");
		$this->view->title = $this->TextHomeMetaTitle;
		$this->view->metadescription = $this->TextHomeMetaDescription;
        
		if ($this->isSiteGallery) {
			$id = 1;
			
		    $annonceGallery = new AnnonceGallery(); 
            $this->view->listAllGalleries = $annonceGallery->getAnnoncesByShow($id);
			
			$category = new Category();  
			$currentCat = $category->fetchRow("ID = ".$id);
			
			$filter = new Zend_Filter();
			$filter	->addFilter(new Zend_Filter_StripTags())->addFilter(new Zend_Filter_StringTrim());

			$this->view->title = $currentCat['NAVTITRENOM'];
			$this->view->metadescription = $filter->filter($currentCat['NAVDESCRIPTION']);  
			$this->view->metakeywords = $currentCat['KEYWORDS']; 
		}
		if ($this->isSiteEbusiness) {
	        $annonces = new AnnonceContent();
	        $result = $annonces->getAnnoncesByShow(0);
	        $this->view->listads = $result;

	        $annoncesfrontHeader = new  AnnonceFrontHeader();
	        $this->view->listinfos = $annoncesfrontHeader->getAnnonces();
        }

	}

}



?>PKi$H[7l\X��"controllers/ServicesController.phpnu&1i�<?php

class ServicesController  extends Modules_Default_Controllers_MainController
{

	public function init()
	{
		$this->view->baseUrl = $this->getBaseUrl();
		$this->checkMaintenance();
	}

	public function indexAction()
	{
		$this->_forward('information');
	}
	public function informationAction()
	{
		if ($this->getRequest()->getParam('p') && (int)$this->getRequest()->getParam('p')>0) {
				
			$id = (int)$this->getRequest()->getParam('p');
			$footer = new FooterContent();
            $detailFooterRow = $footer->fetchRow('ID = '.$id);
            if ($detailFooterRow) {
                $detailFooter = $detailFooterRow->toArray();
                 
                $linksMenu[0]['NAVURL'] = "";
                $linksMenu[0]['NAVNOM'] = $detailFooter['TITRE'];
                $this->view->linksMenu = $linksMenu;
				
                $this->view->title = $detailFooter['TITRE'];
                $this->view->service = $detailFooter;
            } else {
                $this->log("Impossible de trouver l'information : ".$this->getRequest()->getRequestUri(), 'warn');
                $this->_redirect('/');
            }
		}
	}

	public function faqAction() {
		$linksMenu[0]['NAVURL'] = '/services/faq';
		$linksMenu[0]['NAVNOM'] = 'FAQ';
		$this->view->linksMenu = $linksMenu;
			
		$this->view->title = 'Foire aux questions';
			
		$faq = new FAQ();
		$this->view->faqs = $faq->getLists();
		$faqtype = new FAQType();
		$this->view->faqType = $faqtype->getTypes();
	}
}



?>PKi$H[�"~.��controllers/AjaxController.phpnu&1i�<?php

class AjaxController extends Modules_Default_Controllers_MainController
{
	private $layout;

	public function init()
	{
		$this->view->baseUrl = $this->getBaseUrl();
		$layout = Zend_Layout::getMvcInstance();
		$layout->disableLayout();
		$this->checkMaintenance();
	}
	public function indexAction()
	{
		$this->_forward('ajaxmessage');
	}

	public function ajaxmessageAction() {
		$this->render();
	}
	public function ajaxvalueAction() {
		$this->render();
	}
	public function ajaxcaddyAction() {
		$this->render();
	}
	public function ajaxlivraisonAction() {
		$this->render();
	}
	public function ajaxaccountAction() {
		$this->render();
	}



	public function autocompletekeywordAction() {
		$result = array();
		if ($this->getRequest()->isPost()) {
			$filter = new Zend_Filter();
			$filter->addFilter(new Zend_Filter_StringTrim())
			->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringToLower())
			->addFilter(new Zend_Filter_CustomAlnum(array('allowwhitespace' => true)));

			$keyword = new KeyWord();
			$key = $filter->filter(utf8_decode($this->getRequest()->getPost('search')));
			$result = $keyword->findByKeyword($key);
		}
		$this->view->messageSuccess = serialize($result);
		$this->render('ajaxvalue');
	}
}
?>PKi$H[e���*�*+controllers/ProduitspromotionController.phpnu&1i�<?php

class ProduitsPromotionController extends Modules_Default_Controllers_MainController
{

	private $myCaddy;

	public function init()
	{
		$this->view->baseUrl = $this->getBaseUrl();
		$this->checkMaintenance();

	}
    
    private function computeUrlNavigationParent($row) {
        return $row['NAVNOM_URLPARENTS']."/".$row['CATNAVNOM'];
    }
    
	public function indexAction()
	{
		$params = $this->getRequest()->getParams();
		$params['c'] = 1;
		$params['page'] = 'nos-promotions';
		$this->getRequest()->setParams($params);
		$this->_forward('/categorie');
	}
	private function computeProductListToShow($list, $user) {
		try {
			$listProducts = array();
			$metakeywords = '';

			$isAllPromos = false;
			$currentPromoAll = array();
			$currentPromo = array();
			$listUserCodeInternIdBrendFound = array();
			$listUserCodeInternIdBrends = array();
			$listIdBrendFound = array();
			$listUserIdBrendFound = array();
			$listUserIdBrends = array();
			$listIdBrends = array();
			$promoCalculator = new PromoCalculator();
			$promoProduct = new PromoProduct();
			$promoUser = new PromoUser();
			$product= new Product();
 
			if (!empty($list)) {
				$idCategory = $list[0]['CATID'];
				$myPromo = $promoProduct->getRemiseByProductCategory($idCategory);
				if ($this->isPromoActive($myPromo)) { $isAllPromos = true; $currentPromoAll = $myPromo; }
			}
			$productChildQte = new ProductChildQte();

			foreach ($list AS $row) {
				$currentProduct = array();
				$currentProduct['ID'] = $row['ID'];
				$currentProduct['NOM'] = $row['NOM'];
				//$currentProduct['DESCSHORT'] = $this->cutString($row['DESCSHORT'], 80);
				$currentProduct['DESCSHORT'] = $row['DESCSHORT'];
				$currentProduct['URL'] = $row['URL'];
				$currentProduct['BREND'] = $row['BREND'];
				$currentProduct['isSHOWBREND'] = $row['isSHOWBREND'];
				$currentProduct['BRENDURL'] = $row['BRENDURL'];
				$currentProduct['NBREFERENCE'] = $row['NBREFERENCE'];
				$currentProduct['isDEVISPRODUCT'] = $row['isDEVISPRODUCT'];
                $currentProduct['NAVNOM_URLPARENTS'] = $this->computeUrlNavigationParent($row);

				if (isset($row['NAVNOM'])) {
					$navnom = $row['NAVNOM'];
				} else {
					$navnom = $row['PRODNAVNOM'];
				}

				$currentProduct['NAVNOM'] = $this->verifyNavigationString($navnom, $row['NOM'], '');
                

				$currentProduct['NAVTITRE'] = $row['NAVTITRE'];
				$currentProduct['NAVDESC'] = $row['NAVDESC'];

				$isFirst = false;

				if (empty($metakeywords)) {
					$metakeywords .= $row['KEYWORDS_PROD'];
				} else {
					$metakeywords .= ','.$row['KEYWORDS_PROD'];
				}

				$currentProduct['isPROMO'] = $row['isPROMO'];
				$currentProduct['PRIX'] = $row['PRIX'];

				/*
				 * PRIX DEGRESSIF
				 */
				$currentProduct['isPRIXDEGRESSIF'] = $productChildQte->isPrixDegressifByProductID($row['ID']);
					
				/*
				 * CALCUL PROMO
				 */
				$idBrend = $row['BRENDID'];

				if (!in_array($idBrend, $listIdBrends, true)) {
					$myPromo = $promoProduct->getRemiseByProductBrend($idBrend);
					array_push($listIdBrends, $idBrend);
					if ($this->isPromoActive($myPromo)) { array_push($listIdBrendFound, array('ID' => $idBrend, 'PROMO' => $myPromo)); }
				}
				if ($row['isPROMO'] == 1) {
					$isRemise = false;
					if (in_array($idBrend, $listIdBrends, true)) {
						foreach ($listIdBrendFound as $brendPromos) {
							if ($brendPromos['ID'] == $idBrend) {
								$currentProduct['isPROMO'] = 0;
								$currentPromo = $brendPromos['PROMO'];
								if ($currentPromo['REMISEEURO'] > 0) {
									$currentProduct['PRIX'] = $promoCalculator->calculEuro($row['PRIX'], $currentPromo['REMISEEURO']);
									$isRemise = true;
								}
								if ($currentPromo['REMISEPOUR'] > 0) {
									$currentProduct['PRIX'] = $promoCalculator->calculPour($row['PRIX'], $currentPromo['REMISEPOUR']);
									$isRemise = true;
								}
								break;
							}
						}
					}
					if ($isAllPromos && !empty($currentPromoAll) && !$isRemise ) {
						$currentProduct['isPROMO'] = 0;
						if ($currentPromoAll['REMISEEURO'] > 0) {
							$currentProduct['PRIX'] = $promoCalculator->calculEuro($row['PRIX'], $currentPromoAll['REMISEEURO']);
						}
						if ($currentPromoAll['REMISEPOUR'] > 0) {
							$currentProduct['PRIX'] = $promoCalculator->calculPour($row['PRIX'], $currentPromoAll['REMISEPOUR']);
						}
					}
				}
				if (isset($user) && !empty($user)) {
					$userId = $user['id'];
					$codeIntern = $user['cintern'];
					$isRemise = false;

					if (!empty($codeIntern)) {
						if (!in_array($idBrend.'-'.$codeIntern, $listUserCodeInternIdBrends, true)) {
							$myPromo = $promoUser->getRemiseByCodeInternMarque($idBrend, $codeIntern);
							array_push($listUserCodeInternIdBrends, $idBrend.'-'.$codeIntern);
							if ($this->isPromoActive($myPromo)) { array_push($listUserCodeInternIdBrendFound, array('ID' => $idBrend, 'CODE' => $codeIntern, 'PROMO' => $myPromo)); }
						}
						if (in_array($idBrend.'-'.$codeIntern, $listUserCodeInternIdBrends, true)) {
							foreach ($listUserCodeInternIdBrendFound as $brendPromos) {
								if ($brendPromos['ID'] == $idBrend && $brendPromos['CODE'] == $codeIntern ) {
									$currentProduct['isPROMO'] = 0;
									$currentPromo = $brendPromos['PROMO'];
									if ($currentPromo['REMISEEURO'] > 0) {
										$currentProduct['PRIX'] = $promoCalculator->calculEuro($row['PRIX'], $currentPromo['REMISEEURO']);
										$isRemise = true;
									}
									if ($currentPromo['REMISEPOUR'] > 0) {
										$currentProduct['PRIX'] = $promoCalculator->calculPour($row['PRIX'], $currentPromo['REMISEPOUR']);
										$isRemise = true;
									}
									break;
								}
							}
						}
					}
					if (!$isRemise) {
						if (!in_array($idBrend, $listUserIdBrends, true)) {
							$myPromo = $promoUser->getRemiseByMarque($idBrend, $userId);
							array_push($listUserIdBrends, $idBrend);
							if ($this->isPromoActive($myPromo)) { array_push($listUserIdBrendFound, array('ID' => $idBrend, 'PROMO' => $myPromo)); }
						}
						if (in_array($idBrend, $listUserIdBrends, true)) {
							foreach ($listUserIdBrendFound as $brendPromos) {
								if ($brendPromos['ID'] == $idBrend) {
									$currentProduct['isPROMO'] = 0;
									$currentPromo = $brendPromos['PROMO'];
									if ($currentPromo['REMISEEURO'] > 0) {
										$currentProduct['PRIX'] = $promoCalculator->calculEuro($row['PRIX'], $currentPromo['REMISEEURO']);
										$isRemise = true;
									}
									if ($currentPromo['REMISEPOUR'] > 0) {
										$currentProduct['PRIX'] = $promoCalculator->calculPour($row['PRIX'], $currentPromo['REMISEPOUR']);
										$isRemise = true;
									}
									break;
								}
							}
						}
					}
				}


				if ($currentProduct['PRIX'] <= 0 ) { $currentProduct['PRIX'] = $row['PRIX']; }
				
				$currentProduct['PRIXLOWEST'] = $product->calculateLowestPrice($currentProduct['ID']);
				
				array_push($listProducts, $currentProduct);
			}
			return $result = array( 'PRODUCTS' => $listProducts, 'META_KEY' =>  $metakeywords);
		} catch (Zend_Exception $e) {
			$this->log('Erreur computeProductListToShow : '.$e->getMessage(),'err');
		}
		return $result = array( 'PRODUCTS' => array(), 'META_KEY' =>  '');
	}
	public function categorieAction()
	{
		$userNamespace = $this->getSession();
		$category = new Category2();
		$product = new Product();

		$auth = Zend_Auth::getInstance();
		$auth->setStorage($this->getSessionStorage());
		$storage = $auth->getStorage()->read();
		$currentUser = array();
		if ($auth->hasIdentity() && isset($storage['user'])) {
			$currentUser = $storage['user'];
		}
		if ($this->getRequest()->getParam('c')) {
			$id = (int)$this->getRequest()->getParam('c');

			if ($id>0) {

				try {
					$this->checkTypeOfPromo($id);
					$listCat = array();
					$listCat = $category->getTreeCatsOf($id);
					if (!empty($listCat)) {
						$this->view->listCat = $listCat;

						$this->view->isPromoPage = true;
						$breadcrumb = $category->getTreeInLineOf($id);
						$this->view->breadcrumb = $breadcrumb;
						$this->view->actualDesign = $this->showDesign(0, 0);

						if (empty($listCat['NAVTITRENOM'])) {
							$listCat['NAVTITRENOM'] = $listCat['NOM'];
						}
						if (empty($listCat['NAVDESCRIPTION'])) {
							$listCat['NAVDESCRIPTION'] = $listCat['DESCRIPTION'];
						}

						$filter = new Zend_Filter();
						$filter	->addFilter(new Zend_Filter_StripTags())->addFilter(new Zend_Filter_StringTrim());

						$this->view->metadescription = $listCat['NAVDESCRIPTION'];
						$this->view->title = $listCat['NAVTITRENOM'];
						$isTri_metaKeyword = false;

						$annoncesleft = new AnnonceLeft();
						$this->view->listads = $annoncesleft->getAnnoncesByShow($id);

						if (!$listCat['SUBS']) {
							$triSql = 'NOM ASC';
							//List of products
							$productList = $product->getProductsByIdCategoryForPromotion($id, $triSql);


							$this->view->orderNameProduct = $userNamespace->objOrderNameProduct;
							$resultProduct = $this->computeProductListToShow($productList, $currentUser);
							$this->view->listAllProducts = $resultProduct['PRODUCTS'];

                            if (!empty($listCat['KEYWORDS'])) {
                                $this->view->metakeywords = $listCat['KEYWORDS'];
                            } else {                                
                                $this->view->metakeywords = $resultProduct['META_KEY'];
                            }
							
							//Show product page
							$this->render('nosproduits');
						} else {
							$metakeywords = $listCat['KEYWORDS'];

                            if (empty($metakeywords)) {
							    for ($index = 0; $index < sizeOf($listCat['SUBS']); $index++) {
								    if (empty($metakeywords)) {
									    $metakeywords .= $listCat['SUBS'][$index]['KEYWORDS'];
								    } else {
									    $metakeywords .= ','.$listCat['SUBS'][$index]['KEYWORDS'];
								    }
							    }
                            }
							$this->view->metakeywords = $metakeywords;
						}
					} else {
						$this->log('Impossible de trouver la categorie : '.$this->getRequest()->getRequestUri(), 'warn');
						$this->_redirect('/');
					}

				} catch (Zend_Exception $e) {
					$this->log('Erreur pour trouver : '.$this->getRequest()->getRequestUri()." ".$e->getMessage(),'err');
					$this->_redirect('/');
				}
			} else {
				$this->_redirect('/');
			}
		}  else {
			$this->_redirect('/');
		}
	}

	private function checkTypeOfPromo($id) {
		$category = new Category2();
		$firstCategory = $category->getParentFirstOf($id);
		if ($firstCategory != null) {
			$currentId = $firstCategory["ID"];
			if ($currentId == 2) { $this->view->prefixPromoClass = "eco-"; }
			if ($currentId == 1) { $this->view->prefixPromoClass = ""; }
		}
	}

	private function isPromoActive($myPromo) {
		if ($myPromo) {
			if ($myPromo['REMISEEURO'] > 0) { return true; }
			if ($myPromo['REMISEPOUR'] > 0) { return true; }
		}
		return false;
	}
}
?>PKi$H[���1L1L"controllers/ProduitsController.phpnu&1i�<?php

class ProduitsController extends Modules_Default_Controllers_MainController
{

	private $myCaddy;

	public function init()
	{
		$this->view->baseUrl = $this->getBaseUrl();
		$this->checkMaintenance();
	}
	public function indexAction()
	{
		$this->_redirect('/');
	}
    public function ajaxdownloaddocumentAction() {
    
        $message = "";
        $isSuccess = false;
        if ($this->getRequest()->isPost()) {
        
			$filter = new Zend_Filter();
			$filter	->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim());

			$validator = new Zend_Validate();
			$validator -> addValidator(new Zend_Validate_NotEmpty());

			$validatorEmail = new Zend_Validate_EmailAddress();
                
			$params = array();
			$params = $this->getRequest()->getPost();

			$civility = $filter->filter($params['civility_doc']);
			$name = $filter->filter($params['name_doc']);
			$firstname = $filter->filter($params['firstname_doc']);
			$email = $filter->filter($params['email_doc']);
			$product_id = (int) $params['product_id_doc'];
            
			if ($validator->isValid($civility) && $validator->isValid($name)  && $validator->isValid($firstname)
             && $validatorEmail->isValid($email)  && $product_id > 0) {
             
				$product = $this->computeProductDetail($product_id);
                $linkProd = $this->baseUrl_SiteCommerceUrl."/".Utils_Tool::getFormattedUrlProduct($product['NAVNOM_URLPARENTS'], $product['NAVNOM'], $product['ID']);
	            $linkCat = $this->baseUrl_SiteCommerceUrl."/".Utils_Tool::getFormattedUrlCategory($product['NAVNOM_URLPARENTS'], $product['CATNAVNOM'], $product['IDCATEGORY']);
                $prodName = $product['NOM'];
                $catName = $product['CATNOM'];
                
                $docUrl =$product['DOCURL'];
                if (empty($docUrl)) {
					$listFTFDS = $this->getFTFDSByIdProd($product_id);
                    if (isset($listFTFDS) && !empty($listFTFDS) && sizeof($listFTFDS) > 0) {
                           $docUrl = $listFTFDS[0]['URL'];
                    }
                }
                
                $destFullName = $civility." ".$firstname." ".$name;
                
                $fromEmail = $this->no_reply_Mail;
                $fromName = $this->siteName;
                $toEmail = $email;
                
                try {
                    $userGuest = new UserGuest();
                    $date = new Zend_Date();
                    $data = array (
						'INFORMATION' => $destFullName,
						'ACTION' => "Fiche technique � t�l�charger : ".$prodName,
						'EMAIL' => $toEmail,
                        'DATEINSERT' => $date->toString('YYYY-MM-dd HH:mm:ss')
					);
					$userGuest->insert($data);
                    
			        $view = new Zend_View();
			        $view->addScriptPath('../application/modules/default/views/helpers/');
			        $view->assign("user_name",$name);
			        $view->assign("user_firstname",$firstname);
			        $view->assign("user_email",$email);
			        $view->assign("user_civility",$civility);
			        $view->assign("user_fullname",$destFullName);
                    
			        $view->assign("site_url",$this->siteName);
			        $view->assign("product_url",$linkProd);
			        $view->assign("category_url",$linkCat);
			        $view->assign("category_name",$catName);
			        $view->assign("product_name",$prodName);
			        $view->assign("document_link",$this->baseUrl_SiteCommerceUrl."/".$docUrl);
                    
                    $body = $view->render("mail_ajaxdownloaddocument.phtml");
			        $subject = "Fiche technique : ".$prodName;
				
			        $mail = new Zend_Mail();
			        $mail->setBodyHtml($body);
			        $mail->setFrom($fromEmail, $fromName);
			        $mail->addTo($toEmail);
			        $mail->setSubject($subject);

			        $mail->send();
			        $this->log("L'email de fiche technique a �t� envoy� par : ".$fromEmail.", ".$fromName." � ".$toEmail,'info');
 
		        } catch (Zend_Exception $e) {
			        $this->log($e->getMessage(),'err');
		        }         
             
                $message = "Le mail � �t� envoy� � <b>".$destFullName."</b>.";
                $isSuccess = true;
            }   else if ($product_id > 0) {
				$product = $this->computeProductDetail($product_id);
			    $this->view->detailProduct = $product;
            }  
        }
        
        $this->view->message = $message;
        $this->view->isSuccess = $isSuccess;
        
		$layout = Zend_Layout::getMvcInstance();
		$layout->disableLayout();
		$this->render();
    }
    public function ajaxsendfriendAction() {
    
        $message = "";
        $isSuccess = false;
        if ($this->getRequest()->isPost()) {
        
			$filter = new Zend_Filter();
			$filter	->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim());

			$validator = new Zend_Validate();
			$validator -> addValidator(new Zend_Validate_NotEmpty());

			$params = array();
			$params = $this->getRequest()->getPost();

			$name = $filter->filter($params['name_friend']);
			$email = $filter->filter($params['email_friend']);
			$message = nl2br(htmlspecialchars($params['message_friend']));
			$product_id = (int) $params['product_id_friend'];
            
			if ($validator->isValid($name)  && $validator->isValid($email) && $validator->isValid($message) && $product_id > 0) {
            
                $fromEmail = $this->no_reply_Mail;
                $fromName = $name;
                $toEmail = $email;
				$product = $this->computeProductDetail($product_id);
                
                 try {
                 
                    $userGuest = new UserGuest();
					$date = new Zend_Date();
                    $data = array (
						'INFORMATION' => $name,
						'ACTION' => "Conseillez cet article : ".$product["NOM"],
						'EMAIL' => $toEmail,
                        'DATEINSERT' => $date->toString('YYYY-MM-dd HH:mm:ss')
					);
					$userGuest->insert($data);
                    
			        $view = new Zend_View();
			        $view->addScriptPath('../application/modules/default/views/helpers/');              
			        $view->assign("text_message",$message);
                    
                    $body = $view->render("mail_ajaxsendfriend.phtml");
			        $subject = "Voici un article conseill� par ".$name;
				 
			        $mail = new Zend_Mail();
			        $mail->setBodyHtml(utf8_decode($body));
			        $mail->setFrom($fromEmail, $fromName);
			        $mail->addTo($toEmail);
			        $mail->setSubject($subject);

			        $mail->send();
			        $this->log("L'email de conseille a �t� envoy� par : ".$fromEmail.", ".$fromName." � ".$toEmail,'info');
 
		        } catch (Zend_Exception $e) {
			        $this->log($e->getMessage(),'err');
		        }      
             
                $message = "Le mail � �t� envoy� � <b>".$email."</b>.";
                $isSuccess = true;
            }    
        }
        
        $this->view->message = $message;
        $this->view->isSuccess = $isSuccess;
        
		$layout = Zend_Layout::getMvcInstance();
		$layout->disableLayout();
		$this->render();
    }
        
	public function nosmarquesAction() {        
		$this->view->title = 'Nos marques';
        $brand = new SupplierBrend();
        $this->view->brends = $brand->getAllShowableBrends();
    }
    
	public function nosmarquesdetailAction() {   
		$this->view->title = 'Nos marques'; 
        if ($this->getRequest()->getParam('id')) {
			$id = (int)$this->getRequest()->getParam('id');
            if ($id > 0) {
                try {
                    $brand = new SupplierBrend();
                    $brendData = $brand->getBrendByID($id);
                    $this->view->brends = $brendData;
                    $this->view->title = 'Nos marques - '.$brendData["BREND"]; 
		        } catch (Zend_Exception $e) {
			        $this->log("Error nosmarquesdetailAction : ".$id." : ".$e->getMessage(),'err');
                    $this->_forward('nosmarques','produits');
		        }
            } 
        }else {
            $this->_forward('nosmarques','produits');
        }
    }
    
	public function ajaxshowchildqtepriceAction() {
		$this->view->detailProductQte = array();
		$id = (int)$this->getRequest()->getParam('id');
		if ($id > 0) {
			$productChildQte = new ProductChildQte();
			$detailProductQte = $productChildQte->getAllActiveByItem($id);
				
			//Calcul des promos pour le prix degressif
			$productChild = new ProductChild();
			$childs = $productChild->getChildsInfoByListId($id);
			$promo = new PromoCalculator();
			$facture = new Facture();
			foreach ($detailProductQte AS $row) {
				$factureLine = new FactureLine();
				$childs[0]["PRIX"] = $row["PRIX"];
				$factureLine->setLineInfo($childs[0], 1, "N");
				$factureLine->setPromoCaddyType(false);
				$facture->addLine($factureLine);
				$promo->computeAllPromos($facture, null);
				$row["PRIX"] = $factureLine->getPrixTotalHT(true);
			}
				
			if (!empty($detailProductQte)) {
				$this->view->detailProductQte = $detailProductQte;
			}
		}
		$layout = Zend_Layout::getMvcInstance();
		$layout->disableLayout();
		$this->render();
	}
	public function ajaxshowallchildsAction() {
		$id = (int)$this->getRequest()->getParam('id');
		if ($id > 0) {
			$myProduct = $this->computeProductDetail($id);
			if ($myProduct) {
				$this->view->detailProduct = $myProduct;
				$category = new Category();
				$categoryFirst = $category->getParentFirstOf($myProduct['IDCATEGORY']);
				$this->view->actualDesign = $this->showDesign($categoryFirst['ID'], $categoryFirst);
			} else {
				$this->view->detailProduct = array();
				$this->view->actualDesign = array();
			}
		}
		$layout = Zend_Layout::getMvcInstance();
		$layout->disableLayout();
		$this->render();
	}

	public function ajaxcodereductionAction() {
		if ($this->getRequest()->isPost()) {

			//filtres pour changer les chaines
			$filter = new Zend_Filter();
			$filter	->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim());

			//valideurs pour les chaines
			$validator = new Zend_Validate();
			$validator -> addValidator(new Zend_Validate_NotEmpty());

			$params = array();
			$params = $this->getRequest()->getPost();

			$codeReduc = $filter->filter($params['codeReduc']);
			$this->view->messageSuccessReduc = "NOK";

			$user_namespace = $this->getSession();
			if (isset($user_namespace->urlCurrentProduct) && !empty($user_namespace->urlCurrentProduct)) {
				$this->view->urlCurrentProduct = $user_namespace->urlCurrentProduct;
			}

			if ($validator->isValid($codeReduc)) {

				$codeReduction = new CodeReduction();
				$resultCode = $codeReduction->getVerifyCodeBy($codeReduc);
				if (isset($resultCode) && !empty($resultCode)) {
					if ($resultCode['isACTIF'] == 1) {

						$usernamespace =  $this->getSession();
							
						$myFacture = $usernamespace->myFactureValidate;

						$myFacture->code_reduction = $resultCode;

						$myFacture->code_reduction['EURO'] = $myFacture->getPrixCodeReduction();
						$usernamespace->myFactureValidate = $myFacture;
						$this->view->messageSuccessReduc = "OK";
						$this->view->messageMessReduc = "Le code de r�duction est disponible";
					} else { $this->view->messageMessReduc = "Le code de r�duction n'est pas actif"; }
				} else { $this->view->messageMessReduc = "Le code de r�duction n'est plus disponible"; }
			} else {
				$usernamespace =  $this->getSession();
				$myFacture = $usernamespace->myFactureValidate;
				$myFacture->code_reduction = array();
				$usernamespace->myFactureValidate = $myFacture;

				$this->view->messageMessReduc = "Le code de r�duction n'est pas valide";
			}
		}
		$this->computeMonPanier();
		$this->_forward('ajaxcaddy','ajax');
	}

	private function computeLivraison ($totalHT) {
		$result = array();
		$result['fraisLivEUR'] = 0;
		$result['fraisLivPOUR'] = 0;
		$result['francoEur'] = 0;
		$result['resteFrancoLiv'] = 0;
		$promoCommand = new PromoCommand();
		try {
			$fraisCMD = $promoCommand->fetchAll('MONTANTFRAISCMD IS NOT NULL','MONTANTFRAISCMD ASC')->toArray();
			if ($fraisCMD) {
				foreach ($fraisCMD as $rowFrais) {
					if ($totalHT < $rowFrais['MONTANTFRAISCMD']) {
						if ($rowFrais['REMISEEURO'] > 0) {
							$result['fraisLivEUR'] = $rowFrais['REMISEEURO'];
						} else if ($rowFrais['REMISEPOUR'] > 0) {
							$result['fraisLivEUR'] = sprintf("%.2f", ($totalHT * $rowFrais['REMISEPOUR']) / 100);
							$result['fraisLivPOUR'] = $rowFrais['REMISEPOUR'];
						}
						break;
					}
				}
				foreach ($fraisCMD as $rowFrais) {
					$result['francoEur'] = $rowFrais['MONTANTFRAISCMD'];
				}
					
				if($totalHT < $result['francoEur']) {
					$result['resteFrancoLiv'] = $result['francoEur'] - $totalHT;
				}
			}
		} catch (Zend_Exception $e) {
			$this->log("Error computeOldLivraison : ".$e->getMessage(),'err');
		}
		return $result;
	}

	public function monpanierAction() {
		if ($this->getRequest()->getParam('paypalVerifError')) {
			$this->view->paypalVerifError = "Votre commande n'a pas �t� prise en compte, rev�rifier vos informations";
		}

		$user_namespace = $this->getSession();

		if (isset($user_namespace->urlCurrentProduct) && !empty($user_namespace->urlCurrentProduct)) {
			$this->view->urlCurrentProduct = $user_namespace->urlCurrentProduct;
		}
        
		$this->view->title = 'Mon Panier';
		$this->view->etapeCommande = 1;
		$linksMenu = array();
		$linksMenu[0]['NAVURL'] = '/mon-panier.html';
		$linksMenu[0]['NAVNOM'] = 'Mon Panier';

		$this->view->linksMenu = $linksMenu;

		$this->saveCaddyTemp();

		$this->computeMonPanier();
        
	}

	private function saveCaddyTemp() {

		$userNamespace = $this->getSession();
		if (isset($userNamespace->myObjectCaddy) && !empty($userNamespace->myObjectCaddy)) {
			$myCaddy = $userNamespace->myObjectCaddy;
			$auth = Zend_Auth::getInstance();
			$auth->setStorage($this->getSessionStorage());
			$storage = $auth->getStorage()->read();

			if ($auth->hasIdentity() && isset($storage['user']) && !empty($myCaddy->items)) {
				$caddyTemp = new CaddyTemp();
				$caddyTemp->delete('USERID = '.$storage['user']['id']);

				foreach ($myCaddy->items as $item) {
					$data = array (
						'CHILDID' => $item->idChild,
						'CHILDQUANTITY' => $item->qteChild,
						'PRODUCTID' => $item->idProduit,
						'PRODUCTNOM' => $item->nom,
						'DESCSHORT' => $item->descshort,
						'NAVNOM' => $item->navnom,
						'URL' => $item->url,
						'DESIGNATION' => $item->designation,
						'USERID' => $storage['user']['id'],
						'SELECTEDOPTION' => $item->selectedOption 
					);

					$caddyTemp->insert($data);
				}
                
                if ($this->carte_fidelite_enabled) {
                    $carteFidelite = new CarteFidelite();
                    $this->view->myCaddyFideliteAvailable = $carteFidelite->getAnnoncesByAvailability($storage['user']['id']);
                    $this->view->myCaddyFideliteAllExceptCurrents = $carteFidelite->getAnnoncesByAvailabilityWithoutCurrent($storage['user']['id']);
                    $this->view->myUserFideliteInfo = $carteFidelite->getInfosByUser($storage['user']['id']);
                }
			}
		}
	}

	private function generateFacture($facture, $caddy) {
		foreach($caddy->items as $item) {
			$optionList = new OptionList();
			$productChild = new ProductChild();
			$results = $productChild->getChildsInfoByListId($item->idChild);
			foreach ($results AS $row) {
				$myItem = $caddy->getItemByIdAndOption($row['IDCHILD'], $item->selectedOption);

				if ($myItem != null) {
					$factureLine = new FactureLine();
					$factureLine->setLineInfo($row, $myItem->qteChild, $myItem->isAccessoire);

					$factureLine->item_selectedOption = $myItem->selectedOption;
						
					$factureLine->product_navnom = $this->verifyNavigationString($factureLine->product_navnom, $factureLine->product_nom, '');

					$factureLine->setPromoCaddyType(false);

					$facture->addLine($factureLine);
				}
			}
		}   
        
		$userNamespace = $this->getSession();    
        if (isset($userNamespace->myObjectCaddyFidelite) && !empty($userNamespace->myObjectCaddyFidelite)) {
            $fidelitegifts = $userNamespace->myObjectCaddyFidelite;
		        foreach($fidelitegifts->items as $item) {
			        $factureLine = new FactureLine();
			        $factureLine->setFideliteGift($item);
                    $facture->addFideliteLine($factureLine);
                }
        }
                
	}

	private function generateFactureCaddyType($facture, $caddy) {
		$userCaddyType = new UserCaddyType();
		foreach($caddy->itemsCaddyType as $item) {
			$results = $userCaddyType->getArticleByCaddyIdList($item->id);
			foreach ($results AS $row) {
				$myItem = $caddy->getItemCaddyTypeByIdChildAndOption($row['IDCHILD'], $item->selectedOption);
				if ($myItem != null && ($row['REMISEEURO'] > 0 || $row['REMISEPOUR'] > 0)) {

					$factureLine = new FactureLine();
					$factureLine->product_navnom = $this->verifyNavigationString($factureLine->product_navnom, $factureLine->product_nom, '');
					$factureLine->setLineInfo($row, $myItem->qte, 'N');
					$factureLine->caddytype_id = $myItem->id;
						
					$factureLine->item_selectedOption = $myItem->selectedOption;

					if ($row['REMISEEURO'] > 0) {
						$factureLine->remise_euro = $row['REMISEEURO'];
						$factureLine->setPromoCaddyType(true);
						$factureLine->caddytype_isActif = 'Y';
					} else if ($row['REMISEPOUR'] > 0) {
						$factureLine->remise_pour = $row['REMISEPOUR'];
						$factureLine->setPromoCaddyType(true);
						$factureLine->caddytype_isActif = 'Y';
					}

					if ($factureLine->isCaddyTypeActif()) {
						$poidsCurrent = $factureLine->getPoidsTotal();
						if ($poidsCurrent > 0) { $facture->total_poids += $poidsCurrent ;
						} else { $facture->isAncienPoids = true;  }
						if ($factureLine->isFrancoDenied()) { $facture->isFrancoDenied = true; }

						$facture->total_HT_HR += $factureLine->getPrixTotalHT(true);

						$facture->addLine($factureLine);
					}
				}
			}
		}
	}
		
	private function computeFactureGlobalByQteDegressif($myFacture) {
		$productChildQte = new ProductChildQte();
		$productChild = new ProductChild();
		foreach ($myFacture->facture_lines as $lines) {
			$result = $productChild->getChildPriceByIdChild($lines->item_id);
			$currentPrice = $productChildQte->getCurrentPrice($lines->item_id, $lines->item_qte, $result['PRIX']);
			$lines->item_prix = sprintf("%.2f",$currentPrice);
		}
	}

	public function computeMonPanier() {
		$userNamespace = $this->getSession();
		$myCaddyTemp = $userNamespace->myObjectCaddy;
		if ((isset($myCaddyTemp->items) && !empty($myCaddyTemp->items)) ||
		(isset($myCaddyTemp->itemsCaddyType) && !empty($myCaddyTemp->itemsCaddyType))) {

			$auth = Zend_Auth::getInstance();
			$auth->setStorage($this->getSessionStorage());
			$storage = $auth->getStorage()->read();
			$user = array();
			if ($auth->hasIdentity() && isset($storage['user'])) {
				$user = $storage['user'];
			}

			$myFacture_CodeReduc = array();
			if (isset($userNamespace->myFactureValidate)) {
				$myFacture = $userNamespace->myFactureValidate;
				if (isset($myFacture->code_reduction) && !empty($myFacture->code_reduction)) {
					$myFacture_CodeReduc = $myFacture->code_reduction;
				}
			}

			$myFacture = new Facture();

			$userNamespace->myFactureValidate = $myFacture;

			$resteFrancoLiv = 0;

			$this->generateFacture($myFacture, $myCaddyTemp);
			if (isset($user) && !empty($user) && $user['iscaddytype'] == 'Y') {
				//Panier Type apres le calcul des promos
				$this->generateFactureCaddyType($myFacture, $myCaddyTemp);
			}
			/*Recuperation du prix degressif*/
			$this->computeFactureGlobalByQteDegressif($myFacture);

			$myFacture->code_reduction = $myFacture_CodeReduc;

			/*
			 * CALCUL DES PROMOS
			 */
			$promo = new PromoCalculator();
			$promo->computeAllPromos($myFacture, $user);

			$resteToValid = $promo->getPrixCommandValidation($myFacture);
			if ($resteToValid > 0) {
				$this->view->isCommandValid = "Vous ne pouvez pas valider votre commande,<br/> il vous manque la somme de <b>".$resteToValid."</b> euros, pour atteindre le <b>minimum requis</b>.";
			}

			$myFacture->total_HT = $myFacture->getPrixTotalHT();

			/*
			 * MODE DE LIVRAISON
			 */

			//Calcul des frais de livraison
			$lastFraisLivEur = 0;

			$arrayLivraison = $this->computeLivraison($myFacture->total_HT);
			if (isset($arrayLivraison) && !empty($arrayLivraison)) {
				if ($myFacture->total_HT == 0) {
					$myFacture->total_frais_port = sprintf("%.2f", 0);
					$myFacture->total_frais_port_pour  = 0;
				} else {
					$myFacture->total_frais_port = $arrayLivraison['fraisLivEUR'];
					$myFacture->total_frais_port_pour  = $arrayLivraison['fraisLivPOUR'];
				}

				$lastFraisLivEur  = $arrayLivraison['francoEur'];
				$resteFrancoLiv  = $arrayLivraison['resteFrancoLiv'];
			}

			$myFacture->total_HT_FP = $myFacture->getPrixTotalHT_FP(false);
			$myFacture->total_TVA = $myFacture->getPrixTotalTVA(false);
			$myFacture->total_TTC = $myFacture->getPrixTotalTTC(false);
			$myFacture->total_remise = $myFacture->getPrixRemise();

			$myFacture->resteFrancoLiv = $resteFrancoLiv;
			if ($myFacture->resteFrancoLiv > 0) {
				$this->view->resteFrancoLiv = "Il vous reste <b>".number_format(sprintf("%.2f", $myFacture->resteFrancoLiv), 2, ',', ' ')."</b> euros, avant d'avoir le franco de port.";
			}
            
			if ($this->carte_fidelite_enabled) {
                $carteFidelite = new CarteFidelite();
                $myUserFideliteInfo = $carteFidelite->getInfosByUser($user['id']);                
                if (!$myFacture->isCarteFidelitePointsValid($myUserFideliteInfo['POINTFIDELITETOTAL'])) {
                	$this->view->isCommandValid = "Vous ne pouvez pas valider votre commande,<br/> vous n'avez pas assez de <b>points fid�lit�</b>.";
			    }
			}
            
			$userNamespace->myFactureValidate = $myFacture;
			$this->view->myFacture = $myFacture;
			$this->view->user_facture_validate = $myFacture;
            
		} else {
			$userNamespace->myFactureValidate = new Facture();
			$userNamespace->myObjectCaddy = new Caddy();
			$this->view->myFacture = $userNamespace->myFactureValidate;
			$this->view->user_facture_validate = $userNamespace->myFactureValidate;
            
		}
	}



	public function formatNumber($number) {
		return number_format($number, 2, ',', ' ');
	}

	public function getCaddyProducts($myCaddyTemp) {

		$i = 0;
		foreach($myCaddyTemp->items as $item) {
			if ($i == 0 ) {
				$stringTempP = $item->idProduit;
				$stringTempC = $item->idChild;
			} else {
				$stringTempP .= ', '.$item->idProduit;
				$stringTempC .= ', '.$item->idChild;
			}
			$i++;
		}



		$sql = "
			SELECT p.NOM NOM,p.NAVNOM NAVNOM, p.DESCRIPTIONSHORT DESCSHORT, p.ID IDPRODUCT, pic.URL URL,p.isPROMO isPROMO, pc.DESIGNATION DESIGNATION, p.STOCK STOCK,
			pc.ID IDCHILD, pc.REFERENCE REFERENCE, pc.isDEVIS isDEVIS, pc.isPROMO isPROMOCHILD, pc.PRIX PRIX, p.DATEPROMO DATEPROMO,
			p.IDCATEGORY IDCATEGORY, p.IDBREND IDBREND, p.isSHOWBREND isSHOWBREND, pc.QUANTITYMIN QUANTITYMIN, pc.POIDS POIDS, pc.isFRANCODENIED isFRANCODENIED
			FROM product p
			LEFT JOIN picture pic ON pic.IDPRODUCT = p.ID 
			LEFT JOIN productchild pc ON pc.IDPRODUCT = p.ID
			WHERE p.ID IN ( ".$stringTempP." )
			AND pc.ID IN ( ".$stringTempC." )
			AND p.isACTIVE = 0
			AND pic.POSITION = 1
			";


		$product = new Product();
		$result = $product->getAdapter()->fetchAll($sql);


		$promoProduct = new PromoProduct();
		$i = 0;

		$childRefBuy = '';
		$myTemp = array();
		foreach ($result AS $row) {

			$myItem = $myCaddyTemp->getItemById($row['IDCHILD']);

			if ($myItem != null)
			{
				$myTemp[$i]['CHILD']['isACCESSOIRE'] = $myItem->isAccessoire;

				$myTemp[$i]['CHILD']['ID'] = $row['IDCHILD'];
				$myTemp[$i]['CHILD']['REFERENCE'] = $row['REFERENCE'];
				$myTemp[$i]['CHILD']['DESIGNATION'] = $row['DESIGNATION'];
				$myTemp[$i]['CHILD']['isPROMO'] = $row['isPROMOCHILD'];
				$myTemp[$i]['CHILD']['isDEVIS'] = $row['isDEVIS'];
				$myTemp[$i]['CHILD']['POIDS'] = $row['POIDS'];
				$myTemp[$i]['CHILD']['isFRANCODENIED'] = $row['isFRANCODENIED'];
				$myTemp[$i]['CHILD']['QUANTITYMIN'] = $row['QUANTITYMIN'];
				$myTemp[$i]['CHILD']['PRIX'] = sprintf("%.2f",$row['PRIX']);
				$myTemp[$i]['CHILD']['REMISEEURO'] = 0;
				$myTemp[$i]['CHILD']['REMISEPOUR'] = 0;

				$myTemp[$i]['CHILD']['QUANTITY'] = $myItem->qteChild;

				//Insertion du code pour la gestion des promos
				$myTemp[$i]['CHILD']['PROMOPRIX'] = sprintf("%.2f",$row['PRIX']);

				if ($row['isPROMOCHILD'] == 0) {
					//Produit - REFERENCE
					$myPromo = $promoProduct->fetchRow("REFERENCE = '".$row['REFERENCE']."'");
					if ($myPromo['REMISEEURO'] > 0) {
						$myTemp[$i]['CHILD']['PROMOPRIX'] = sprintf("%.2f",$row['PRIX'] - $myPromo['REMISEEURO']);
					}
					if ($myPromo['REMISEPOUR'] > 0) {
						$myTemp[$i]['CHILD']['PROMOPRIX'] = sprintf("%.2f",$row['PRIX'] - (($row['PRIX'] * $myPromo['REMISEPOUR']) / 100));
					}

					if ($myTemp[$i]['CHILD']['PROMOPRIX'] < 0) {
						$myTemp[$i]['CHILD']['PROMOPRIX'] = sprintf("%.2f",$row['PRIX']);
					}
				}

				if ($myTemp[$i]['CHILD']['isDEVIS'] == 0) {
					$myTemp[$i]['CHILD']['PRIX'] = 0;
					$myTemp[$i]['CHILD']['PROMOPRIX'] = 0;
				}

				$myTemp[$i]['PRODUIT']['ID'] = $row['IDPRODUCT'];
				$myTemp[$i]['PRODUIT']['NOM'] = $row['NOM'];
				$myTemp[$i]['PRODUIT']['DESCSHORT'] = $row['DESCSHORT'];
				$myTemp[$i]['PRODUIT']['isPROMO'] = $row['isPROMO'];
				$myTemp[$i]['PRODUIT']['IDBREND'] = $row['IDBREND'];
				$myTemp[$i]['PRODUIT']['isSHOWBREND'] = $row['isSHOWBREND'];
				$myTemp[$i]['PRODUIT']['IDCATEGORY'] = $row['IDCATEGORY'];
				$myTemp[$i]['PRODUIT']['DATEPROMO'] = $row['DATEPROMO'];
				$myTemp[$i]['PRODUIT']['STOCK'] = $row['STOCK'];

				$myTemp[$i]['PRODUIT']['NAVNOM'] = $this->verifyNavigationString($row['NAVNOM'], $row['NOM'], '');

				$myTemp[$i]['PRODUIT']['URL'] = $row['URL'];


				$i++;
			}
		}
		return $myTemp;

	}


	public function ajaxaddpanierAction() {
		if ($this->getRequest()->isPost('productAddForm')) {
			$params = $this->getRequest()->getPost();

			$idProduct = $params['idProd'];

			for ($i = 0; $i < $params['nbr']; $i++) {
				if (isset($params['idChild_'.$i])) {
					$idchild = $params['idChild_'.$i];

					if (isset($params['quantity_'.$idchild])) {
						$qte = intval($params['quantity_'.$idchild]);
						$quantityMin = intval($params['qtyMinChild_'.$i]);
						$isAccessoire = $params['isAccessoire_'.$i];
						$selectedOptionValue = '';
						if (isset($params['selectedOption_'.$i]) && !empty($params['selectedOption_'.$i])) {
							$selectedOptionValue = $params['selectedOption_'.$i];
						}

						if ($qte > 0) {

							$qte = $this->computeQtyMin($qte, $quantityMin);

							$this->ajouterArticle( $idchild, $qte, $isAccessoire, $selectedOptionValue);
							$this->view->messageError = '';
							$this->view->messageSuccess = "Le produit a &eacute;t&eacute; ajout&eacute; &agrave; votre panier";
						} else {
							$this->supprimerArticle($idchild, $selectedOptionValue);
							$this->view->messageSuccess = "Votre panier a &eacute;t&eacute; actualis&eacute;";
							$this->view->messageError = '';
						}
					}
				}
			}

		}
		$layout = Zend_Layout::getMvcInstance();
		$layout->disableLayout();
		$this->render();
	}

	public function ajaxcountcaddyAction() {
		$userNamespace = $this->getSession();
		$myCaddy = $userNamespace->myObjectCaddy;
		$nbArticles = 0;
		if (isset($myCaddy->items)) {
			$nbArticles=count($myCaddy->items);
		}
		if ($nbArticles > 1) {
			$this->view->messageSuccess = $nbArticles.' PRODUITS';
		} else if ($nbArticles == 0) {
			$this->view->messageSuccess = 'Aucun produit';
		} else {
			$this->view->messageSuccess = $nbArticles.' PRODUIT';
		}
		$this->_forward('ajaxvalue', 'ajax');
	}
	/*
	 * Caddy
	 *
	 */
	public function ajaxcheckcaddyAction() {
		if ($this->getRequest()->isPost('caddyCheckForm')) {
			$params = $this->getRequest()->getPost();

			if (isset($params['Child'],$params['Quantity'])) {
				$listChild = $params['Child'];
				$listQuantity = $params['Quantity'];
				$listQuantityMin = $params['QuantityMin'];
				$listAcc= $params['Accessoire'];
				$listCaddyType= $params['CaddyType'];
				$listSelectedOption= $params['selectedOption'];

				for ($i = 0; $i < sizeof($listChild); $i++) {
					if (isset($listChild[$i],$listQuantity[$i])) {
						$idchild = intval($listChild[$i]);
						$qte = intval($listQuantity[$i]);
						$quantityMin = intval($listQuantityMin[$i]);
						$isAccessoire = $listAcc[$i];
						$idCaddyType = intval($listCaddyType[$i]);
						$selectedOption = $listSelectedOption[$i];

						if ($qte > 0) {
							$qte = $this->computeQtyMin($qte, $quantityMin);

							if ($idCaddyType > 0) {
								$this->ajouterArticleCaddyType($idCaddyType, $qte, $selectedOption);
							} else {
								$this->ajouterArticle($idchild, $qte, $isAccessoire, $selectedOption);
							}
							$this->view->messageError="";
							$this->view->messageSuccess = "Votre caddy a &eacute;t&eacute; modifi&eacute;";
						} else {
							if ($idCaddyType > 0) {
								$this->supprimerArticleCaddyType($idCaddyType, $selectedOption);
							} else {
								$this->supprimerArticle($idchild, $selectedOption);
							}
						}
					}
				}
			}
		}

		$this->_forward('ajaxmessage','ajax');
	}

	private function computeQtyMin($qte, $qteMin)
	{
		$reste = $qte % $qteMin;
		$value = ($qte - $reste) / $qteMin;

		if ($reste != 0) {
			$value++;
		}
		$result = $qteMin * $value;
		return $result;
	}



	private function ajouterArticleCaddyType($idCaddyType, $qteChild, $selectedOption){
		try {
			$userNamespace = $this->getSession();
			if (!isset($userNamespace->myObjectCaddy)) { $userNamespace->myObjectCaddy = new Caddy(); }
			$caddy = $userNamespace->myObjectCaddy;
			$caddy->addItemToCaddyType($idCaddyType, $qteChild, $selectedOption);
			$userNamespace->myObjectCaddy = $caddy;
		} catch (Zend_Exception $e) { $this->log($e->getMessage(), 'err'); }
	}

	private function ajouterArticle($idChild, $qteChild, $isAccessoire, $selectedOptionValue){
		try {
			$userNamespace = $this->getSession();
			if (!isset($userNamespace->myObjectCaddy)) { $userNamespace->myObjectCaddy = new Caddy(); }
			$caddy = $userNamespace->myObjectCaddy;
			$caddy->addItemToCaddy($idChild, $qteChild, $isAccessoire, $selectedOptionValue);
			$userNamespace->myObjectCaddy = $caddy;
		} catch (Zend_Exception $e) { $this->log($e->getMessage(), 'err'); }
	}

	private function supprimerArticle($idChild, $selectedOptionValue){
		try {
			$userNamespace = $this->getSession();
			if (!isset($userNamespace->myObjectCaddy)) { $userNamespace->myObjectCaddy = new Caddy(); }
			$caddy = $userNamespace->myObjectCaddy;
			$caddy->delItemToCaddy($idChild, $selectedOptionValue);
			$userNamespace->myObjectCaddy = $caddy;
		} catch (Zend_Exception $e) { $this->log($e->getMessage(), 'err'); }
	}

	private function supprimerArticleCaddyType($idCaddyType, $selectedOptionValue){
		try {
			$userNamespace = $this->getSession();
			if (!isset($userNamespace->myObjectCaddy)) { $userNamespace->myObjectCaddy = new Caddy(); }
			$caddy = $userNamespace->myObjectCaddy;
			$caddy->delItemToCaddyType($idCaddyType, $selectedOptionValue);
			$userNamespace->myObjectCaddy = $caddy;
		} catch (Zend_Exception $e) { $this->log($e->getMessage(), 'err'); }
	}

	private function computeProductChildsList($id, $idCat, $idBrend) {
		$myListChild = array();
		try {
			$productChild = new ProductChild();
			$productChildTemp = $productChild->getProductChildsByIdProduct($id);

			$myListChild = $this->computeProductChildsListArray($productChildTemp, $idCat, $idBrend);
		} catch (Zend_Exception $e) {
			$this->log($e->getMessage(), 'err');
		}
		return $myListChild;
	}


	private function computeProductChildsListArray($productChilds, $idCat, $idBrend) {
		$myListChild = array();
		try {
			$i = -1;
			$actualChild = 0;

			$isAllPromos = false;
			$currentPromoAll = array();
			$currentPromo = array();
			$listUserCodeInternIdBrendFound = array();
			$listUserCodeInternIdBrends = array();
			$listIdBrendFound = array();
			$listUserIdBrendFound = array();
			$listUserIdBrends = array();
			$listIdBrends = array();
			$promoCalculator = new PromoCalculator();
			$promoProduct = new PromoProduct();
			$promoUser = new PromoUser();

            $user = array();
            try {
			    $auth = Zend_Auth::getInstance();
			    $auth->setStorage($this->getSessionStorage());
			    $storage = $auth->getStorage()->read();
			    if ($auth->hasIdentity() && isset($storage['user'])) {
				    $user = $storage['user'];
                }
            }
            catch (Zend_Exception $e) {
                $this->log($e->getMessage(), 'err');
            }


			if (!empty($productChilds)) {
				$idCategory = $idCat;
				$myPromo = $promoProduct->getRemiseByProductCategory($idCategory);
				if ($this->isPromoActive($myPromo)) { $isAllPromos = true; $currentPromoAll = $myPromo; }
			}

			$userNamespace = $this->getSession();
			$myCaddy = $userNamespace->myObjectCaddy;
				
			$productChildQte = new ProductChildQte();
			foreach ($productChilds as $child) {
				if ($child['ID'] != $actualChild) {
					$i++;
					/* Prix Unitaire par Quantite*/
					$myListChild[$i]['QTEPRIXITEM'] = $productChildQte->getQteByItem($child['ID']);
					$myListChild[$i]['isQTEPRIXACTIVE'] = $child['isQTEPRIXACTIVE'];
					$child['PRIX'] = $productChildQte->getCurrentPrice($child['ID'], $myCaddy->getQuantity($child['ID']), $child['PRIX']);
						
					$myListChild[$i]['ID'] = $child['ID'];
					$myListChild[$i]['PRODUCTNAVNOM'] = $this->verifyNavigationString($child['PRODUCTNAVNOM'], $child['PRODUCTNOM'], '') ;
					$myListChild[$i]['PRODUCTNOM'] = $child['PRODUCTNOM'];
					$myListChild[$i]['PRODUCTID'] = $child['PRODUCTID'];
					$myListChild[$i]['REFERENCE'] = $child['REFERENCE'];
					$myListChild[$i]['DESIGNATION'] = $child['DESIGNATION'];
					$myListChild[$i]['PRIX'] = sprintf("%.2f",$child['PRIX']);
					$myListChild[$i]['isPROMO'] = $child['isPROMO'];
					$myListChild[$i]['isDEVIS'] = $child['isDEVIS'];
					$myListChild[$i]['QUANTITYMIN'] = $child['QUANTITYMIN'];

					$myListChild[$i]['PROMOPRIX'] = '';
					if ($child['isPROMO'] == 0) {
						$myPromo = $promoProduct->fetchRow("REFERENCE = '".$child['REFERENCE']."'");
						if ($myPromo['REMISEEURO'] > 0) {
							$myListChild[$i]['PROMOPRIX'] = sprintf("%.2f",$child['PRIX'] - $myPromo['REMISEEURO']);
						}
						if ($myPromo['REMISEPOUR'] > 0) {
							$myListChild[$i]['PROMOPRIX'] = sprintf("%.2f",$child['PRIX'] - (($child['PRIX'] * $myPromo['REMISEPOUR']) / 100));
						}
						if ($myListChild[$i]['PROMOPRIX'] < 0) { $myListChild[$i]['PROMOPRIX'] = 0; }
					}

					$myListChild[$i]['IMAGEPROMO'] = $child['IMAGEPROMO'];
					$myListChild[$i]['OPTION_VALUES'] = array();
					$actualChild = $child['ID'];


					/*
					 * CALCUL PROMO
					 */

					if (!in_array($idBrend, $listIdBrends, true)) {
						$myPromo = $promoProduct->getRemiseByProductBrend($idBrend);
						array_push($listIdBrends, $idBrend);
						if ($this->isPromoActive($myPromo)) { array_push($listIdBrendFound, array('ID' => $idBrend, 'PROMO' => $myPromo)); }
					}
					if ($child['isPROMO'] == 1) {
						$isRemise = false;
						if (in_array($idBrend, $listIdBrends, true)) {
							foreach ($listIdBrendFound as $brendPromos) {
								if ($brendPromos['ID'] == $idBrend) {
									$myListChild[$i]['isPROMO'] = 0;
									$currentPromo = $brendPromos['PROMO'];
									if ($currentPromo['REMISEEURO'] > 0) {
										$myListChild[$i]['PROMOPRIX'] = $promoCalculator->calculEuro($myListChild[$i]['PRIX'], $currentPromo['REMISEEURO']);
										$isRemise = true;
									}
									if ($currentPromo['REMISEPOUR'] > 0) {
										$myListChild[$i]['PROMOPRIX'] = $promoCalculator->calculPour($myListChild[$i]['PRIX'], $currentPromo['REMISEPOUR']);
										$isRemise = true;
									}
									break;
								}
							}
						}
						if ($isAllPromos && !empty($currentPromoAll) && !$isRemise ) {
							$myListChild[$i]['isPROMO'] = 0;
							if ($currentPromoAll['REMISEEURO'] > 0) {
								$myListChild[$i]['PROMOPRIX'] = $promoCalculator->calculEuro($myListChild[$i]['PRIX'], $currentPromoAll['REMISEEURO']);
							}
							if ($currentPromoAll['REMISEPOUR'] > 0) {
								$myListChild[$i]['PROMOPRIX'] = $promoCalculator->calculPour($myListChild[$i]['PRIX'], $currentPromoAll['REMISEPOUR']);
							}
						}
					}
					if (isset($user) && !empty($user)) {
						$userId = $user['id'];
						$codeIntern = $user['cintern'];
						$isRemise = false;

						if (!empty($codeIntern)) {
							if (!in_array($idBrend.'-'.$codeIntern, $listUserCodeInternIdBrends, true)) {
								$myPromo = $promoUser->getRemiseByCodeInternMarque($idBrend, $codeIntern);
								array_push($listUserCodeInternIdBrends, $idBrend.'-'.$codeIntern);
								if ($this->isPromoActive($myPromo)) { array_push($listUserCodeInternIdBrendFound, array('ID' => $idBrend, 'CODE' => $codeIntern, 'PROMO' => $myPromo)); }
							}
							if (in_array($idBrend.'-'.$codeIntern, $listUserCodeInternIdBrends, true)) {
								foreach ($listUserCodeInternIdBrendFound as $brendPromos) {
									if ($brendPromos['ID'] == $idBrend && $brendPromos['CODE'] == $codeIntern ) {
										$myListChild[$i]['isPROMO'] = 0;
										$currentPromo = $brendPromos['PROMO'];
										if ($currentPromo['REMISEEURO'] > 0) {
											$myListChild[$i]['PROMOPRIX'] = $promoCalculator->calculEuro($myListChild[$i]['PRIX'], $currentPromo['REMISEEURO']);
											$isRemise = true;
										}
										if ($currentPromo['REMISEPOUR'] > 0) {
											$myListChild[$i]['PROMOPRIX'] = $promoCalculator->calculPour($myListChild[$i]['PRIX'], $currentPromo['REMISEPOUR']);
											$isRemise = true;
										}
										break;
									}
								}
							}
						}
						if (!$isRemise) {
							if (!in_array($idBrend, $listUserIdBrends, true)) {
								$myPromo = $promoUser->getRemiseByMarque($idBrend, $userId);
								array_push($listUserIdBrends, $idBrend);
								if ($this->isPromoActive($myPromo)) { array_push($listUserIdBrendFound, array('ID' => $idBrend, 'PROMO' => $myPromo)); }
							}
							if (in_array($idBrend, $listUserIdBrends, true)) {
								foreach ($listUserIdBrendFound as $brendPromos) {
									if ($brendPromos['ID'] == $idBrend) {
										$myListChild[$i]['isPROMO'] = 0;
										$currentPromo = $brendPromos['PROMO'];
										if ($currentPromo['REMISEEURO'] > 0) {
											$myListChild[$i]['PROMOPRIX'] = $promoCalculator->calculEuro($myListChild[$i]['PRIX'], $currentPromo['REMISEEURO']);
											$isRemise = true;
										}
										if ($currentPromo['REMISEPOUR'] > 0) {
											$myListChild[$i]['PROMOPRIX'] = $promoCalculator->calculPour($myListChild[$i]['PRIX'], $currentPromo['REMISEPOUR']);
											$isRemise = true;
										}
										break;
									}
								}
							}
						}
					}
					if ($myListChild[$i]['PROMOPRIX'] < 0) { $myListChild[$i]['PROMOPRIX'] = $myListChild[$i]['PRIX']; }
				}
				$myListChild[$i]['OPTION_VALUES'][$child['OPTIONID']]['OPTIONVALUE'] = $child['OPTIONVALUE'];
				$myListChild[$i]['OPTION_VALUES'][$child['OPTIONID']]['OPTIONID'] = $child['OPTIONID'];
			}

		} catch (Zend_Exception $e) {
			$this->log($e->getMessage(), 'err');
		}
		return $myListChild;
	}

	private function checkTypeOfPromo($id) {
		$category = new Category2();
		$firstCategory = $category->getParentFirstOf($id);
		if ($firstCategory != null) {
			$currentId = $firstCategory["ID"];
			if ($currentId == 2) { $this->view->prefixPromoClass = "eco-"; }
		}
	}

	private function computeProductDetail($id) {
		try {
			$product = new Product();

			//Get Product
			$productTemp = $product->getProductById($id);

            $currentUser = array();
            try {
                $auth = Zend_Auth::getInstance();
                $auth->setStorage($this->getSessionStorage());
                $storage = $auth->getStorage()->read();
                if ($auth->hasIdentity() && isset($storage['user'])) {
                    $currentUser = $storage['user'];
                }
            }
            catch (Zend_Exception $e) { }

			if ($productTemp) {
				//Get Picture
				$picture = new Picture();
				$productPics = $picture->getAllByIdProduct($id);

				//Produits Annexe
				$productAnnexe = new ProductAnnexe();
				$productList = $productAnnexe->getAnnexesByProductID($id, 'NOM ASC');
				$listAnnexes = $this->computeProductListToShow($productList, $currentUser);
				$this->view->listAnnexes = $listAnnexes['PRODUCTS'];

				//Produits Accessoire
				$productAccessoire = new ProductAccessoire();
				$listAccessoires = $productAccessoire->getAccessoiresOptionsByProductID($id, 'NOM ASC');

				$listAccessoireChilds = $this->computeProductChildsListArray($listAccessoires, $productTemp[0]['IDCATEGORY'], $productTemp[0]['IDBREND']);

				$myProduct = array();

				$myProduct['PRODUCT_ACCESSOIRE'] = $listAccessoireChilds;

				if ($product->isInCategorySubsidiaire($productTemp[0]['ID'], 2)) {
					$this->view->prefixPromoClass = "eco-";
				}

				$myProduct['ID'] = $productTemp[0]['ID'];
				$myProduct['NOM'] = $productTemp[0]['NOM'];

				$myProduct['NAVNOM'] = $this->verifyNavigationString( $productTemp[0]['NAVNOM'], $productTemp[0]['NOM'], "");

				$myProduct['NAVTITRE'] = $productTemp[0]['NAVTITRE'];
				$myProduct['NAVDESC'] = $productTemp[0]['NAVDESC'];

				if (empty($myProduct['NAVTITRE'])) {
					$myProduct['NAVTITRE'] = $myProduct['NOM'];
				}
				if (empty($myProduct['NAVDESC'])) {
					$myProduct['NAVDESC'] = $productTemp[0]['DESCSHORT'];
				}
				$myProduct['NAVNOM_URLPARENTS'] = $this->computeUrlNavigationParent($productTemp[0]);

				$myProduct['KEYWORDS'] = $productTemp[0]['KEYWORDS'];
				$myProduct['DESCSHORT'] = $productTemp[0]['DESCSHORT'];
				$myProduct['DESCLONG'] = $productTemp[0]['DESCLONG'];
				$myProduct['DESCNORME'] = $productTemp[0]['DESCNORME'];
				$myProduct['DESCTECH'] = $productTemp[0]['DESCTECH'];
				$myProduct['PRIX'] = sprintf("%.2f",$productTemp[0]['PRIX']);
				$myProduct['PRIXLOWEST'] = $product->calculateLowestPrice($productTemp[0]['ID']);
				$myProduct['isPROMO'] = $productTemp[0]['isPROMO'];
				$myProduct['IDCATEGORY'] = $productTemp[0]['IDCATEGORY'];
				$myProduct['CATNOM'] = $productTemp[0]['CATNOM'];
				$myProduct['CATNAVNOM'] = $productTemp[0]['CATNAVNOM'];
				$myProduct['URL'] = $productTemp[0]['URL'];
				$myProduct['BREND'] = $productTemp[0]['BREND'];
				$myProduct['IDBREND'] = $productTemp[0]['IDBREND'];
				$myProduct['isSHOWBREND'] = $productTemp[0]['isSHOWBREND'];
				$myProduct['BRENDURL'] = $productTemp[0]['BRENDURL'];
				$myProduct['isDEVISPRODUCT'] = $productTemp[0]['isDEVISPRODUCT'];
				$myProduct['DOCNAME'] = $productTemp[0]['DOCNAME'];
				$myProduct['DOCURL'] = $productTemp[0]['DOCURL'];
				$myProduct['STOCK'] = $productTemp[0]['STOCK'];
				$myProduct['isQTEPRIXACTIVE'] = $productTemp[0]['isQTEPRIXACTIVE'];
				$myProduct['BOOSTED_BESTSELLER'] = $productTemp[0]['BOOSTED_BESTSELLER'];

				$myProduct['ONSELECT_IDOPTION'] = $productTemp[0]['ONSELECT_IDOPTION'];
				if ($myProduct['ONSELECT_IDOPTION'] > 0) {
					$optionList = new OptionList();
					$myProduct['ONSELECT_OPTION'] = $optionList->getByIdProduct($myProduct['ID']);
				}

				$myProduct['LISTPICS'] = $productPics;

				$i = 0;
				$myProduct['LISTOPTION'] = array();
				foreach ($productTemp as $option) {
                    $hasOption = false;
                    foreach ($myProduct['LISTOPTION'] as $current_option) {
                        if ($current_option['IDOPTION'] == $option['IDOPTION']) {
                            $hasOption = true;
                            break;
                        }
                    }
                    if (!$hasOption) {
                        $myProduct['LISTOPTION'][$i]['NOMOPTION'] = $option['NOMOPTION'];
                        $myProduct['LISTOPTION'][$i]['IDOPTION'] = $option['IDOPTION'];
                        $i++;
                    }
				}

				$myProduct['LISTCHILD'] = $this->computeProductChildsList($id, $myProduct['IDCATEGORY'], $myProduct['IDBREND']);

				return $myProduct;
			} else { return false;}
		} catch (Zend_Exception $e) {
			$this->log("ComputeProductDetail : "+$e->getMessage(), 'err');
		}
		return false;
	}
    
    private function checkForProductRedirection($row) {
	    $link = "";
	    if(isset($row['PRODUCT_URL'])) {
		    $link = "/".$row['PRODUCT_URL'];
	    } else if (isset($row['NAVNOM'])) {
		    $link = "/".Utils_Tool::getFormattedUrlProduct($row['NAVNOM_URLPARENTS'], $row['NAVNOM'], $row['ID']);
	    } else if (isset($row['PRODNAVNOM'])){
		    $link = "/".Utils_Tool::getFormattedUrlProduct($row['NAVNOM_URLPARENTS'], $row['PRODNAVNOM'], $row['ID']);
	    } 
        if ($this->FeatureRedirectionAuto) {
            $front = Zend_Controller_Front::getInstance();
            $currentpage = $front->getRequest()->getRequestUri();
            if ($link != $currentpage) {
                $this->send301Redirection($this->baseUrl_SiteCommerceUrl.$link);
            }
        }
        $this->setCanonicalUrl($this->baseUrl_SiteCommerceUrl.$link);
    }
    private function checkForCategoryRedirection($row) {
	    $link = "/".Utils_Tool::getFormattedUrlCategory($row['NAVNOM_URLPARENTS'], $row['NAVNOM'], $row['ID']); 
        if ($this->FeatureRedirectionAuto) {
            $front = Zend_Controller_Front::getInstance();
            $currentpage = $front->getRequest()->getRequestUri();
        
            if ($link != $currentpage) {
                $this->send301Redirection($this->baseUrl_SiteCommerceUrl.$link);
            }
        }
        $this->setCanonicalUrl($this->baseUrl_SiteCommerceUrl.$link);
    }

	public function detailAction()
	{
		if ($this->getRequest()->getParam('p')) {
			$id = (int)$this->getRequest()->getParam('p');

			if ($id>0) {
                $user_namespace = null;
				try {
					$user_namespace = $this->getSession();
	            } catch (Zend_Exception $e) {  
                
                }
	
				try {				
                    $myProduct = $this->computeProductDetail($id);

					if ($myProduct) {
                    
                        $this->checkForProductRedirection($myProduct);

                        if (isset($user_namespace) && !empty($user_namespace)){
						    $user_namespace->urlCurrentProduct = $this->getRequest()->getRequestUri();

						    $user_namespace->currentProductDetail = $myProduct;
                        }

						$category = new Category();

						$breadcrumb = $category->getTreeInLineOf($myProduct['IDCATEGORY']);

						$this->view->listFTFDS = $this->getFTFDSByIdProd($id);

						$this->view->breadcrumb = $breadcrumb;
                        
                        if (isset($user_namespace) && !empty($user_namespace)){
						    $user_namespace->currentProductDetailDesign = $this->showDesign($breadcrumb[0]['ID'], $breadcrumb[0]);
						    $this->view->actualDesign = $user_namespace->currentProductDetailDesign;
                        }
						$this->view->title = $myProduct['NAVTITRE'];

						$filter = new Zend_Filter();
						$filter	->addFilter(new Zend_Filter_StripTags())->addFilter(new Zend_Filter_StringTrim());
						$this->view->metadescription = $filter->filter($myProduct['NAVDESC']);
						$this->view->metakeywords = $myProduct['KEYWORDS'];

						$this->view->detailProduct = $myProduct;
                                                
                        $isProductOutOfStock = false;
                        if ($myProduct['STOCK'] == 4) {
                            $isProductOutOfStock = true;
                        }
                        $this->view->isProductOutOfStock = $isProductOutOfStock; 
                        
					} else { $this->log('Le produit est introuvable : '.$this->getRequest()->getRequestUri(), 'warn'); $this->_redirect('/'); }
				} catch (Zend_Exception $e) {  $this->log($e->getMessage(), 'err'); $this->_redirect('/');  }
			} else { $this->_redirect('/');  }
		}  else { $this->_redirect('/');  }
	}


	private function isPromoActive($myPromo) {
		if ($myPromo) {
			if ($myPromo['REMISEEURO'] > 0) { return true; }
			if ($myPromo['REMISEPOUR'] > 0) { return true; }
		}
		return false;
	}


	private function computeProductListToShowOld($list, $user) {
		$i = 0;
		$j = 1;
		$isFirst = true;
		$listProducts = array();
		$metakeywords = '';

		$isAllPromos = false;
		$currentPromoAll = array();
		$currentPromo = array();
		$listUserCodeInternIdBrendFound = array();
		$listUserCodeInternIdBrends = array();
		$listIdBrendFound = array();
		$listUserIdBrendFound = array();
		$listUserIdBrends = array();
		$listIdBrends = array();
		$promoCalculator = new PromoCalculator();
		$promoProduct = new PromoProduct();
		$promoUser = new PromoUser();
 
		if (!empty($list)) {
			$idCategory = $list[0]['CATID'];
			$myPromo = $promoProduct->getRemiseByProductCategory($idCategory);
			if ($this->isPromoActive($myPromo)) { $isAllPromos = true; $currentPromoAll = $myPromo; }
             
		}

		foreach ($list AS $row) {
			if ($j == 9 ) {
				$j = 1;
				$i++;
				$isFirst = true;
			} else {
				if (!$isFirst) {
					$j++;
				}
			}

			$listProducts[$i][$j]['ID'] = $row['ID'];
			$listProducts[$i][$j]['NOM'] = $row['NOM'];
			$listProducts[$i][$j]['DESCSHORT'] = $this->cutString($row['DESCSHORT'], 80);
			$listProducts[$i][$j]['URL'] = $row['URL'];
			$listProducts[$i][$j]['BREND'] = $row['BREND'];
			$listProducts[$i][$j]['isSHOWBREND'] = $row['isSHOWBREND'];
			$listProducts[$i][$j]['BRENDURL'] = $row['BRENDURL'];
			$listProducts[$i][$j]['NBREFERENCE'] = $row['NBREFERENCE'];
			$listProducts[$i][$j]['isDEVISPRODUCT'] = $row['isDEVISPRODUCT'];
			$listProducts[$i][$j]['BOOSTED_BESTSELLER'] = $row['BOOSTED_BESTSELLER'];

			$listProducts[$i][$j]['NAVNOM'] = $this->verifyNavigationString($row['PRODNAVNOM'], $row['NOM'], '');
			$listProducts[$i][$j]['NAVNOM_URLPARENTS'] = $row['NAVNOM_URLPARENTS'];

			$listProducts[$i][$j]['NAVTITRE'] = $row['NAVTITRE'];
			$listProducts[$i][$j]['NAVDESC'] = $row['NAVDESC'];

			$isFirst = false;

			if (empty($metakeywords)) {
				$metakeywords .= $row['KEYWORDS_PROD'];
			} else {
				$metakeywords .= ','.$row['KEYWORDS_PROD'];
			}

			$listProducts[$i][$j]['isPROMO'] = $row['isPROMO'];
			$listProducts[$i][$j]['PRIX'] = $row['PRIX'];

			/*
			 * CALCUL PROMO
			 */
			$idBrend = $row['BRENDID'];

			if (!in_array($idBrend, $listIdBrends, true)) {
				$myPromo = $promoProduct->getRemiseByProductBrend($idBrend);
				array_push($listIdBrends, $idBrend);
				if ($this->isPromoActive($myPromo)) { array_push($listIdBrendFound, array('ID' => $idBrend, 'PROMO' => $myPromo)); }
			}
			if ($row['isPROMO'] == 1) {
				$isRemise = false;
				if (in_array($idBrend, $listIdBrends, true)) {
					foreach ($listIdBrendFound as $brendPromos) {
						if ($brendPromos['ID'] == $idBrend) {
							$listProducts[$i][$j]['isPROMO'] = 0;
							$currentPromo = $brendPromos['PROMO'];
							if ($currentPromo['REMISEEURO'] > 0) {
								$listProducts[$i][$j]['PRIX'] = $promoCalculator->calculEuro($row['PRIX'], $currentPromo['REMISEEURO']);
								$isRemise = true;
							}
							if ($currentPromo['REMISEPOUR'] > 0) {
								$listProducts[$i][$j]['PRIX'] = $promoCalculator->calculPour($row['PRIX'], $currentPromo['REMISEPOUR']);
								$isRemise = true;
							}
							break;
						}
					}
				}
				if ($isAllPromos && !empty($currentPromoAll) && !$isRemise ) {
					$listProducts[$i][$j]['isPROMO'] = 0;
					if ($currentPromoAll['REMISEEURO'] > 0) {
						$listProducts[$i][$j]['PRIX'] = $promoCalculator->calculEuro($row['PRIX'], $currentPromoAll['REMISEEURO']);
					}
					if ($currentPromoAll['REMISEPOUR'] > 0) {
						$listProducts[$i][$j]['PRIX'] = $promoCalculator->calculPour($row['PRIX'], $currentPromoAll['REMISEPOUR']);
					}
				}
			}
			if (isset($user) && !empty($user)) {
				$userId = $user['id'];
				$codeIntern = $user['cintern'];
				$isRemise = false;

				if (!empty($codeIntern)) {
					if (!in_array($idBrend.'-'.$codeIntern, $listUserCodeInternIdBrends, true)) {
						$myPromo = $promoUser->getRemiseByCodeInternMarque($idBrend, $codeIntern);
						array_push($listUserCodeInternIdBrends, $idBrend.'-'.$codeIntern);
						if ($this->isPromoActive($myPromo)) { array_push($listUserCodeInternIdBrendFound, array('ID' => $idBrend, 'CODE' => $codeIntern, 'PROMO' => $myPromo)); }
					}
					if (in_array($idBrend.'-'.$codeIntern, $listUserCodeInternIdBrends, true)) {
						foreach ($listUserCodeInternIdBrendFound as $brendPromos) {
							if ($brendPromos['ID'] == $idBrend && $brendPromos['CODE'] == $codeIntern ) {
								$listProducts[$i][$j]['isPROMO'] = 0;
								$currentPromo = $brendPromos['PROMO'];
								if ($currentPromo['REMISEEURO'] > 0) {
									$listProducts[$i][$j]['PRIX'] = $promoCalculator->calculEuro($row['PRIX'], $currentPromo['REMISEEURO']);
									$isRemise = true;
								}
								if ($currentPromo['REMISEPOUR'] > 0) {
									$listProducts[$i][$j]['PRIX'] = $promoCalculator->calculPour($row['PRIX'], $currentPromo['REMISEPOUR']);
									$isRemise = true;
								}
								break;
							}
						}
					}
				}
				if (!$isRemise) {
					if (!in_array($idBrend, $listUserIdBrends, true)) {
						$myPromo = $promoUser->getRemiseByMarque($idBrend, $userId);
						array_push($listUserIdBrends, $idBrend);
						if ($this->isPromoActive($myPromo)) { array_push($listUserIdBrendFound, array('ID' => $idBrend, 'PROMO' => $myPromo)); }
					}
					if (in_array($idBrend, $listUserIdBrends, true)) {
						foreach ($listUserIdBrendFound as $brendPromos) {
							if ($brendPromos['ID'] == $idBrend) {
								$listProducts[$i][$j]['isPROMO'] = 0;
								$currentPromo = $brendPromos['PROMO'];
								if ($currentPromo['REMISEEURO'] > 0) {
									$listProducts[$i][$j]['PRIX'] = $promoCalculator->calculEuro($row['PRIX'], $currentPromo['REMISEEURO']);
									$isRemise = true;
								}
								if ($currentPromo['REMISEPOUR'] > 0) {
									$listProducts[$i][$j]['PRIX'] = $promoCalculator->calculPour($row['PRIX'], $currentPromo['REMISEPOUR']);
									$isRemise = true;
								}
								break;
							}
						}
					}
				}
			}


			if ($listProducts[$i][$j]['PRIX'] <= 0 ) { $listProducts[$i][$j]['PRIX'] = $row['PRIX']; }
		}
		return $result = array( 'PRODUCTS' => $listProducts, 'META_KEY' =>  $metakeywords);
	}
    
    private function computeUrlNavigationParent($row) {
        return $row['NAVNOM_URLPARENTS']."/".$row['CATNAVNOM'];
    }
 

	private function computeProductListToShowFromEs($user, $searchWord, $listFacets) {
		try {
            if (empty($this->FeatureElasticSearchWsdl) || empty($this->FeatureElasticSearchUsername) || empty($this->FeatureElasticSearchKey) || $this->FeatureElasticSearchEnableOnSearch == false) {
		        return array( 'PRODUCTS' => array(), 'META_KEY' =>  '');
            }
            $facetsValues = "";
            if (!empty($listFacets)){
                $facetsValues = json_encode($listFacets);
            }
            $this->log("Elastic search => Search word : ".$searchWord. " / Facets : ".$facetsValues,'info');
             
            $result = new stdClass();
            $isCalledSucceed = false;
            try
            {     
                $soapClient = $this->getSoapClient($this->FeatureElasticSearchWsdl);
                $request = $this->getSoapHeader($this->FeatureElasticSearchUsername, $this->FeatureElasticSearchKey);
                    
                $request->SearchWord = $searchWord;
                if (!empty($listFacets)){
                    $request->Facets = $facetsValues;
                }
                
                $parameters = new stdClass();
                $parameters->request = $request;
                    
                $result = $soapClient->SearchProducts($parameters);
                
                $isCalledSucceed = true;
                $soapClient = null;   
            }
            catch (SoapFault $fault)
            {
				$this->log($fault->faultstring,'err');
            }
                
            if (!$isCalledSucceed || $result->SearchProductsResult->Total == 0) {
		        return array( 'PRODUCTS' => array(), 'META_KEY' =>  '');
            }   
            //------------------------------------------------------
            
            $listProducts = array();  
			$listUserIdBrendFound = array();
			$listUserIdBrends = array();
		    $listIdBrends = array(); 
		    $listIdBrendFound = array();
			$promoUser = new PromoUser();
			$promoCalculator = new PromoCalculator();
			$promoProduct = new PromoProduct();
			$product = new Product();
			$metakeywords = '';  
            
			$isAllPromos = false;
              
            $listOfFacets = array();
            
            if (isset($result->SearchProductsResult->Facets->ProductFacet)) {
                if (!is_array($result->SearchProductsResult->Facets->ProductFacet)) { 
                    array_push($listOfFacets, $result->SearchProductsResult->Facets->ProductFacet); 
                } else {
                    $listOfFacets = $result->SearchProductsResult->Facets->ProductFacet;
                }
            }
            
            $listOfProducts = array();
            if ($result->SearchProductsResult->Total == 1) {
                array_push($listOfProducts, $result->SearchProductsResult->Products->ProductDetail); 
            } else {
                $listOfProducts = $result->SearchProductsResult->Products->ProductDetail;
            }
            
			foreach ($listOfProducts as $row) { 
                try
                {     
				    $currentProduct = array();
				    $currentProduct['ID'] = $row->ProductId;
				    $currentProduct['NOM'] = $row->Name;
				    $currentProduct['DESCSHORT'] = $row->ShortDescription;
				    $currentProduct['PRODUCT_URL'] = $row->ProductUrl;
			  
				    $currentProduct['NAVNOM'] =  $row->MetaNavigationName; 
				    $currentProduct['NAVTITRE'] =  $row->MetaTitle;
				    $currentProduct['NAVDESC'] =  $row->MetaDescription;
                  
                    $isPromo = false; 
                    $currentPrice = 99999; 
                    if (isset($row->ProductPrice)) {
				        $currentProduct['isDEVISPRODUCT'] = !$row->ProductPrice->IsDevis;
				        $currentProduct['PRIX'] = $row->ProductPrice->Price;
				        $currentProduct['PRIXLOWEST'] = $currentProduct['PRIX'];
				        $currentProduct['isPRIXDEGRESSIF'] = $row->ProductPrice->IsDegresivePrice;
				        $currentProduct['isPROMO'] = !$row->ProductPrice->IsPromo;
                        $currentPrice = $row->ProductPrice->Price; 
                        $isPromo = $currentProduct['isPROMO'];
                    } else {
				        $currentProduct['isDEVISPRODUCT'] = "";
				        $currentProduct['PRIX'] = $currentPrice;
				        $currentProduct['PRIXLOWEST'] = $currentProduct['PRIX'];
				        $currentProduct['isPRIXDEGRESSIF'] = 0;
				        $currentProduct['isPROMO'] = 1;
                    }
					
                    if (isset($row->Category)) {
				        $currentProduct['CATID'] = $row->Category->Id;
				        $currentProduct['CATNOM'] = $row->Category->Name;
                        $currentProduct['NAVNOM_URLPARENTS'] = $row->Category->NavigationName;
                    } else {
				        $currentProduct['CATID'] = 0;
				        $currentProduct['CATNOM'] = "";
                        $currentProduct['NAVNOM_URLPARENTS'] = "";
                    }
                
                    if (isset($row->Reranking)) {
                        $currentProduct['BOOSTED_BESTSELLER'] = $row->Reranking->BestSeller; 
                    } else {
                        $currentProduct['BOOSTED_BESTSELLER'] = 99999; 
                    }
                 
				    $currentProduct['URL'] = $row->DefaultPictureUrl; 
                
				    $idBrend = 0;
                    if (isset($row->Brand)) {
				        $currentProduct['isSHOWBREND'] = !$row->Brand->IsShow;
				        $currentProduct['BREND'] = $row->Brand->Name;
				        $currentProduct['BRENDURL'] = $row->Brand->Url;
                        $idBrend = $row->Brand->Id;
                    } else {
				        $currentProduct['isSHOWBREND'] = false;
				        $currentProduct['BREND'] = "";
				        $currentProduct['BRENDURL'] = "";
                    }
				    $currentProduct['NBREFERENCE'] = $row->NbReferences;
                 
                
			        $listUserCodeInternIdBrendFound = array();
			        $listUserCodeInternIdBrends = array();
                   
				    /*
				        * CALCUL PROMO
				        */ 
                
				    if (!in_array($idBrend, $listIdBrends, true)) {
					    $myPromo = $promoProduct->getRemiseByProductBrend($idBrend);
					    array_push($listIdBrends, $idBrend);
					    if ($this->isPromoActive($myPromo)) {
                            $isPromo = true;
                            array_push($listIdBrendFound, array('ID' => $idBrend, 'PROMO' => $myPromo)); 
                        }
				    }
				    if ($isPromo) {
					    $isRemise = false;
					    if (in_array($idBrend, $listIdBrends, true)) {
						    foreach ($listIdBrendFound as $brendPromos) {
							    if ($brendPromos['ID'] == $idBrend) {
								    $currentProduct['isPROMO'] = 0;
								    $currentPromo = $brendPromos['PROMO'];
								    if ($currentPromo['REMISEEURO'] > 0) {
									    $currentProduct['PRIX'] = $promoCalculator->calculEuro($currentPrice, $currentPromo['REMISEEURO']);
									    $isRemise = true;
								    }
								    if ($currentPromo['REMISEPOUR'] > 0) {
									    $currentProduct['PRIX'] = $promoCalculator->calculPour($currentPrice, $currentPromo['REMISEPOUR']);
									    $isRemise = true;
								    }
								    break;
							    }
						    }
					    }
					    if ($isAllPromos && !empty($currentPromoAll) && !$isRemise ) {
						    $currentProduct['isPROMO'] = 0;
						    if ($currentPromoAll['REMISEEURO'] > 0) {
							    $currentProduct['PRIX'] = $promoCalculator->calculEuro($row['PRIX'], $currentPromoAll['REMISEEURO']);
						    }
						    if ($currentPromoAll['REMISEPOUR'] > 0) {
							    $currentProduct['PRIX'] = $promoCalculator->calculPour($row['PRIX'], $currentPromoAll['REMISEPOUR']);
						    }
					    }
				    }
				    if (isset($user) && !empty($user)) {
					    $userId = $user['id'];
					    $codeIntern = $user['cintern'];
					    $isRemise = false;

					    if (!empty($codeIntern)) {
						    if (!in_array($idBrend.'-'.$codeIntern, $listUserCodeInternIdBrends, true)) {
							    $myPromo = $promoUser->getRemiseByCodeInternMarque($idBrend, $codeIntern);
							    array_push($listUserCodeInternIdBrends, $idBrend.'-'.$codeIntern);
							    if ($this->isPromoActive($myPromo)) { 
                                    $isPromo = true;
                                    array_push($listUserCodeInternIdBrendFound, array('ID' => $idBrend, 'CODE' => $codeIntern, 'PROMO' => $myPromo)); 
                                }
						    }
						    if (in_array($idBrend.'-'.$codeIntern, $listUserCodeInternIdBrends, true)) {
							    foreach ($listUserCodeInternIdBrendFound as $brendPromos) {
								    if ($brendPromos['ID'] == $idBrend && $brendPromos['CODE'] == $codeIntern ) {
									    $currentProduct['isPROMO'] = 0;
									    $currentPromo = $brendPromos['PROMO'];
									    if ($currentPromo['REMISEEURO'] > 0) {
										    $currentProduct['PRIX'] = $promoCalculator->calculEuro($currentPrice, $currentPromo['REMISEEURO']);
										    $isRemise = true;
									    }
									    if ($currentPromo['REMISEPOUR'] > 0) {
										    $currentProduct['PRIX'] = $promoCalculator->calculPour($currentPrice, $currentPromo['REMISEPOUR']);
										    $isRemise = true;
									    }
									    break;
								    }
							    }
						    }
					    }
					    if (!$isRemise) {
						    if (!in_array($idBrend, $listUserIdBrends, true)) {
							    $myPromo = $promoUser->getRemiseByMarque($idBrend, $userId);
							    array_push($listUserIdBrends, $idBrend);
							    if ($this->isPromoActive($myPromo)) { 
                                    $isPromo = true;
                                    array_push($listUserIdBrendFound, array('ID' => $idBrend, 'PROMO' => $myPromo)); 
                                }
						    }
						    if (in_array($idBrend, $listUserIdBrends, true)) {
							    foreach ($listUserIdBrendFound as $brendPromos) {
								    if ($brendPromos['ID'] == $idBrend) {
									    $currentProduct['isPROMO'] = 0;
									    $currentPromo = $brendPromos['PROMO'];
									    if ($currentPromo['REMISEEURO'] > 0) {
										    $currentProduct['PRIX'] = $promoCalculator->calculEuro($currentPrice, $currentPromo['REMISEEURO']);
										    $isRemise = true;
									    }
									    if ($currentPromo['REMISEPOUR'] > 0) {
										    $currentProduct['PRIX'] = $promoCalculator->calculPour($currentPrice, $currentPromo['REMISEPOUR']);
										    $isRemise = true;
									    }
									    break;
								    }
							    }
						    }
					    } 
                    }  
				    if ($currentProduct['PRIX'] <= 0 ) { 
                        $currentProduct['PRIX'] = $currentPrice; 
                    } 
				    $currentProduct['PRIXLOWEST'] = $product->calculateLowestPrice($currentProduct['ID']);
					
				    array_push($listProducts, $currentProduct);
                }
                catch (Zend_Exception $e)
                {
			        $this->log($e->getMessage(),'err');
                }
            } 
            
			return array( 'PRODUCTS' => $listProducts, 'FACETS' => $listOfFacets, 'META_KEY' =>  $metakeywords);
		} catch (Zend_Exception $e) {
			$this->log('computeProductListToShowFromEs : '.$e->getMessage(),'err');
		}
		return array( 'PRODUCTS' => array(), 'META_KEY' =>  '');
    }
      
      
	private function computeProductListToShow($list, $user) {
		try {
			$listProducts = array();
			$metakeywords = '';

			$isAllPromos = false;
			$currentPromoAll = array();
			$currentPromo = array();
			$listUserCodeInternIdBrendFound = array();
			$listUserCodeInternIdBrends = array();
			$listUserIdBrendFound = array();
			$listUserIdBrends = array();
			$listIdBrends = array();
			$listIdBrendFound = array();
			$promoCalculator = new PromoCalculator();
			$promoProduct = new PromoProduct();
			$promoUser = new PromoUser();
			$product= new Product();

			if (!empty($list)) {
				$idCategory = $list[0]['CATID'];
				$myPromo = $promoProduct->getRemiseByProductCategory($idCategory);
				if ($this->isPromoActive($myPromo)) { $isAllPromos = true; $currentPromoAll = $myPromo; }
			}
			$productChildQte = new ProductChildQte();

			foreach ($list AS $row) {
				$currentProduct = array();
				$currentProduct['ID'] = $row['ID'];
				$currentProduct['NOM'] = $row['NOM'];
				$currentProduct['CATID'] = $row['CATID'];
				$currentProduct['CATNOM'] = $row['CATNOM'];
				$currentProduct['DESCSHORT'] = $row['DESCSHORT'];
				$currentProduct['URL'] = $row['URL'];
				$currentProduct['BREND'] = $row['BREND'];
				$currentProduct['isSHOWBREND'] = $row['isSHOWBREND'];
				$currentProduct['BRENDURL'] = $row['BRENDURL'];
				$currentProduct['NBREFERENCE'] = $row['NBREFERENCE'];
				$currentProduct['isDEVISPRODUCT'] = $row['isDEVISPRODUCT'];
                $currentProduct['NAVNOM_URLPARENTS'] = $this->computeUrlNavigationParent($row);
                $currentProduct['BOOSTED_BESTSELLER'] = $row['BOOSTED_BESTSELLER'];

				if (isset($row['NAVNOM'])) {
					$navnom = $row['NAVNOM'];
				} else {
					$navnom = $row['PRODNAVNOM'];
				}

				$currentProduct['NAVNOM'] = $this->verifyNavigationString($navnom, $row['NOM'], '');

				$currentProduct['NAVTITRE'] = $row['NAVTITRE'];
				$currentProduct['NAVDESC'] = $row['NAVDESC'];

				$isFirst = false;

				if (empty($metakeywords)) {
					$metakeywords .= $row['KEYWORDS_PROD'];
				} else {
					$metakeywords .= ','.$row['KEYWORDS_PROD'];
				}

				$currentProduct['isPROMO'] = $row['isPROMO'];
				$currentProduct['PRIX'] = $row['PRIX'];

				/*
				 * PRIX DEGRESSIF
				 */
				$currentProduct['isPRIXDEGRESSIF'] = $productChildQte->isPrixDegressifByProductID($row['ID']);
					
				/*
				 * CALCUL PROMO
				 */
				$idBrend = $row['BRENDID'];

				if (!in_array($idBrend, $listIdBrends, true)) {
					$myPromo = $promoProduct->getRemiseByProductBrend($idBrend);
					array_push($listIdBrends, $idBrend);
					if ($this->isPromoActive($myPromo)) { array_push($listIdBrendFound, array('ID' => $idBrend, 'PROMO' => $myPromo)); }
				}
				if ($row['isPROMO'] == 1) {
					$isRemise = false;
					if (in_array($idBrend, $listIdBrends, true)) {
						foreach ($listIdBrendFound as $brendPromos) {
							if ($brendPromos['ID'] == $idBrend) {
								$currentProduct['isPROMO'] = 0;
								$currentPromo = $brendPromos['PROMO'];
								if ($currentPromo['REMISEEURO'] > 0) {
									$currentProduct['PRIX'] = $promoCalculator->calculEuro($row['PRIX'], $currentPromo['REMISEEURO']);
									$isRemise = true;
								}
								if ($currentPromo['REMISEPOUR'] > 0) {
									$currentProduct['PRIX'] = $promoCalculator->calculPour($row['PRIX'], $currentPromo['REMISEPOUR']);
									$isRemise = true;
								}
								break;
							}
						}
					}
					if ($isAllPromos && !empty($currentPromoAll) && !$isRemise ) {
						$currentProduct['isPROMO'] = 0;
						if ($currentPromoAll['REMISEEURO'] > 0) {
							$currentProduct['PRIX'] = $promoCalculator->calculEuro($row['PRIX'], $currentPromoAll['REMISEEURO']);
						}
						if ($currentPromoAll['REMISEPOUR'] > 0) {
							$currentProduct['PRIX'] = $promoCalculator->calculPour($row['PRIX'], $currentPromoAll['REMISEPOUR']);
						}
					}
				}
				if (isset($user) && !empty($user)) {
					$userId = $user['id'];
					$codeIntern = $user['cintern'];
					$isRemise = false;

					if (!empty($codeIntern)) {
						if (!in_array($idBrend.'-'.$codeIntern, $listUserCodeInternIdBrends, true)) {
							$myPromo = $promoUser->getRemiseByCodeInternMarque($idBrend, $codeIntern);
							array_push($listUserCodeInternIdBrends, $idBrend.'-'.$codeIntern);
							if ($this->isPromoActive($myPromo)) { array_push($listUserCodeInternIdBrendFound, array('ID' => $idBrend, 'CODE' => $codeIntern, 'PROMO' => $myPromo)); }
						}
						if (in_array($idBrend.'-'.$codeIntern, $listUserCodeInternIdBrends, true)) {
							foreach ($listUserCodeInternIdBrendFound as $brendPromos) {
								if ($brendPromos['ID'] == $idBrend && $brendPromos['CODE'] == $codeIntern ) {
									$currentProduct['isPROMO'] = 0;
									$currentPromo = $brendPromos['PROMO'];
									if ($currentPromo['REMISEEURO'] > 0) {
										$currentProduct['PRIX'] = $promoCalculator->calculEuro($row['PRIX'], $currentPromo['REMISEEURO']);
										$isRemise = true;
									}
									if ($currentPromo['REMISEPOUR'] > 0) {
										$currentProduct['PRIX'] = $promoCalculator->calculPour($row['PRIX'], $currentPromo['REMISEPOUR']);
										$isRemise = true;
									}
									break;
								}
							}
						}
					}
					if (!$isRemise) {
						if (!in_array($idBrend, $listUserIdBrends, true)) {
							$myPromo = $promoUser->getRemiseByMarque($idBrend, $userId);
							array_push($listUserIdBrends, $idBrend);
							if ($this->isPromoActive($myPromo)) { array_push($listUserIdBrendFound, array('ID' => $idBrend, 'PROMO' => $myPromo)); }
						}
						if (in_array($idBrend, $listUserIdBrends, true)) {
							foreach ($listUserIdBrendFound as $brendPromos) {
								if ($brendPromos['ID'] == $idBrend) {
									$currentProduct['isPROMO'] = 0;
									$currentPromo = $brendPromos['PROMO'];
									if ($currentPromo['REMISEEURO'] > 0) {
										$currentProduct['PRIX'] = $promoCalculator->calculEuro($row['PRIX'], $currentPromo['REMISEEURO']);
										$isRemise = true;
									}
									if ($currentPromo['REMISEPOUR'] > 0) {
										$currentProduct['PRIX'] = $promoCalculator->calculPour($row['PRIX'], $currentPromo['REMISEPOUR']);
										$isRemise = true;
									}
									break;
								}
							}
						}
					}
				}


				if ($currentProduct['PRIX'] <= 0 ) { $currentProduct['PRIX'] = $row['PRIX']; }
 
				$currentProduct['PRIXLOWEST'] = $product->calculateLowestPrice($currentProduct['ID']);
					
				array_push($listProducts, $currentProduct);
			}
			return $result = array( 'PRODUCTS' => $listProducts, 'META_KEY' =>  $metakeywords);
		} catch (Zend_Exception $e) {
			$this->log('ComputeProductListToShow : '.$e->getMessage(),'err');
		}
		return $result = array( 'PRODUCTS' => array(), 'META_KEY' =>  '');
	}

	private function getLastCharOf($str) { return $str{strlen($str)-1}; }

    private function ebusinessCategoryAction($id) {
         $currentUser = array();
		try {
		    $auth = Zend_Auth::getInstance();
		    $auth->setStorage($this->getSessionStorage());
		    $storage = $auth->getStorage()->read();
		    if ($auth->hasIdentity() && isset($storage['user'])) {
			    $currentUser = $storage['user'];
            }
        }
        catch (Zend_Exception $e) {
        }

        $category = new Category();
		$product = new Product();
        $productList = array();
		$listCat = array();
		$listCat = $category->getTreeCatsOfWithLevel($id, true);
                    
		if (!empty($listCat)) {
                    
            $this->checkForCategoryRedirection($listCat);
                        
			$this->view->listCat = $listCat;
			$breadcrumb = $category->getTreeInLineOf($id);
			$this->view->breadcrumb = $breadcrumb;
			$this->view->actualDesign = $this->showDesign($breadcrumb[0]['ID'], $breadcrumb[0]);

			if (empty($listCat['NAVTITRENOM'])) {
				$listCat['NAVTITRENOM'] = $listCat['NOM'];
			}
			if (empty($listCat['NAVDESCRIPTION'])) {
				$listCat['NAVDESCRIPTION'] = $listCat['DESCRIPTION'];
			}

			/* Referencement automatique
				$key = new KeyMap();
				$key->updateCatEntry($id);
				*/

			$filter = new Zend_Filter();
			$filter	->addFilter(new Zend_Filter_StripTags())->addFilter(new Zend_Filter_StringTrim());

			$this->view->metadescription = $filter->filter($listCat['NAVDESCRIPTION']);
			$this->view->title = $listCat['NAVTITRENOM'];
			//$isTri_metaKeyword = false;

			$annoncesleft = new AnnonceLeft();
			$this->view->listads = $annoncesleft->getAnnoncesByShow($id);
						
			if (!$listCat['SUBS']) {
				$triSql = 'BOOSTED_BESTSELLER ASC';
				switch ($this->_request->getParam('tri')) {
					case 1:
						$triSql = "PRIX ASC";
						break;
					case 2:
						$triSql = "PRIX DESC";
						break;
					case 3:
						$triSql = 'NOM ASC';
						break;
					case 4:
						$triSql = 'NOM DESC';
						break;
					case 5:
						$triSql = 'BOOSTED_BESTSELLER ASC';
						break;
										
				}
				$this->view->currentCategory =$listCat;
								
				//List of products
				$productList = $product->getProductsByIdCategory($id, $triSql);
								
				$resultProduct = $this->computeProductListToShow($productList, $currentUser);
				$this->view->listAllProducts = $resultProduct['PRODUCTS'];
                            
                if (!empty($listCat['KEYWORDS'])) {
                    $this->view->metakeywords = $listCat['KEYWORDS'];
                } else {                                
                    $this->view->metakeywords = $resultProduct['META_KEY'];
                }
								
				//Show product page
				$this->render('nosproduits');
			} else {
				$metakeywords = $listCat['KEYWORDS'];

                if (empty($metakeywords)) {
                    for ($index = 0; $index < sizeOf($listCat['SUBS']); $index++) {
                        if (empty($metakeywords)) {
                            $metakeywords .= $listCat['SUBS'][$index]['KEYWORDS'];
                        } else {
                            $metakeywords .= ','.$listCat['SUBS'][$index]['KEYWORDS'];
                        }
                    }
                }
				$this->view->metakeywords = $metakeywords;
                if ($this->FeatureProductShowBestSellerOnCategory) {
					$productList = $product->getAllProductsBestSellerByCatId($id);
					$resultProduct = $this->computeProductListToShow($productList, $currentUser);
					$this->view->listAllProductsBestSeller = $resultProduct['PRODUCTS'];
                } 
				$productList = $product->getAllTreeSubProductsByCatId($id);
				$resultProduct = $this->computeProductListToShow($productList, $currentUser);                             
				$this->view->listAllProducts = $resultProduct['PRODUCTS'];
			}
		} else {
			$this->log('Impossible de trouver la categorie : '.$this->getRequest()->getRequestUri(), 'warn');
			$this->_redirect('/');
		}
    }

    private function gallerieCategoryAction($id) {
		$annonce = new AnnonceCms(); 
        $this->view->listAllArticles = $annonce->getAnnoncesByShow($id);
        
		$annonceGallery = new AnnonceGallery(); 
        $this->view->listAllGalleries = $annonceGallery->getAnnoncesByShow($id);

        $category = new Category();  
		$currentCat = $category->fetchRow("ID = ".$id);
		
		$this->view->currentCat = $currentCat;
		
		$this->view->currentCatSubs = $category->getTreeCatsOfWithLevel($id, true);
		
		if (empty($currentCat['NAVTITRENOM'])) {
			$currentCat['NAVTITRENOM'] = $currentCat['NOM'];
		}
		if (empty($currentCat['NAVDESCRIPTION'])) {
			$currentCat['NAVDESCRIPTION'] = $currentCat['DESCRIPTION'];
		}
		$filter = new Zend_Filter();
		$filter	->addFilter(new Zend_Filter_StripTags())->addFilter(new Zend_Filter_StringTrim());

		$this->view->title = $currentCat['NAVTITRENOM'];
		$this->view->metadescription = $filter->filter($currentCat['NAVDESCRIPTION']);  
		$this->view->metakeywords = $currentCat['KEYWORDS']; 
    }

	public function categorieAction()
	{ 
		if ($this->getRequest()->getParam('c')) {
			$id = (int)$this->getRequest()->getParam('c');

			if ($id>0) {

				try {
                    if ($this->isSiteEbusiness) {
                        $this->ebusinessCategoryAction($id);
                    } 
                    if ($this->isSiteGallery) {
                        $this->gallerieCategoryAction($id);
                    } 
				} catch (Zend_Exception $e) {
					$this->log('Erreur pour trouver : '.$this->getRequest()->getRequestUri()." ".$e->getMessage(),'err');
					$this->_redirect('/');
				}
			} else {
				$this->_redirect('/');
			}
		}  else {
			$this->_redirect('/');
		}
	}
 
	public function rechercheAction () {
        $listFacetsSelected = array(); 
		try {
			$date = new Zend_Date();
			$date_start = $date->toString('YYYY-MM-dd HH:mm:ss');

			$filter = new Zend_Filter();
			$filter->addFilter(new Zend_Filter_StringTrim())
			->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringToLower())
			->addFilter(new Zend_Filter_CustomAlnum(array('allowwhitespace' => true)));

			$keyTemp = $filter->filter($this->getRequest()->getParam('key'));
			if ($keyTemp=='Rechercher') { $keyTemp = ''; }

			$title = 'Votre s�lection';
			$linksMenu = array();

			if (strlen($keyTemp) == 0) {
				$linksMenu[0]['NAVURL'] = '/produits/recherche';
				$linksMenu[0]['NAVNOM'] = $title;

			} else {
				$title .= ' : "'.$keyTemp.'"';
				$linksMenu[0]['NAVURL'] = '/produits/recherche?key='.$keyTemp;
				$linksMenu[0]['NAVNOM'] = 'Votre s�lection : '.$keyTemp;
			}

			$this->view->linksMenu = $linksMenu;
			$this->view->title = $title;
			$this->view->searchKey = $keyTemp;

			if (!empty($keyTemp) && strlen($keyTemp) >= 2 ) {
                
                $currentUser = array();
                try {
                    $auth = Zend_Auth::getInstance();
                    $auth->setStorage($this->getSessionStorage());
                    $storage = $auth->getStorage()->read();
                    if ($auth->hasIdentity() && isset($storage['user'])) {
                        $currentUser = $storage['user'];
                    }
                }
                catch (Zend_Exception $e) { }
 
                foreach ( $this->getRequest()->getParams() as $key => $value) {
                    if (Utils_Tool::startsWith($key, "facet_") ) {
                        $keys = explode("_", $key);
                        $idFacet = $keys[1]."_".$keys[2];
                        $listFacetsSelected[$idFacet] = $value; 
                    }
                }  
                
				$resultProduct = $this->computeProductListToShowFromEs($currentUser, $keyTemp, $listFacetsSelected);
                
                if (sizeof($resultProduct['PRODUCTS']) == 0) {
                    $listFacetsSelected = array(); 
					$this->log("Alternative search => Search word : ".$keyTemp,'info');
                    $product = new Product();
				    $productList = $product->getProductsBySearch($keyTemp);
                    
				    $resultProduct = $this->computeProductListToShow($productList, $currentUser); 
                }
                
                $currentFacets = array();
                if (isset($resultProduct['FACETS']) && !empty($resultProduct['FACETS'])) {
                    $currentFacets = $resultProduct['FACETS'];
                }
				$this->view->listSearchFacets =  $currentFacets;
				$this->view->listSearchPages =  $resultProduct['PRODUCTS'];
				$this->view->nbrProd = sizeof($resultProduct['PRODUCTS']);

				try {
					$date = new Zend_Date();
					$data = array (
								'VALUE' => $keyTemp,
								'DATEEND' => $date->toString('YYYY-MM-dd HH:mm:ss'),
								'IP' => $_SERVER['REMOTE_ADDR'],
								'DATESTART' => $date_start
					);

					$statsSearch = new StatsSearch();
					$statsSearch->insert($data);
				} catch (Zend_Exception $e) {
					$this->log($e->getMessage(),'err');
				}

			} else {
				$this->view->listSearchPages = array();
				$this->view->listSearchFacets = array();
				$this->view->nbrProd = 0;
			}

		} catch (Zend_Exception $e) {
			$this->log($e->getMessage(),'err');
		}
        
        if ($this->getRequest()->isXmlHttpRequest()) {
		    $layout = Zend_Layout::getMvcInstance();
		    $layout->disableLayout();
        }
	}


	private function getFTFDSByIdProd($id) {
		$childFTFDS = new ProductChildFTFDS();
		$selectFTFDS = "SELECT pcftfds.ID_CHILD ID_CHILD ,pcftfds.URL URL
							FROM productchild_ftfds AS pcftfds 
						LEFT JOIN productchild AS pc ON pcftfds.ID_CHILD = pc.ID
						WHERE pc.IDPRODUCT = ".$id;

		$listFTFDS = $childFTFDS->getAdapter()->fetchAll($selectFTFDS);
		return $listFTFDS;
	}

	public function monpaniercleanupAction() {
		$userNamespace = $this->getSession();

		if (!isset($userNamespace->myObjectCaddy)) {
			$userNamespace->myObjectCaddy = new Caddy();
		}

		$caddy = $userNamespace->myObjectCaddy;
		$caddy->cleanUp();
		$userNamespace->myObjectCaddy = $caddy;
        $userNamespace->myObjectCaddyFidelite = new CaddyFidelite();
        
		$this->_forward('/monpaniertype');
	}

	public function monpaniertypeeditAction() {
		try {
			$linksMenu[0]['NAVURL'] = '/mon-panier-type-actualiser.html';
			$linksMenu[0]['NAVNOM'] = 'Mon Panier type';
			$this->view->linksMenu = $linksMenu;

			$this->view->title = 'Int�grer vos produits directement � votre panier';

			if ($this->isConnected()) {
				if ($this->_request->isPost()) {
					$params = $this->_request->getPost();
					if (isset($params['Child'],$params['Quantity'], $params['CaddyType'])) {
						$listChild = $params['Child'];
						$listQuantity = $params['Quantity'];
						$listQuantityMin = $params['QuantityMin'];
						$listCaddyType =  $params['CaddyType'];
						$listSelectedOption =  $params['selectedOption'];

						for ($i = 0; $i < sizeof($listChild); $i++) {
							if (isset($listChild[$i],$listQuantity[$i])) {
								$idchild = $listChild[$i];
								$qte = intval($listQuantity[$i]);
								$quantityMin = intval($listQuantityMin[$i]);
								$idCaddyType = intval($listCaddyType[$i]);
								$selectedOption = $listSelectedOption[$i];

								if ($qte > 0) {
									$qte = $this->computeQtyMin($qte, $quantityMin);
									if ($idCaddyType > 0 ) {
										$this->ajouterArticleCaddyType($idCaddyType, $qte, $selectedOption);
									} else {
										$this->ajouterArticle($idchild,$qte, 'N', $selectedOption);
									}
								} else {
									if ($idCaddyType > 0 ) {
										$this->supprimerArticleCaddyType($idCaddyType, $selectedOption);
									} else {
										$this->supprimerArticle($idchild, $selectedOption);
									}
								}
							}
						}
					}
				}
			}
		} catch (Zend_Exception $e) { $this->log($e->getMessage(),'err'); }
		$this->_redirect('/mon-panier.html');
	}

}
?>PKi$H[��m�ֺֺcontrollers/UserController.phpnu&1i�<?php


class UserController extends Modules_Default_Controllers_MainController
{
	public function init() {
		$this->view->baseUrl = $this->getBaseUrl();
		$this->checkMaintenance();
	}
	public function indexAction() {

	}
    
    public function deletecaddyfidelitypointAction() {
        try {
            $auth = Zend_Auth::getInstance();
			$auth->setStorage($this->getSessionStorage());
			$storage = $auth->getStorage()->read();
			if ($auth->hasIdentity() && isset($storage['user'])) {
		        if ($this->getRequest()->getParam('id')) {          
                    $id = (int) $this->getRequest()->getParam('id');
                    if ($id > 0) {
                        $userNamespace = $this->getSession();
                        if (isset($userNamespace->myObjectCaddyFidelite)) { 
                            $caddyFidelite = $userNamespace->myObjectCaddyFidelite;
                            $caddyFidelite->removeItem($id);
                            $userNamespace->myObjectCaddyFidelite = $caddyFidelite;
                        }
                    }    
                }            
            }
        } catch (Zend_Exception $e) { $this->log($e->getMessage(), 'err'); }
        $this->_redirect('/mon-panier.html');
    }

	public function addcaddyfidelitypointAction() {

        try {
            $auth = Zend_Auth::getInstance();
			$auth->setStorage($this->getSessionStorage());
			$storage = $auth->getStorage()->read();
			if ($auth->hasIdentity() && isset($storage['user'])) {
		        if ($this->getRequest()->getParam('id')) {          
                    $id = (int) $this->getRequest()->getParam('id');
                    if ($id > 0) {
                        $carteFidelite = new CarteFidelite();
                        $isAvailable = $carteFidelite->isAnnonceAvailableForUser($storage['user']['id'], $id);
                        if ($isAvailable) {
                            $userNamespace = $this->getSession();
                            if (!isset($userNamespace->myObjectCaddyFidelite)) { $userNamespace->myObjectCaddyFidelite = new CaddyFidelite(); }
                            $caddyFidelite = $userNamespace->myObjectCaddyFidelite;
                            $caddyFidelite->addItem($id);
                            $userNamespace->myObjectCaddyFidelite = $caddyFidelite;
                        }
                    }    
                }            
            }
        } catch (Zend_Exception $e) { $this->log($e->getMessage(), 'err'); }
        $this->_redirect('/mon-panier.html');
	}
	private function computeFactureTVA($facture, $paysLivraison) {
		$fact = new Facture();
		$fact->computeFactureTVA($facture, $paysLivraison);
		return $facture;
	}

	public function commandeAction()
	{
		if ($this->getRequest()->getParam('ref')) {
			$auth = Zend_Auth::getInstance();
			$auth->setStorage($this->getSessionStorage());
			$storage = $auth->getStorage()->read();

			$linksMenu[0]['NAVURL'] = '/mon-compte.html';
			$linksMenu[0]['NAVNOM'] = 'Mon compte';
			$this->view->linksMenu = $linksMenu;

			$filter = new Zend_Filter();
			$filter->addFilter(new Zend_Filter_StringTrim())
			->addFilter(new Zend_Filter_StripTags());

			if ($auth->hasIdentity() && isset($storage['user'])) {

				$commande = new Command();
				$ref = $filter->filter($this->getRequest()->getParam('ref'));
				$isExist = $commande->fetchRow("REFERENCE = '".$ref."'");
				if ($isExist) {

					$resultCommande = $commande->findCommandByUserAndRef($storage['user']['id'],$ref );

					$myCommand = array();
					$myCommand['CADDY'] = array();
					$myCommand['CADDYFIDELITE'] = array();
					$i = 0;

                    $idCommand = 0;
					foreach ($resultCommande AS $row) {
						if ($i == 0) {
							$myCommand['REFERENCE'] = $row['REFERENCE'];
							$myCommand['ID'] = $row['ID'];
                            $idCommand = $row['ID'];

							$myCommand['PRIXTOTALTTC'] = sprintf("%.2f", $row['TOTALTTC']);
							$myCommand['PRIXTOTALHTFP'] = sprintf("%.2f", $row['TOTALHTFP']);
							$myCommand['PRIXFRAISPORTPOUR'] = $row['FRAISPORTPOUR'];
							$myCommand['PRIXFRAISPORT'] = sprintf("%.2f", $row['FRAISPORT']);
							$myCommand['PRIXTOTALHT'] = sprintf("%.2f", $row['TOTALHT']);
							$myCommand['PRIXTOTALHTHR'] = sprintf("%.2f", $row['TOTALHTHR']);
							$myCommand['PRIXREMISEEUR'] = sprintf("%.2f", $row['REMISEEUR']);
							$myCommand['DATESTART'] = $row['DATESTART'];

							$myCommand = $this->computeFactureTVA($myCommand, $row['LIVPAYS']);

							$myCommand['STATUT'] = $row['STATUT'];
							$myCommand['LIV_RAISONSOCIAL'] = $row['LIVRAISONSOCIAL'];
							$myCommand['LIV_ADRESSE'] = $row['LIVADRESSE'];
							$myCommand['LIV_CP'] = $row['LIVCP'];
							$myCommand['LIV_VILLE'] = $row['LIVVILLE'];
							$myCommand['LIV_PAYS'] = $row['LIVPAYS'];
							$myCommand['FACT_RAISONSOCIAL'] = $row['FACTRAISONSOCIAL'];
							$myCommand['FACT_ADRESSE'] = $row['FACTADRESSE'];
							$myCommand['FACT_CP'] = $row['FACTCP'];
							$myCommand['FACT_VILLE'] = $row['FACTVILLE'];
							$myCommand['FACT_PAYS'] = $row['FACTPAYS'];
							$myCommand['USER_NOM'] = $row['USERNOM'];
							$myCommand['USER_PRENOM'] = $row['USERPRENOM'];
							$myCommand['USER_TEL'] = $row['USERTEL'];
							$myCommand['USER_FAX'] = $row['USERFAX'];
							$myCommand['USER_NUMCOMPTE'] = $row['USERNUMCOMPTE'];
							$myCommand['USER_EMAIL'] = $row['USEREMAIL'];
							$myCommand['USER_MODEPAIEMENT'] = $row['USERMODEPAIEMENT'];
							$myCommand['LIV_NOM'] = $row['LIV_NOM'];
							$myCommand['CODEREDUCTION'] = $row['CODEREDUCTION'];
							$myCommand['USER_MODEPAIEMENT_TYPE'] = $row['USER_MODEPAIEMENT_TYPE'];
							$myCommand['USER_MODEPAIEMENT_LABEL'] = $row['USER_MODEPAIEMENT_LABEL'];
						}

						$myCommand['CADDY'][$i]['ID'] = $row['CHILDID'];
						$myCommand['CADDY'][$i]['REFERENCE'] = $row['CHILDREF'];
						$myCommand['CADDY'][$i]['DESIGNATION'] = $row['DESIGNATION'];
						$myCommand['CADDY'][$i]['isPROMO'] = $row['CHILDisPROMO'];
						$myCommand['CADDY'][$i]['isDEVIS'] = $row['CHILDisDEVIS'];
						$myCommand['CADDY'][$i]['PRIX'] = sprintf("%.2f", $row['CHILDPRIX']);
						$myCommand['CADDY'][$i]['QUANTITY'] = $row['CHILDQUANTITY'];
						$myCommand['CADDY'][$i]['PROMOPRIX'] = sprintf("%.2f", $row['CHILDPROMOPRIX']);
						$myCommand['CADDY'][$i]['PRIXTOTAL'] = sprintf("%.2f", $row['CHILDPRIXTOTAL']);
						$myCommand['CADDY'][$i]['REMISEPRIX'] = sprintf("%.2f", $row['CHILDPRIXREMISE']);
						$myCommand['CADDY'][$i]['REMISEPRIXTAUXE'] = sprintf("%.2f", $row['CHILDREMISEPRIXTAUXE']);
						$myCommand['CADDY'][$i]['REMISEPRIXTAUXP'] = $row['CHILDREMISEPRIXTAUXP'];
						$myCommand['CADDY'][$i]['PRODUCTID'] = $row['PRODUCTID'];
						$myCommand['CADDY'][$i]['PRODUCTNOM'] = $row['PRODUCTNOM'];
						$myCommand['CADDY'][$i]['STOCK'] = $row['STOCK'];
						$myCommand['CADDY'][$i]['SELECTEDOPTION'] = $row['SELECTEDOPTION'];
                        
						$myCommand['CADDY'][$i]['NAVPRODUCTNOM'] = $this->verifyNavigationString($row['PRODUCTNAVNOM'], $row['PRODUCTNOM'],'');
						$myCommand['CADDY'][$i]['NAVNOM_URLPARENTS'] = $row['NAVNOM_URLPARENTS'];
						$i++;
					}
                    
                    
					$i = 0;
					$resultCommandeFidelite = $commande->findCommandFideliteByUserAndRef($idCommand);
					foreach ($resultCommandeFidelite AS $row) {
						$myCommand['CADDYFIDELITE'][$i]['IDFIDELITE'] = $row['IDFIDELITE'];
						$myCommand['CADDYFIDELITE'][$i]['NOM'] = $row['NOM'];
						$myCommand['CADDYFIDELITE'][$i]['NBPOINT'] = $row['NBPOINT'];
                        $i++;
                    }
						
					if ($myCommand['STATUT'] == 1 || $myCommand['STATUT'] == 2 || $myCommand['STATUT'] == 3) {
						$this->view->title = 'Votre Facture';
					} else {
						$this->view->title = 'Votre Devis';
					}


					$this->view->facture = $myCommand;
					$this->render('facture');
				} else {
					$this->_redirect('/mon-compte.html');
				}
			} else {
				$this->_redirect('/connectez-vous.html');
			}
		} else {
			$this->_redirect('/mon-compte.html');
		}
	}
	public function newsletteraddAction()
	{
		if ($this->getRequest()->isPost()) {

			//filtres pour changer les chaines
			$filter = new Zend_Filter();
			$filter	->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim())
			->addFilter(new Zend_Filter_StringToLower());

			$validatorEmail = new Zend_Validate_EmailAddress();

			$email = $filter->filter($this->getRequest()->getPost('nltr_email'));
			$date = new Zend_Date();
			$dateins = $date->toString('YYYY-MM-dd HH:mm:ss');
			$code = md5($dateins.'_'.$email);

			if ($validatorEmail->isValid($email)) {
				$myNltr = new UserNewsletter();
				$isExist = $myNltr->fetchRow("EMAIL = '".$email."'");
				if(!$isExist) {
					$data = array(
						'EMAIL' => $email,
						'CODE' => $code,
						'DATEINS' => $dateins
					);
					$myNltr->insert($data);
					$this->view->messageSuccess =   "Vous �tes maintenant membre de notre <b>Newsletter</b>";//"Pour effacer : <a href='/user/newsletter/nltr_quit/$code'>$code</a>";
				} else {
					$this->view->messageError =  "L'email existe d�j�";
				}
			} else {
				$this->view->messageError =  "V�rifier votre email";
			}
		}
		$this->_forward('ajaxmessage','ajax');
	}
	public function newsletterAction()
	{
		if ($this->getRequest()->getParam('nltr_quit')) {
			//filtres pour changer les chaines
			$filter = new Zend_Filter();
			$filter	->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim());

			$code = $filter->filter($this->getRequest()->getParam('nltr_quit'));

			$myNltr = new UserNewsletter();
			$isExist = $myNltr->fetchRow("CODE = '".$code."'");

			if ($isExist) {
				$myNltr->delete("CODE = '".$code."'");
			}
			$this->view->nltrMessageError = "Vous avez �t� d�sinscrit";
		}
		$this->_forward('index','index');
	}

	public function deconnexionAction()
	{
		$auth = Zend_Auth::getInstance();
		$auth->setStorage($this->getSessionStorage())->clearIdentity();

		$this->view->user = null;
		$this->resetSession();

		$this->_redirect('/connectez-vous.html');
	}

	public function ajaxdeconnexionAction()
	{
		$auth = Zend_Auth::getInstance();
		$auth->setStorage($this->getSessionStorage())->clearIdentity();
		$this->view->user = null;
		$this->resetSession();

		$layout = Zend_Layout::getMvcInstance();
		$layout->disableLayout();
	}

	private function passgen() {
		$chaine ="mnoTUzS5678kVvwxy9WXYZRNCDEFrslq41GtuaHIJKpOPQA23LcdefghiBMbj0";
		srand((double)microtime()*1000000);
		for($i=0; $i<8; $i++){
			@$pass .= $chaine[rand()%strlen($chaine)];
		}
		return $pass;
	}


	public function passwordforgetAction() {
        try {
		    $this->view->title = 'Mot de passe oubli� ?';
		    $linksMenu[0]['NAVURL'] = '/connectez-vous.html';
		    $linksMenu[0]['NAVNOM'] = 'Identifiez-vous !';
		    $this->view->linksMenu = $linksMenu;
		    $this->view->showSlide = 1;

		    $filter = new Zend_Filter();
		    $filter	->addFilter(new Zend_Filter_StripTags())
		    ->addFilter(new Zend_Filter_StringTrim());

		    $validatorEmail = new Zend_Validate_EmailAddress();

		    if ($this->getRequest()->isPost()) {
			    $email = $filter->filter($this->getRequest()->getPost('emailpassword'));
			    if ($validatorEmail->isValid($email)) {
				    $user = new User();
				    $isExist = $user->fetchRow("EMAIL = '".$email."'");

				    if ($isExist) {

					    $newMDP = $this->passgen();
					    $mail = new Zend_Mail();

					    $mail->setBodyHtml("Cher(�re) ".$isExist['NOM']." ".$isExist['PRENOM'].",<br><br>
					    Nous avons bien re�u votre message nous demandant de vous aider � retrouver vos identifiants. <br>
					    Vous trouverez ci-dessous votre nouveau mot de passe. <br>
					    Si celui ci ne vous convient pas, vous pouvez le modifier � tout moment.<br><br>
					    Votre pseudo : ".$isExist['LOGIN']."<br>
					    Votre mot de passe : ".$newMDP."<br><br>
					    <a href='".$this->baseUrl_SiteCommerceUrl."/mon-compte.html'>Vous pouvez vous connecter ici</a><br><br>
					    ".$this->siteName);

					    $mail->setFrom($this->serviceClient_Mail, $this->siteName);
					    $mail->addTo($isExist['EMAIL'], $isExist['NOM'].' '.$isExist['PRENOM']);
					    $mail->setSubject($this->siteName.', votre mot de passe');
					    $mail->send();

					    $data = array('MDP' => md5($newMDP));
					    $user->update($data, 'ID = '.$isExist['ID']);

					    $this->view->messageSuccessPass = "Nous venons de vous envoyer par email votre nouveau mot de passe.";
				    } else {
				     $this->view->messageErrorPass = "V�rifier votre email";
				    }

			    } else {
				    $this->view->messageErrorPass = "V�rifier votre email";
			    }
		    }
		} catch (Zend_Exception $e) { $this->log($e->getMessage(), 'err'); }
		$this->render('connexion');
	}
	public function connexionAction() {
		$this->view->title = 'Identifiez-vous !';
		$linksMenu[0]['NAVURL'] = '/connectez-vous.html';
		$linksMenu[0]['NAVNOM'] = 'Identifiez-vous !';
		$this->view->linksMenu = $linksMenu;
		$this->view->showSlide = 1;

		if ($this->getRequest()->isPost()) {
			$filter = new Zend_Filter();
			$filter	->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim());

			$validator = new Zend_Validate();
			$validator -> addValidator(new Zend_Validate_NotEmpty())
			-> addValidator(new Zend_Validate_StringLength(4));

			$login = $filter->filter($this->getRequest()->getPost('connexion_login'));
			$mdp = $filter->filter($this->getRequest()->getPost('connexion_mdp'));

			$user = new User();


			if ($validator->isValid($login) && $validator->isValid($mdp)) {
				$messageSuccess = $this->connectMe($login, $mdp);
				if ($messageSuccess == "SUCCESS") {

					$this->retrievecommandbyuser();

					$currentAncre = $this->getRequest()->getPost('current_con_ancre');
					if (isset($currentAncre) && !empty($currentAncre)) {
						if ($currentAncre == "commandes") {
							$this->_redirect('/mon-compte.html#commandes');
						} else if ($currentAncre == "selection") {
							$this->_redirect('/mon-compte.html#selection');
						}
					} else {
						$userNamespace = $this->getSession();
						$myCaddyTemp = $userNamespace->myObjectCaddy;
						if (isset($myCaddyTemp->items) && !empty($myCaddyTemp->items)) {
							$this->_redirect('/mon-panier.html');
						} else {
							$this->_redirect('/');
						}
					}

				} else {
					$this->view->messageErrorConnect =  $messageSuccess;
					$this->view->user = null;

					$currentAncre = $this->getRequest()->getPost('current_con_ancre');
					if (isset($currentAncre) && !empty($currentAncre)) {
						$this->view->current_con_ancre = $currentAncre;
					}
				}
			} else {
				foreach ($validator->getErrors() as $errorCode) {
					$this->view->messageErrorConnect =  $this->getErrorValidator($errorCode);
				}
			}
		}
	}

	public function ajaxrefreshcaddytypeAction() {
		if ($this->isConnected()) {
			$user = $this->getStorageUser();
			if ($user['iscaddytype'] == 'Y') { $this->view->messageSuccess = 'SUCCESS';
			} else { $this->view->messageSuccess = 'ERROR'; }
		}
		$this->_forward('ajaxvalue','ajax');
	}

	public function ajaxrefreshcaddysizeAction() {
		$userNamespace = $this->getSession();
		$result = 'Aucun produit';
		if (isset($userNamespace->myObjectCaddy) && !empty($userNamespace->myObjectCaddy)) {
			$myCaddy = $userNamespace->myObjectCaddy;
			$size = $myCaddy->getTotalSize();
			if ($size > 1) {
				$result = $size.' PRODUITS';
			} else if ($size == 1) {
				$result = $size.' PRODUIT';
			}
		}
		$this->view->messageSuccess = $result;
		$this->_forward('ajaxvalue','ajax');
	}

	public function ajaxconnexionAction() {
		if ($this->getRequest()->isPost()) {
			$filter = new Zend_Filter();
			$filter	->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim());

			$validator = new Zend_Validate();
			$validator -> addValidator(new Zend_Validate_NotEmpty())
			-> addValidator(new Zend_Validate_StringLength(4));

			$login = $filter->filter($this->getRequest()->getPost('connexionleft_login'));
			$mdp = $filter->filter($this->getRequest()->getPost('connexionleft_mdp'));

			if ($validator->isValid($login) && $validator->isValid($mdp)) {
				$messageSuccess = $this->connectMe($login, $mdp);
				if ($messageSuccess == "SUCCESS") {

					$this->retrievecommandbyuser();

					$auth = Zend_Auth::getInstance();
					$auth->setStorage($this->getSessionStorage());
					$storage = $auth->getStorage()->read();
				} else {
					$this->view->messageError = $messageSuccess;
				}
			} else {
				foreach ($validator->getErrors() as $errorCode) {
					$this->view->messageError =  $this->getErrorValidator($errorCode);
				}
			}
		}
		$this->_forward('ajaxaccount','ajax');
	}

	public function moncompteAction() {
		$this->view->title = 'Mon Compte';
		if ($this->isConnected()) {

			$linksMenu[0]['NAVURL'] = '/mon-compte.html';
			$linksMenu[0]['NAVNOM'] = 'Mon compte';
			$this->view->linksMenu = $linksMenu;

			$user = $this->getStorageUser();

			$command = new Command();
			$this->view->myCommands = $command->findCommandsByUser($user['id']);
			$this->view->myDevis = $command->findDevisByUser($user['id']);
			$this->view->caddyType = $this->getCaddyTypeByUserConnected();
            
            $carteFidelite = new CarteFidelite();
			$this->view->carteFidelite = $carteFidelite->getInfosByUser($user['id']);
            
			$this->view->listfidelitegift = $carteFidelite->getAnnoncesByShow(1);
            
            
			$this->view->populateFormEdit = $user;

		}  else { $this->_redirect('/connectez-vous.html'); }
	}

	public function enregistrementAction() {
		$isAdd = false;

		$this->view->title = 'Cr�ation de votre compte';
		$linksMenu[0]['NAVURL'] = '/user/enregistrement';
		$linksMenu[0]['NAVNOM'] = ' Identifiez-vous !';
		$this->view->linksMenu = $linksMenu;

		$this->view->showSlide = 2;

		if ($this->getRequest()->isPost()) {

			$filter = new Zend_Filter();
			$filter	->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim());
			$filter2 = new Zend_Filter();
			$filter2->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim())
			->addFilter(new Zend_Filter_Digits());

			$filterMaj = new Zend_Filter();
			$filterMaj->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim())
			->addFilter(new Zend_Filter_StringToUpper());

			$validator = new Zend_Validate();
			$validator -> addValidator(new Zend_Validate_NotEmpty())
			-> addValidator(new Zend_Validate_StringLength(4));

			$validatorTel = new Zend_Validate();
			$validatorTel -> addValidator(new Zend_Validate_NotEmpty())
			-> addValidator(new Zend_Validate_StringLength(10));

			$validator2 = new Zend_Validate();
			$validator2 -> addValidator(new Zend_Validate_NotEmpty());

			$validatorEmail = new Zend_Validate_EmailAddress();

			$adduser_login = $filter->filter($this->getRequest()->getPost('adduser_login'));
			$adduser_mdp = $filter->filter($this->getRequest()->getPost('adduser_mdp'));
			$adduser_mdp2 = $filter->filter($this->getRequest()->getPost('adduser_mdp2'));

			$adduser_civility = $filter->filter($this->getRequest()->getPost('adduser_civility'));
            $adduser_nom = $filterMaj->filter($this->getRequest()->getPost('adduser_nom'));
			$adduser_prenom = $filter->filter($this->getRequest()->getPost('adduser_prenom'));
            
			$adduser_fct = $filter->filter($this->getRequest()->getPost('adduser_fct'));
			$adduser_tel = $filter2->filter($this->getRequest()->getPost('adduser_tel'));
			$adduser_fax = $filter2->filter($this->getRequest()->getPost('adduser_fax'));
			$adduser_email = $adduser_login;// $filter->filter($this->getRequest()->getPost('adduser_email'));


			$adduser_adresse = $filter->filter($this->getRequest()->getPost('adduser_adresse'));
			$adduser_cp = $filter->filter($this->getRequest()->getPost('adduser_cp'));
			$adduser_ville = $filter->filter($this->getRequest()->getPost('adduser_ville'));
			$adduser_pays = $filter->filter($this->getRequest()->getPost('adduser_pays'));
			$adduser_departement = $filter->filter($this->getRequest()->getPost('adduser_departement'));
			$adduser_region = $filter->filter($this->getRequest()->getPost('adduser_region'));
			$adduser_adressecomplete = $filter->filter($this->getRequest()->getPost('adduser_adressecomplete'));

			$adresse_type = $this->getRequest()->getPost('address_type');
			if ($adresse_type == 'new') {
				$adduser_adresse = $filter->filter($this->getRequest()->getPost('adduser_adresse'));
				$adduser_cp = $filter->filter($this->getRequest()->getPost('adduser_cp'));
				$adduser_ville = $filter->filter($this->getRequest()->getPost('adduser_ville'));
				$adduser_pays = $filter->filter($this->getRequest()->getPost('adduser_pays'));
				$adduser_departement = $filter->filter($this->getRequest()->getPost('adduser_departement'));
				$adduser_region = $filter->filter($this->getRequest()->getPost('adduser_region'));
				$adduser_adressecomplete = $filter->filter($this->getRequest()->getPost('adduser_adressecomplete'));
			} else {
				$adduser_adresse = $filter->filter($this->getRequest()->getPost('adduser_adresse_old'));
				$adduser_cp = $filter->filter($this->getRequest()->getPost('adduser_cp_old'));
				$adduser_ville = $filter->filter($this->getRequest()->getPost('adduser_ville_old'));
				$adduser_pays = $filter->filter($this->getRequest()->getPost('adduser_pays_old'));
				$adduser_departement = '';
				$adduser_region = '';
				$adduser_adressecomplete = $filter->filter($this->getRequest()->getPost('adduser_adresse_old'));
			}

			$adduser_raisonsocial = $filterMaj->filter($this->getRequest()->getPost('adduser_raisonsocial'));
			$adduser_siret = $filterMaj->filter($this->getRequest()->getPost('adduser_siret'));
			$adduser_numidfisc = $filterMaj->filter($this->getRequest()->getPost('adduser_numidfisc'));
			$adduser_codeape = $filterMaj->filter($this->getRequest()->getPost('adduser_codeape'));
			$adduser_sectactivite = $filterMaj->filter($this->getRequest()->getPost('adduser_sectactivite'));

			$adduser_comm = $filter->filter($this->getRequest()->getPost('adduser_comm'));

			$adduser_newsletter = $filter->filter($this->getRequest()->getPost('adduser_newsletter'));

			$typeUser = $filter->filter($this->getRequest()->getPost('adduser_typeuser'));

			$date = new Zend_Date();
			$dateinsc = $date->toString('YYYY-MM-dd HH:mm:ss');

			$data = array(
                                  'LOGIN' => $adduser_login, 
                                  'MDP' => md5($adduser_mdp), 
                                  'ROLE' => 0, 
                                  'NOM' => $adduser_nom, 
                                  'PRENOM' => $adduser_prenom,
                                  'CIVILITE' => $adduser_civility, 
                                  'FONCTION' => $adduser_fct, 
                                  'RAISONSOCIAL' => $adduser_raisonsocial, 
                                  'ADRESSE' => $adduser_adresse, 
                                  'CP' => $adduser_cp, 
                                  'VILLE' => $adduser_ville, 
                                  'DEPARTEMENT' => $adduser_departement, 
                                  'REGION' => $adduser_region, 
								  'ADRESSECOMPLETE' => $adduser_adressecomplete,
                                  'PAYS' => $adduser_pays, 
                                  'EMAIL' => $adduser_email, 
                                  'TEL' => $adduser_tel, 
                                  'FAX' => $adduser_fax, 
                                  'SIRET' => $adduser_siret, 
								  'NUMIDFISC' => $adduser_numidfisc,
                                  'CODEAPE' => $adduser_codeape, 
                                  'SECTACTIVITE' => $adduser_sectactivite, 
                                  'COMMENTAIRE' => $adduser_comm,  
                                  'TYPE' => $typeUser, 
                                  'DATEINSC' => $dateinsc);

			$isTypeOk = false;
			if ($validator2->isValid($typeUser)) {
				$isTypeOk = true;
			}

			$errorType = 0;
			if ($validator->isValid($adduser_mdp) && $validator->isValid($adduser_mdp2) &&
			$validator2->isValid($adduser_civility) &&
			$validator2->isValid($adduser_nom) && $validator2->isValid($adduser_adresse) &&
			$validator2->isValid($adduser_prenom) && $validator2->isValid($adduser_ville) &&
			$validator2->isValid($adduser_pays) &&
			$validatorEmail->isValid($adduser_login) && $validator2->isValid($adduser_cp)
			) {
				if ($isTypeOk) {
					if ($typeUser == "Professionnel") {
						if ($validator2->isValid($adduser_raisonsocial) &&
						$validator2->isValid($adduser_siret) &&
						$validator2->isValid($adduser_numidfisc) &&
						$validator2->isValid($adduser_codeape)) {

						} else {
							$errorType = 3;
							foreach ($validator2->getErrors() as $errorCode) {
								$this->view->messageErrorAddUser =  $this->getErrorValidator($errorCode);
							}
						}
					}
				} else {
					$errorType = 2;
					$this->view->messageErrorAddUser =  "Vous devez choisir entre Particulier et Professionnel. ";
				}
			} else {
				$errorType = 1;
				foreach ($validator->getErrors() as $errorCode) {
					$this->view->messageErrorAddUser =  $this->getErrorValidator($errorCode);
				}
				foreach ($validator2->getErrors() as $errorCode) {
					$this->view->messageErrorAddUser =  $this->getErrorValidator($errorCode);
				}
				foreach ($validatorEmail->getErrors() as $errorCode) {
					$this->view->messageErrorAddUser =  $this->getErrorValidator($errorCode);
				}
			}


			if ($errorType == 0) {
				if ($validatorTel->isValid($adduser_tel)) {
					if ($adduser_mdp2 == $adduser_mdp) {

						try {
							$user = new User();

							$isExistLogin = $user->fetchRow("LOGIN = '".$adduser_login."'");

							if (!$isExistLogin) {

								$isExistEmail = $user->fetchRow("EMAIL = '".$adduser_email."'");
								if (!$isExistEmail) {
									$isAdd = $user->insert($data);
									$this->log("Nouveau client : ".$adduser_email,'info');
									if ($adduser_newsletter) {
										$user_newsletter = new UserNewsletter();
										$code = md5($dateinsc.'_'.$adduser_email);
											
										$isExistNL = $user_newsletter->fetchRow("EMAIL = '".$adduser_email."'");

										if(!$isExistNL) {
											$dataNL = array(
						 	 					'EMAIL' => $adduser_email,
						 	 					'DATEINS' => $dateinsc,
						 	 					'CODE' => $code
											);
											$user_newsletter->insert($dataNL);
										}
									}
									$messageSuccess = $this->connectMe($adduser_login, $adduser_mdp);
									if ($messageSuccess != "SUCCESS") {
										$this->view->messageErrorAddUser = $messageSuccess;
									}

								} else {
									$this->view->messageErrorAddUser =  "L'email est d�j� utilis�.";
								}
							} else {
								$this->view->messageErrorAddUser =  "L'identifiant existe d�j�";
							}
						} catch (Zend_Exception $e) {
							$this->log($e->getMessage(),'err');
							$data['newsletter'] = $adduser_newsletter;
							$this->view->populateFormAdd = $data;
							$this->view->messageErrorAddUser =  "Une erreur est survenue, v�rifier vos informations.";
							$this->render('connexion');
						}
					} else {
						$this->view->messageErrorAddUser =  "V�rifier votre mot de passe";
					}
				} else {
					$this->view->messageErrorAddUser =  "V�rifier votre num�ro de t�l�phone";
				}
			}

			$data['newsletter'] = $adduser_newsletter;
			$this->view->populateFormAdd = $data;

		}
		if ($isAdd) {
			$currentAncre = $this->getRequest()->getPost('current_save_ancre');
			if (isset($currentAncre) && !empty($currentAncre)) {
				if ($currentAncre == "commandes") {
					$this->_redirect('/mon-compte.html#commandes');
				} else if ($currentAncre == "selection") {
					$this->_redirect('/mon-compte.html#selection');
				}
			} else {
				$userNamespace = $this->getSession();
				$myCaddyTemp = $userNamespace->myObjectCaddy;
				if (isset($myCaddyTemp->items) && !empty($myCaddyTemp->items)) {
					$this->_redirect('/mon-panier.html');
				} else {
					$this->_redirect('/');
				}
			}
		} else {
			$currentAncre = $this->getRequest()->getPost('current_save_ancre');
			if (isset($currentAncre) && !empty($currentAncre)) {
				$this->view->current_save_ancre = $currentAncre;
			}
			$this->render('connexion');
		}
	}

	public function actualiserAction() {

		$linksMenu[0]['NAVURL'] = '/mon-compte.html';
		$linksMenu[0]['NAVNOM'] = 'Mon compte';
		$this->view->linksMenu = $linksMenu;
		if ($this->getRequest()->isPost()) {

			$filter = new Zend_Filter();
			$filter	->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim());
			$filter2 = new Zend_Filter();
			$filter2->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim())
			->addFilter(new Zend_Filter_Digits());

			$filterMaj = new Zend_Filter();
			$filterMaj->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim())
			->addFilter(new Zend_Filter_StringToUpper());


			$validator = new Zend_Validate();
			$validator -> addValidator(new Zend_Validate_NotEmpty())
			-> addValidator(new Zend_Validate_StringLength(4));

			$validatorTel = new Zend_Validate();
			$validatorTel -> addValidator(new Zend_Validate_NotEmpty())
			-> addValidator(new Zend_Validate_StringLength(10));

			$validator2 = new Zend_Validate();
			$validator2 -> addValidator(new Zend_Validate_NotEmpty());


			$validatorEmail = new Zend_Validate_EmailAddress();

			$edituser_civility = $filter->filter($this->getRequest()->getPost('edituser_civility'));
			$edituser_nom = $filterMaj->filter($this->getRequest()->getPost('edituser_nom'));
			$edituser_prenom = $filter->filter($this->getRequest()->getPost('edituser_prenom'));
			$edituser_fct = $filter->filter($this->getRequest()->getPost('edituser_fct'));
			$edituser_tel = $filter2->filter($this->getRequest()->getPost('edituser_tel'));
			$edituser_fax = $filter2->filter($this->getRequest()->getPost('edituser_fax'));
			$edituser_email = $filter->filter($this->getRequest()->getPost('edituser_email'));

			$adresse_type = $this->getRequest()->getPost('address_type');
			if ($adresse_type == 'new') {
				$edituser_adresse = $filter->filter($this->getRequest()->getPost('edituser_adresse'));
				$edituser_cp = $filter->filter($this->getRequest()->getPost('edituser_cp'));
				$edituser_ville = $filter->filter($this->getRequest()->getPost('edituser_ville'));
				$edituser_pays = $filter->filter($this->getRequest()->getPost('edituser_pays'));
				$edituser_departement = $filter->filter($this->getRequest()->getPost('edituser_departement'));
				$edituser_region = $filter->filter($this->getRequest()->getPost('edituser_region'));
				$edituser_adressecomplete = $filter->filter($this->getRequest()->getPost('edituser_adressecomplete'));
			} else {
				$edituser_adresse = $filter->filter($this->getRequest()->getPost('edituser_adresse_old'));
				$edituser_cp = $filter->filter($this->getRequest()->getPost('edituser_cp_old'));
				$edituser_ville = $filter->filter($this->getRequest()->getPost('edituser_ville_old'));
				$edituser_pays = $filter->filter($this->getRequest()->getPost('edituser_pays_old'));
				$edituser_departement = '';
				$edituser_region = '';
				$edituser_adressecomplete = $filter->filter($this->getRequest()->getPost('edituser_adresse_old'));
			}

			$edituser_raisonsocial = $filterMaj->filter($this->getRequest()->getPost('edituser_raisonsocial'));
			$edituser_siret = $filterMaj->filter($this->getRequest()->getPost('edituser_siret'));
			$edituser_numidfisc = $filterMaj->filter($this->getRequest()->getPost('edituser_numidfisc'));
			$edituser_codeape = $filterMaj->filter($this->getRequest()->getPost('edituser_codeape'));
			$edituser_sectactivite = $filterMaj->filter($this->getRequest()->getPost('edituser_sectactivite'));

			$edituser_comm = $filter->filter($this->getRequest()->getPost('edituser_comm'));
			//$edituser_modepaiement = $filter->filter($this->getRequest()->getPost('edituser_modepaiement'));

			$typeUser = $filter->filter($this->getRequest()->getPost('edituser_typeuser'));


			$isTypeOk = false;
			if ($validator2->isValid($typeUser)) {
				$isTypeOk = true;
			}

			$errorType = 0;
			if ($validator2->isValid($edituser_civility) &&
			$validator2->isValid($edituser_nom) && $validator2->isValid($edituser_adresse) &&
			$validator2->isValid($edituser_prenom) && $validator2->isValid($edituser_ville) &&
			$validator2->isValid($edituser_pays) &&
			$validatorEmail->isValid($edituser_email)  && $validator2->isValid($edituser_cp)
			) {
				if ($isTypeOk) {
					if ($typeUser == "Professionnel") {
						if ($validator2->isValid($edituser_raisonsocial) &&
						$validator2->isValid($edituser_siret) &&
						$validator2->isValid($edituser_numidfisc) &&
						$validator2->isValid($edituser_codeape)) {

						} else {
							$errorType = 3;
							foreach ($validator2->getErrors() as $errorCode) {
								$this->view->messageErrorEditUser =  $this->getErrorValidator($errorCode);
							}
						}
					}
				} else {
					$errorType = 2;
					$this->view->messageErrorEditUser =  "Vous devez choisir entre Particulier et Professionnel. ";
				}
			} else {
				$errorType = 1;
					
				foreach ($validator->getErrors() as $errorCode) {
					$this->view->messageErrorEditUser =  $this->getErrorValidator($errorCode);
				}
				foreach ($validator2->getErrors() as $errorCode) {
					$this->view->messageErrorEditUser =  $this->getErrorValidator($errorCode);
				}
				foreach ($validatorEmail->getErrors() as $errorCode) {
					$this->view->messageErrorEditUser =  $this->getErrorValidator($errorCode);
				}
			}


			if ($errorType == 0) {
				if ($typeUser == "Particulier") {
					//$edituser_modepaiement = 1;
					$edituser_raisonsocial = "";
				}

				if ($validatorTel->isValid($edituser_tel)) {

					try {
						$user = new User();
						$auth = Zend_Auth::getInstance();
						$auth->setStorage($this->getSessionStorage());
						$storage = $auth->getStorage()->read();
						$isExistEmail = $user->fetchRow("EMAIL = '".$edituser_email."' AND ID <> ".$storage['user']['id']);
						/*
						 if($storage['user']['iscredit'] == 0 && ($edituser_modepaiement != 1 && $edituser_modepaiement != 2 && $edituser_modepaiement != 6) ) {
							$edituser_modepaiement = 1;
							}
							*/
						$data = array(
	                                  'ROLE' => 0, 
	                                  'NOM' => $edituser_nom, 
	                                  'PRENOM' => $edituser_prenom,
	                                  'CIVILITE' => $edituser_civility, 
	                                  'FONCTION' => $edituser_fct, 
	                                  'RAISONSOCIAL' => $edituser_raisonsocial, 
	                                  'ADRESSE' => $edituser_adresse, 
	                                  'CP' => $edituser_cp, 
	                                  'VILLE' => $edituser_ville, 
	                                  'PAYS' => $edituser_pays, 
	                                  'DEPARTEMENT' => $edituser_departement, 
	                                  'REGION' => $edituser_region, 
	                                  'ADRESSECOMPLETE' => $edituser_adressecomplete, 
	                                  'EMAIL' => $edituser_email, 
	                                  'TEL' => $edituser_tel, 
	                                  'FAX' => $edituser_fax, 
	                                  'SIRET' => $edituser_siret, 
									  'NUMIDFISC' => $edituser_numidfisc,
	                                  'CODEAPE' => $edituser_codeape, 
	                                  'SECTACTIVITE' => $edituser_sectactivite, 
	                                  'COMMENTAIRE' => $edituser_comm,  
	                                  'TYPE' => $typeUser);

						if (!$isExistEmail) {

							$isEdit = $user->update($data, 'ID = '.$storage['user']['id']);

							$myUser = $user->fetchRow("ID = ".$storage['user']['id']);

							$userAuth = $this->computUserInfo($myUser);

							$storage = $auth->getStorage();
							$storage->write(array( 'user' => $userAuth));

							$this->view->user = $userAuth;

							$this->view->messageSuccessEditUser =  "Vos informations ont �t� modifi�es.";
						} else {
							$this->view->messageErrorEditUser =  "L'email est d�j� utilis�";
						}
					} catch (Zend_Exception $e) {
						$this->view->messageErrorEditUser =  "Une erreur est survenue, v�rifier vos informations";
						$this->_forward('moncompte');
					}
				} else {
					$this->view->messageErrorEditUser =  "V�rifier votre num�ro de t�l�phone";
				}
			}
		}
		$this->_forward('moncompte');
	}

	public function modifierAction() {

		$linksMenu[0]['NAVURL'] = '/mon-compte.html';
		$linksMenu[0]['NAVNOM'] = 'Mon compte';
		$this->view->linksMenu = $linksMenu;
		if ($this->getRequest()->isPost()) {

			$filter = new Zend_Filter();
			$filter	->addFilter(new Zend_Filter_StripTags())
			->addFilter(new Zend_Filter_StringTrim());

			$validator = new Zend_Validate();
			$validator -> addValidator(new Zend_Validate_NotEmpty())
			-> addValidator(new Zend_Validate_StringLength(4));

			$validatorEmail = new Zend_Validate_EmailAddress();

			$edituser_login = $filter->filter($this->getRequest()->getPost('edituser_login'));
			$edituser_mdp = $filter->filter($this->getRequest()->getPost('edituser_mdp'));
			$edituser_mdp2 = $filter->filter($this->getRequest()->getPost('edituser_mdp2'));

			$data = array(
                   'LOGIN' => $edituser_login, 
                   'MDP' => md5($edituser_mdp));

			if (
			$validator->isValid($edituser_login) &&
			$validator->isValid($edituser_mdp) &&
			$validator->isValid($edituser_mdp2) &&
			$validatorEmail->isValid($edituser_login)
			) {
				if ($edituser_mdp2 == $edituser_mdp) {

					try {
						$user = new User();
							
						$auth = Zend_Auth::getInstance();
						$auth->setStorage($this->getSessionStorage());
						$storage = $auth->getStorage()->read();
							
						$isExistLogin = $user->fetchRow("LOGIN = '".$edituser_login."' AND ID <> ".$storage['user']['id']);

						if (!$isExistLogin) {
							$isEdit = $user->update($data,'ID = '.$storage['user']['id']);

							$messageResult = $this->connectMe($edituser_login,$edituser_mdp);

							if ($messageResult == "SUCCESS") {
								$auth = Zend_Auth::getInstance();
								$auth->setStorage($this->getSessionStorage());
								$storage = $auth->getStorage()->read();

								if ($auth->hasIdentity() && isset($storage['user'])) {
									$this->view->user = $storage['user'];
								}
							}
							$this->view->messageSuccessEditUser =  "Vos identifiants ont �t� modifi�s.";

						} else {
							$this->view->messageErrorEditUser =  "L'identifiant existe d�j�";
						}
					} catch (Zend_Exception $e) {
						$this->view->messageErrorEditUser =  "Une erreur est survenue, v�rifier vos informations.";
						$this->_forward('moncompte');
					}
				} else {
					$this->view->messageErrorEditUser =  "V�rifier votre mot de passe";
				}
			}  else {
				foreach ($validator->getErrors() as $errorCode) {
					$this->view->messageErrorEditUser =  $this->getErrorValidator($errorCode);
				}
				foreach ($validatorEmail->getErrors() as $errorCode) {
					$this->view->messageErrorEditUser =  $this->getErrorValidator($errorCode);
				}
			}

			$this->_forward('moncompte');

		}
	}



	public function retrievecommandbyrefAction() {
		$result = "ERROR";
		if ($this->getRequest()->isPost()) {
			try {
				$params = $this->getRequest()->getPost();
				$refCommand = $params["ref"];
				$auth = Zend_Auth::getInstance();
				$auth->setStorage($this->getSessionStorage());
				$storage = $auth->getStorage()->read();

				if ($auth->hasIdentity() && isset($storage['user']) &&
				isset($refCommand) && !empty($refCommand)) {

					$myCaddy = new Caddy();

					$command = new Command();
					$resultCommand = $command->findCommandCaddyRetrieve($storage['user']['id'],$refCommand );

					foreach ($resultCommand AS $row) {
						$item = new Item();

						$item->idChild = $row['CHILDID'];
						$item->qteChild = $row['CHILDQUANTITY'];
						$item->idProduit = $row['PRODUCTID'];
						$item->nom = $row['PRODUCTNOM'];
						$item->descshort = $row['DESCSHORT'];
						$item->navnom = $this->verifyNavigationString($row['PRODUCTNAVNOM'],$row['PRODUCTNOM'], '');
						$item->url = $row['URL'];
						$item->designation = $row['DESIGNATION'];
						$item->isAccessoire = 'N';
						$item->stock = $row['STOCK'];
						$item->selectedOption = $row['SELECTEDOPTION'];

						array_push($myCaddy->items, $item);
					}

					$userNamespace = $this->getSession();
					$userNamespace->myObjectCaddy = $myCaddy;
					$result = "SUCCESS";
				}
			} catch (Zend_Exception $e) {
				$this->log("Error retrievecommandbyref : ".$e->getMessage(),'err');
			}
		}
		$this->view->messageSuccess = $result;
		$this->_forward('ajaxvalue', 'ajax');
	}

	private function retrievecommandbyuser() {
		try {
			$auth = Zend_Auth::getInstance();
			$auth->setStorage($this->getSessionStorage());
			$storage = $auth->getStorage()->read();

			if ($auth->hasIdentity() && isset($storage['user'])) {
				$userNamespace = $this->getSession();
				if (isset($userNamespace->myObjectCaddy)) {
					$caddyTemp = $userNamespace->myObjectCaddy;
					if (!empty($caddyTemp->items)) { return false; }
				}
					
				$myCaddy = new Caddy();
				$myCaddy->getCaddyTemp($storage['user']['id']);
				$userNamespace->myObjectCaddy = $myCaddy;
			}
		} catch (Zend_Exception $e) {
			$this->log("Error retrievecommandbyuser : ".$e->getMessage(),'err');
		}
		return false;
	}


	public function ajaxdeletedevisAction() {
		$this->view->messageSuccess = "";
		$this->view->messageError = "";
		if ($this->isConnected()) {
			$user = $this->getStorageUser();
			$command = new Command();
			if($this->_request->getParam('id')) {
				$id = (int)$this->_request->getParam('id');
				if ($id > 0) {
					try {
						$result = $command->deleteDevisByUser($user['id'], $id);

						if ($result == 'OK') {
							$this->view->messageSuccess = "Le devis a �t� supprim�";
							$this->log("Le devis a �t� supprim�",'info');
						} else if ($result == 'USER') {
							$this->view->messageError = "Le devis n'a pas �t� supprim�, vous n'avez pas les droits.";
							$this->log("Le devis n'a pas �t� supprim�, vous n'avez pas les droits",'warn');
						} else {
							$this->view->messageError = "Le devis n'a pas �t� supprim�, vous n'avez pas les droits.";
							$this->log("Le devis n'a pas �t� supprim�, vous n'avez pas les droits",'err');
						}
					} catch (Zend_Exception $e) {
						$this->log($e->getMessage(),'err');
						$this->view->messageError = $e->getMessage();
					}
				}
			}
			$this->view->myDevis = $command->findDevisByUser($user['id']);
		}

		$layout = Zend_Layout::getMvcInstance();
		$layout->disableLayout();
		$this->render('ajaxlistdevis');
	}


	private function getCaddyTypeByUserConnected() {
		$caddyType = array();
		try {
			if ($this->isConnected()) {
				$user = $this->getStorageUser();
				if ($user['iscaddytype'] == 'Y') {
					$userNamespace = $this->getSession();
					if (!isset($userNamespace->myObjectCaddy)) { $userNamespace->myObjectCaddy = new Caddy(); }
					$caddy = $userNamespace->myObjectCaddy;
					$userCaddyType = new UserCaddyType();
					$caddyType = $userCaddyType->computeFrontCaddyTypeByUser($user, $caddy, true);
				}
			}
		} catch (Zend_Exception $e) {
			$this->log($e->getMessage(),'err');
		}
		return $caddyType;
	}

	public function sendmailtoconseillerAction() {
		try {
			$botDetector = new BotDetector();
			$isBot = $botDetector->isBot(getenv("HTTP_USER_AGENT"));
			if ($isBot != 'ERROR') {
				$this->_redirect($this->baseUrl_SiteCommerceUrl);
			}
				
			$linksMenu[0]['NAVURL'] = '/contacter-un-conseiller.html';
			$linksMenu[0]['NAVNOM'] = "Demande d'informations";
			$this->view->linksMenu = $linksMenu;

			if ($this->isConnected()) { $this->view->isConnected = true;
			} else { $this->view->isConnected = false; }

			if ($this->getRequest()->isPost()) {

				$filter = new Zend_Filter();
				$filter	->addFilter(new Zend_Filter_StripTags())
				->addFilter(new Zend_Filter_StringTrim());

				$validatorMessage = new Zend_Validate();
				$validatorMessage -> addValidator(new Zend_Validate_NotEmpty())
				-> addValidator(new Zend_Validate_StringLength(4));

				$validatorTel = new Zend_Validate();
				$validatorTel -> addValidator(new Zend_Validate_NotEmpty())
				-> addValidator(new Zend_Validate_StringLength(10));

				$validatorEmail = new Zend_Validate_EmailAddress();
					

				$params = $this->getRequest()->getPost();
				$message = $filter->filter($params['user_message']);
				$tel = "";
				$email = "";
				$messageNotConnected = "";
				$user = array();
				$fromEmail = $this->no_reply_Mail;
				$fromName = "Invit�";

				$isMailValid = false;

				if ($this->isConnected()) {
					$user = $this->getStorageUser();
					$fromEmail = $user['email'];
					$fromName = $user['prenom']." ".$user['prenom'];
					$tel = $user['tel'];
					$email = $user['email'];
					$isMailValid = true;
				} else {
					$messageNotConnected = 'Non connect�';
					$messageNotConnected .= '<br /><br />';
					$messageNotConnected .= 'IP : '.$_SERVER['REMOTE_ADDR'];
					$messageNotConnected .= '<br /><br />';

					$tel = $filter->filter($params['user_tel']);
					$email = $filter->filter($params['user_email']);
						
					if ($validatorTel->isValid($tel) || $validatorEmail->isValid($email)) {
						$isMailValid = true;
						if (!empty($email)) { $fromEmail = $email; $messageNotConnected .= 'Email : '.$email.'<br /><br />';}
						if (!empty($tel)) { $messageNotConnected .= 'T�l�phone : '.$tel.'<br /><br />'; }
					} else {
						$this->view->messageErrorAskConseiller = "Vous devez nous communiquer votre <b>email</b> ou votre <b>t�l�phone</b> pour prendre contact avec vous.";
					}
				}
				if ($isMailValid) {
					if ($validatorMessage->isValid($message)) {
						$isSend = $this->sendMailToCommercial($message, $messageNotConnected, $user, $fromEmail, $fromName);
						if ($isSend) {
							$this->view->messageSuccessAskConseiller = "Votre demande d'informations a �t� envoy�, un conseiller vous contactera au plus vite.";
						} else {
							$this->view->messageErrorAskConseiller = "Votre demande d'informations n'a pas �t� envoy�, contactez nous au ".$this->tel_contact.".";
						}
					} else {
						$this->view->messageErrorAskConseiller = "Votre message doit contenir au moins 4 caract�res.";
					}
				}
					
				$this->view->messageMail = $email;
				$this->view->messageTel = $tel;
				$this->view->messageBody = $message;
			}
		} catch (Zend_Exception $e) {
			$this->log($e->getMessage(),'err');
		}
	}

	private function sendMailToCommercial($message,$messageNotConnected, $user, $fromEmail, $fromName) {
		try {
			$view = new Zend_View();
			$view->addScriptPath('../application/modules/default/views/helpers/');
			$view->assign("message",$message);
			$view->assign("messageNotConnected",$messageNotConnected);
			$view->assign("user",$user);
				
			$body = $view->render("mail_user_to_commercial.phtml");
			$subject = "[INFORMATION] ".$fromName;
				
			$mail = new Zend_Mail();
			$mail->setBodyHtml($body);
			$mail->setFrom($fromEmail, $fromName);
			$mail->addTo($this->serviceClient_Mail);
			$mail->setSubject($subject);

			$mail->send();
			$this->log("L'email de demande d'informations a �t� envoy� par : ".$fromEmail.", ".$fromName,'info');
			return true;
		} catch (Zend_Exception $e) {
			$this->log($e->getMessage(),'err');
		}
		return false;
	}
}
?>PKi$H[�V���controllers/AuthController.phpnu&1i�<?php

class AuthController  extends Modules_Default_Controllers_MainController
{
	public function init()
	{
		$this->view->baseUrl = $this->getBaseUrl();
		$this->checkMaintenance();
	}
	public function indexAction()
	{

	}
	public function logoutAction()
	{
		Zend_Auth::getInstance()->clearIdentity();
		$this->view->user = null;
		$this->_redirect('/');
	}
	public function loginAction()
	{

		$this->view->message = '';
		if ($this->_request->isPost()) {

			// collect the data from the user
			Zend_Loader::loadClass('Zend_Filter_StripTags');
			$f = new Zend_Filter_StripTags();
			$username = $f->filter($this->_request->getPost('username'));
			$password = $f->filter($this->_request->getPost('password'));

			if (empty($username) || empty($password)) {

				$this->view->message = 'Les champs sont obligatoire.';
					
			} else {

				// setup Zend_Auth adapter for a database table
				Zend_Loader::loadClass('Zend_Auth_Adapter_DbTable');
				$dbAdapter = Zend_Registry::get('dbAdapter');

				$authAdapter = new Zend_Auth_Adapter_DbTable($dbAdapter,
															'user',
															'LOGIN',
															'MDP',
															'MD5(?) AND ROLE = "0"'); 
					
				// Set the input credential values to authenticate against
				$authAdapter->setIdentity($username);
				$authAdapter->setCredential($password);

				// do the authentication
				$auth = Zend_Auth::getInstance();
				$result = $auth->authenticate($authAdapter);
				//$result = $authAdapter->authenticate();
					
				if ($result->isValid()) {

					// success: store database row to auth's storage
					// system. (Not the password though!) //array('IDUSER', 'LOGIN'));
					$data = $authAdapter->getResultRowObject(null, 'mdp');

					$auth->getStorage()->write($data);

					$this->log("Login : ".$username,'info');
					$this->_redirect('/backoffice/');
				} else {
					// failure: clear database row from session
					$this->view->message = 'Les identifiants sont incorrects.';
				}
			}
		}
		$this->render();
	}
}

?>PKi$H[�����!controllers/ContactController.phpnu&1i�<?php

class ContactController  extends Modules_Default_Controllers_MainController
{

	public function init()
	{
		$this->view->baseUrl = $this->getBaseUrl();
	}

	public function indexAction()
	{
        $isAjaxResponse = false;
		if ($this->_request->isPost())
        {
	        $this->sendEmail();
            $isAjaxResponse = true;
        } else if (isset($_GET["required"]) || isset($_GET["type"]) || isset($_GET["value"])) {
	        $this->validateData();
            $isAjaxResponse = true;
        }

        if ($isAjaxResponse) {
		    $layout = Zend_Layout::getMvcInstance();
		    $layout->disableLayout();
		    $this->render('empty');
        }
	} 
    
    // Validates data and sending e-mail
    function sendEmail()
    {
        $filter = new Zend_Filter();
		$filter	->addFilter(new Zend_Filter_StripTags())
		->addFilter(new Zend_Filter_StringTrim());
        
		$validator = new Zend_Validate();
		$validator -> addValidator(new Zend_Validate_NotEmpty());

		$params = $this->_request->getPost();

	    $output = '';
	    $error = 0;
	    if(!$validator->isValid($params['name']))
	    {
		    $output .= '<p>Ins�rer votre nom</p>';
		    $error = 1;
	    }
        
        $validatorEmail = new Zend_Validate_EmailAddress();
        
	    if(!$validator->isValid($params['email']))
	    {
		    $output .= '<p>Ins�rer votre e-mail</p>';
		    $error = 1;
	    }
	    elseif(!$validatorEmail->isValid($params['email']))
	    {
		    $output .= '<p>Mauvais e-mail</p>';
		    $error = 1;
	    }
	
	    if(!$validator->isValid($params['message']))
	    {
		    $output .= '<p>Ins�rer votre message</p>';
		    $error = 1;
	    }
	    if($error)
	    {
		    echo '<blockquote class="error margin_1line margin_bottom_1line">'.utf8_encode($output).'</blockquote>';
	    }
	    else
	    {
			$this->trySendEmail($params, 0);
	    }
    }
	 function trySendEmail($params, $count) {
		 
		$to = $this->contact_Mail;
		$subject = "Message depuis la gallery";
		$mbody = "
		Emetteur:
		".$params['name']."
		".$params['email']."
		
		Message:
		".$params['message']."
		
		";
		try {  
			$mail = new Zend_Mail();
			$mail->setBodyHtml($mbody);
			$mail->setFrom(strip_tags($params['email']), $params['name']);
			$mail->addTo($to);
			$mail->setSubject($subject);
			$mail->send();

			echo '<blockquote class="success margin_1line margin_bottom_1line">'.utf8_encode('E-mail envoy�').'</blockquote>';
			   
		} catch (Zend_Exception $e) { 
			if ($count <= 3) {
				$count += 1; 
				$this->trySendEmail($params, $count);
			} else { 
				echo '<blockquote class="error margin_1line margin_bottom_1line">'.utf8_encode('Une erreur est survenue ... Veuillez r�essayer.').'</blockquote>';		
				$this->log($e->getMessage(),'err'); 
			}
		} 
	 }

    function validateData() {
	 
	    $required = $this->_request->getParam('required');
	    $type = $this->_request->getParam('type');
	    $value = $this->_request->getParam('value');

	    $this->validateRequired($required, $value, $type);

	    switch ($type) {
		    case 'number':
			    $this->validateNumber($value);
			    break;
		    case 'alphanum':
			    $this->validateAlphanum($value);
			    break;
		    case 'alpha':
			    $this->validateAlpha($value);
			    break;
		    case 'date':
			    $this->validateDate($value);
			    break;
		    case 'email':
			    $this->validateEmail($value);
			    break;
		    case 'url':
			    $this->validateUrl($value);
		    case 'all':
			    $this->validateAll($value);
			    break;
	    }
    }

    // The function to check if a field is required or not
    function validateRequired($required, $value, $type) {
	    if($required == "required") {

		    // Check if we got an empty value
		    if($value == "") {
			    echo "false";
			    exit();
		    }
	    } else {
		    if($value == "") {
			    echo "none";
			    exit();
		    }
	    }
    }

    // Validation of an Email Address
    function validateEmail($value) {
        $validatorEmail = new Zend_Validate_EmailAddress();        
	    if($validatorEmail->isValid($value)) {
		    echo "true";
	    } else {
		    echo "false";
	    }
    }

    // Validation of a date
    function validateDate($value) {
	    if(ereg("^(([1-9])|(0[1-9])|(1[0-2]))\/(([0-9])|([0-2][0-9])|(3[0-1]))\/(([0-9][0-9])|([1-2][0,9][0-9][0-9]))$", $value, $regs)) {
		    echo "true";
	    } else {
		    echo "false";
	    }
    }

    // Validation of an URL
    function validateUrl($value) {
	    if(ereg("^(http|https|ftp)\://[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?/?([a-zA-Z0-9\-\._\?\,\'/\\\+&amp;%\$#\=~])*[^\.\,\)\(\s]$", $value, $regs)) {
		    echo "true";
	    } else {
		    echo "false";
	    }
    }

    // Validation of characters
    function validateAlpha($value) {
	    if(ereg("^[a-zA-Z]+$", $value, $regs)) {
		    echo "true";
	    } else {
		    echo "false";
	    }
    }

    // Validation of characters and numbers
    function validateAlphanum($value) {
	    if(ereg("^[a-zA-Z0-9]+$", $value, $regs)) {
		    echo "true";
	    } else {
		    echo "false";
	    }
    }

    // Validation of numbers
    function validateNumber($value) {
	    if(ereg("^[0-9]+$", $value, $regs)) {
		    echo "true";
	    } else {
		    echo "false";
	    }
    }

    // Validation of numbers
    function validateAll($value) {
		    echo "true";
    }

}



?>PKi$H[=5_��-views/helpers/mail_ajaxdownloaddocument.phtmlnu&1i�PKi$H[�Waע�+�views/helpers/mail_user_to_commercial.phtmlnu&1i�PKi$H[�&�܋�'�views/helpers/mail_ajaxsendfriend.phtmlnu&1i�PKi$H[�v��\\%�	views/scripts/commande/paiement.phtmlnu&1i�PKi$H[b�X�??)�views/scripts/commande/facture_mail.phtmlnu&1i�PKi$H[�s��=�=$�Mviews/scripts/commande/facture.phtmlnu&1i�PKi$H[4ڋviews/scripts/commande/paypalipnvalidationtest.phtmlnu&1i�PKi$H[��iAA&>�views/scripts/commande/connexion.phtmlnu&1i�PKi$H[)�^bb"Ւviews/scripts/commande/devis.phtmlnu&1i�PKi$H[0��views/scripts/commande/paypalipnvalidation.phtmlnu&1i�PKi$H[��&�views/scripts/commande/livraison.phtmlnu&1i�PKi$H[��q�y"y"'K�views/scripts/commande/validation.phtmlnu&1i�PKi$H[�Ư>�)�)(�views/scripts/commande/factureedit.phtmlnu&1i�PKi$H[���e���views/scripts/index/index.phtmlnu&1i�PKi$H[!�	views/scripts/contact/empty.phtmlnu&1i�PKi$H[���@!%
views/scripts/contact/index.phtmlnu&1i�PKi$H[�e�l��*�views/scripts/produits/ajaxaddpanier.phtmlnu&1i�PKi$H[@���44*jviews/scripts/produits/monpaniertype.phtmlnu&1i�PKi$H[C�t%
%
(�"views/scripts/produits/nosproduits.phtmlnu&1i�PKi$H[ACEQ��1u-views/scripts/produits/ajaxdownloaddocument.phtmlnu&1i�PKi$H[�f���4�:views/scripts/produits/ajaxshowpromopricecaddy.phtmlnu&1i�PKi$H[�4=j"j"&@views/scripts/produits/categorie.phtmlnu&1i�PKi$H[ޔZ�7T7T#�bviews/scripts/produits/detail.phtmlnu&1i�PKi$H[��''2^�views/scripts/produits/ajaxshowchildqteprice.phtmlnu&1i�PKi$H[���N
N
.�views/scripts/produits/ajaxshowallchilds.phtmlnu&1i�PKi$H[�v�oo&��views/scripts/produits/monpanier.phtmlnu&1i�PKi$H[����$$+X�views/scripts/produits/ajaxannexelist.phtmlnu&1i�PKi$H[ܺP��
�
+��views/scripts/produits/ajaxsendfriend.phtmlnu&1i�PKi$H[��>��,0�views/scripts/produits/categorie_gamma.phtmlnu&1i�PKi$H[�ceRR't�views/scripts/produits/ajaxfacets.phtmlnu&1i�PKi$H[�q��&�views/scripts/produits/catalogue.phtmlnu&1i�PKi$H[
����4��views/scripts/produits/categorie_default_theme.phtmlnu&1i�PKi$H[8Tlq��/�views/scripts/produits/ajaxshowpromoprice.phtmlnu&1i�PKi$H[x��-views/scripts/produits/nosmarquesdetail.phtmlnu&1i�PKi$H[��9\\&views/scripts/produits/recherche.phtmlnu&1i�PKi$H[~$��4�4)�views/scripts/produits/detailmobile.phtmlnu&1i�PKi$H[�J����/�Rviews/scripts/produits/ajaxshowproductbox.phtmlnu&1i�PKi$H[f�	33'bviews/scripts/produits/nosmarques.phtmlnu&1i�PKi$H[��Lpp0�fviews/scripts/produits/ajaxshowallproducts.phtmlnu&1i�PKi$H[ց�4 bkviews/scripts/services/faq.phtmlnu&1i�PKi$H[0��''(�rviews/scripts/services/information.phtmlnu&1i�PKi$H[Y�X_��Gtviews/scripts/pagination.phtmlnu&1i�PKi$H[t�Gdd"<yviews/scripts/ajax/ajaxvalue.phtmlnu&1i�PKi$H[��``&�yviews/scripts/ajax/ajaxlivraison.phtmlnu&1i�PKi$H[a]���$�}views/scripts/ajax/ajaxaccount.phtmlnu&1i�PKi$H[W���n3n3"��views/scripts/ajax/ajaxcaddy.phtmlnu&1i�PKi$H[m�Qixx1`�views/scripts/ajax/caddyaccountrightnoslide.phtmlnu&1i�PKi$H["Yɋ��*9�views/scripts/ajax/caddyaccountright.phtmlnu&1i�PKi$H[rH����$��views/scripts/ajax/ajaxmessage.phtmlnu&1i�PKi$H[l�z��1��views/scripts/produitspromotion/nosproduits.phtmlnu&1i�PKi$H[�Z
(��/��views/scripts/produitspromotion/categorie.phtmlnu&1i�PKi$H[��Pk/	/	&�views/scripts/user/ajaxlistdevis.phtmlnu&1i�PKi$H[DZ�mTKTK"Xviews/scripts/user/connexion.phtmlnu&1i�PKi$H[��RYoo(�Vviews/scripts/user/ajaxlistcommand.phtmlnu&1i�PKi$H[�	�;�; �_views/scripts/user/facture.phtmlnu&1i�PKi$H[]s��WW+ěviews/scripts/user/ajaxcaddyselection.phtmlnu&1i�PKi$H[D:�==-v�views/scripts/user/sendmailtoconseiller.phtmlnu&1i�PKi$H[#�views/scripts/user/newsletter.phtmlnu&1i�PKi$H[c�views/scripts/user/index.phtmlnu&1i�PKi$H[	2rf��.��views/scripts/user/ajaxlistcartefidelite.phtmlnu&1i�PKi$H[�	ƃ�=�="��views/scripts/user/moncompte.phtmlnu&1i�PKi$H[;YP=aa��views/scripts/error/error.phtmlnu&1i�PKi$H[����#V�views/scripts/blog/actualites.phtmlnu&1i�PKi$H[��		W�views/scripts/blog/sujet.phtmlnu&1i�PKi$H[�h�Mjj)�views/scripts/blog/_blogShortDetail.phtmlnu&1i�PKi$H[A���;;$qviews/scripts/blog/_blogHeader.phtmlnu&1i�PKi$H[ �Ss��(views/scripts/blog/_blogCategories.phtmlnu&1i�PKi$H[wUI�U
views/scripts/blog/forum.phtmlnu&1i�PKi$H[f�Բ��"�views/scripts/blog/_blogSide.phtmlnu&1i�PKi$H[��'.��&�views/scripts/blog/_blogSubjects.phtmlnu&1i�PKi$H[ּG����views/scripts/blog/detail.phtmlnu&1i�PKi$H[��y��%,-views/scripts/blog/_blogAddPost.phtmlnu&1i�PKi$H[�~����0X4views/scripts/blog/_blogShortDetailComment.phtmlnu&1i�PKi$H[hپ

w9views/layouts/menuLayout.phtmlnu&1i�PKi$H[�9V���;views/layouts/layout.phtmlnu&1i�PKi$H[��r'���Xviews/layouts/rightLayout.phtmlnu&1i�PKi$H[%�[views/layouts/extraHeaderLayout.phtmlnu&1i�PKi$H[�����\views/layouts/leftLayout.phtmlnu&1i�PKi$H[���
AAmviews/layouts/breadcrumb.phtmlnu&1i�PKi$H[ ׃�

 �qviews/layouts/headerLayout.phtmlnu&1i�PKi$H[����
�
�~views/layouts/menuajax.phtmlnu&1i�PKi$H[#����!�views/layouts/extraLayout.phtmlnu&1i�PKi$H[o���Y
Y
 4�views/layouts/footerLayout.phtmlnu&1i�PKi$H[|�
f��%ݙviews/layouts/extraFooterLayout.phtmlnu&1i�PKi$H[��g��ˡcontrollers/BlogController.phpnu&1i�PKi$H[��\L	L	��controllers/ErrorController.phpnu&1i�PKi$H[R�n � �"R�controllers/CommandeController.phpnu&1i�PKi$H[4&?�Ăcontrollers/IndexController.phpnu&1i�PKi$H[7l\X��"(�controllers/ServicesController.phpnu&1i�PKi$H[�"~.��M�controllers/AjaxController.phpnu&1i�PKi$H[e���*�*+��controllers/ProduitspromotionController.phpnu&1i�PKi$H[���1L1L"ܾcontrollers/ProduitsController.phpnu&1i�PKi$H[��m�ֺֺ_controllers/UserController.phpnu&1i�PKi$H[�V�����controllers/AuthController.phpnu&1i�PKi$H[�����!��controllers/ContactController.phpnu&1i�PK__�%��