97 lines
3.8 KiB
PHP
Executable File
97 lines
3.8 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
// -----------------------------------------------------
|
|
// Etre admin
|
|
// -----------------------------------------------------
|
|
if (isset($_SESSION['isAdmin']) && $_SESSION['isAdmin']=='O' ) {
|
|
|
|
// -----------------------------------------------------
|
|
// Init
|
|
// -----------------------------------------------------
|
|
$lg='FRA';
|
|
$retour=0;
|
|
$listPaysVille="";
|
|
$codePost="";
|
|
$tabVilleListe="";
|
|
|
|
if (isset($_GET["idMl"])) $idMl=$_GET["idMl"];
|
|
if (isset($_GET["theIdZone"])) $theIdZone=$_GET["theIdZone"];
|
|
if (isset($_POST["listPaysVille"])) $listPaysVille=$_POST["listPaysVille"];
|
|
if (isset($_POST["retour"])) $retour=$_POST["retour"];
|
|
|
|
// -----------------------------------------------------
|
|
// Debug
|
|
// -----------------------------------------------------
|
|
if (isset($debug[1]) && $debug[1] == '1' ) {
|
|
$debugMsg .= monDebug(1, [
|
|
'codeOpe' => $codeOpe,
|
|
'idMl' => $idMl,
|
|
'theIdZone' => $theIdZone,
|
|
'listPaysVille' => $listPaysVille,
|
|
'retour' => $retour
|
|
], '');
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// Update
|
|
// -----------------------------------------------------
|
|
if ($codeOpe==='upVille2Zone') {
|
|
// recupere tableau existant
|
|
include ("gt.reqSelectPaysZone.php");
|
|
include ("gt.reqUpdateVille2Zone.php");
|
|
}
|
|
|
|
// -----------------------------------------------------
|
|
// Formulaire
|
|
// -----------------------------------------------------
|
|
echo '<form name="ajouterVille" id="ajouterVille" method="POST" >';
|
|
|
|
// -----------------------------------------------------
|
|
// Champs cachés
|
|
// -----------------------------------------------------
|
|
echo '<input type="hidden" name="codeOpe" id="codeOpe" value="' .$codeOpe. '" >';
|
|
echo '<input type="hidden" name="listPaysVille" id="listPaysVille" value="' .$listPaysVille. '" >';
|
|
echo '<input type="hidden" name="retour" id="retour" value="' .$retour. '" >';
|
|
|
|
// -----------------------------------------------------
|
|
// Zone Formulaire
|
|
// -----------------------------------------------------
|
|
echo '<div id="zoneFormModales" >';
|
|
|
|
// -----------------------------------------------------
|
|
// fetchCommune
|
|
// -----------------------------------------------------
|
|
echo '<span class="libChampsWebmaster" style="width:100%;">Entrez un code postal : ';
|
|
echo '<form name="testCp" id="testCp" method="POST" >';
|
|
echo '<input class="inputWebmaster" type="text" name="codePost" id="codePost" onChange="fetchCommune(this.value, \'4\', \'testCp\');" maxlenght="5" value="' .$codePost. '" >';
|
|
|
|
if (isset($_POST['tabVilleListe']) && !empty($_POST['tabVilleListe'])) {$tabVilleListe=$_POST['tabVilleListe'];}
|
|
if (!empty($tabVilleListe)) {
|
|
$tabVilleListe=json_decode($tabVilleListe);
|
|
}
|
|
if ($codeOpe!='upVille2Zone') echo '<input type="hidden" name="tabVilleListe" id="tabVilleListe" value="' .$tabVilleListe. '" >';
|
|
echo '<span style="display:block;margin:15px; padding:30px;" id="villeListe"></span>';
|
|
echo '</form >';
|
|
echo '</span>';
|
|
|
|
// -----------------------------------------------------
|
|
// Valider
|
|
// -----------------------------------------------------
|
|
echo '<span class="boutonsWebmaster boutonEnregistrer" style="max-width:40%;" onClick="validerVilles();"> Enregistrer';
|
|
echo '</span>';
|
|
|
|
// -----------------------------------------------------
|
|
// Retour
|
|
// -----------------------------------------------------
|
|
echo '<span class="boutonsWebmaster" style="max-width:40%;" onClick=location.href="./frmModale.php?affModale=6-6&idMl=' .$idMl. '&theIdZone=' .$theIdZone. '"><i class="fad fa-chevron-circle-left"></i> Retour';
|
|
echo '</span>';
|
|
|
|
echo '</div>';
|
|
echo '</form>';
|
|
}
|
|
else {
|
|
$confPath="../_conf";
|
|
include ("./adminInclude/redirectionAdmin.php");
|
|
}
|
|
?>
|