20 lines
578 B
PHP
Executable File
20 lines
578 B
PHP
Executable File
<?php
|
|
header('Content-Type: application/json');
|
|
|
|
$pdo = new PDO("pgsql:host=localhost;dbname=adx_system", "admin", "admin123");
|
|
|
|
$id = $_GET['id'] ?? $_POST['id'] ?? '';
|
|
|
|
if (empty($id) || !is_numeric($id)) {
|
|
die(json_encode(['status' => 'error', 'message' => 'Invalid ID']));
|
|
}
|
|
|
|
try {
|
|
$stmt = $pdo->prepare("DELETE FROM admin.huawei_processes WHERE id = ?");
|
|
$stmt->execute([$id]);
|
|
echo json_encode(['status' => 'success', 'message' => 'Process deleted']);
|
|
} catch (Exception $e) {
|
|
echo json_encode(['status' => 'error', 'message' => $e->getMessage()]);
|
|
}
|
|
|