if ($addressListCount !== 0) { // si adresse existe déjà dans la liste sélectionnée echo "addressAlreadyExistInList"; } else { // Si l'adresse n'existe pas dans la liste on l'ajoute $addressList->create($addressName, $listName); echo "successAddList"; } } } } } else { if (isset($_POST["list"]) and isset($_POST["address"])) { $listName = strip_tags($_POST["list"]); $addressName = strip_tags($_POST["address"]); $addressListCount = $addressList->addressListVerification($listName, $addressName); if ($addressListCount === 0) { "addressDoesntExistInList"; } else { $addressList->delete($addressName); echo "successDeleteAddressInList"; } } else { if (isset($_POST["delete"]) && $_POST["delete"] === "true" && isset($_POST["list"])) { $nameList = strip_tags($_POST["list"]); $lists->delete($nameList); } } } break; }
function deleteList(Lists $list, $list_id, $user_id) { $list->delete($list_id, $user_id); }