Element de la saisie

This commit is contained in:
Michael RICOIS 2011-01-26 12:29:52 +00:00
parent 7d7c80673d
commit 1cac520382
5 changed files with 102 additions and 75 deletions

View File

@ -39,27 +39,30 @@ size="10" maxlength="15" value="<?=$saisie['montant']?>"/>
<select name="etablissement5500[]" multiple size="3">
<option value="-">-</option>
<?php
require_once 'scoresws/scoresws.php';
$listEtablissements = scoresws_etablissements($siren.$nic, $siren, 0);
foreach ($listEtablissements as $etablissement) {
// Information etablissement
$title =
$siren.$etablissement['Nic'].' - '.
$etablissement['Adresse'].' '.
$etablissement['CP'].' '.
$etablissement['Ville'];
$value =
$etablissement['Adresse'].' '.
$etablissement['CP'].' '.
$etablissement['Ville'].' ('.
$etablissement['Nic'].')';
$siege = '';
if ($etablissement['Siege'] == 1 && $etablissement['Actif'] == 1) {
$siege = ' (Siège Actif)';
}
// Sélection etablissement
print '<option title="'.$title.$siege.
'" value="'.$value.'">'.$title.$siege.'</option>';
$ws = new WsScores();
$reponse = $ws->getListeEtablissements($siren);
if ($reponse!=false){
$listEtablissements = $reponse->result->liste->item;
if ( count($listEtablissements)>0 ){
foreach ($listEtablissements as $etablissement) {
$title =
$siren.$etablissement->Nic.' - '.
$etablissement->Adresse.' '.
$etablissement->CP.' '.
$etablissement->Ville;
$value = $etablissement->Nic;
$siege = '';
$select = '';
if ($etablissement->Nic == $nic) {
$select = ' selected';
}
if ($etablissement->Siege == 1 && $etablissement->Actif == 1) {
$siege = ' (Siège Actif)';
}
print '<option'.$select.' title="'.$title.$siege.
'" value="'.$value.'">'.$title.$siege.'</option>';
}
}
}
?>
</select>
@ -77,7 +80,7 @@ Utiliser l&#039;établissement : <?=$nic?></a>
foreach ( $tabPerimetreVente as $num => $perimetre ) {
$select = '';
if ( isset($inEditDialog) && $inEditDialog === true ){
if ( in_array($num, $saisie['even']) ) {
if ( isset($saisie['even']) && in_array($num, $saisie['even']) ) {
$select = 'selected';
}
}

View File

@ -10,25 +10,30 @@ $nic = (isset($_REQUEST['nic'] ) ? $_REQUEST['nic'] : '');
<select name="jugement[nic]" size="5">
<option value="-">-</option>
<?php
require_once 'scoresws/scoresws.php';
$listEtablissements = scoresws_etablissements($siren.$nic, $siren, 0);
foreach ($listEtablissements as $etablissement) {
$title =
$siren.$etablissement['Nic'].' - '.
$etablissement['Adresse'].' '.
$etablissement['CP'].' '.
$etablissement['Ville'];
$value = $etablissement['Nic'];
$siege = '';
$select = '';
if ($etablissement['Nic'] == $nic) {
$select = ' selected';
}
if ($etablissement['Siege'] == 1 && $etablissement['Actif'] == 1) {
$siege = ' (Siège Actif)';
}
print '<option'.$select.' title="'.$title.$siege.
'" value="'.$value.'">'.$title.$siege.'</option>';
$ws = new WsScores();
$reponse = $ws->getListeEtablissements($siren);
if ($reponse!=false){
$listEtablissements = $reponse->result->liste->item;
if ( count($listEtablissements)>0 ){
foreach ($listEtablissements as $etablissement) {
$title =
$siren.$etablissement->Nic.' - '.
$etablissement->Adresse.' '.
$etablissement->CP.' '.
$etablissement->Ville;
$value = $etablissement->Nic;
$siege = '';
$select = '';
if ($etablissement->Nic == $nic) {
$select = ' selected';
}
if ($etablissement->Siege == 1 && $etablissement->Actif == 1) {
$siege = ' (Siège Actif)';
}
print '<option'.$select.' title="'.$title.$siege.
'" value="'.$value.'">'.$title.$siege.'</option>';
}
}
}
?>
</select>

View File

@ -8,29 +8,32 @@ $message = '';
if ($idMandataire != '') {
$idMandataire = (int) substr($idMandataire, 1);
require_once 'scoresws/scoresws-int.php';
$tabMandataires = scoresws_getMandataire($idMandataire);
if ($tabMandataires === false) {
$ws = new WsScores();
$reponse = $ws->getMandataire($idMandataire);
if ($reponse === false) {
$message = 'Une erreur est survenue durant la recherche de mandataire.';
} else {
//@todo : format de retour
$tabMandataires = array();
}
} else {
$tabMandataires = $_REQUEST['tabMandataires'];
}
if ($tribunal != '') {
// La cour d'appel suivant le tribunal sélectionné
require_once 'scoresws/scoresws-int.php';
$codeCourAppel = scoresws_getIdCoursAppel($tribunal);
$ws = new WsScores();
$codeCourAppel = $ws->getIdCoursAppel($tribunal);
// Les cours d'appel
require_once realpath(dirname(__FILE__).'/coursappel.php');
// Les tribunaux
require_once 'scoresws/scoresws.php';
$o = new StdClass;
$o->tabTypes = array('C', 'I', 'G');
$tribunaux = $ws_soap_client_ent->__call('getTribunaux', array($o));
$ws = new WsScores();
$reponse = $ws->getTribunaux(array('C', 'I', 'G'));
$tribunaux = $reponse->result->item;
} else {
$message = 'Pas de tribunal sélectionné.';
}
@ -122,16 +125,18 @@ foreach ($coursAppel as $value) {
<select name="tabMandataires[tribunal]">
<option value="">Choix du tribunal</option>
<?php
foreach ($tribunaux as $code => $lib) {
if ($tabMandataires['tribunal'] == $code || $code == $tribunal) {
$select = ' selected';
foreach ($tribunaux as $trib) {
if ($tabMandataires['tribunal'] == $trib->code ||
$trib->code == $tribunal) {
$select = ' selected';
} else {
$select = '';
}
$lib = $trib->nom;
if (strlen($lib) > 39) {
$lib = substr($lib, 0, 41).'...';
}
print '<option value="'.$code.'"'.$select.'>'.$lib.'</option>';
print '<option value="'.$trib->code.'"'.$select.'>'.$lib.'</option>';
}
?>
</select>

View File

@ -21,9 +21,15 @@ function saisie_save($siret, $idEntreprise, $tabInfo)
$etabnic = $_REQUEST['etabnic'];
// Vente et Cession evénement 5500
foreach($perimetreVente as $k => $p){
if ( $p=='-' ){
array_splice($perimetreVente, $k, 1);
}
}
if (isset($perimetreVente) && count($perimetreVente) > 0) {
$tabJugement['even'] =
array_merge($tabJugement['even'], $perimetreVente);
$tabJugement['even'] = array_merge(
$tabJugement['even'],
$perimetreVente);
}
// Liste établissements concernées

View File

@ -1,5 +1,4 @@
<?php
header('Content-Type: text/html; charset='.CHARSET);
$search = (isset($_GET['search'])) ? strtolower($_GET['search']) : '';
if ($search == false) {
return;
@ -12,19 +11,24 @@ if (strlen($filtre) != 5 && strlen($filtre) != 2) {
$filtre = '';
}
require_once 'scoresws/scoresws.php';
$tableResults =
scoresws_searchMandataires($searchStr,
array('V', 'N', 'H', 'A', 'M'),
$filtre);
if ($tableResults === false) {
$ws = new WsScores();
$reponse = $ws->searchMandataires(
$searchStr,
array('V', 'N', 'H', 'A', 'M'),
$filtre
);
if ($reponse === false) {
print 'Erreur durant la recherche';
exit;
}
$output[] =
array('label' => "A l'adresse du bien vendu",
'id' => 'adresse');
$tableResults = $reponse->result->item;
$output[] = array(
'label' => "A l'adresse du bien vendu",
'id' => 'adresse'
);
/*
REGEX Code Postal : ^(F-)?((2[A|B])|[0-9]{2})[0-9]{3}$
@ -33,11 +37,15 @@ $output[] =
// Recherche des codes postaux
if (count($tableResults) > 0) {
$i = 0;
foreach ($tableResults as $code => $lib) {
$tabResults[$i]['code'] = $code;
$tabResults[$i]['lib'] =
htmlspecialchars_decode(html_entity_decode($lib), ENT_QUOTES);
preg_match('/(?<!bp )((2[A|B])|[0-9]{2})[0-9]{3}( )/i', $lib, $matches);
foreach ($tableResults as $result) {
$tabResults[$i]['code'] = $result->id;
$tabResults[$i]['lib'] = htmlspecialchars_decode(
html_entity_decode($result->mand), ENT_QUOTES);
preg_match(
'/(?<!bp )((2[A|B])|[0-9]{2})[0-9]{3}( )/i',
$result->mand,
$matches
);
$tabResults[$i]['cp'] = $matches[0];
$i++;
}
@ -51,9 +59,9 @@ if (count($tableResults) > 0) {
// Affichage des valeurs
foreach ($tabResults as $item) {
$output[] =
array('label' => $item['lib'],
'id' => $item['code']);
$output[] = array(
'label' => $item['lib'],
'id' => $item['code']);
}
}
print json_encode($output);