mirror of https://github.com/itflow-org/itflow
Added edit notes, and added a bunch of delete functionality, fixed edit categories not showing correct type
This commit is contained in:
parent
bf5b055ad7
commit
62f86df80e
|
|
@ -46,7 +46,7 @@
|
|||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editAccountModal<?php echo $account_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
<a class="dropdown-item" href="post.php?delete_account=<?php echo $account_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -36,7 +36,7 @@
|
|||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editCategoryModal<?php echo $category_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
<a class="dropdown-item" href="post.php?delete_category=<?php echo $category_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@
|
|||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientAssetModal<?php echo $client_asset_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
<a class="dropdown-item" href="post.php?delete_client_asset=<?php echo $client_asset_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientContactModal<?php echo $client_contact_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
<a class="dropdown-item" href="post.php?delete_client_contact=<?php echo $client_contact_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editinvoiceModal<?php echo $invoice_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addinvoiceCopyModal<?php echo $invoice_id; ?>">Copy</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addinvoiceCopyModal<?php echo $invoice_id; ?>">PDF</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
<a class="dropdown-item" href="post.php?delete_invoice=<?php echo $invoice_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -37,7 +37,7 @@
|
|||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientLocationModal<?php echo $client_location_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
<a class="dropdown-item" href="post.php?delete_client_location=<?php echo $client_location_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -31,7 +31,7 @@
|
|||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientLoginModal<?php echo $client_login_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
<a class="dropdown-item" href="post.php?delete_client_login=<?php echo $client_login_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -27,8 +27,8 @@
|
|||
<i class="fas fa-ellipsis-h"></i>
|
||||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientnoteModal<?php echo $client_note_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientNoteModal<?php echo $client_note_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="post.php?delete_client_note=<?php echo $client_note_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientVendorModal<?php echo $client_vendor_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
<a class="dropdown-item" href="post.php?delete_client_vendor=<?php echo $client_vendor_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@
|
|||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editClientModal<?php echo $client_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
<a class="dropdown-item" href="post.php?delete_client=<?php echo $client_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@
|
|||
<div class="form-group">
|
||||
<label>Type</label>
|
||||
<select class="form-control" name="type" required>
|
||||
<?php foreach($category_types_array as $category_type2 => $category_type2) { ?>
|
||||
<?php foreach($category_types_array as $category_type2) { ?>
|
||||
<option <?php if($category_type == $category_type2) { echo "selected"; } ?>><?php echo $category_type2; ?></option>
|
||||
<?php } ?>
|
||||
</select>
|
||||
|
|
|
|||
|
|
@ -0,0 +1,34 @@
|
|||
<div class="modal fade" id="editClientNoteModal<?php echo $client_note_id; ?>" tabindex="-1">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="fa fa-edit"></i> Edit Note</h5>
|
||||
<button type="button" class="close" data-dismiss="modal">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<form action="post.php" method="post" autocomplete="off">
|
||||
<input type="hidden" name="client_note_id" value="<?php echo $client_note_id; ?>">
|
||||
<div class="modal-body">
|
||||
<div class="form-group">
|
||||
<label>Subject</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text"><i class="fa fa-edit"></i></span>
|
||||
</div>
|
||||
<input type="text" class="form-control" name="subject" value="<?php echo $client_note_subject; ?>" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label>Note</label>
|
||||
<textarea rows="8" class="form-control" name="note" required><?php echo $client_note_body; ?></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancel</button>
|
||||
<button type="submit" name="edit_client_note" class="btn btn-primary">Save</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
@ -59,7 +59,7 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editExpenseModal<?php echo $expense_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addExpenseCopyModal<?php echo $expense_id; ?>">Copy</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addExpenseRefundModal<?php echo $expense_id; ?>">Refund</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
<a class="dropdown-item" href="post.php?delete_expense=<?php echo $expense_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@
|
|||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editinvoiceModal<?php echo $invoice_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addinvoiceCopyModal<?php echo $invoice_id; ?>">Copy</a>
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#addinvoiceCopyModal<?php echo $invoice_id; ?>">PDF</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
<a class="dropdown-item" href="post.php?delete_invoice=<?php echo $invoice_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@
|
|||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editMileageModal<?php echo $mileage_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
<a class="dropdown-item" href="post.php?delete_mileage=<?php echo $mileage_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
168
post.php
168
post.php
|
|
@ -47,6 +47,17 @@ if(isset($_POST['edit_client'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_GET['delete_client'])){
|
||||
$client_id = intval($_GET['delete_client']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM clients WHERE client_id = $client_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Client deleted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_vendor'])){
|
||||
|
||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
||||
|
|
@ -88,6 +99,17 @@ if(isset($_POST['edit_vendor'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_GET['delete_vendor'])){
|
||||
$vendor_id = intval($_GET['delete_vendor']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM vendors WHERE vendor_id = $vendor_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Vendor deleted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_mileage'])){
|
||||
|
||||
$date = strip_tags(mysqli_real_escape_string($mysqli,$_POST['date']));
|
||||
|
|
@ -121,6 +143,17 @@ if(isset($_POST['edit_mileage'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_GET['delete_mileage'])){
|
||||
$mileage_id = intval($_GET['delete_mileage']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM mileage WHERE mileage_id = $mileage_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Mileage deleted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_account'])){
|
||||
|
||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
||||
|
|
@ -147,6 +180,17 @@ if(isset($_POST['edit_account'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_GET['delete_account'])){
|
||||
$account_id = intval($_GET['delete_account']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM accounts WHERE account_id = $account_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Account deleted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_category'])){
|
||||
|
||||
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
|
||||
|
|
@ -174,6 +218,17 @@ if(isset($_POST['edit_category'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_GET['delete_category'])){
|
||||
$category_id = intval($_GET['delete_category']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM categories WHERE category_id = $category_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Category deleted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_expense'])){
|
||||
|
||||
$date = strip_tags(mysqli_real_escape_string($mysqli,$_POST['date']));
|
||||
|
|
@ -209,6 +264,17 @@ if(isset($_POST['edit_expense'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_GET['delete_expense'])){
|
||||
$expense_id = intval($_GET['delete_expense']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM expenses WHERE expense_id = $expense_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Expense deleted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_transfer'])){
|
||||
|
||||
$date = strip_tags(mysqli_real_escape_string($mysqli,$_POST['date']));
|
||||
|
|
@ -240,6 +306,17 @@ if(isset($_POST['edit_transfer'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_GET['delete_transfer'])){
|
||||
$transfer_id = intval($_GET['delete_transfer']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM transfers WHERE transfer_id = $transfer_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Transfer deleted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_invoice'])){
|
||||
|
||||
$client = intval($_POST['client']);
|
||||
|
|
@ -259,6 +336,17 @@ if(isset($_POST['add_invoice'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_GET['delete_invoice'])){
|
||||
$invoice_id = intval($_GET['delete_invoice']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM invoices WHERE invoice_id = $invoice_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Invoice deleted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_invoice_item'])){
|
||||
|
||||
$invoice_id = intval($_POST['invoice_id']);
|
||||
|
|
@ -396,6 +484,17 @@ if(isset($_POST['edit_client_contact'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_GET['delete_client_contact'])){
|
||||
$client_contact_id = intval($_GET['delete_client_contact']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM client_contacts WHERE client_contact_id = $client_contact_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Contact deleted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_client_location'])){
|
||||
|
||||
$client_id = intval($_POST['client_id']);
|
||||
|
|
@ -434,6 +533,17 @@ if(isset($_POST['edit_client_location'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_GET['delete_client_location'])){
|
||||
$client_location_id = intval($_GET['delete_client_location']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM client_locations WHERE client_location_id = $client_location_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Location deleted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_client_asset'])){
|
||||
|
||||
$client_id = intval($_POST['client_id']);
|
||||
|
|
@ -470,6 +580,17 @@ if(isset($_POST['edit_client_asset'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_GET['delete_client_asset'])){
|
||||
$client_asset_id = intval($_GET['delete_client_asset']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM client_assets WHERE client_asset_id = $client_asset_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Asset deleted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_client_vendor'])){
|
||||
|
||||
$client_id = intval($_POST['client_id']);
|
||||
|
|
@ -500,6 +621,17 @@ if(isset($_POST['edit_client_vendor'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_GET['delete_client_vendor'])){
|
||||
$client_vendor_id = intval($_GET['delete_client_vendor']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM client_vendors WHERE client_vendor_id = $client_vendor_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Vendor deleted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_client_login'])){
|
||||
|
||||
$client_id = intval($_POST['client_id']);
|
||||
|
|
@ -532,6 +664,17 @@ if(isset($_POST['edit_client_login'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_GET['delete_client_login'])){
|
||||
$client_login_id = intval($_GET['delete_client_login']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM client_logins WHERE client_login_id = $client_login_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Login deleted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_client_note'])){
|
||||
|
||||
$client_id = intval($_POST['client_id']);
|
||||
|
|
@ -546,6 +689,31 @@ if(isset($_POST['add_client_note'])){
|
|||
|
||||
}
|
||||
|
||||
if(isset($_POST['edit_client_note'])){
|
||||
|
||||
$client_note_id = intval($_POST['client_note_id']);
|
||||
$subject = strip_tags(mysqli_real_escape_string($mysqli,$_POST['subject']));
|
||||
$note = strip_tags(mysqli_real_escape_string($mysqli,$_POST['note']));
|
||||
|
||||
mysqli_query($mysqli,"UPDATE client_notes SET client_note_subject = '$subject', client_note_body = '$note' WHERE client_note_id = $client_note_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Note updated";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_GET['delete_client_note'])){
|
||||
$client_note_id = intval($_GET['delete_client_note']);
|
||||
|
||||
mysqli_query($mysqli,"DELETE FROM client_notes WHERE client_note_id = $client_note_id");
|
||||
|
||||
$_SESSION['alert_message'] = "Note deleted";
|
||||
|
||||
header("Location: " . $_SERVER["HTTP_REFERER"]);
|
||||
|
||||
}
|
||||
|
||||
if(isset($_POST['add_user'])){
|
||||
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
|
||||
$password = mysqli_real_escape_string($mysqli,$_POST['password']);
|
||||
|
|
|
|||
|
|
@ -55,7 +55,7 @@ $sql = mysqli_query($mysqli,"SELECT * FROM transfers ORDER BY transfers.transfer
|
|||
</button>
|
||||
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
|
||||
<a class="dropdown-item" href="#" data-toggle="modal" data-target="#editTransferModal<?php echo $transfer_id; ?>">Edit</a>
|
||||
<a class="dropdown-item" href="#">Delete</a>
|
||||
<a class="dropdown-item" href="post.php?delete_transfer=<?php echo $transfer_id; ?>">Delete</a>
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
|
|
|||
Loading…
Reference in New Issue