Merge pull request #405 from wrongecho/delete-client

Delete client - post.php
This commit is contained in:
Johnny 2022-03-25 16:09:15 -04:00 committed by GitHub
commit 1e8638818b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 9 additions and 2 deletions

View File

@ -1226,6 +1226,13 @@ if(isset($_POST['edit_client'])){
}
if(isset($_GET['delete_client'])){
if($session_user_role !== "3"){
$_SESSION['alert_type'] = "danger";
$_SESSION['alert_message'] = "You are not permitted to do that!";
header("Location: " . $_SERVER["HTTP_REFERER"]);
exit();
}
$client_id = intval($_GET['delete_client']);
//Get Client Name
@ -1247,9 +1254,9 @@ if(isset($_GET['delete_client'])){
mysqli_query($mysqli,"DELETE FROM software WHERE software_client_id = $client_id");
mysqli_query($mysqli,"DELETE FROM vendors WHERE vendor_client_id = $client_id");
mysqli_query($mysqli,"DELETE FROM client_tags WHERE client_id = $client_id");
mysqli_query($mysqli,"DELETE FROM user_clients WHERE client_id = $client_id");
mysqli_query($mysqli,"DELETE FROM scheduled_tickets WHERE scheduled_ticket_client_id = $client_id");
$sql = mysqli_query($mysqli,"SELECT recurring_id FROM recurring WHERE recurring_client_id = $client_id");
$sql = mysqli_query($mysqli,"SELECT recurring_id FROM recurring WHERE recurring_client_id = $client_id");
while($row = mysqli_fetch_array($sql)){
$recurring_id = $row['recurring_id'];