extranet/www/pages/ajax_surveillance.php
2010-04-16 08:03:44 +00:00

37 lines
926 B
PHP

<?php
require_once 'user/user.php';
require_once 'surveillance/surveillance.php';
$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']
));
if($_REQUEST['q']=='setsurv')
{
$set = setSurveillance($_REQUEST['formSurv']);
FB::log($set, 'set');
if($set==''){
$return = '';
}elseif ($set===false){
$return = 'Erreur : Mise sous surveillance impossible.'."\n";
}else{
$return = 'Erreur : '.$set."\n";
}
}
elseif($_REQUEST['q']=='getsurv')
{
$return = getSurveillance($source, $siret);
}
elseif($_REQUEST['q']=='ajouter')
{
$siret = $_REQUEST['siret'];
$source = ( isset($_REQUEST['source']) && !empty($_REQUEST['source']) ) ?
$_REQUEST['source'] : '' ;
$return = formSurveillance($source, $siret, array(), true);
}
echo $return;