diff --git a/htdocs/soc.php b/htdocs/soc.php index 7859f3050d4..96df1c66a96 100644 --- a/htdocs/soc.php +++ b/htdocs/soc.php @@ -76,7 +76,14 @@ if ($_POST["action"] == 'add' or $_POST["action"] == 'update') if ($_POST["action"] == 'add') { $socid = $soc->create(); - Header("Location: soc.php?socid=$socid"); + + if ($socid > 0) { + Header("Location: soc.php?socid=$socid"); + } + else { + $mesg="Erreur, cette société existe déjà"; + $_GET["actions"]='create'; + } } } @@ -99,7 +106,10 @@ if ($_GET["action"] == 'create') if ($_GET["type"]=='c') { $soc->client=1; } if ($_GET["type"]=='p') { $soc->client=2; } - print '