2009-03-13 14:58:10 +00:00
|
|
|
|
<?php
|
2010-01-22 08:58:39 +00:00
|
|
|
|
header('Content-Type: text/html; charset='.CHARSET);
|
2009-07-21 15:08:08 +00:00
|
|
|
|
|
2009-03-13 14:58:10 +00:00
|
|
|
|
$error=FALSE;
|
|
|
|
|
|
|
|
|
|
$tabMandataires = array();
|
|
|
|
|
$tabMandataires = $_REQUEST['tabMandataires'];
|
|
|
|
|
|
|
|
|
|
//V<>rification des donn<6E>es
|
|
|
|
|
$fields = array();
|
2010-01-22 08:58:39 +00:00
|
|
|
|
if($tabMandataires['sirenGrp']=='' && $tabMandataires['sirenMand']==''){
|
|
|
|
|
$fields[] ='Siren'; $error=TRUE; }
|
|
|
|
|
if($tabMandataires['sirenGrp'] == $tabMandataires['sirenMand']){
|
|
|
|
|
$fields[] ='Siren de la soci<63>t<EFBFBD> civile identique au Siren du mandataire';
|
|
|
|
|
$error=TRUE; }
|
2009-03-13 14:58:10 +00:00
|
|
|
|
if($tabMandataires['Nom']=='' ){$fields[] ='Nom'; $error=TRUE;}
|
2009-03-20 09:07:19 +00:00
|
|
|
|
if($tabMandataires['type']==''){$fields[] ='Type'; $error=TRUE;}
|
2009-03-13 14:58:10 +00:00
|
|
|
|
if($tabMandataires['coursAppel']==''){$fields[] ='Cours d\'appel'; $error=TRUE;}
|
2009-03-20 09:07:19 +00:00
|
|
|
|
if($tabMandataires['Statut']==''){$fields[] ='Statut'; $error=TRUE;}
|
2009-03-13 14:58:10 +00:00
|
|
|
|
if($tabMandataires['adresse']==''){$fields[] ='Adresse'; $error=TRUE;}
|
2009-03-20 09:07:19 +00:00
|
|
|
|
if($tabMandataires['cp']==''){$fields[] ='Code Postal'; $error=TRUE;}
|
|
|
|
|
if($tabMandataires['ville']==''){$fields[] ='Ville'; $error=TRUE;}
|
2009-07-21 15:08:08 +00:00
|
|
|
|
if($tabMandataires['tel']==''){$fields[] ='T<>l<EFBFBD>phone'; $error=TRUE;}
|
2009-03-13 14:58:10 +00:00
|
|
|
|
|
|
|
|
|
//Envoi de la requ<71>te au webservices
|
|
|
|
|
if ($error==TRUE){
|
2009-03-20 09:07:19 +00:00
|
|
|
|
$message = '<font color="red">';
|
|
|
|
|
$message.= 'Veuillez remplir les champs suivants : ';
|
|
|
|
|
$message.= join(', ', $fields);
|
|
|
|
|
$message.= '</font>';
|
2009-03-13 14:58:10 +00:00
|
|
|
|
}else{
|
|
|
|
|
$message='';
|
|
|
|
|
//On int<6E>rroge le webservice
|
|
|
|
|
//Connection au webservice
|
2010-01-22 08:58:39 +00:00
|
|
|
|
$client = new SoapClient(null, array(
|
|
|
|
|
'trace' => 1,
|
|
|
|
|
'soap_version' => SOAP_1_1,
|
|
|
|
|
'location' => WEBSERVICE_URL,
|
|
|
|
|
'uri' => WEBSERVICE_URI,
|
|
|
|
|
'login' => $_SESSION['tabInfo']['login'],
|
|
|
|
|
'password' => $_SESSION['tabInfo']['password'],
|
|
|
|
|
//'encoding' => 'UTF-8'
|
2009-03-13 14:58:10 +00:00
|
|
|
|
));
|
2009-03-24 12:00:16 +00:00
|
|
|
|
$firephp->log($tabMandataires);
|
2009-07-21 15:08:08 +00:00
|
|
|
|
//Si le webservice renvoie une erreur, on l'affecte <20> message
|
2009-03-20 17:44:22 +00:00
|
|
|
|
try {
|
2009-03-20 09:07:19 +00:00
|
|
|
|
$client->setMandataire($tabMandataires);
|
|
|
|
|
}catch(SoapFault $fault){
|
|
|
|
|
$message = 'Une erreur s\'est produite durant l\'enregistrement';
|
2009-03-20 17:44:22 +00:00
|
|
|
|
}
|
2009-03-13 14:58:10 +00:00
|
|
|
|
}
|
|
|
|
|
print $message;
|
|
|
|
|
|
|
|
|
|
?>
|