'; // pour les insert on prends toutes les langues, et si afficher=non on forcera un insert if (empty($codeLangueTab) or $refresh=='Oui') {require_once($includePath. "/req/03-init.langueListAll.php");} // $idPrd=''; $continuer=1; $FIN='N'; $affOngImg='1'; $theImage ="./Catalogue/_parDefaut/prdDefaut.png"; $trouveLG=false; // Pour avoir le idPrd par defaut dans les champs - sera pas utilisé dans le insert if (empty($idPrd)) { include ("./catalog/req/reqCountProduits.php"); $idPrd=$nbp+1; } $nomPrd ="Nom de l'article " .$idPrd. " " .$_SESSION['lgCouranteLibelle']; $descCourt ="Description courte de l'article " .$idPrd. " " .$_SESSION['lgCouranteLibelle']; $descLong ="Description longue de l'article " .$idPrd. " " .$_SESSION['lgCouranteLibelle']; // ----------------------------------------------------- // Post // ----------------------------------------------------- if (isset($_POST['idPrd'])) {$idPrd=$_POST['idPrd'];} if (isset($_POST['nomPrd'])) {$nomPrd=$_POST['nomPrd'];} if (isset($_POST['descCourt'])) {$descCourt=$_POST['descCourt'];} if (isset($_POST['descLong'])) {$descLong=$_POST['descLong'];} if (isset($_POST['idFam'])) {$idFam=$_POST['idFam'];} if (isset($_POST['idCat'])) {$idCat=$_POST['idCat'];} if (isset($_GET['theImage'])) {$theImage=$_GET['theImage']; } if (isset($_POST['theImage'])) {$theImage=$_POST['theImage']; } if (isset($_GET['affOngImg'])) {$affOngImg=$_GET['affOngImg']; } if (isset($_POST['affOngImg'])) { $affOngImg=$_POST['affOngImg']; } if (isset($_GET['src'])) { $src=$_GET['src']; } // ----------------------------------------------------- if ($codeOpe=="faireInsert") { // ----------------------------------------------------- // Cas de la premier fois : on charge l'image // ----------------------------------------------------- if ($_SESSION['insertInitFait']!=1) { // ----------------------------------------------------- // Upload // ----------------------------------------------------- if (!empty($_FILES["fileToUpload"]["tmp_name"])) { $target_dir = "../Catalogue/_images_produits/petites/"; $targetExtension =['jpeg', 'jpg', 'png', 'svg', 'bmp']; $targetSize ='5242880'; //5 Mo $largeurMax = 0; $hauteurMax = 0; $largeurMin = 0; $hauteurMin = 0; include ($includePathAdmin. "/_fonctions/uploadGenerique.php"); } // ----------------------------------------------------- // Requete insert // ----------------------------------------------------- include ("./catalog/req/reqCountProduits.php"); $idPrd=$nbp+1; include ("./catalog/req/reqInsertPrd.php"); include ("./catalog/req/reqInsertLibellePrd.php"); $_SESSION['insertInitFait']=1; } else { // ----------------------------------------------------- // Changement de langue pour les autres // ----------------------------------------------------- include ("./catalog/req/reqInsertLibellePrd.php"); } // changement de langue include ($includePathAdmin. "/drapeaux/changementLg.php"); } else if (isset($debug[1]) && $debug[1] == '1' ) { $debugMsg .= monDebug (1,['codeOpe vide ou different de faireInsert' => '' ], 'art.createProduit.modale.php'); } // ----------------------------------------------------- // init insert false par defaut // ----------------------------------------------------- if ($trouveLG==false) { $_SESSION['insertInitFait']=0; } // ----------------------------------------------------- // Debug // ----------------------------------------------------- if (isset($debug[1]) && $debug[1] == '1' ) { $debugMsg .= monDebug (1,[ 'theImage' => $theImage, 'idPrd' => $idPrd, 'nomPrd' => $nomPrd, 'descCourt' => $descCourt, 'descLong' => $descLong, 'SESSION[insertInitFait]' => $_SESSION['insertInitFait'] ], 'art.createProduit.modale.php'); } // ----------------------------------------------------- // Form // ----------------------------------------------------- echo '
'; echo '
'; // ----------------------------------------------------- // Champs cachés // ----------------------------------------------------- echo ''; echo ''; // ----------------------------------------------------- // Langue drapeaux // ----------------------------------------------------- $niveau=0; include ("./adminInclude/drapeaux/drapeauxAff.php"); // ----------------------------------------------------- // Champs du formulaire // ----------------------------------------------------- if ($trouveLG==false && empty($codeOpe) ) { // ----------------------------------------------------- // Image // ----------------------------------------------------- echo ''; echo '
'; if (!empty($theImage) && file_exists ( "." .$theImage) ) {echo '
 ';} echo '
'; // ----------------------------------------------------- // Chemin // ----------------------------------------------------- echo ''; $title="L'image article"; echo 'Image article : '; echo ''; echo ''; // ----------------------------------------------------- // Btn parcourir // ----------------------------------------------------- echo ''; echo '
'; echo '
'; // ----------------------------------------------------- // Catégories // ----------------------------------------------------- echo ''; include ("./catalog/req/reqAllCat.php"); // include ("./catalog/req/reqAllCatLib.php"); $title="catégorie"; echo 'Catégorie : '; echo ''; echo ''; // ----------------------------------------------------- // Catégories // ----------------------------------------------------- if ($_SESSION['afficherSousCat']==1) { include ("./catalog/req/reqSelectLibellesSousCatFrom.php"); echo ''; $title="Sous-catégorie"; echo 'Sous-catégorie : '; echo ''; echo ''; } } // ----------------------------------------------------- // Champs propre a chaque les langues => traduction libelle // ----------------------------------------------------- if ($FIN!=='OUI') { echo 'Nom ' .$_SESSION['lgCouranteLibelle']. ' : '; $nomPrd=stripslashes($nomPrd); $nomPrd= gTranslate($nomPrd, strtolower( substr ($_SESSION['lgCouranteCode'], 0, -1) ) ) ; echo ''; echo ''; echo ''; $title="Description rapide de l'article : apparaît dans la liste des articles"; echo 'Description courte ' .$_SESSION['lgCouranteLibelle']. ' : '; $descCourt=stripslashes($descCourt); $descCourt= gTranslate($descCourt, strtolower( substr ($_SESSION['lgCouranteCode'], 0, -1) ) ) ; echo ''; echo ''; echo ''; $title="Description longue : apparaît dans le détail des articles"; echo 'Description longue ' .$_SESSION['lgCouranteLibelle']. ' : '; $descLong=stripslashes($descLong); $descLong= gTranslate($descLong, strtolower( substr ($_SESSION['lgCouranteCode'], 0, -1) ) ); echo ''; echo ''; } echo '
'; if ($trouveLG==false && !empty($codeOpe)) { // ----------------------------------------------------- // On a fini : toutes langues faites : retour // ----------------------------------------------------- echo ''; echo ' '; echo 'Retour'; echo ''; // ----------------------------------------------------- // On a fini : ajouter un autre produit ? // ----------------------------------------------------- echo ' '; echo '  '; echo 'Ajouter un autre article'; echo '

'; } else { // ----------------------------------------------------- // Langues a faire : valider // ----------------------------------------------------- echo ''; echo ' '; echo 'Valider pour ' .$_SESSION['lgCouranteLibelle'] .'


'; echo '
'; } echo '
'; echo '
'; echo '
'; // zoneFormModales } else { $confPath="../_conf"; include ("./adminInclude/redirectionAdmin.php"); } ?>