extranet/www/pages/ajax_surveillance.php
2010-02-23 15:27:18 +00:00

38 lines
1018 B
PHP

<?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')
{
$firephp->log($_REQUEST['formSurv'],'formSurv');
$set = setSurveillance($_REQUEST['formSurv']);
$firephp->log($set, 'set');
if($set!==false){
$return = '<br/>L\'entité a été placé sous surveillance.'."\n";
}else{
$return = '<br/>Une erreur a rendu impossible la mise sous surveillance.'."\n";
}
}
elseif($_REQUEST['q']=='getsurv')
{
$return = getSurveillance($source, $siret);
}
elseif($_REQUEST['q']=='ajouter')
{
$firephp->log($_REQUEST, 'REQUEST');
$siret = $_REQUEST['siret'];
$source = ( isset($_REQUEST['source']) && !empty($_REQUEST['source']) ) ?
$_REQUEST['source'] : '' ;
$return = formSurveillance($source, $siret, array(), true);
}
echo $return;
exit;
?>