alpha_full/admin/options/commercant/commercant.php
2026-04-06 22:58:51 +02:00

166 lines
7.2 KiB
PHP
Executable File

<?php
$nomFicAppelant = basename(__FILE__);
// -----------------------------------------------------
// Variables
// -----------------------------------------------------
$optAff=5;
$theIdContTab=array();
$theIdContTabV=array();
$idContTab=array();
// -----------------------------------------------------
// Post
// -----------------------------------------------------
include ("commercant.post.php");
// -----------------------------------------------------
// Requete count langues
// -----------------------------------------------------
if (empty($tableLangueCode) or $refresh=='Oui') { include ($includePath. "/req/03-init.langueActives.php"); }
// -----------------------------------------------------
// Update
// -----------------------------------------------------
if ($codeOpe==='upContact') {
include ("commercant.reqUpdate.php");
}
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['Pas de update' => ''], '');}
// -----------------------------------------------------
// Select
// -----------------------------------------------------
$refresh="Oui";
include ("../_include/initSessLg.php");
include ("commercant.reqSelect.php");
// -----------------------------------------------------
// Debug
// -----------------------------------------------------
if (isset($debug[1]) && $debug[1] == '1') {include ("commercant.debug.php");}
// -----------------------------------------------------
// Onglets
// -----------------------------------------------------
echo '<div id="menuOnglets" style="display:inline;width:100%;clear:both;" >';
include ("commercant.onglets.php");
echo $sousOngCont;
echo '</div>';
// -----------------------------------------------------
// Formulaire
// -----------------------------------------------------
echo '<form name="CONTF" id="CONTF" method="POST" >';
// -----------------------------------------------------
// Champs cachés
// -----------------------------------------------------
echo '<input type="hidden" name="codeOpe" id="codeOpe" value="' .$codeOpe. '" />';
echo '<input type="hidden" name="lgCourante" id="lgCourante" value="' .$_SESSION['lgCouranteCode']. '" />';
echo '<input type="hidden" name="theIdContact2" id="theIdContact2" value="' .$theIdContact2. '" />';
echo '<input type="hidden" name="theLibContact2" id="theLibContact2" value="' .$theLibContact2. '" />';
echo '<input type="hidden" name="thePopContact2" id="thePopContact2" value="' .$thePopContact2. '" />';
echo '<input type="hidden" name="theDescContact2" id="theDescContact2" value="' .$theDescContact2. '" />';
echo '<input type="hidden" name="typeOfCommercant" id="typeOfCommercant" value="' .$typeOfCommercant. '" />';
// -----------------------------------------------------
// List box langues
// -----------------------------------------------------
echo '<div >';
if ($_SESSION['nbLg']>1) {
echo '<div style="width:100%; margin:10px;" >';
// echo '<br><br>';
echo '<input type="radio" value="1" name="propager" >';
echo '<span class="actionMessages">Propager les valeurs à toutes les langues.</span>&#160;';
$lgLien="affAdmin=6&affOpt=5&typeOfCommercant=" .$typeOfCommercant;
// echo '<br>';
include ($includePathAdmin. "/drapeaux/drapeauxListBox.php");
// flag edt : todo : on click => modifier la requete update avec une boucle lg
echo '</div>';
}
echo '</div>';
$e=0;
for ($a=1;$a<=count($idContTab);$a++) {
$test=strpos(strip_tags($descContTab[$a]),"Etiquette");
if ($test!==false) { $e=$e+1;
$theIdContTab[$e]=$idContTab[$a];
$theDescContTab[$e]=$descContTab[$a];
$theMsgContTab[$e]=strip_tags($msgContTab[$a]);
$thePopContTab[$e]=$popContTab[$a];
}
}
// $admMsg .=print_r($theIdContTab);
$e=0;
for ($a=1;$a<=count($idContTab);$a++) {
$test=strpos(strip_tags($descContTab[$a]),'Valeur');
if ($test!==false) {
$e=$e+1;
$theIdContTabV[$e]=$idContTab[$a];
$theDescContTabV[$e]=$descContTab[$a];
$theMsgContTabV[$e]=strip_tags($msgContTab[$a]);
$thePopContTabV[$e]=$popContTab[$a];
}
}
echo '<div class="fondColorListe" style="width:99.9%; text-align:left; display:grid; grid-gap:1px;grid-template-columns:25% 25% 25% 25%; grid-gap:0px; padding-top:0px; margin:0px;" >';
echo '<span class="libelleLV" >';
echo 'Étiquette : ';
echo '</span>';
echo '<span class="libelleLV" >';
echo 'Valeur : ';
echo '</span>';
echo '<span class="libelleLV" >';
echo 'Info-bulle de l\'étiquette : ';
echo '</span>';
echo '<span class="libelleLV" >';
echo 'Info-bulle valeur : ';
echo '</span>';
for ($i=1;$i<=count($theIdContTab);$i++) {
// -----------------------------------------------------
// Desc garder pour dev
// -----------------------------------------------------
// echo '<span >' .$theIdContTab[$i]. ' desc </span>';
// echo '<div style="display:inline-block;" >';
// echo '<input style="width:90%;" class="inputLV" type="text" onChange="upContactDesc(this.value,' .$theIdContTab[$i]. ')" name="theDescContact" id="theDescContact' .$theIdContTab[$i]. '" value="' .$theDescContTab[$i]. '" title="Description du contact" />';
// echo '<input class="inputLV" type="text" onChange="upContactDesc(this.value,' .$theIdContTabV[$i]. ')" name="theDescContact" id="theDescContact' .$theIdContTabV[$i]. '" value="'.strip_tags($theDescContTabV[$i]). '" title="Valeur" />';
// echo '</div>';
// -----------------------------------------------------
// Libelle
// -----------------------------------------------------
echo '<span class="celluleLV"> ';
$titre="Saisissez un libellé ";
echo '<input class="inputLV" type="text" onChange="upContact(this.value,' .$theIdContTab[$i]. ')" value="' .$theMsgContTab[$i]. '" title="' .$titre. ' "/>';
echo '</span>';
echo '<span class="celluleLV"> ';
$titre="Saisissez une valeur";
echo '<input class="inputLV" type="text" onChange="upContact(this.value,' .$theIdContTabV[$i]. ')" value="' .$theMsgContTabV[$i]. '" title="' .$titre. ' "/>';
echo '</span>';
// -----------------------------------------------------
// Popup
// -----------------------------------------------------
echo '<span class="celluleLV"> ';
$titre="Saisissez un libellé pour la bulle étiquette";
echo '<input class="inputLV" type="text" onChange="upContactPop(' .$theIdContTab[$i]. ',this.value)" value="' .$thePopContTab[$i]. '" title="' .$titre. ' "/>';
echo '</span>';
echo '<span class="celluleLV" >';
$titre="Saisissez un libellé pour la bulle valeur";
echo '<input class="inputLV" type="text" onChange="upContactPop(' .$theIdContTabV[$i]. ',this.value)" value="'.strip_tags($thePopContTabV[$i]). '" title="' .$titre. ' "/>';
echo '</span>';
}
echo '</div>';
// -----------------------------------------------------
// Valider
// -----------------------------------------------------
echo '<div class="zoneValidate" style="width:95%;" >';
echo '</div>';
echo '</form>';
include ("commercant.fin_session.php");
?>