Primo commit: trasferimento del progetto PPEasy

This commit is contained in:
2024-09-18 10:30:50 +02:00
commit eb475f257e
4233 changed files with 1043848 additions and 0 deletions
+46
View File
@@ -0,0 +1,46 @@
<?php
include('include/headscript.php');
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$requiredParams = [
'id'
];
foreach ($requiredParams as $param) {
if (! in_array($param, array_keys($_POST)) || empty($_POST[$param])) {
$response = json_encode([
'status' => 'failed',
'message' => "Mandatory field is missing !({$param})"
]);
header('Content-Type: application/json');
echo $response;
exit();
}
}
$UpdateQuery = new WA_MySQLi_Query($cmctrfdb);
$UpdateQuery->Action = "delete";
$UpdateQuery->Table = "identificationparts";
$UpdateQuery->addFilter("ididentificationparts", "=", "i", "{$_POST['id']}");
try {
$UpdateQuery->execute();
$response = json_encode([
'status' => 'success'
]);
} catch (Exception $e) {
$response = json_encode([
'status' => 'failed',
'message' => $e->getMessage()
]);
}
} else {
$response = json_encode([
'status' => 'failed',
'message' => 'Method not allowed'
]);
}
header('Content-Type: application/json');
echo $response;