Current File : /home/karenpetzb/application/modules/backoffice/views/scripts/category/edit.phtml
<div class="table-box">	
	<div class="col-md-3 text-left">
		<a class="<?php if ($this->populateForm['isACTIVE'] == false) { echo 'btn btn-danger';} else { echo 'btn btn-info'; } ?>" 
			target="_blank" 
			href="<?php echo $this->baseUrl; ?>/<?php echo Utils_Tool::getFormattedUrlCategory($this->populateForm['NAVNOM_URLPARENTS'], $this->populateForm['NAVNOM'], $this->populateForm['ID']); ?>">
			<i class="glyphicon glyphicon-eye-open"></i>&nbsp;<?php echo $this->populateForm['NOM']; ?>
		</a> 
	</div>
	<?php  if ($this->isSiteEbusiness) {  ?>
	<div class="col-md-6 text-right" style="margin-top:0px;">
		<form action="<?php echo $this->baseUrl; ?>/backoffice/category/editmigrate#tabs-category" method="post" >
			 <div class="col-md-6 text-right"> D�sactiver cette cat�gorie et migrer les produits vers<br />
				<small>Une redirection sera effectu�e vers la cat�gorie s�lectionn�e</small>
			</div>
			<div class="col-md-4 text-right"> 
					<select name="idcategory" id="idcategory"  class="form-control" >
						<option value="0" selected="selected">Cette cat�gorie</option> 
						<?php 
							$show = array();
							foreach($this->listallcategories as $row) { 
								for ($level=0 ; $level<11; $level++) { 
									if ((!isset($show['NOM'.$level]) || $show['NOM'.$level] != $row['NOM'.$level]) && $row['NOM'.$level] != null) {
									  if ($this->populateForm['ID'] == $row['ID'.$level]) {
										break;
									  } else {
										?>
											<option value="<?php echo $this->escape($row['ID'.$level]); ?>"  >
												<?php 
												for ($i=0 ; $i<$level; $i++) { 
													echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
												}
												echo $row['NOM'.$level]; ?>
														
											</option>
											<?php 
											$show['NOM'.$level] = $row['NOM'.$level];
										}
									  } 
									} 
							} ?>
					</select> 
			</div>
			<div class="col-md-2 text-right">
				<input type="hidden" name="id" value="<?php echo $this->populateForm['ID']; ?>">
				<button class="btn btn-primary" type="submit" name="edit"><i class="glyphicon glyphicon-resize-small"></i>&nbsp;Migrer</button>
			</div>
		</form>	
	</div>
	<?php } ?> 
	<div class="col-md-3 text-right">
		<form action="<?php echo $this->baseUrl; ?>/backoffice/category/editactive#tabs-category" method="post" >
					
			<input type="radio" class="bluecheckradios" name="active" id="active1" value="1" <?php if ($this->populateForm['isACTIVE'] == true) { echo 'checked="checked"';} ?>><label for="active1">&nbsp;Actif</label>
			<input type="radio" class="bluecheckradios" name="active" id="active2" value="0" <?php if ($this->populateForm['isACTIVE'] == false) { echo 'checked="checked"';} ?>><label for="active2">&nbsp;Inactif</label>
			<input type="hidden" name="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>
		</form>	
	</div>
	
	<?php  if ($this->isSiteGallery) {  ?>
	<div class="col-md-3 text-right">
		<form action="<?php echo $this->baseUrl; ?>/backoffice/category/edittheme#tabs-category" method="post" >
			<div class="col-md-8 no-space-top"> 
				<select name="idtheme" id="idtheme"  class="form-control" >
					<?php  foreach($this->FeatureSiteThemeCms as $row) {  
					if ($row['ID_THEME'] != 3 && $row['ID_THEME'] != 5) {
					?>
					<option  value="<?php echo $row['ID_THEME']; ?>" <?php if ($row['ID_THEME'] == $this->populateForm['ID_THEME']) { echo 'selected="selected"';}?> >
						<?php echo $row['NOM_THEME']; ?> 
					</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-edit"></i>&nbsp;Modifier le th�me</button>
			</div>
		</form>	
	</div>
	<?php  }  ?>

	<div class="col-md-12"><?php echo $this->render("alert_tr.phtml"); ?></div>
								
	<div class="col-md-12 no-space-side">
		<div class="tabs-section ">
			<ul class="nav nav-tabs" id="myTab">
				<li ><a href="#tabs-category" data-toggle="tab">Cat�gorie</a></li>
				<li ><a href="#tabs-referencement" data-toggle="tab">R�f�rencement</a></li>
				<li ><a href="#tabs-image" data-toggle="tab">Images</a></li>
				<?php  if ($this->isSiteGallery) {  ?>
				<li ><a href="#tabs-gallery" data-toggle="tab">Articles / Galleries</a></li>
				<?php  }  ?>
			</ul>
			<div class="tab-content">
				<div class="tab-pane active" id="tabs-category">
					<section class="boxpadding">
						<form action="<?php echo $this->baseUrl; ?>/backoffice/category/editcategory#tabs-category" method="post"  enctype="multipart/form-data" >
							<table class="table">
                	<?php  if ($this->isSiteGallery) {  ?>
				       	  <tr >
									  <td class="col-md-4"><label for="position">Position</label></td>
									  <td class="col-md-8"><input type="text" name="position" id="position" value="<?php echo $this->populateForm['POSITION']; ?>" class="form-control"/></td>
								  </tr> 
				        <?php  }  ?>
                  
								<tr >
									<td class="col-md-4"><i class="glyphicon glyphicon-asterisk"></i>&nbsp;<label for="nom">Nom</label></td>
									<td class="col-md-8"><input type="text" name="nom" id="nom" value="<?php echo $this->populateForm['NOM']; ?>" class="form-control"/></td>
								</tr> 
								<tr >
									<td ><label for="desc">Description</label></td>
									<td>
                                        <textarea class="form-control"  rows="10" cols="40" name="desc" id="desc"><?php echo $this->populateForm['DESCRIPTION'];?></textarea>
                                    </td>
								</tr>
                
                
                <?php if ($this->FeatureCategoryTextDescriptionShort) { ?>
								<tr >
									<td ><label for="descshort">Description courte</label></td>
									<td>
									  <textarea class="form-control"  rows="10" cols="40" name="descshort" id="descshort"><?php echo $this->populateForm['DESCRIPTIONSHORT'];?></textarea>
								  </td>
								</tr>
                <?php } else { ?>
                     <input type="hidden" name="descshort" value="" />
                <?php } ?>
                
                <?php if ($this->FeatureCategoryTextDescriptionLong) { ?>
								<tr >
									<td ><label for="desclong">Description longue</label></td>
									<td>
                                        <textarea class="form-control"  rows="10" cols="40" name="desclong" id="desclong"><?php echo $this->populateForm['DESCRIPTIONLONG'];?></textarea>
                                    </td>
								</tr>
                <?php } else { ?>
								<input type="hidden" name="desclong" value="" />
                <?php } ?>
                
                <?php if ($this->FeatureCategoryLinkRedirection) { ?>
								<tr >
									<td ><label for="urlredirect">Url de redirection</label><br /><small># = aucune action</small></td>
									<td>
										<input class="form-control" type="text" name="urlredirect" id="urlredirect" value="<?php echo $this->populateForm['URLREDIRECT'];?>"> 
                                    </td>
								</tr>
                <?php } else { ?>
								<input type="hidden" name="urlredirect" value="" />
                <?php } ?>
								<tr >
									<td ><label for="idparent">Cat�gorie parente</label></td>
									<td> 
										<select name="idparent" id="idparent"  class="form-control" >
											<option value="0">AUCUNE</option>
											<?php 
											$show = array();
											foreach($this->listallcategories as $row) { 
											 	for ($level=0 ; $level<11; $level++) { 
													if ((!isset($show['NOM'.$level]) || $show['NOM'.$level] != $row['NOM'.$level]) && $row['NOM'.$level] != null) {
													?>
														<option value="<?php echo $this->escape($row['ID'.$level]); ?>" <?php if ($row['ID'.$level] == $this->populateForm['IDPARENT']) { echo 'selected="selected"';}?> >
															<?php 
											 				for ($i=0 ; $i<$level; $i++) { 
																echo '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';
															}
															echo $row['NOM'.$level]; ?>
														
														</option>
														<?php 
														$show['NOM'.$level] = $row['NOM'.$level];
													}
												 } 
											} ?>
										</select> 
									</td>
								</tr>
								<tr >
									<td >
										<label for="picCat" >Image</label>
										<br/>
										<div class="col-md-12 text-center no-space-top">
											<?php if (!empty($this->populateForm['URL'])) { ?>
											<ul class="gallerybox ">
											  	<li>
													<figure>
														<img src="<?php echo $this->baseUrl.'/'.$this->populateForm['URL'];?>" />
													</figure>
												</li>
											</ul>
											<?php } ?>
										</div>
									</td>
									<td>
										<input type="file" name="picCat" id="picCat" size="50"/>
										<br><i>Extensions : jpg, gif, png</i>
										
									</td>
								</tr>
                                
                                <?php if ($this->FeatureCategoryPictureSlide) { ?>
								<tr >
									<td >
										<label for="picCat" >Image du slide</label>
										<br/>
										<div class="col-md-12 text-center no-space-top">
											<?php if (!empty($this->populateForm['URL_SLIDE'])) { ?>
											<ul class="gallerybox ">
											  	<li>
													<figure>
														<img src="<?php echo $this->baseUrl.'/'.$this->populateForm['URL_SLIDE'];?>" />
													</figure>
												</li>
											</ul>
											<?php } ?>
										</div>
									</td>
									<td>
										<input type="file" name="picSlideCat" id="picSlideCat" size="50"/>
										<br><i>Extensions : jpg, gif, png</i>
									</td>
								</tr>
                                <?php } ?>

								<?php  if ($this->isSiteEbusiness) {  ?>
								<tr >
									<td>
										<label for="picChoice" >Image de "Comment Choisir"</label>
										<br/>
										<?php if (isset($this->populateForm['CHOICEURL']) && !empty($this->populateForm['CHOICEURL'])) { ?>
										<div class="col-md-12 text-center no-space-top">
											<ul class="gallerybox ">
											  	<li>
													<figure>
														<img src="<?php echo $this->baseUrl.'/'.$this->populateForm['CHOICEURL'];?>" />
													</figure>
												</li>
											</ul>
										</div>
										<?php } ?>
									</td>
									<td>
										<input type="file" name="picChoice" id="picChoice" size="50"/>
										<br><i>Extensions : jpg, gif, png</i>
										
									</td>
								</tr> 
								<tr>
									<td nowrap="nowrap"><label for=docChoice>Document de "Comment Choisir"</label></td>
									<td>
										<select name="docChoice" id="docChoice" class="form-control">
										<option value="" selected="selected">Aucun</option>
										<?php 
											$files = glob("doc/*.pdf");
											for ($i=0; $i <sizeof($files); $i++) {				
										?>
										<option value="<?php echo $files[$i]; ?>" <?php if ($files[$i] == $this->populateForm['CHOICEDOC']) { echo 'selected="selected"';} ?> ><?php echo $files[$i]; ?></option>
										<?php } ?>
										</select> 
									</td>
								</tr> 
                                <?php } ?>
								<tr>
									<td align="center" colspan="2">	
										<input type="hidden" name="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="tabs-referencement">
					<section class="boxpadding">
						<form action="<?php  echo $this->baseUrl; ?>/backoffice/category/customnavnomedit#tabs-referencement" method="post">
						<table class="table"> 
							<tr >
								<td colspan="2" ><h5>M�ta donn�es</h5></td>
							</tr> 
							<tr >
								<td class="col-md-4">
									<label for="navnom">Nom de navigation</label>
								</td>
								<td class="col-md-8">
									<input type="text" name="navnom" id="navnom" value="<?php echo $this->populateForm['NAVNOM']; ?>" class="form-control"/>
								</td>
							</tr>
							<tr >
								<td ><label for="navtitrenom">Titre de navigation</label>	<br/>
								<i><?php if (!empty($this->populateForm['NAVTITRENOM'])) { echo  strlen($this->populateForm['NAVTITRENOM'])." caract�res"; } ?></i></td> 
								<td > 
								  <input class="form-control" type="text" name="navtitrenom" id="navtitrenom" value="<?php echo $this->populateForm['NAVTITRENOM'];?>">
                </td>
							</tr>  
							<tr>
								<td><label for="navdescription">Description</label>	<br/>
                <i><?php if (!empty($this->populateForm['NAVDESCRIPTION'])) { echo  strlen($this->populateForm['NAVDESCRIPTION'])." caract�res"; } ?></i></td>
								<td>
									<input class="form-control" type="text" name="navdescription" id="navdescription" value="<?php echo $this->populateForm['NAVDESCRIPTION'];?>">
	              </td>
							</tr>  
							<tr>
								<td><label for="keywords">Mots cl�s</label></td>
								<td>
									<input class="form-control" type="text" name="keywords" id="keywords" value="<?php echo $this->populateForm['KEYWORDS'];?>">
								</td>
							</tr>
              <tr >
                <td colspan="2" >
                  <h5>Url</h5>
                </td>
              </tr>
              <tr>
                <td>
                  <label for="urlaccess">Acc�s hi�rarchique</label>
                </td>
                <td>
                  <input class="form-control" <?php if ($this->populateForm['IDPARENT'] != 0) { echo "readonly='readonly'"; } ?> type="text" name="urlaccess" id="urlaccess" value="<?php echo $this->populateForm['NAVNOM_URLPARENTS'];?>" placeholder="Pr�fix composant l'url, Ex : rubrique/sous-rubrique" >
                  </td>
              </tr>
              <tr >
								<td colspan="2" class="text-center">
									<input type="hidden" name="nom" value="<?php echo $this->populateForm['NOM'];?>">
									<input type="hidden" size="60" name="id" value="<?php echo $this->populateForm['ID'];?>">
                    <input type="hidden" size="60" name="idparent" value="<?php echo $this->populateForm['IDPARENT'];?>">
                    <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="tabs-image">
					<section class="boxpadding">
						<table class="table">  
							<tr>
								<td width="250px">
									<label for="idparent">Images</label>
								</td>
								<td >
									<?php 
										$files = glob("items/category/".$this->populateForm['ID']."/*.*");
										for ($i=0; $i <sizeof($files); $i++) {				
									?>
									<div class="col-md-3 text-center no-space-top">
										<form action="<?php echo $this->baseUrl; ?>/backoffice/category/setpicture#tabs-image" 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-4 text-right">
											<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="idCat" value="<?php echo $this->populateForm['ID']; ?>" >
										</div>
                                            
                                        <?php if ($this->FeatureCategoryPictureSlide) { ?>
										    <div class="col-md-8 text-right">
										        <select name="typeimage" class="form-control">
										            <option value="0" selected="selected">Normal</option>
										            <option value="1" >Slide</option>
                                                </select>
                                            </div>
                                         <?php } else { ?>
                                            <input type="hidden" value="0" name="typeimage">
                                         <?php }  ?>
										</form>	
										<div class="col-md-12 text-left">
										<form action="<?php echo $this->baseUrl; ?>/backoffice/category/erasepicture#tabs-image" method="post" id="delPictureImage<?php echo $i;?>">
											<button class="btn btn-danger btn-modal" type="button" data-toggle="ajaxModalSubmitDelete" data-form="delPictureImage<?php echo $i;?>"  ><i class="glyphicon glyphicon-trash"></i>&nbsp;Supprimer</button>
											<input type="hidden" name="picture" value="<?php echo $files[$i]; ?>" >
											<input type="hidden" name="idCat" value="<?php echo $this->populateForm['ID']; ?>" >
										</form>	
										</div>
									</div>
									<?php } ?>
								</td>
							</tr>
								<?php  if ($this->isSiteEbusiness) {  ?>
							<tr >
								<td >
									<label for="idparent" >Images de "Comment choisir"</label>
								</td>
								<td >
									<?php 
										$files = glob("items/category_choice/".$this->populateForm['ID']."/*.*");
										for ($i=0; $i <sizeof($files); $i++) {				
									?>
									<div class="col-md-3 text-center no-space-top">
										<form action="<?php echo $this->baseUrl; ?>/backoffice/category/setpicturechoice#tabs-image" 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-6 text-left">
											<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="idCat" value="<?php echo $this->populateForm['ID']; ?>" >
										</div>
										</form>	
										<div class="col-md-6 text-right">
										<form action="<?php echo $this->baseUrl; ?>/backoffice/category/erasepicturechoice#tabs-image" method="post" id="delPictureImageChoice<?php echo $i;?>">
											<button class="btn btn-danger btn-modal" type="button" data-toggle="ajaxModalSubmitDelete" data-form="delPictureImageChoice<?php echo $i;?>"  ><i class="glyphicon glyphicon-trash"></i>&nbsp;Supprimer</button>
											<input type="hidden" name="picture" value="<?php echo $files[$i]; ?>" >
											<input type="hidden" name="idCat" value="<?php echo $this->populateForm['ID']; ?>" >
										</form>	
										</div>
									</div>
									<?php } 
										$files = glob("items/category_choice/*.*");
										for ($i=0; $i <sizeof($files); $i++) {				
									?>
									<div class="col-md-3 text-center no-space-top">
										<form action="<?php echo $this->baseUrl; ?>/backoffice/category/setpicturechoice#tabs-image" 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="idCat" value="<?php echo $this->populateForm['ID']; ?>" >
										</div>
										</form>	
									</div>
									
									<?php } ?>
								</td>
							</tr>
							<?php } ?>
						</table>
					</section>
				</div>
			
				<div class="tab-pane" id="tabs-gallery">
					<section class="boxpadding"> 
						<table class="display table" id="AnnonceCmsGalleryTable" width="100%">
							<tbody>
							
								<?php if(!empty($this->listAnnoncecms))  { ?> 
								<tr>
									<td colspan="4">Articles</td>
								</tr>
								<?php } 
								foreach($this->listAnnoncecms as $row)  { ?>
								<tr>
									<td></td>
									<td><?php echo $row['NOM'];?></td> 
									<td><?php if ($this->escape($row['isSHOW'])==0) {echo 'Actif';} else {echo 'Inactif';} ?></td>
									<td style="width:300px;">
										<div class="btn-group">
											<a class="btn btn-success" href="<?php echo $this->baseUrl; ?>/backoffice/annoncecms/edit/id/<?php echo $row['ID']; ?>" target="_blank"><span class="glyphicon glyphicon-edit"></span> Modifier</a>
											<button class="btn btn-danger btn-modal" data-toggle="ajaxModalDelete" data-linkok="<?php echo $this->baseUrl; ?>/backoffice/category/deletecms/id/<?php echo $this->populateForm['ID'];?>/idarticle/<?php echo $row['ID']; ?>#tabs-gallery"><span class="glyphicon glyphicon-trash"></span> Supprimer</a>
										</div>
									</td>
								</tr>
								<?php } ?>
								<tr >
									<td colspan="4">
										<div class="col-md-12">Galleries <span id="message-gallery"></span></div> 
										
										<div class="col-md-12">
											<div id="fine-uploader-manual-trigger"></div>
										</div>
										
									
										<?php if(!empty($this->listAnnonceGallery))  { ?> 
										<div class="col-md-12">
											<ul id="sortable-gallery">
												<?php foreach($this->listAnnonceGallery as $row)  { ?>
												<li class="col-md-12" style="list-style-type:none" data-pic-id="<?php echo $row['ID']; ?>" data-cat-id="<?php echo $this->populateForm['ID']; ?>" > 
													<?php if (!empty($row['URL'])) { 
														$urlPicture = $row['URL'];?>
													<div class="col-md-3 no-space-top">
														<ul class="gallerybox">
															<li >
																<figure>
																	<img src="<?php echo $this->baseUrl.'/'.Utils_Tool::find_thumb($urlPicture, 100);?>" />
																</figure>
															</li>
														</ul>
													</div> 
													<?php } ?> 
													<div class="col-md-3 no-space-top"><?php echo $row['NOM'];?></div> 
													<div class="col-md-3 no-space-top"><?php if ($this->escape($row['isSHOW'])==0) {echo 'Actif';} else {echo 'Inactif';} ?></div>
													<div class="col-md-3 no-space-top">
														<div class="btn-group">
															<a class="btn btn-success" href="<?php echo $this->baseUrl; ?>/backoffice/annoncegallery/edit/id/<?php echo $row['ID']; ?>" target="_blank"><span class="glyphicon glyphicon-edit"></span> Modifier</a>
														
															<button class="btn btn-danger btn-modal" data-toggle="ajaxModalDelete" data-linkok="<?php echo $this->baseUrl; ?>/backoffice/category/deletegallery/id/<?php echo $this->populateForm['ID'];?>/idgallery/<?php echo $row['ID']; ?>#tabs-gallery"><span class="glyphicon glyphicon-trash"></span> Supprimer</a>
														</div>
													</div>
												</li>
												<?php } ?>
											</ul>
										</div>
										<?php } ?> 
									</td> 
								</tr>
							</tbody>
						</table> 
					</section>
				</div>
			</div>
		</div>
	</div>
</div>
<style> 
  .sortable-placeholder{ height: 1.5em; line-height: 1.2em; } 
  
        #trigger-upload {
            color: white;
            background-color: #00ABC7;
            font-size: 14px;
            padding: 7px 20px;
            background-image: none;
        }

        #fine-uploader-manual-trigger .qq-upload-button {
            margin-right: 15px;
        }

        #fine-uploader-manual-trigger .buttons {
            width: 36%;
        }

        #fine-uploader-manual-trigger .qq-uploader .qq-total-progress-bar-container {
            width: 60%;
        }
    </style>
    <link href="<?php echo $this->baseUrl; ?>/css/themes/admin/js/fileupload/fine-uploader-new.min.css" rel="stylesheet"> 
    <script src="<?php echo $this->baseUrl; ?>/css/themes/admin/js/fileupload/fine-uploader.min.js"></script>
 
    <script type="text/template" id="qq-template-manual-trigger">
        <div class="qq-uploader-selector qq-uploader" qq-drop-area-text="Drag & Drop">
            <div class="qq-total-progress-bar-container-selector qq-total-progress-bar-container">
                <div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-total-progress-bar-selector qq-progress-bar qq-total-progress-bar"></div>
            </div>
            <div class="qq-upload-drop-area-selector qq-upload-drop-area" qq-hide-dropzone>
                <span class="qq-upload-drop-area-text-selector"></span>
            </div>
            <div class="buttons">
                <div class="qq-upload-button-selector qq-upload-button">
                    <div>S�lectionner</div>
                </div>
                <button type="button" id="trigger-upload" class="btn btn-primary">
                    <i class="glyphicon glyphicon-upload"></i> Upload
                </button>
            </div>
            <span class="qq-drop-processing-selector qq-drop-processing">
                <span>Upload en cours ...</span>
                <span class="qq-drop-processing-spinner-selector qq-drop-processing-spinner"></span>
            </span>
            <ul class="qq-upload-list-selector qq-upload-list" aria-live="polite" aria-relevant="additions removals">
                <li>
                    <div class="qq-progress-bar-container-selector">
                        <div role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" class="qq-progress-bar-selector qq-progress-bar"></div>
                    </div>
                    <span class="qq-upload-spinner-selector qq-upload-spinner"></span>
                    <img class="qq-thumbnail-selector" qq-max-size="100" qq-server-scale>
                    <span class="qq-upload-file-selector qq-upload-file"></span>
                    <span class="qq-edit-filename-icon-selector qq-edit-filename-icon" aria-label="Edit filename"></span>
                    <input class="qq-edit-filename-selector qq-edit-filename" tabindex="0" type="text">
                    <span class="qq-upload-size-selector qq-upload-size"></span>
                    <button type="button" class="qq-btn qq-upload-cancel-selector qq-upload-cancel">Annuler</button>
                    <button type="button" class="qq-btn qq-upload-retry-selector qq-upload-retry">R�essayer</button>
                    <button type="button" class="qq-btn qq-upload-delete-selector qq-upload-delete">Supprimer</button>
                    <span role="status" class="qq-upload-status-text-selector qq-upload-status-text"></span>
                </li>
            </ul>

            <dialog class="qq-alert-dialog-selector">
                <div class="qq-dialog-message-selector"></div>
                <div class="qq-dialog-buttons">
                    <button type="button" class="qq-cancel-button-selector">Fermer</button>
                </div>
            </dialog>

            <dialog class="qq-confirm-dialog-selector">
                <div class="qq-dialog-message-selector"></div>
                <div class="qq-dialog-buttons">
                    <button type="button" class="qq-cancel-button-selector">Non</button>
                    <button type="button" class="qq-ok-button-selector">Oui</button>
                </div>
            </dialog>

            <dialog class="qq-prompt-dialog-selector">
                <div class="qq-dialog-message-selector"></div>
                <input type="text">
                <div class="qq-dialog-buttons">
                    <button type="button" class="qq-cancel-button-selector">Annuler</button>
                    <button type="button" class="qq-ok-button-selector">Ok</button>
                </div>
            </dialog>
		<div id="qq-dialog-error-message" class="alert alert-danger hide"></div>
        </div>
    </script>

 
	<script>
	 
	 $('#sortable-gallery').sortable({
            placeholder : "fantom",
		axis: 'y',
		update: function (event, ui) {  
		
			var data = 'position='+ui.item.index()+'&id='+ui.item.attr('data-pic-id')+'&category='+ui.item.attr('data-cat-id');
			
			 $.ajax({
				 data: data,
				 type: 'post',
				 url: '<?php echo $this->baseurl; ?>/backoffice/annoncegallery/editposition'
			 });
		}
	});

		var url = document.location.toString();
		if (url.match('#')) {
			$('.nav-tabs a[href="#' + url.split('#')[1] + '"]').tab('show');
		} else {
			$('.nav-tabs a[href="#tabs-category"]').tab('show');
		}
		
	
		var manualUploader = new qq.FineUploader({
			element: document.getElementById('fine-uploader-manual-trigger'),
			template: 'qq-template-manual-trigger',
			text: {
                formatProgress: "{percent}% de {total_size}",
                failUpload: "Upload erron�",
                waitingForResponse: 'Upload en cours ...',
                paused: "Pause"
            }, 
			request: {
				endpoint: '<?php echo $this->baseUrl; ?>/backoffice/category/addmultiplegallery?idCat=<?php echo $this->populateForm['ID']; ?>'
			},
			thumbnails: {
				placeholders: {
					waitingPath: '<?php echo $this->baseUrl; ?>/css/themes/admin/js/fileupload/placeholders/waiting-generic.png',
					notAvailablePath: '<?php echo $this->baseUrl; ?>/css/themes/admin/js/fileupload/placeholders/not_available-generic.png'
				}
			},
			autoUpload: false,
			debug: false, 
            showMessage: function(message) { 
            },
		});

		qq(document.getElementById("trigger-upload")).attach("click", function() {
			manualUploader.uploadStoredFiles();
		});
	</script>