154 lines
6.2 KiB
PHP
Executable File
154 lines
6.2 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
|
|
// -----------------------------------------------------
|
|
// init
|
|
// -----------------------------------------------------
|
|
$famToOpen=1;
|
|
$fait=0;
|
|
require_once ($includePath. "/_fonctions/fonctions.gene.php");
|
|
|
|
// -----------------------------------------------------
|
|
// Post
|
|
// -----------------------------------------------------
|
|
if (isset($_POST['gondole']) && !empty($_POST['gondole'])) {$gondole=$_POST['gondole'];}
|
|
if (isset($_POST['famToOpen']) && !empty($_POST['famToOpen'])) {$famToOpen=$_POST['famToOpen'];}
|
|
|
|
// -----------------------------------------------------
|
|
// Requete update gondole
|
|
// -----------------------------------------------------
|
|
if ($codeOpe=='majTV') {include ("./catalog/req/updateGondole.php");}
|
|
|
|
// -----------------------------------------------------
|
|
// Requetes select
|
|
// -----------------------------------------------------
|
|
include ("./catalog/req/reqAllCat.php");
|
|
// include ("./catalog/req/reqAllCatLib.php");
|
|
|
|
// -----------------------------------------------------
|
|
// Debug
|
|
// -----------------------------------------------------
|
|
if (isset($debug[1]) && $debug[1] == '1') {include ("./catalog/treeview/treeview.debug.php");}
|
|
|
|
// ------------------------------------------------------
|
|
// Boite de recherche ou aide/info
|
|
// ------------------------------------------------------
|
|
echo '<div id="zoneRechercheWbm">';
|
|
|
|
// -----------------------------------------------------
|
|
// Boite aide
|
|
// -----------------------------------------------------
|
|
echo '<div id="bandeauAideInfo" >';
|
|
echo '<span class="info-icon fad fa-info-circle" onMouseOver="openPopup(\'T\');" onMouseLeave="closePopup(\'T\');"></span>';
|
|
echo '<div id="popupInfoT" class="popup">';
|
|
echo '<div class="popup-content">';
|
|
echo '<span class="popup-close" onClick="closePopup(\'T\');">×</span>';
|
|
echo '<img src="./adminInclude/designAdmin/info.png" alt="Info" class="popup-icon" />';
|
|
echo '<p>Ici vous pouvez parcourir votre catalogue sous forme d\'arborescence pour trouver un article rapidement. Avec un <b>clic droit</b> vous pouvez accéder directement aux fiches des catégories.</p>';
|
|
echo '</div>';
|
|
echo '</div>';
|
|
|
|
// -----------------------------------------------------
|
|
// Ajout
|
|
// -----------------------------------------------------
|
|
if ($_SESSION['afficherSousCat']==1) {
|
|
echo ' ';
|
|
echo '<div class="boutonsWebmaster tooltip-bottom" data-tooltip="Ajouter une catégorie" onClick="window.self.location=\'./frmModale.php?affModale=82-1\';" >';
|
|
echo '<i class="fad fa-plus"></i> ';
|
|
echo 'Ajouter une catégorie';
|
|
echo '</div>';
|
|
}
|
|
echo '</div>';
|
|
echo '</div>';
|
|
|
|
// -----------------------------------------------------
|
|
// zoneForm
|
|
// -----------------------------------------------------
|
|
echo '<div id="zoneFormWbm" >';
|
|
echo '<form name="tvForm" id="tvForm" method="POST">';
|
|
|
|
// -----------------------------------------------------
|
|
// Champs cachés
|
|
// -----------------------------------------------------
|
|
echo '<input type="hidden" value="' .$idPrd. '" id="idPrd" name="idPrd">';
|
|
echo '<input type="hidden" value="' .$gondole. '" id="gondole" name="gondole">';
|
|
echo '<input type="hidden" value="' .$codeOpe. '" id="codeOpe" name="codeOpe">';
|
|
echo '<input type="hidden" value="'.$famToOpen.'" id="famToOpen" name="famToOpen">';
|
|
|
|
echo '</form>';
|
|
|
|
echo '<ul id="myArbo" >';
|
|
for ($f=0; $f<count($tabIdFam); $f++) {
|
|
$nbPrd=0;
|
|
$_SESSION['nbPrd']=0;
|
|
$nbCat=0;
|
|
$_SESSION['nbCat']=0;
|
|
|
|
// -----------------------------------------------------
|
|
// Categories
|
|
// -----------------------------------------------------
|
|
echo '<li>';
|
|
echo '<div class="caret" id="caret' .$f. '" >';
|
|
$idFam=$tabIdFam[$f];
|
|
echo '<span id="famItem' .$tabIdFam[$f]. '" class="famItem" onContextMenu="return menuContFam(this,\'' .$tabIdFam[$f]. '\');" >';
|
|
if (isset($tabNomFam[$f])) echo $tabNomFam[$f];
|
|
|
|
// nb catégories
|
|
if ($_SESSION['afficherSousCat']==1) {
|
|
$idFamRech=$idFam;
|
|
include ("./catalog/req/reqSelectSousCatFromCat.php");
|
|
// include ("./catalog/req/reqSelectLibellesSousCatFrom.php");
|
|
echo ' <span style="font-size:0.9rem;"> : ' .$nbCat. ' sous-catégorie(s) </span>';
|
|
}
|
|
|
|
// //nb articles categories si pas afficge sous-cat
|
|
echo ' <span id="nbArtParFam' .$f. '" style="font-size:0.9rem;"></span>';
|
|
if ($_SESSION['afficherSousCat']!=1) {
|
|
echo '<span style="font-size:0.9rem;"> article(s) </span>';
|
|
}
|
|
|
|
echo '<input id="idFam" type="hidden" style="display: none;" value="' .$tabIdFam[$f]. '" >';
|
|
echo ' ';
|
|
|
|
if ($tabAffFam[$f] == 1) {
|
|
if (!empty($tabImageFam[$f]) && $tabImageFam[$f]!="-" ) {
|
|
if (urlExist($_SESSION['server'].$tabImageFam[$f])==true) {echo '<img class="imgFamTV" src=".' .$tabImageFam[$f]. '" />';}
|
|
else echo '<span class="imgFamTV" style="border:0" ><br><br></span>';
|
|
}
|
|
}
|
|
else echo '<span class="imgFamTV" style="border:0;"></span>';
|
|
echo '</span>';
|
|
echo '</div>';
|
|
|
|
echo '<ul class="nested" >';
|
|
if ($_SESSION['afficherSousCat']==1) {
|
|
for ($c=0; $c < count($tabLibSousCat); $c++) {
|
|
include ("./catalog/treeview/treeviewPage_Cat.php");
|
|
}
|
|
}
|
|
else include ("./catalog/treeview/treeviewPage_sansCat.php");
|
|
echo '</ul>';
|
|
echo '</li>';
|
|
}
|
|
echo '</ul>';
|
|
echo '</div>';
|
|
?>
|
|
|
|
<script>
|
|
var toggler = document.getElementsByClassName("caret");
|
|
var i;
|
|
for (i = 0; i < toggler.length; i++) {
|
|
toggler[i].addEventListener("click", function() {
|
|
this.parentElement.querySelector(".nested").classList.toggle("active");
|
|
this.classList.toggle("caret-down");
|
|
});
|
|
}
|
|
|
|
toggler = document.getElementsByClassName("puceCategorie");
|
|
for (i = 0; i < toggler.length; i++) {
|
|
toggler[i].addEventListener("click", function() {
|
|
this.parentElement.querySelector(".nested").classList.toggle("active");
|
|
this.classList.toggle("puceCategorie-down");
|
|
});
|
|
}
|
|
</script>
|