:: **Zploit** v1.0 | Current Path: **/home/kreativepixelz/www/crm/quatation/**
:: Editing File: client_delete.php
<?php include 'config/db.php'; include 'check_login.php'; // ✅ Validate client ID if (!isset($_GET['id']) || !is_numeric($_GET['id'])) { header("Location: clients_list.php?msg=Invalid Client ID"); exit; } $client_id = intval($_GET['id']); // ✅ Check if client exists $check_sql = "SELECT id FROM clients WHERE id = $client_id"; $check_res = mysqli_query($conn, $check_sql); if (mysqli_num_rows($check_res) === 0) { header("Location: clients_list.php?msg=Client not found"); exit; } // ✅ Delete client $delete_sql = "DELETE FROM clients WHERE id = $client_id"; if (mysqli_query($conn, $delete_sql)) { header("Location: clients_list.php?msg=Client deleted successfully"); exit; } else { $error = urlencode(mysqli_error($conn)); header("Location: clients_list.php?msg=Error deleting client: $error"); exit; } ?>