getAnnonceCollecte($idan, $siret); $idanResult = $O['result']; } catch (SoapFault $fault) { require_once 'soaperror.php'; processSoapFault($client, $fault, $_SESSION['tabInfo']); } return $idanResult; } function supprAnnonceCollecte($idan, $siret = ''){ global $client; try { $O = $client->supprAnnonceCollecte($idan, $siret); $error = $O['error']; } catch (SoapFault $fault) { require_once 'soaperror.php'; processSoapFault($client, $fault, $_SESSION['tabInfo']); } if ( isset($error) && $error['errNum'] == 0 ){ $output = 'Annonce '.$idan.' supprimé !'; } elseif ( isset($error) && $error['errNum'] != 0 ) { $output = 'Erreur lors de la suppression.'; } else { $output = "Une erreur est survenue..."; } return $output; } function supprAnnonce($source, $idan, $siret) { global $client; $sourceNum = false; $source = strtoupper($source); if (in_array($source, array('BODA', 'BODB', 'BODC'))){ $sourceNum = 1; } elseif ($source == 'BALO') { $sourceNum = 2; } elseif ($source == 'ASSO') { $sourceNum = 3; } elseif (in_array($source, array('BOMP A', 'BOMP B', 'BOMP C', 'MAPA'))) { $sourceNum = 4; } elseif (!empty($source)){ $sourceNum = 0; } if ($sourceNum === false) { return "Source inconnu"; } try { $O = $client->supprAnnonce($sourceNum, $idan, $siret); $error = $O['error']; } catch (SoapFault $fault) { require_once 'soaperror.php'; processSoapFault($client, $fault, $_SESSION['tabInfo']); } if ( isset($error) && $error['errNum'] == 0 ){ $output = 'Annonce '.$idan.' supprimé !'; } elseif ( isset($error) && $error['errNum'] != 0 ) { $output = 'Erreur lors de la suppression.'; } else { $output = "Une erreur est survenue..."; } return $output; } function dupliqueAnnonceCollecte($idan, $siret){ global $client; try { $O = $client->dupliqueAnnonceCollecte($idan, $siret); $error = $O['error']; } catch (SoapFault $fault) { require_once 'soaperror.php'; processSoapFault($client, $fault, $_SESSION['tabInfo']); } if ( isset($error) && $error['errNum'] == 0 ){ $output = 'Annonce '.$idan.' dupliqué sur '.$siret.'!'; } elseif ( isset($error) && $error['errNum'] != 0 ) { $output = 'Erreur lors de la duplication.'; } else { $output = "Une erreur est survenue..."; } return $output; } switch ( $subaction ) { case 'deleteDialog': $source = $params[2]; $idan = $params[3]; $siret = $_SESSION['tabInfo']['entrep']['siret']; ?>