From 5c7f9b3b03f6d2ab432b20831485714b3210c61f Mon Sep 17 00:00:00 2001 From: Peter Hoppe Date: Wed, 1 Mar 2023 23:59:47 +0100 Subject: [PATCH] =?UTF-8?q?profil=20l=C3=B6schen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- php/php-dog/deleteProfil.php | 54 ++++++++++++++++++++++++++++++++++++ src/App.css | 6 +++- src/components/DogNavbar.tsx | 4 +-- 3 files changed, 61 insertions(+), 3 deletions(-) create mode 100644 php/php-dog/deleteProfil.php diff --git a/php/php-dog/deleteProfil.php b/php/php-dog/deleteProfil.php new file mode 100644 index 0000000..9491722 --- /dev/null +++ b/php/php-dog/deleteProfil.php @@ -0,0 +1,54 @@ +dbConnection(); + +//var_dump($_POST); + +//IF REQUEST METHOD IS NOT EQUAL TO POST +if($_SERVER["REQUEST_METHOD"] != "POST") +{ + $returnData = new CMsg(0,404,'Page Not Found! REQUEST_METHOD'); + echo $returnData->jsonarray(); + return; +} + +if( + !isset($_POST['qr_id']) + || !isset($_POST['qr_id']) +) +{ + $fields = ['fields' => ['qr_id']]; + $returnData = new CMsg(0, 422, 'Please Fill in all Required Fields!', $fields); + echo $returnData->jsonarray(); + return; +} +else +{ + try + { + $stmt = $conn->prepare("DELETE FROM `dogs` WHERE `qr_id`=?"); + $stmt->execute([$qr_id]); + + if($stmt->rowCount()) + { + // delete upload dir + } + + } +} diff --git a/src/App.css b/src/App.css index a63ce2e..1985e48 100644 --- a/src/App.css +++ b/src/App.css @@ -27,7 +27,11 @@ img background: #ffffff; } - +.mantine-FileInput-input +{ + min-width: 300px; + text-align: center; +} @media print { diff --git a/src/components/DogNavbar.tsx b/src/components/DogNavbar.tsx index be6bd21..3b58e8f 100644 --- a/src/components/DogNavbar.tsx +++ b/src/components/DogNavbar.tsx @@ -26,8 +26,8 @@ const openDeleteModal = () => centered: true, children: ( - Are you sure you want to delete your profile? This action is destructive and you will have - to contact support to restore your data. + Wirklich Dein Profil löschen? Alle Daten gehen verloren und können nicht + wiederhergestellt werden! ), labels: { confirm: 'Account löschen', cancel: "Behalten, nicht löschen" },