Added delete quotes which also deletes all history of that quote added status to recurring under client, changed password view to from its own th button to just an icon

This commit is contained in:
root
2019-05-18 00:01:21 -04:00
parent 3dd1905176
commit 9b8f48794f
6 changed files with 45 additions and 11 deletions

View File

@@ -861,6 +861,31 @@ if(isset($_POST['edit_quote'])){
}
if(isset($_GET['delete_quote'])){
$quote_id = intval($_GET['delete_quote']);
mysqli_query($mysqli,"DELETE FROM quotes WHERE quote_id = $quote_id");
//Delete Items Associated with the Quote
$sql = mysqli_query($mysqli,"SELECT * FROM invoice_items WHERE quote_id = $quote_id");
while($row = mysqli_fetch_array($sql)){;
$item_id = $row['item_id'];
mysqli_query($mysqli,"DELETE FROM invoice_items WHERE item_id = $item_id");
}
//Delete History Associated with the Quote
$sql = mysqli_query($mysqli,"SELECT * FROM invoice_history WHERE quote_id = $quote_id");
while($row = mysqli_fetch_array($sql)){;
$invoice_history_id = $row['invoice_history_id'];
mysqli_query($mysqli,"DELETE FROM invoice_history WHERE invoice_history_id = $invoice_history_id");
}
$_SESSION['alert_message'] = "Quotes deleted";
header("Location: " . $_SERVER["HTTP_REFERER"]);
}
if(isset($_POST['add_quote_copy'])){
$quote_id = intval($_POST['quote_id']);