Current File : /home/karenpetzb/application/modules/backoffice/views/scripts/product/edit.phtml
<?php 
	$categoryListStringSelected = "";
	$categoryListString = "";
	
	$categoryDUP1ListStringSelected = ""; 
	$categoryDUP2ListStringSelected = ""; 
	$categoryDUP3ListStringSelected = ""; 
	
	$show = array();
	foreach($this->listallcategories as $row) { 
	 	for ($level=0 ; $level<11; $level++) { 
			if ((!isset($show['NOM'.$level]) || $show['NOM'.$level] != $row['NOM'.$level]) && $row['NOM'.$level] != null) {
			 	 
				$currentID = $row['ID'.$level];
				$currentLABEL = $row['NOM'.$level];
				
				$dataResult = computeSelectOption($currentID, $this->populateForm['IDCATEGORY'],$currentLABEL , $level);
				$categoryListStringSelected .= $dataResult['selected'];
				$categoryListString .= $dataResult['unselected'];
				
				$idCategoryDup1 = "";
				if (isset($this->populateForm['IDCATEGORY_DUP1'])){
					$idCategoryDup1 = $this->populateForm['IDCATEGORY_DUP1'];
				}				
				$dataResultDUP1 = computeSelectOption($currentID, $idCategoryDup1 ,$currentLABEL , $level);
							
				$idCategoryDup2 = "";
				if (isset($this->populateForm['IDCATEGORY_DUP2'])){
					$idCategoryDup2 = $this->populateForm['IDCATEGORY_DUP2'];
				}				
				$dataResultDUP2 = computeSelectOption($currentID, $idCategoryDup2,$currentLABEL , $level);
					
				$idCategoryDup3 = "";
				if (isset($this->populateForm['IDCATEGORY_DUP3'])){
					$idCategoryDup3 = $this->populateForm['IDCATEGORY_DUP3'];
				}	
				$dataResultDUP3 = computeSelectOption($currentID, $idCategoryDup3,$currentLABEL , $level);
				
				$categoryDUP1ListStringSelected .= $dataResultDUP1['selected'];
				$categoryDUP2ListStringSelected .= $dataResultDUP2['selected'];
				$categoryDUP3ListStringSelected .= $dataResultDUP3['selected'];
				
				$show['NOM'.$level] = $row['NOM'.$level];
			}
		 } 
	} 
	
	function computeSelectOption($id, $idtotest, $label, $level) {
				$categoryListStringSelected = "";
				$categoryListString = "";
				$categoryListStringSelected .= '<option value="'; 
				$categoryListStringSelected .= (int)$id;
				$categoryListStringSelected .= '"'; 
				
				$categoryListString .= '<option value="'; 
				$categoryListString .= (int)$id;
				$categoryListString .= '"'; 
				
				if ($id == $idtotest) { 
					$categoryListStringSelected .= ' selected="selected"';
				}
				$categoryListString .= '>';
				$categoryListStringSelected .= '>';
				 
 				for ($i=0 ; $i<$level; $i++) { 
					$categoryListString .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
					$categoryListStringSelected .= '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
				}
				$categoryListStringSelected .= $label; 
				$categoryListStringSelected .= '</option>'; 
				$categoryListString .= $label; 
				$categoryListString .= '</option>';
				return array('selected' => $categoryListStringSelected, 'unselected' => $categoryListString);
	}
	?>
	
<div class="table-box">	
	<div class="col-md-8 text-left">
    
		<a class="<?php if ($this->isProductOutOfStock) { echo 'btn btn-warning';} elseif (!$this->isProcuctEnable) { echo 'btn btn-danger';} else { echo 'btn btn-info'; } ?>" target="_blank" href="<?php echo $this->baseUrl; ?>/<?php echo Utils_Tool::getFormattedUrlProduct($this->populateForm['NAVNOM_URLPARENTS'], $this->populateForm['NAVNOM'], $this->populateForm['ID']); ?>">
			<i class="glyphicon glyphicon-eye-open"></i>&nbsp;<?php echo $this->populateForm['NOM']; ?>
		</a>
    <b>
    <?php if ($this->isProductOutOfStock) { 
        echo "Le produit est �puis�";
    } elseif (!$this->isProcuctEnable) { 
        echo "Le produit est d�sactiv�";
    }  ?>
    </b>
	</div>
	<div class="col-md-4 text-right">
		<button class="btn btn-danger btn-modal text-right" data-toggle="ajaxModalDelete" data-linkok="<?php echo $this->baseUrl; ?>/backoffice/product/del/id/<?php echo $this->populateForm['ID']; ?>" ><span class="glyphicon glyphicon-trash"></span> Supprimer</button>
	</div>
	<div class="col-md-12 no-space-side">
		<div class="tabs-section ">
			<ul class="nav nav-tabs" id="myTab">
				<li class="active"><a href="#product" data-toggle="tab">Produit</a></li>
				<li><a href="#items" data-toggle="tab">Items</a></li>
				<li><a href="#pricedeg" data-toggle="tab">Prix d�gressif</a></li>
				<li><a href="#referencement" data-toggle="tab">R�f�rencement</a></li>
				<li><a href="#accessoire" data-toggle="tab">Accessoires</a></li>
				<li><a href="#images" data-toggle="tab">Images</a></li>
				<li><a href="#docs" data-toggle="tab">Documents</a></li>
				<li><a href="#cats" data-toggle="tab">Cat�gories</a></li>
			</ul>
			<div class="tab-content">
				<div class="tab-pane active" id="product">
					<section class="boxpadding">
						<form action="<?php  echo $this->baseUrl; ?>/backoffice/product/editproduct#product" method="post">
							<table class="table">
								<?php echo $this->render("alert_tr.phtml"); ?>
								<tr >
									<td class="col-md-4"><label for="active"><span <?php if ($this->populateForm['isACTIVE'] == 1) { echo 'class="errorText"';} ?>>Statut</span></label></td>
									<td class="col-md-8">
										<input type="radio" class="bluecheckradios" name="active" id="active0" value="0" <?php if ($this->populateForm['isACTIVE'] == 0) { echo 'checked="checked"';} ?>><label for="active0">&nbsp;Actif</label> 
										<input type="radio" class="bluecheckradios" name="active" id="active1" value="1" <?php if ($this->populateForm['isACTIVE'] == 1) { echo 'checked="checked"';} ?>><label for="active1">&nbsp;Inactif</label>
									</td>
								</tr>
								<tr>
									<td><i class="glyphicon glyphicon-asterisk"></i>&nbsp;<label for="nom">Nom</label></td>
									<td ><input type="text" class="form-control"  size="60" name="nom" id="nom" value="<?php echo $this->populateForm['NOM'];?>"></td>
								</tr> 
								<tr>
									<td ><i class="glyphicon glyphicon-asterisk"></i>&nbsp;<label for="descshort">Description courte</label></td>
									<td class="desc-panel-detail-short"><textarea class="form-control"  rows="2" cols="50" name="descshort" id="descshort"><?php echo $this->populateForm['DESCRIPTIONSHORT'];?></textarea></td>
								</tr>
								<tr>
									<td><i class="glyphicon glyphicon-asterisk"></i>&nbsp;<label for="descshort">Description longue</label></td>
									<td class="desc-panel-detail"><textarea class="form-control"  rows="10" cols="40" name="desclong" id="desclong"><?php echo $this->populateForm['DESCRIPTIONLONG'];?></textarea></td>
								</tr>
								<tr>
									<td><label for="descshort">Description technique</label></td>
									<td class="desc-panel-detail"><textarea class="form-control" rows="10" cols="40" name="desctech" id="desctech"><?php echo $this->populateForm['DESCRIPTIONTECH'];?></textarea></td>
								</tr>
								<tr>
									<td><label for="descshort">Description norme</label></td>
									<td class="desc-panel-detail"><textarea class="form-control" rows="10" cols="40" name="descnorme" id="descnorme"><?php echo $this->populateForm['DESCRIPTIONNORME'];?></textarea></td>
								</tr>
								<tr>
									<td ><label for="prix">A partir de </label></td>
									<td>
										<div style="float: left;">
											<input type="checkbox" class="bluecheckradios" name="devisonproduct" id="devisonproduct" onchange="showOrHide('devisonproduct', 'productPriceLabel');" <?php if ($this->populateForm['isDEVIS'] == 0) { echo 'checked="checked"'; } ?>><label for="devisonproduct">sur devis</label>
										</div>
										<div style="float: left;margin-left: 30px" id="productPriceLabel">
											<input type="hidden" name="prix" id="prix" value="<?php echo $this->populateForm['PRIXLOWEST'];?>">
											
											<?php echo "Prix calcul� : ".$this->populateForm['PRIXLOWEST']; ?><b>&nbsp;&#8364;</b>
										</div>
									</td>
								</tr>
								<tr >
									<td><label for="datePromoProduct">Date de la Promotion (Promotion 3)</label></td>
									<td>
										<input type="text" class="form-control" readonly="readonly" name="datePromoProduct" id="datePromoProduct" value="<?php echo $this->populateForm['DATEPROMO']; ?>" maxlength="10" />
										<input type="hidden"  name="sd" id="datePromoProductField" value="<?php echo $this->populateForm['DATEPROMO']; ?>" maxlength="10" />
									
									</td>
								</tr>
								<tr >
									<td><label for="idcategory">Cat�gorie</label></td>
									<td>
									
										<select class="form-control"  name="idcategory" id="idcategory">
											<?php  echo $categoryListStringSelected;?>
										</select>
									</td>
								</tr>
								<tr>
									<td><label for="stock">Disponibilit�</label></td>
									<td>
										<select class="form-control" name="stock" id="stock">
											<option value="1" <?php if ($this->populateForm['STOCK'] == 1) { echo 'selected="selected"';} ?> >Disponible</option>
											<option value="2" <?php if ($this->populateForm['STOCK'] == 2) { echo 'selected="selected"';} ?> >Disponible sous 8 jours</option>
											<option value="3" <?php if ($this->populateForm['STOCK'] == 3) { echo 'selected="selected"';} ?> >Nous contacter</option>
											<option value="4" <?php if ($this->populateForm['STOCK'] == 4) { echo 'selected="selected"';} ?> >�puis�</option>
										</select>
									</td>
								</tr>
								<tr >
									<td><label for="idbrend">Marque</label></td>
									<td>
										<select class="form-control" name="idbrend" id="idbrend">
											<option value="0">Aucun</option>
											<?php foreach($this->listbrend as $row) { 
												?>
											<option value="<?php echo $this->escape($row['ID']); ?>" <?php if ($row['ID'] == $this->populateForm['IDBREND']) { echo 'selected="selected"';}?> >
												<?php echo $this->escape($row['BREND']); ?>
											</option>
											<?php } ?>
										</select>
										<div class="col-md-12">
											<div class="col-md-3 no-space-top">Afficher la marque ?</div>
											<div class="col-md-9 no-space-top">
												<input type="radio" class="bluecheckradios" value="0" name="showbrend" id="showbrend0" <?php if ($this->populateForm['isSHOWBREND'] == 0) { echo 'checked="checked"';} ?>><label for="showbrend0">&nbsp;Oui</label>
												<input type="radio" class="bluecheckradios" value="1" name="showbrend" id="showbrend1" <?php if ($this->populateForm['isSHOWBREND'] == 1) { echo 'checked="checked"';} ?>><label for="showbrend1">&nbsp;Non</label>
											</div>
										</div>	
									</td>
								</tr>
                <tr>
                  <td>
                    <label for="boostedhome">Mise en avant</label>
                  </td>
                  <td>
                    <input type="text" class="form-control" name="boostedhome" value="<?php echo $this->populateForm['BOOSTED_HOME'];?>" placeholder="Affichage sur la page d'accueil (0 = Annulation)" />
                  </td>
                </tr>
                <tr>
                  <td>
                    <label for="boostedhome">Meilleure vente</label>
                  </td>
                  <td>
                    <input type="text" class="form-control" name="boostedbestseller" value="<?php echo $this->populateForm['BOOSTED_BESTSELLER'];?>" placeholder="Score de meilleure vente" />
                  </td>
                </tr>
								<tr>
									<td colspan="2" class="text-center">
										<input type="hidden" name="id" id="id" value="<?php echo $this->populateForm['ID'];?>" />
										<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-edit"></i>&nbsp;Modifier</button>
									</td>
								</tr>
							</table>
						</form> 
					</section>
				</div>
				<div class="tab-pane" id="items">
					<section class="boxpadding">
						<table class="table">
							<?php echo $this->render("alert_tr.phtml"); ?>
								<tr >
									<td><h5>Caract�ristiques</h5><i>D�tail de produits</i></td>
									<td>
										<form action="<?php echo $this->baseUrl; ?>/backoffice/product/addproductoption#items" method="post">
										<div class="col-md-12  no-space-top">
											<div class="col-md-8 no-space-top">
												<select name="idoption" id="idoption" class="form-control">
													<?php foreach($this->listoption as $row) { ?>
													<option value="<?php echo $this->escape($row['ID']); ?>" > 
														<?php echo $this->escape($row['NOM']); ?>
													</option>
													<?php } ?>
												</select>
											</div>
											<div class="col-md-4  no-space-top">	
												<input type="hidden" name="id" value="<?php echo $this->populateForm['ID'];?>" />	
												<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-plus"></i>&nbsp;Ajouter</button>
											</div>	
										</div>
										</form>	
									</td>
								</tr>
								<tr >
									<td colspan="2" >
										<?php foreach($this->listproductoption as $row) { ?>
											<label><?php echo $this->escape($row['NOMOPTION']); ?></label>
											<button class="btn btn-danger btn-modal" data-toggle="ajaxModalDelete" data-linkok="<?php echo $this->baseUrl; ?>/backoffice/product/delproductoption/idopt/<?php echo $this->escape($row['IDOPTION']);?>/id/<?php echo $this->populateForm['ID'];?>#items" ><span class="glyphicon glyphicon-resize-full"></span> D�lier</button>
										<?php } ?>
									</td>
								</tr>
								<tr >
									<td><h5>Caract�ristique</h5><i>S�lectionnable</i></td> 
									<td>
										<?php if ($this->populateForm['ONSELECT_IDOPTION'] > 0) {  
												$optionList = $this->populateForm['ONSELECT_OPTION'];?>
												<div class="col-md-12  no-space-top">
													<div class="col-md-4  no-space-top"><?php echo $optionList->name; ?></div>
													<div class="col-md-4  no-space-top"><?php echo $optionList->valuesHTML(); ?></div>
													<div class="col-md-4  no-space-top"><button class="btn btn-danger btn-modal" data-toggle="ajaxModalDelete" data-linkok="<?php echo $this->baseUrl; ?>/backoffice/product/delcaracteristiquelist/id/<?php echo $this->populateForm['ID'];?>#items" ><span class="glyphicon glyphicon-resize-full"></span> D�lier</button></div>
												</div>
												
										<?php  } else { 
										 if (isset($this->listChild) && !empty($this->listChild)) { ?>
											<form action="<?php echo $this->baseUrl; ?>/backoffice/product/addcaracteristiquelist#items" method="post">											
												<div class="col-md-12  no-space-top">
													<div class="col-md-8  no-space-top">
														<select name="idoption" class="form-control">
															<?php foreach($this->optionsbylist as $optionList) { ?>
																<option value="<?php echo $optionList->id;?>">
																	<?php 
																	$values = explode("::", $optionList->valuesString);
																	$result = "";
																	foreach ($values as $value) {
																		if (empty($result))  {
																			$result .= $value;
																		} else {
																			$result .= ", ".$value;
																		}
																	}
																	echo $optionList->name." (".$result.")";
																	?>
																</option>
															<?php } ?>
														</select>
													</div>
													<div class="col-md-4  no-space-top">
														<input type="hidden" name="id" value="<?php echo $this->populateForm['ID'];?>" />
														<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-plus"></i>&nbsp;Ajouter</button>
													</div>
												</div>
											</form>
										<?php }} ?>
									</td>
								</tr>
								<tr >
									<td colspan="2" >
										<form action="<?php echo $this->baseUrl; ?>/backoffice/product/addchilds#items" method="post">
											<div class="col-md-12 no-space">
												<h5>Ajouter des r�f�rences</h5>
												<input type="hidden" name="id" value="<?php echo $this->populateForm['ID'];?>" />
												<div class="invoice-box">													
													<?php for ($index = 0; $index < 2; $index++) { ?>
													<input type="hidden" value="0" name="<?php echo $index."etatstock";  ?>" />
													<input type="hidden" value="0" name="<?php echo $index."poids";  ?>" />
													<input type="hidden" value="0" name="<?php echo $index."imagePromo";  ?>" />
													<div class="col-md-6 no-space-top">
														<div class="invoice-content">
															<div class="col-md-12 no-space">
																<table class="table ">
					                                                <tbody>
						                                                <tr>
						                                                    <td class="meta-head"><i class="glyphicon glyphicon-asterisk"></i>&nbsp;D�signation</td>
						                                                    <td><input class="form-control" type="text"  name="<?php echo $index."designation";  ?>" id="<?php echo $index."designation";  ?>"  value="<?php if (isset($this->populateChild[$index.'DESIGNATION'])) { echo $this->populateChild[$index.'DESIGNATION']; } ?>" /></td>
						                                                </tr>
						                                            </tbody>
					                                            </table>
															</div>
															<div class="col-md-6 no-space">
																<table class="table table-left no-border-top">
					                                                <tbody>
						                                                <tr>
						                                                    <td class="meta-head"><i class="glyphicon glyphicon-asterisk"></i>&nbsp;R�f�rence</td>
						                                                    <td><input class="form-control" type="text" name="<?php echo $index."reference";  ?>" id="<?php echo $index."reference";  ?>" value="<?php if (isset($this->populateChild[$index.'REFERENCE'])) { echo $this->populateChild[$index.'REFERENCE']; }?>" /></td>
						                                                </tr>
						                                                <tr>
						                                                    <td class="meta-head"><i class="glyphicon glyphicon-asterisk"></i>&nbsp;Prix</td>
						                                                    <td><input class="form-control"  type="text" name="<?php echo $index."prixNormal";  ?>" id="<?php echo $index."prixNormal";  ?>" value="<?php if (isset($this->populateChild[$index.'PRIX'])) { echo $this->populateChild[$index.'PRIX']; } ?>" /></td>
						                                                </tr>
						                                                <tr>
						                                                    <td class="meta-head">Sur devis ?</td>
						                                                    <td class="text-center"><input type="checkbox" class="bluecheckradios" name="<?php echo $index."devisprice";  ?>" id="<?php echo $index."devisprice";  ?>" /></td>
						                                                </tr>
						                                                <tr>
						                                                    <td class="meta-head">Quantit� minimum</td>
						                                                    <td><input class="form-control" type="text"  name="<?php echo $index."quantiteMin";  ?>" id = "<?php echo $index."quantiteMin";  ?>" value="<?php if (isset($this->populateChild[$index.'QUANTITYMIN'])) { echo $this->populateChild[$index.'QUANTITYMIN']; } ?>" /></td>
						                                                </tr>
						                                            </tbody>
					                                            </table>
															</div>
															<div class="col-md-6 no-space">
					                                            <table class="table table-right no-border-top">
					                                                <tbody>
																		<?php 
																		$listOption = array();
																		$i = 0;
																		foreach($this->listproductoption as $row) { 
																			$listOption[$i] = $this->escape($row['IDOPTION']);
																			$i++; ?>
						                                                <tr>
						                                                    <td class="meta-head"><?php echo $this->escape($row['NOMOPTION']); ?></td>
						                                                    <td><input class="form-control" type="text" name="<?php echo $index."option".$row['IDOPTION']; ?>" id="<?php echo $index."option".$row['IDOPTION']; ?>" value=""></td>
						                                                </tr>
																		<?php } ?>																		
						                                            </tbody>
					                                            </table>
				                                            </div>
				                                        </div>
			                                        </div>
			                                        <?php } ?>
	                                        	</div>
											</div>
											<div class="col-md-12 text-center col-margin-15">
												<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-plus"></i>&nbsp;Ajouter</button>
												<input type="hidden" name="listOption"  value='<?php echo serialize($listOption);?>'>
											</div>
										</form>	
									</td>
								</tr>
								<?php if (isset($this->listChild) && !empty($this->listChild)) { ?>
								<tr>
									<td colspan="2">
										<form action="<?php echo $this->baseUrl; ?>/backoffice/product/editchilds#items" method="post">
											<input type="hidden" name="id" value="<?php echo $this->populateForm['ID'];?>" />
											<div class="col-md-12 no-space">
												<h5>Modifier les r�f�rences</h5>
												<div class="invoice-box">
													<?php  $index = 0;
													foreach($this->listChild as $row) { ?>	
													<input type="hidden" name="<?php echo $index."idchild"; ?>" id="<?php echo $index."idchild"; ?>" value="<?php echo $this->escape($row['ID']);?>">														
													<input type="hidden" value="0" name="<?php echo $index."etatstock";  ?>" />												
													<input type="hidden" value="0" name="<?php echo $index."poids";  ?>" />
																			
													<div class="col-md-6 no-space-top">
														<div class="invoice-content">
															<div class="col-md-12 no-space">
																<table class="table ">
					                          <tbody>
						                          <tr>
						                              <td class="meta-head"><i class="glyphicon glyphicon-asterisk"></i>&nbsp;D�signation</td>
						                              <td><input class="form-control" type="text"  name="<?php echo $index."designation";  ?>"  value="<?php echo $row['DESIGNATION'];  ?>" /></td>
						                          </tr>
						                      </tbody>
					                      </table>
															</div>
															<div class="col-md-6 no-space">
																<table class="table table-left no-border-top">
					                            <tbody>
						                            <tr>
						                                <td class="meta-head"><i class="glyphicon glyphicon-asterisk"></i>&nbsp;R�f�rence</td>
						                                <td><input class="form-control" type="text" name="<?php echo $index."reference"; ?>" id="<?php echo $index."reference"; ?>" value="<?php echo $this->escape($row['REFERENCE']);?>"></td>
						                            </tr>
						                            <tr>
						                                <td class="meta-head"><i class="glyphicon glyphicon-asterisk"></i>&nbsp;Prix</td>
						                                <td><input class="form-control" type="text" name="<?php echo $index."prixNormal"; ?>" id="<?php echo $index."prixNormal"; ?>" value="<?php echo $this->escape($row['PRIX']);?>"></td>
						                            </tr>
						                            <tr>
						                                <td class="meta-head">Sur devis ?</td>
						                                <td class="text-center"><input type="checkbox" class="bluecheckradios" name="<?php echo $index."devisprice"; ?>" id="<?php echo $index."devisprice"; ?>" <?php if ($row['isDEVIS'] == 0) { echo 'checked="checked"'; } ?> ></td>
						                            </tr>
						                            <tr>
						                                <td class="meta-head">Quantit� minimum</td>
						                                <td><input class="form-control" type="text" size="5" name="<?php echo $index."quantiteMin"; ?>" id = "<?php echo $index."quantiteMin"; ?>" value="<?php echo $this->escape($row['QUANTITYMIN']);?>" ></td>
						                            </tr>
						                            <tr>
						                                <td class="meta-head">Franco annulation</td>
						                                <td class="text-center"><input type="checkbox" class="bluecheckradios" name="<?php echo $index."francodenied"; ?>" id="<?php echo $index."francodenied"; ?>" <?php if ($row['isFRANCODENIED'] == 0) { echo 'checked="checked"'; } ?> ></td>
						                            </tr>
						                            <tr>
						                                <td class="meta-head">Image de la promo</td>
						                                <td><input class="form-control" type="text" size="2" name="<?php echo $index."imagePromo"; ?>" id = "<?php echo $index."imagePromo"; ?>" value="<?php echo $this->escape($row['IMAGEPROMO']);?>" ></td>
						                            </tr>
						                            <tr>
						                                <td class="meta-head">Points de fid�lit�</td>
						                                <td><input class="form-control" type="text" size="2" name="<?php echo $index."pointFidelite"; ?>" id = "<?php echo $index."pointFidelite"; ?>" value="<?php echo $this->escape($row['POINTFIDELITE']);?>" ></td>
						                            </tr>
						                        </tbody>
					                        </table>
															</div>
															<div class="col-md-6 no-space">
					                      <table class="table table-right no-border-top">
					                          <tbody>
									                    <?php  foreach($this->listproductoption as $option) {  ?>
						                          <tr>
						                              <td class="meta-head"><?php echo $this->escape($option['NOMOPTION']); ?></td>
						                              <td><input class="form-control" type="text" size="10" name="<?php echo $index."option".$option['IDOPTION']; ?>" id="<?php echo $index."option".$option['IDOPTION']; ?>" value="<?php if (isset($row['OPTION_VALUE_'.$option['IDOPTION']])) {echo $this->escape($row['OPTION_VALUE_'.$option['IDOPTION']]); } ?>"></td>
						                          </tr>
									                    <?php } ?>																		
						                      </tbody>
					                      </table>
				                      </div>
				                      <div class="col-md-12 text-center col-margin-15" >
				                        <button class="btn btn-danger btn-modal" data-toggle="ajaxModalDelete" data-linkok="<?php echo $this->baseUrl; ?>/backoffice/product/delchild/idchild/<?php echo $this->escape($row['ID']); ?>/id/<?php echo $this->populateForm['ID'];?>#items" ><span class="glyphicon glyphicon-trash"></span> Supprimer</button>
							                  <button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-edit"></i>&nbsp;Modifier</button>
		                          </div>
				                    </div>
			                    </div>
			                    <?php $index++; } ?>
		                        <div class="col-md-12 text-center" >
					                    <input type="hidden" name="listOption"  value='<?php echo serialize($listOption);?>'>
					                    <input type="hidden" name="nbRows"  value='<?php echo $index;?>'>
				                    </div>
	                      </div>
											</div>
										</form>
									</td>
								</tr>
								<?php } ?>
							</table> 
					</section>
				</div>
				<div class="tab-pane" id="pricedeg">
					<section class="boxpadding">
						<table class="table">
							<?php echo $this->render("alert_tr.phtml"); ?>
							<tr class="nostriped"> 
								<td >
									<form action="<?php echo $this->baseUrl; ?>/backoffice/product/editchildqteprixactivation#pricedeg" method="post">
										<div class="col-md-2 no-space-top"><label for="activateItemPrix">Activer les prix d�gr�ssif</label></div>
										<div class="col-md-1 no-space-top"><input type="checkbox" class="bluecheckradios" id="activateItemPrix"  name="activateItemPrix" <?php if ($this->populateForm['isQTEPRIXACTIVE']) { echo 'checked="checked"';} ?> ></div>
										<div class="col-md-8 no-space-top text-left">
											<input type="hidden" name="id" value="<?php echo $this->populateForm['ID'];?>" />
											<button class="btn btn-success" type="submit" ><i class="glyphicon glyphicon-edit"></i>&nbsp;Modifier</button>
										</div>
									</form>
								</td>
							</tr> 
							<?php if (isset($this->listChild) && !empty($this->listChild)) { ?>
							<tr class="nostriped">
								<td  >
									<form action="<?php echo $this->baseUrl; ?>/backoffice/product/addchildqteprix#pricedeg" method="post">
									<table class="table">
										<thead align="center">
											<tr>
												<th>R�f�rence</th> 
												<th >Quantit� minimum</th> 
												<th >Quantit� maximum</th>  
												<th class="text-center" >Prix</th>  
												<th>&nbsp;</th>  
											</tr>
										</thead>
										<tbody>
											<tr align="center">
												<td>
													<select class="form-control" name="item_id">
														<?php foreach($this->listChild as $row) { ?>
														<option value="<?php echo $row['ID']; ?>"><?php echo $this->escape($row['REFERENCE']);?></option>
														<?php } ?>
													</select>
												</td> 
												<td><input type="text" class="form-control" placeholder="Quantit� minimum d'achat" name="min" value="" size="5"/></td> 
												<td>
													<div class="col-md-9 no-space-top"><input type="text" class="form-control" placeholder="Quantit� maximum d'achat" name="max" value="" size="5"/></div>
													<div class="col-md-3 no-space-top"><input type="checkbox" class="bluecheckradios" name="maxend" id="maxend" /><label for="maxend">&nbsp;Et plus</label></div>
												</td>
												<td><input type="text" class="form-control" placeholder="Prix d'achat" name="prix" value="" size="5"/></td> 
												<td>
													<input type="hidden" name="id" value="<?php echo $this->populateForm['ID'];?>" />
													<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-plus"></i>&nbsp;Ajouter</button>
												</td> 
											</tr>
										</tbody>
									</table>
									</form>
								</td>
							</tr>
							<?php }
							if (isset($this->productChildQte) && !empty($this->productChildQte)) { ?>
							<tr class="nostriped">
								<td >
									<table class="table">
										<thead align="center">
											<tr>
												<th>R�f�rence</th> 
												<th>D�signation</th> 
												<th>De</th> 
												<th>�</th> 
												<th class="text-center">Prix</th> 
												<th>&nbsp;</th>
											</tr>
										</thead>
										<tbody>
											<?php foreach($this->productChildQte as $row) { ?>
											<tr > 
												<td >
													<span <?php if (!$row['isQTEPRIXACTIVE']) { ?>style="color:red;"<?php } ?>><?php echo $this->escape($row['REFERENCE']);?></span>
												</td>
												<td >
													<span><?php echo $row['DESIGNATION'];?></span> 
												</td> 
												<td >
													<span><?php echo $this->escape($row['MIN']);?></span> 
												</td> 
												<td  >
													<span>
													<?php if ($row['MAX'] <> 999999999) { echo $this->escape($row['MAX']); }
													else {echo "Et Plus"; } ?></span> 
												</td> 
												<td >
													<span><?php echo $this->escape($row['PRIX']);?></span> 
												</td> 
												<td  > 
													<button class="btn btn-danger btn-modal" data-toggle="ajaxModalDelete" data-linkok="<?php echo $this->baseUrl; ?>/backoffice/product/delchildqteprix/id/<?php echo $this->populateForm['ID'];?>/item_id/<?php echo $row['ID'];?>#pricedeg" ><span class="glyphicon glyphicon-trash"></span> Supprimer</button>
												</td>
											</tr>
											<?php } ?> 
										</tbody>
									</table> 
								</td>
							</tr>
							<?php } ?>
						</table> 
					</section>
				</div>
				<div class="tab-pane" id="referencement">
					<section class="boxpadding">
						<table class="table">
							<?php echo $this->render("alert_tr.phtml"); ?>
							<tr >
								<td><h5>M�ta donn�es</h5></td>
							</tr>
							<tr>
								<td >
									<form action="<?php  echo $this->baseUrl; ?>/backoffice/product/editnavheader#referencement" method="post">
										<input type="hidden" size="60" name="id" value="<?php echo $this->populateForm['ID'];?>">
										<table class="table">
											<tr class="nostriped">
												<td ><label for="navtitre">Titre</label>	<br/>
                          <i><?php if (!empty($this->populateForm['NAVTITRE'])) { echo  strlen($this->populateForm['NAVTITRE'])." caract�res"; } ?></i>
												</td>
												<td >
													<input placeholder="Titre de la page" class="form-control" size="70" type="text" name="navtitre" id="navtitre" value="<?php echo $this->populateForm['NAVTITRE'];?>"> 
												</td>
											</tr> 
											<tr class="nostriped">
												<td ><label for="navdesc">Description</label><br/>	
                          <i><?php if (!empty($this->populateForm['NAVDESC'])) { echo  strlen($this->populateForm['NAVDESC'])." caract�res"; } ?></i>
												</td>
												<td >
													<input placeholder="Description de la page" class="form-control" type="text" name="navdesc" id="navdesc" value="<?php echo $this->populateForm['NAVDESC'];?>" >
												</td>
											</tr> 
											<tr class="nostriped">
												<td ><label for="keywords_list">Mots cl�s</label></td>
												<td ><input placeholder="Vos mots cl�s" class="form-control"  size="40" type="text" name="keywords_list" id="keywords_list" value="<?php echo $this->populateForm['KEYWORDS'];?>">
												<i>mot cl� 1, mot cl� 2, ...</i></td>
											</tr> 								
											<tr class="nostriped">
												<td colspan="2" class="text-center" >
													<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-edit"></i>&nbsp;Modifier</button>
												</td>
											</tr> 
										</table>
									</form>
								</td>
							</tr>  
							<tr >
								<td><h5>Nom de navigation</h5></td>
							</tr>
							<tr> 
								<td >
									<form action="<?php  echo $this->baseUrl; ?>/backoffice/product/editcustomnavnom#referencement" method="post">
									<input type="hidden" size="60" name="id" value="<?php echo $this->populateForm['ID'];?>">
														
									<table  class="table">
										<tr class="nostriped">
											<td ><label for="navnom">Nom actuel</label></td> 
											<td >
											<input type="hidden" name="nom" value="<?php echo $this->populateForm['NOM'];?>">
											<input placeholder="Nom de navigation alternatif" class="form-control"  type="text" size="70" name="navnom" id="navnom" value="<?php echo $this->populateForm['NAVNOM'];?>"></td>
										</tr> 
										<tr class="nostriped">
											<td ><label for="navnom_custom1">Nom</label></td>
											<td >
												<input placeholder="Nom de navigation alternatif" class="form-control"  size="70" type="text" value="<?php echo $this->populateForm['CUSTOM_NAVNOM1'];?>" name="navnom_custom1" id="navnom_custom1" />
											</td>
										</tr> 
										<tr class="nostriped">
											<td ><label for="navnom_custom2">Nom</label></td>
											<td >
												<input placeholder="Nom de navigation alternatif" class="form-control"  size="70" type="text" value="<?php echo $this->populateForm['CUSTOM_NAVNOM2'];?>" name="navnom_custom2" id="navnom_custom2" />
											</td>
										</tr>
										<tr class="nostriped">
											<td ><label for="navnom_custom3">Nom</label></td>
											<td >
												<input placeholder="Nom de navigation alternatif" class="form-control"  size="70" type="text" value="<?php echo $this->populateForm['CUSTOM_NAVNOM3'];?>" name="navnom_custom3" id="navnom_custom3" />
											</td>
										</tr>
										<tr class="nostriped">
											<td colspan="2" class="text-center">
												<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-edit"></i>&nbsp;Modifier</button>
											</td>
										</tr> 
									</table>
									</form>
								</td> 
							</tr>
							<tr >
								<td><h5>Sitemap</h5></td>
							</tr>
							<tr class="nostriped">
								<td>  
									<pre>
									 <?php echo $this->siteMapShow; ?> 
									 </pre>
								</td>
							</tr>  
						</table>
					</section>
				</div>
				<div class="tab-pane" id="accessoire">
					<section class="boxpadding">
						<table class="table">
							<?php echo $this->render("alert_tr.phtml"); ?>							
							<tr >
								<td><h5>Accessoires</h5></td>
							</tr>
							<tr >
								<td>
									<form action="<?php  echo $this->baseUrl; ?>/backoffice/product/addproductaccessoire#accessoire" method="post">
									<table class="table">
										<tr  class="nostriped">
											<td class="col-md-2"><label for="reference_acc">R�f�rence</label></td>
											<td class="col-md-8">
												<input placeholder="Ajouter une r�f�rence de produit en tant qu'accessoire" class="form-control" type="text" name="reference_acc" id="reference_acc">
											</td>
											<td class="col-md-2">
												<input type="hidden" size="60" name="id" value="<?php echo $this->populateForm['ID'];?>">
												<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-plus"></i>&nbsp;Ajouter</button>
											</td>
										</tr>
										<tr  class="nostriped">
											<td class="col-md-2"><label >Accessoires li�s</label></td>
											<td class="col-md-10" colspan="2"> 
												<div id="idproduitacc_success" > 
												<?php echo $this->render("/product/ajaxaccessoirelist.phtml"); ?>
												</div>
											</td>
										</tr> 
									</table>	
									</form>
								</td>
							</tr>  
														
							<tr >
								<td><h5>Les clients ayant consult� cet article ont �galement regard� ces produits</h5></td>
							</tr>
							<tr>
								<td>
									<table class="table">
										<tr  class="nostriped">
											<td class="col-md-2"><label for="idcategoryann">Cat�gorie</label></td>
											<td class="col-md-10">
												<select class="form-control" name="idcategoryann" id="idcategoryann">
													<option value="none">S�lectionner</option>
													<?php  echo $categoryListString; ?>
												</select>  
											</td>
										</tr> 
										<tr  class="nostriped">
											<td><label for="idproduitann">Produits</label></td>
											<td > 
												<div id="idcategoryann_success" ></div>	
												<div id="idcategoryann_loading" class="ajax-loading" style="display: none;">Chargement</div>
											
											</td>
										</tr> 
										<tr  class="nostriped">
											<td><label >Produits li�s</label></td>
											<td > 
												<div id="idproduitann_success" > 
												<?php echo $this->render("/product/ajaxannexelist.phtml"); ?>
												</div>
											</td>
										</tr> 
									</table>
								</td>
							</tr>
						</table>
					</section>
				</div>
				<div class="tab-pane" id="images">
					<section class="boxpadding">
						<table class="table">
							<?php echo $this->render("alert_tr.phtml"); ?>							
							<tr >
								<td ><h5>Images</h5></td>
							</tr>
							<tr >
								<td>
									<form method="post" enctype="multipart/form-data" action="<?php echo $this->baseUrl; ?>/backoffice/product/uploadpics#images">
									<table class="table">
										<tr  class="nostriped">
											<td class="col-md-2"><label for="reference_acc">Ajouter une image</label></td>
											<td class="col-md-8">
												<input type="file" name="file" class="file" size="50"/><br/>
												<i>Extensions : jpeg, jpg, gif, png</i>
											</td>
											<td class="col-md-2">
												<input type="hidden" name="idcat" id="idcat" value="<?php echo $this->populateForm['IDCATEGORY'];?>" />
												<input type="hidden" name="id" value="<?php echo $this->populateForm['ID'];?>" />
												<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-plus"></i>&nbsp;Ajouter</button>
											</td>
										</tr>
									</table>
									</form>
								</td>
							</tr> 
							<tr>
								<td><h5>Images du produit</h5></td>
							</tr>
							<tr >
								<td >
									<form action="<?php echo $this->baseUrl; ?>/backoffice/product/editpicture#images" method="post">
										<input type="hidden" name="id" value="<?php echo $this->populateForm['ID'];?>" />
										<table class="table">
											<tr  class="nostriped">
												<td class="text-center no-space-top"><button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-edit"></i>&nbsp;Modifier</button></td>
											</tr>
											<tr  class="nostriped">
												<td >
													
													<?php $i=0; 
													foreach($this->listPicture as $row) { ?>
													
													<div class="col-md-3 text-center no-space-top">
														<div class="col-md-12 text-center">
															<ul class="gallerybox">
															  	<li>
																	<figure>
																		<img src="<?php echo $this->baseUrl.'/'.$row['URL']; ?>" />
																	</figure>
																</li>
															</ul>
														</div>
														<div class="col-md-12 text-center">
																<input placeholder="Position d'affichage" class="form-control" type="text" size="2" name="position<?php echo $i; ?>" value="<?php echo $row['POSITION']; ?>">
																<input placeholder="Information sur l'image" class="form-control" type="text" size="15" name="string1_<?php echo $i; ?>" value="<?php echo $row['STRING1']; ?>">
																<input placeholder="Information sur l'image" class="form-control" type="text" size="15" name="string2_<?php echo $i; ?>" value="<?php echo $row['STRING2']; ?>">
																<input type="hidden" name="id<?php echo $i; ?>" value="<?php echo $row['ID']; ?>" >
														</div>
														<div class="btn-group">
															<button class="btn btn-danger btn-modal" data-toggle="ajaxModalDelete" data-linkok="<?php echo $this->baseUrl; ?>/backoffice/product/delpicture/pic/<?php echo $row['ID']; ?>/id/<?php echo $this->populateForm['ID'];?>#images" ><i class="glyphicon glyphicon-resize-full"></i>&nbsp;D�lier</button>
														</div>
													</div>
													<?php $i++; } ?>
													<input type="hidden" name="nbrImg" value="<?php echo $i; ?>" >
												</td>
											</tr>
										</table>
									</form>
								</td>
							</tr>
							<tr ><td ><h5>Images de la cat�gorie</h5></td></tr>
							<tr  class="nostriped">
								<td>
									<?php 
										$files = glob("items/product/".$this->populateForm['IDCATEGORY']."/*.*");
										for ($i=0; $i <sizeof($files); $i++) {				
									?>
									
									
									<div class="col-md-3 text-center no-space-top">
										<form action="<?php echo $this->baseUrl; ?>/backoffice/product/setpicture#images" method="post" >
										<div class="col-md-12 text-center">
											<ul class="gallerybox ">
											  	<li>
													<figure>
														<img src="<?php echo $this->baseUrl.'/'.$files[$i]; ?>" />
													</figure>
												</li>
											</ul>
										</div>
										<div class="col-md-12">
											<button class="btn btn-primary" type="submit" name="edit"><i class="glyphicon glyphicon-resize-small"></i>&nbsp;Lier</button>
											<input type="hidden" name="picture" value="<?php echo $files[$i]; ?>" >
											<input type="hidden" name="id" value="<?php echo $this->populateForm['ID'];?>" />
										</div>
										</form>	
									</div>
									<?php } ?>
								</td>
							</tr>
							<tr ><td ><h5>Image par d�faut</h5></td></tr>
							<tr >
								<td >
									<?php 
										$files = glob("items/product/default/*.*");
										for ($i=0; $i <sizeof($files); $i++) {				
									?>
									<div class="col-md-3 text-center no-space-top">
										<form action="<?php echo $this->baseUrl; ?>/backoffice/product/setpicture#images" method="post">
										<div class="col-md-12 text-center">
											<ul class="gallerybox">
											  	<li>
													<figure>
														<img src="<?php echo $this->baseUrl.'/'.$files[$i]; ?>" />
													</figure>
												</li>
											</ul>
										</div>
										<div class="col-md-12">
											<button class="btn btn-primary" type="submit" name="edit"><i class="glyphicon glyphicon-resize-small"></i>&nbsp;Lier</button>
											<input type="hidden" name="picture" value="<?php echo $files[$i]; ?>" >
											<input type="hidden" name="id" value="<?php echo $this->populateForm['ID'];?>" />
										</div>
										</form>	
									</div>
									<?php } ?>
								</td>
							</tr>
						</table>
					</section>
				</div>
				<div class="tab-pane" id="docs">
					<section class="boxpadding">
						<table class="table">
							<?php echo $this->render("alert_tr.phtml"); ?>		
							<tr >
								<td ><h5>Document associ� au produit</h5></td>
							</tr>
							<tr >
								<td >
									<?php 
									if (isset($this->populateForm['DOCNAME']) && !empty($this->populateForm['DOCNAME'])) {
									?>
									
										<table class="table">
											<tr >
												<td >
													<a class="btn btn-primary" href="<?php echo $this->baseUrl.'/'.$this->populateForm['DOCURL']; ?>" target="_blank"><i class="glyphicon glyphicon-eye-open"></i>&nbsp;Voir le document : <?php echo $this->populateForm['DOCNAME']; ?></a>
												</td>
												<td>
													<button class="btn btn-danger btn-modal" data-toggle="ajaxModalDelete" data-linkok="<?php echo $this->baseUrl; ?>/backoffice/product/deldoc/id/<?php echo $this->populateForm['ID']; ?>#docs" ><span class="glyphicon glyphicon-trash"></span> Supprimer</button>
												</td>
											</tr>		
										</table>
									<?php } else { ?>
										<form method="post" enctype="multipart/form-data" action="<?php echo $this->baseUrl; ?>/backoffice/product/editdoc#docs">
										<table class="table">
											<thead>
												<tr>
													<th>Nom du lien</th>
													<th>Document</th>
													<th></th>
												</tr>
											</thead>
											<tbody>
												<tr >
													<td>
														<input type="hidden" name="docid_product" id="docid_product" value="<?php echo $this->populateForm['ID']; ?>">
														<input class="form-control" type="text" name="docname_product" id="docname_product" value="<?php echo $this->populateForm['DOCNAME'];?>">
													</td>
													<td>
														<input type="file" name="file_doc" class="file" size="50"/>
														<input type="hidden" name="id" value="<?php echo $this->populateForm['ID'];?>" />
													</td>
													<td>
														<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-plus"></i>&nbsp;Ajouter</button>
													</td>
												</tr>	
											</tbody>
										</table>
										</form>
									<?php  }  ?>	
								</td>
							</tr>
							
							<tr >
								<td ><h5>Document associ� aux r�f�rences</h5></td>
							</tr>
							<?php if (isset($this->listChild) && !empty($this->listChild)) { ?>
							<tr >
								<td >
									<table class="table">
										<thead>	
											<tr align="center">
												<th>R�f�rence</th>
												<th>Document</th>
											</tr>
										</thead>
										<tbody>
										<?php  foreach($this->listChild as $row) { ?>
										<tr  class="nostriped">
											<td >
												<span><?php echo $this->escape($row['REFERENCE']);?></span>
											</td>
											
											<td >
												<form method="post" enctype="multipart/form-data" action="<?php echo $this->baseUrl; ?>/backoffice/product/editftfds#docs">
													<input type="hidden" name="idchild_ftfds" id="idchild_ftfds" value="<?php echo $this->escape($row['ID']);?>">
													<input type="hidden" name="id" value="<?php echo $this->populateForm['ID'];?>" />
													
													<?php 
													$isFTFDS = false;
													foreach($this->listFTFDS as $rowFTFDS) {  
														if ($rowFTFDS['ID_CHILD'] == $row['ID']) {
													?>
														<div class="col-md-8">
															<a class="btn btn-primary" href="<?php echo $this->baseUrl.'/'.$rowFTFDS['URL']; ?>" target="_blank"><i class="glyphicon glyphicon-eye-open"></i>&nbsp;Voir le document</a>
														</div>
														<div class="col-md-4">
															<button class="btn btn-danger btn-modal" data-toggle="ajaxModalDelete" data-linkok="<?php echo $this->baseUrl; ?>/backoffice/product/delftfds/idchild/<?php echo $this->escape($rowFTFDS['ID_CHILD']); ?>/id/<?php echo $this->populateForm['ID'];?>#docs" ><span class="glyphicon glyphicon-trash"></span> Supprimer</button>
														</div>
													<?php 
														$isFTFDS = true;
														}
													}
													if ($isFTFDS == false) { ?>
														<div class="col-md-8">
															<input type="file" name="file_ftfds" class="file" size="50"/>
														</div>
														<div class="col-md-4">
															<button class="btn btn-success" type="submit" name="add"><i class="glyphicon glyphicon-plus"></i>&nbsp;Ajouter</button>
														</div>
													<?php  }  ?>
												</form>
											</td>
										</tr>	
										<?php } ?>	
										</tbody>
									</table>
								</td>
							</tr>
							<?php } ?>
						</table>
					</section>
				</div>
				<div class="tab-pane" id="cats">
					<section class="boxpadding">
						<form action="<?php  echo $this->baseUrl; ?>/backoffice/product/editproductcategories#cats" method="post">
							<input type="hidden" name="id" id="id" value="<?php echo $this->populateForm['ID'];?>" />
							<table class="table">
								<?php echo $this->render("alert_tr.phtml"); ?>		
								<tr>
									<td class="text-center">
										<button class="btn btn-success" type="submit" name="edit"><i class="glyphicon glyphicon-edit"></i>&nbsp;Modifier</button>
									</td>
								</tr>
								<tr >
									<td  ><h5>Dupliquer le produit dans les cat�gories</h5></td>
								</tr>
								<tr >
									<td>
										<table class="table">
											<tr class="nostriped">
												<td><label for="idcategory_duplicat1">Cat�gorie</label></td>
												<td> 
													<select class="form-control" name="idcategory_duplicat1" id="idcategory_duplicat1">
														<option value="0">Aucun</option>
														<?php  echo $categoryDUP1ListStringSelected;?>
													</select>
												</td>
											</tr>
											<tr class="nostriped">
												<td><label for="idcategory_duplicat2">Cat�gorie</label></td>
												<td> 
													<select class="form-control" name="idcategory_duplicat2" id="idcategory_duplicat2">
														<option value="0">Aucun</option>
														<?php  echo $categoryDUP2ListStringSelected;?>
													</select>
												</td>
											</tr> 
											<tr class="nostriped">
												<td><label for="idcategory_duplicat3">Cat�gorie</label></td>
												<td> 
													<select class="form-control" name="idcategory_duplicat3" id="idcategory_duplicat3">
														<option value="0" >Aucun</option>
														<?php  echo $categoryDUP3ListStringSelected;?>
													</select>
												</td>
											</tr> 
										</table>
									</td>
								</tr> 
								<tr >
									<td colspan="2" ><h5>Dupliquer le produit dans les cat�gories subsidiaires</h5></td>
								</tr>
								<tr >
									<td>
										<table class="table">
											<tr class="nostriped">
												<td><label for="idcategory_promosolde">Cat�gorie</label></td>
												<td> 
													<select style="height:200px" class="form-control" id="idcategory_promosolde" name="idcategory_promosolde[]" multiple="multiple" >
														<option value="0">Aucun</option>
														<?php 
														$show = array();
														$productCategories = $this->productCategories;
														foreach($this->listallcategories2 as $row) { 
														 	for ($level=0 ; $level<11; $level++) { 
																if ((!isset($show['NOM'.$level]) || $show['NOM'.$level] != $row['NOM'.$level]) && $row['NOM'.$level] != null) {
																?>
																	<option value="<?php echo $this->escape($row['ID'.$level]); ?>"  
																	<?php foreach ($productCategories as $currentCategory) {  
																		 if ($row['ID'.$level] == $currentCategory['ID']) { echo 'selected="selected"'; }
																		}?>  
																	>
																		<?php 
														 				for ($i=0 ; $i<$level; $i++) { 
																			echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
																		}
																		echo $this->escape($row['NOM'.$level]); ?>
																	
																	</option>
																	<?php 
																	$show['NOM'.$level] = $row['NOM'.$level];
																}
															 } 
														} ?>
													</select>
												</td>
											</tr>
										</table>
									</td>
								</tr> 
							</table>
						</form>
					</section>
				</div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript"> 
$(function(){ 
	initEditor('#descshort');
	initEditor('#desclong');
	initEditor('#desctech');
	initEditor('#descnorme');
	initTabs(window.location.hash);
	$("#idcategoryann_success").html("");
	$("#idcategoryann").bind({
		change: function() {  
			if ($(this).val() != 'none' ) {
					$("#idcategoryann_loading").css({'display' : 'block'});
					$("#idcategoryann_success").html(""); 
					 $.ajax( {
					type : "POST", 
					async : true,
					url : '/backoffice/product/ajaxproductannexelistbycat', 
					data : "idcategory="+$(this).val()+"&idproduct="+$("#id").val(),
					success : function(data) {  
						$("#idcategoryann_loading").css({'display' : 'none'});
						$("#idcategoryann_success").html(data);
					}}); 
			}  
	   } 
	});
	
	var str = "<?php echo $this->populateForm['DATEPROMO']; ?>";
	var res = str.split("-");
	$("#datePromoProduct").datepicker({ 
		altFormat: 'yy-mm-dd', 
		altField: "#datePromoProductField",
		dateFormat: 'DD, d MM, yy'
	}).datepicker("setDate", new Date(res[0],res[1] - 1,res[2]));
});

function refreshListProduct(type) {
	if (type == 'ann') {  
		 $.ajax( {
				type : "POST", 
				async : true,
				url : '/backoffice/product/ajaxproductannexelistbycat', 
				data : "idcategory="+$("#idcategoryann option:selected").val()+"&idproduct="+$("#id").val(),
				success : function(data) {   
					$("#idcategoryann_success").html(data);
				}});
	} 
} 

function delProductAccessoire(idProduct, idAccessoire) {
	$.ajax( {
		type : "POST", 
		async : true,
		url : '/backoffice/product/ajaxdelproductaccessoire',  
		data : "idproduct="+idProduct+"&idAccessoire="+idAccessoire,
		success : function(data) {  
			$("#idproduitacc_success").html(data);   
		}});  
} 

function addProductAnnexe(idProduct, idAnnexe) {
	$.ajax( {
		type : "POST", 
		async : true,
		url : '/backoffice/product/ajaxaddproductannexe', 
		data : "idproduct="+idProduct+"&idannexe="+idAnnexe,
		success : function(data) {  
			$("#idproduitann_success").html(data);  
			refreshListProduct('ann');
		}});  
} 
function delProductAnnexe(idProduct, idAnnexe) {
	$.ajax( {
		type : "POST", 
		async : true,
		url : '/backoffice/product/ajaxdelproductannexe', 
		data : "idproduct="+idProduct+"&idannexe="+idAnnexe,
		success : function(data) {  
			$("#idproduitann_success").html(data);   
			refreshListProduct('ann');
		}});  
} 
</script>