123 lines
5.7 KiB
PHP
Executable File
123 lines
5.7 KiB
PHP
Executable File
<?php
|
|
$nomFicAppelant = basename(__FILE__);
|
|
// -----------------------------------------------------
|
|
// Etre admin
|
|
// -----------------------------------------------------
|
|
if (isset($_SESSION['isAdmin']) && $_SESSION['isAdmin']=='O' ) {
|
|
|
|
$theIdZone=1;
|
|
$numTranche2="";
|
|
$poidsMin2="";
|
|
$poidsMax2="";
|
|
$prix2="";
|
|
|
|
// -----------------------------------------------------
|
|
// Post
|
|
// include ("gt.post.php");
|
|
if (!empty($_GET['idMl'])) {$idMl=$_GET['idMl'];}
|
|
else
|
|
{if (isset($_POST['idMl'])) {$idMl=$_POST['idMl'];}}
|
|
|
|
if (!empty($_GET['theIdZone'])) {$theIdZone=$_GET['theIdZone'];}
|
|
else
|
|
{if (isset($_POST['theIdZone'])) {$theIdZone=$_POST['theIdZone'];}}
|
|
|
|
if (isset($_POST['numTranche2'])) {$numTranche2=$_POST['numTranche2'];}
|
|
if (isset($_POST['poidsMin2'])) {$poidsMin2=$_POST['poidsMin2'];}
|
|
if (isset($_POST['poidsMax2'])) {$poidsMax2=$_POST['poidsMax2'];}
|
|
if (isset($_POST['prix2'])) {$prix2=$_POST['prix2'];}
|
|
|
|
// -----------------------------------------------------
|
|
// Update
|
|
// -----------------------------------------------------
|
|
if ($codeOpe==='gtTranche') {include ("gt.reqUpdateTranche.php");}
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['Pas de update activ' => ''], '');}
|
|
|
|
// -----------------------------------------------------
|
|
// Select
|
|
// -----------------------------------------------------
|
|
include ("gt.reqSelectTranches.php");
|
|
include ("gt.reqSelectZone.php");
|
|
|
|
// -----------------------------------------------------
|
|
// Debug
|
|
// -----------------------------------------------------
|
|
if (isset($debug[1]) && $debug[1] == '1') {include ("gt.debug.php");}
|
|
|
|
// -----------------------------------------------------
|
|
// Titre
|
|
// -----------------------------------------------------
|
|
for($i=0; $i<count($tabIdZone); $i++) {
|
|
if ($tabIdZone[$i]==$theIdZone) {
|
|
$libelleZone=$tabIdDescZone[$i];
|
|
$_SESSION['libelleZone']=$libelleZone;
|
|
if (isset($debug[2]) && $debug[2] == '1') { $debugMsg .= monDebug(2, ['$_SESSION[libelleZone]=' => $_SESSION['libelleZone']], '');}
|
|
}
|
|
}
|
|
|
|
$title='Tranches tarifaires pour : \'' .$_SESSION['libelleMl']. '\' et pour la zone :<span style="font-size:1.2rem;">' .$libelleZone. '';
|
|
echo '<script type="text/javascript">document.getElementById(\'over\').innerHTML=$title;</script>';
|
|
|
|
// -----------------------------------------------------
|
|
// Zone Formulaire
|
|
// -----------------------------------------------------
|
|
echo '<div id="zoneFormModales">';
|
|
|
|
// -----------------------------------------------------
|
|
// Ajouter tranche
|
|
// -----------------------------------------------------
|
|
echo '<span class="boutonsWebmaster" onClick="window.self.location=\'./frmModale.php?affModale=6-4&idMl=' .$idMl. '&theIdZone=' .$theIdZone. '\';">';
|
|
echo '<i class="fad fa-plus"></i>';
|
|
echo '<span> Ajouter une tranche tarifaire </span>';
|
|
echo '</span>';
|
|
|
|
// -----------------------------------------------------
|
|
// Retour
|
|
// -----------------------------------------------------
|
|
echo '<span class="boutonsWebmaster" style="max-width:40%;" onClick=location.href="./frmModale.php?affModale=6-2&idMl=' .$idMl. '&theIdZone=' .$theIdZone. '"><i class="fad fa-chevron-circle-left"></i> Retour';
|
|
echo '</span>';
|
|
|
|
echo '<form name="gtTrancheF" id="gtTrancheF" method="POST" >';
|
|
// -----------------------------------------------------
|
|
// Champs cachés
|
|
// -----------------------------------------------------
|
|
echo '<input type="hidden" name="codeOpe" id="codeOpe" value="' .$codeOpe. '" />';
|
|
echo '<input type="hidden" name="theIdZone" id="theIdZone" value="' .$theIdZone. '" />';
|
|
echo '<input type="hidden" name="idMl" id="idMl" value="' .$idMl. '" />';
|
|
echo '<input type="hidden" name="numTranche2" id="numTranche2" value="' .$numTranche2. '" />';
|
|
echo '<input type="hidden" name="poidsMax2" id="poidsMax2" value="' .$poidsMax2. '" />';
|
|
echo '<input type="hidden" name="poidsMin2" id="poidsMin2" value="' .$poidsMin2. '" />';
|
|
echo '<input type="hidden" name="prix2" id="prix2" value="' .$prix2. '" />';
|
|
|
|
if (!empty($tabPoidsMin)) {
|
|
for ($i=0; $i<count($tabPoidsMin); $i++) {
|
|
echo '<div style="border:1px solid lightgrey; margin:7px; padding:3px;" >';
|
|
|
|
// -----------------------------------------------------
|
|
// Champs
|
|
// -----------------------------------------------------
|
|
require_once ('../_include/_fonctions/fonctions.gene.php');
|
|
$tabPoidsMin[$i]=formatNB($tabPoidsMin[$i],$lg);
|
|
$tabPoidsMax[$i]=formatNB($tabPoidsMax[$i],$lg);
|
|
$tabPrixMl[$i]=formatNB($tabPrixMl[$i],$lg);
|
|
echo '<span class="fondColorListe libChampsWebmaster" style="width:100%;" >';
|
|
// echo 'N ' .$tabNumTranche[$i];
|
|
echo 'Poids min : <input class="inputWebmaster" value="' .$tabPoidsMin[$i]. '" onChange="changeTrancheMin(this.value,' .$tabNumTranche[$i]. ');" />';
|
|
echo 'Poids max : <input class="inputWebmaster" value="' .$tabPoidsMax[$i]. '" onChange="changeTrancheMax(this.value,' .$tabNumTranche[$i]. ');" />';
|
|
echo 'Prix HT : <input class="inputWebmaster" value="' .$tabPrixMl[$i]. '" onChange="changeTranchePrix(this.value,' .$tabNumTranche[$i]. ');" />';
|
|
|
|
echo ' ';
|
|
echo '<i class="fad fa-trash-alt" style="color:red;fill:red;cursor:pointer;" onClick="zoneDelete(' .$theIdZone. ');"></i>';
|
|
echo '</span>';
|
|
echo '</div>';
|
|
}
|
|
}
|
|
else echo 'Pas de res count($tabPoidsMin)' ;
|
|
echo '</form>';
|
|
echo '</div>';
|
|
}
|
|
else {
|
|
$confPath="../_conf";
|
|
include ("./adminInclude/redirectionAdmin.php");
|
|
}
|
|
?>
|