profil löschen
This commit is contained in:
54
php/php-dog/deleteProfil.php
Normal file
54
php/php-dog/deleteProfil.php
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
<?php
|
||||||
|
// error_reporting(E_ALL);
|
||||||
|
// ini_set("display_errors", 1);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
header("Access-Control-Allow-Origin: *");
|
||||||
|
header("Access-Control-Allow-Headers: access");
|
||||||
|
header("Access-Control-Allow-Methods: POST");
|
||||||
|
header("Content-Type: application/json; charset=UTF-8");
|
||||||
|
header("Access-Control-Allow-Headers: Content-Type, Access-Control-Allow-Headers, Authorization, X-Requested-With");
|
||||||
|
|
||||||
|
session_start();
|
||||||
|
|
||||||
|
require __DIR__.'/classes/Database.php';
|
||||||
|
require __DIR__.'/classes/lib.php';
|
||||||
|
|
||||||
|
$db_connection = new Database();
|
||||||
|
$conn = $db_connection->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
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -27,7 +27,11 @@ img
|
|||||||
background: #ffffff;
|
background: #ffffff;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.mantine-FileInput-input
|
||||||
|
{
|
||||||
|
min-width: 300px;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
@media print
|
@media print
|
||||||
{
|
{
|
||||||
|
|||||||
@ -26,8 +26,8 @@ const openDeleteModal = () =>
|
|||||||
centered: true,
|
centered: true,
|
||||||
children: (
|
children: (
|
||||||
<Text size="sm">
|
<Text size="sm">
|
||||||
Are you sure you want to delete your profile? This action is destructive and you will have
|
Wirklich Dein Profil löschen? Alle Daten gehen verloren und können nicht
|
||||||
to contact support to restore your data.
|
wiederhergestellt werden!
|
||||||
</Text>
|
</Text>
|
||||||
),
|
),
|
||||||
labels: { confirm: 'Account löschen', cancel: "Behalten, nicht löschen" },
|
labels: { confirm: 'Account löschen', cancel: "Behalten, nicht löschen" },
|
||||||
|
|||||||
Reference in New Issue
Block a user