alpha_full/pages/clients/client.form2.php
2026-04-06 22:58:51 +02:00

114 lines
7.6 KiB
PHP
Executable File

<?php
$nomFicAppelant = basename(__FILE__);
// ---------------------------------------------------
// Flag pour savoir si on fait un update ou pas dans le panier, ou suivant
// ---------------------------------------------------
echo '<input type="hidden" name="flagUpdFact" id="flagUpdFact" style="width:50px;" value="' .$flagUpdFact. '" >';
echo '<input type="hidden" name="faireCP" id="faireCP" style="width:50px;" value="' .$faireCP. '" >';
// pour la navigation clic droit
// debug
// if (isset($affPageSite)) echo 'affPageSite = '.$affPageSite;
// else echo 'affPageSite = empty';
echo '<input type="hidden" style="display:none;" id="affPageSite" value="' .$affPageSite. '" >';
// ---------------------------------------------------
// Formulaire 2 : adresse fact
// ---------------------------------------------------
if (empty($clientMsg)) {$refresh='Oui'; include ($includePath. '/req/06-init.cliMsgList.php');$refresh='N';}
// ---------------------------------------------------
// Adresse fact
// ---------------------------------------------------
dynamiqItemMessage(0, 1, 'libClientsCell', '-styleDiv-', 'span', 'libClients', '-action-', 'client', 13, '-' );
// echo '<div class="champsCliCell"><input class="champsCli" type="text" name="adresse" id="adresse" value="' .$adresse. '" onKeyPress="if (event.keyCode == 13) validerModifFact();" onClick="document.getElementById(\'flagUpdFact\').value=\'Oui\';"></div>';
dynamiqChamp(0, 1, 'champsCliCell', 'input', 'text', 'champsCli', 'onKeyPress="if (event.keyCode == 13) validerModifFact();" onClick="document.getElementById(\'flagUpdFact\').value=\'Oui\';" ', 'adresse', 'N° et rue', $adresse, '-', '-');
// ---------------------------------------------------
// Adresse - 2
// ---------------------------------------------------
dynamiqItemMessage(0, 1, 'libClientsCell', '-styleDiv-', 'span', 'libClients', '-action-', 'client', 14, '-' );
// echo '<div class="champsCliCell" >';
// echo '<input class="champsCli" type="text" name="adresse2" id="adresse2" maxlenght="254" value="' .$adresse2. '" onKeyPress="if (event.keyCode == 13) validerModifFact();" onClick="document.getElementById(\'flagUpdFact\').value=\'Oui\';"></div>';
dynamiqChamp(0, 1, 'champsCliCell', 'input', 'text', 'champsCli', 'onKeyPress="if (event.keyCode == 13) validerModifFact();" onClick="document.getElementById(\'flagUpdFact\').value=\'Oui\';" ', 'adresse2', 'Complément adresse', $adresse2, '-', '-');
// ---------------------------------------------------
// Code post fact
// ---------------------------------------------------
if (isset($_POST['codePost']) && !empty($_POST['codePost'])) {$codePost=$_POST['codePost'];}
dynamiqItemMessage(0, 1, 'libClientsCell', '-styleDiv-', 'span', 'libClients', '-action-', 'client', 15, '-' );
// echo '<div class="champsCliCell"><input class="champsCli" type="text" name="codePost" id="codePost" onChange="fetchCommune ( this.value, \'2\', form.id) ;" onKeyPress="if (event.keyCode == 13) fetchCommune(this.value,\'2\', form.id); document.getElementById(\'flagUpdFact\').value=\'Oui\';" onClick="document.getElementById(\'flagUpdFact\').value=\'Oui\';" maxlenght="5" value="' .$codePost. '" ></div>';
dynamiqChamp(0, 1, 'champsCliCell', 'input', 'text', 'champsCli', 'onChange="fetchCommune ( this.value, \'2\', form.id) ;" onKeyPress="if (event.keyCode == 13) fetchCommune(this.value,\'2\', form.id); document.getElementById(\'flagUpdFact\').value=\'Oui\';" onClick="document.getElementById(\'flagUpdFact\').value=\'Oui\';" ', 'codePost', 'Complément adresse', $codePost, '-', 'maxlenght="5"');
// ---------------------------------------------------
// Recup Post villes
// ---------------------------------------------------
if (isset($_POST['tabVilleListe']) && !empty($_POST['tabVilleListe'])) {$tabVilleListe=$_POST['tabVilleListe'];}
echo '<input type="hidden" name="tabVilleListe" id="tabVilleListe" value="' .$tabVilleListe. '" >';
if (!empty($tabVilleListe)) {$tabVilleListe=json_decode($tabVilleListe);}
if (isset($debug[3]) && $debug[3] == '1') {
echo '<br><pre>';
// print_r($_POST);
print_r($tabVilleListe);
echo '<br></pre>';
}
// ---------------------------------------------------
// Ville fact
// ---------------------------------------------------
dynamiqItemMessage(0, 1, 'libClientsCell', '-styleDiv-', 'span', 'libClients', '-action-', 'client', 16, '-' );
if (!empty($tabVilleListe)) {
if ( $affMContext === true ) echo '<div class="champsCliCell" style="cursor:context-menu" ' .$mouseOverMenuContextContainer. ' onContextMenu="return mConStyle(this, \'Clients\', \'champsCliCell\', 5,\'client\', 3, 16, event);" >';
else echo '<div class="champsCliCell" >';
if ( $affMContext === true ) echo '<select class="listeDeroulanteCli" name="ville" onKeyPress="if (event.keyCode == 13) validerModifFact();" onClick="document.getElementById(\'flagUpdFact\').value=\'Oui\';" style="cursor:context-menu" ' .$mouseOverMenuContextContainer. ' onContextMenu="return mConStyle(this, \'Clients\', \'listeDeroulanteCli\', 7,\'client\', 3, 16, event);">';
else echo '<select class="listeDeroulanteCli" name="ville" onKeyPress="if (event.keyCode == 13) validerModifFact();" onClick="document.getElementById(\'flagUpdFact\').value=\'Oui\';" >';
for($v=0;$v<count($tabVilleListe);$v++) {
if ($tabVilleListe[$v]== $ville && ( $tabVilleListe[$v]!="Coursegoules" && $siteName!='pizzaJeannot' )) {
echo '<option value="' .$tabVilleListe[$v]. '" selected>' .$tabVilleListe[$v]. '</option>';
}
else {
if ($siteName!='pizzaJeannot' ) {echo '<option value="' .$tabVilleListe[$v]. '" >' .$tabVilleListe[$v]. '</option>';}
else if ($tabVilleListe[$v]!="Coursegoules" ) {echo '<option value="' .$tabVilleListe[$v]. '" >' .$tabVilleListe[$v]. '</option>';}
}
}
echo '</select>';
echo '</div>';
}
else {
dynamiqChamp(0, 1, 'champsCliCell', 'input', 'text', 'champsCli', 'onClick="document.getElementById(\'flagUpdFact\').value=\'Oui\';" ', 'ville', 'Ville', $ville, '-', 'maxlenght="150"');
}
// ---------------------------------------------------
// Pays fact
// ---------------------------------------------------
dynamiqItemMessage(0, 1, 'libClientsCell', '-styleDiv-', 'span', 'libClients', '-action-', 'client', 17, '-' );
if ( $affMContext === true ) echo '<div class="champsCliCell" style="cursor:context-menu" ' .$mouseOverMenuContextContainer. ' onContextMenu="return mConStyle(this, \'Clients\', \'champsCliCell\', 5,\'client\', 3, 17, event);" >';
else echo '<div class="champsCliCell" >';
if ( $affMContext === true ) echo '<select class="listeDeroulanteCli" name="idPaysFact" onKeyPress="if (event.keyCode == 13) validerModifFact();" onClick="document.getElementById(\'flagUpdFact\').value=\'Oui\';" style="cursor:context-menu" ' .$mouseOverMenuContextContainer. ' onContextMenu="return mConStyle(this, \'Clients\', \'listeDeroulanteCli\', 7,\'client\', 3, 17, event);">';
else echo '<select class="listeDeroulanteCli" name="idPaysFact" onKeyPress="if (event.keyCode == 13) validerModifFact();" onClick="document.getElementById(\'flagUpdFact\').value=\'Oui\';" >';
for($j=0; $j<count($tabIdPays) ; $j++) {
if ($tabIdPays[$j]==$idPaysFact)
{echo '<option value="' .$tabIdPays[$j]. '" selected>' .$tabLibPays[$j]. '</option>';}
else
{echo '<option value="' .$tabIdPays[$j]. '" >' .$tabLibPays[$j]. '</option>';}
}
echo '</select>';
echo '</div>';
echo '<script type="text/javascript" src="' .$includePathJs. '/fetchCommune.js" ></script>';
?>