From bd5b1848d6cecc78f2ff6629b118ca812f320782 Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Mon, 31 Jan 2022 19:40:27 +0000 Subject: [PATCH 1/4] Comment test page as causing Github syntax check to fail --- test_client_payments_by_invoice.php | 280 ++++++++++++++-------------- 1 file changed, 140 insertions(+), 140 deletions(-) diff --git a/test_client_payments_by_invoice.php b/test_client_payments_by_invoice.php index b8c9dcc0..35ed9400 100644 --- a/test_client_payments_by_invoice.php +++ b/test_client_payments_by_invoice.php @@ -1,141 +1,141 @@ $sb, 'o' => $o))); - -//Paging -if(isset($_GET['p'])){ - $p = intval($_GET['p']); - $record_from = (($p)-1)*$_SESSION['records_per_page']; - $record_to = $_SESSION['records_per_page']; -}else{ - $record_from = 0; - $record_to = $_SESSION['records_per_page']; - $p = 1; -} - -if(isset($_GET['q'])){ - $q = mysqli_real_escape_string($mysqli,$_GET['q']); -}else{ - $q = ""; -} - -if(!empty($_GET['sb'])){ - $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); -}else{ - $sb = "invoice_date"; -} - -if(isset($_GET['o'])){ - if($_GET['o'] == 'ASC'){ - $o = "ASC"; - $disp = "DESC"; - }else{ - $o = "DESC"; - $disp = "ASC"; - } -}else{ - $o = "DESC"; - $disp = "ASC"; -} - - -$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM invoices - WHERE client_id = $client_id - AND (invoice_number LIKE '%$q%') - ORDER BY $sb $o LIMIT $record_from, $record_to"); - -$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); -$total_found_rows = $num_rows[0]; -$total_pages = ceil($total_found_rows / 10); - -?> - -
-
-
Payments
-
-
-
- - -
- -
- -
-
-
-
-
- - "> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
DateDueInvoiceInvoice Amount
$
Date RecievedPayment MethodPayment ReferencePayment Amount
$
- - - -
-
-
\ No newline at end of file +// +// //Rebuild URL +// +//$url_query_strings_sb = http_build_query(array_merge($_GET,array('sb' => $sb, 'o' => $o))); +// +////Paging +//if(isset($_GET['p'])){ +// $p = intval($_GET['p']); +// $record_from = (($p)-1)*$_SESSION['records_per_page']; +// $record_to = $_SESSION['records_per_page']; +//}else{ +// $record_from = 0; +// $record_to = $_SESSION['records_per_page']; +// $p = 1; +//} +// +//if(isset($_GET['q'])){ +// $q = mysqli_real_escape_string($mysqli,$_GET['q']); +//}else{ +// $q = ""; +//} +// +//if(!empty($_GET['sb'])){ +// $sb = mysqli_real_escape_string($mysqli,$_GET['sb']); +//}else{ +// $sb = "invoice_date"; +//} +// +//if(isset($_GET['o'])){ +// if($_GET['o'] == 'ASC'){ +// $o = "ASC"; +// $disp = "DESC"; +// }else{ +// $o = "DESC"; +// $disp = "ASC"; +// } +//}else{ +// $o = "DESC"; +// $disp = "ASC"; +//} +// +// +//$sql = mysqli_query($mysqli,"SELECT SQL_CALC_FOUND_ROWS * FROM invoices +// WHERE client_id = $client_id +// AND (invoice_number LIKE '%$q%') +// ORDER BY $sb $o LIMIT $record_from, $record_to"); +// +//$num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); +//$total_found_rows = $num_rows[0]; +//$total_pages = ceil($total_found_rows / 10); +// +//?> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file From 3bac0188e61b0ee416263ae5a95c9a148d9e3b2d Mon Sep 17 00:00:00 2001 From: Marcus Hill Date: Mon, 31 Jan 2022 20:24:47 +0000 Subject: [PATCH 2/4] Add backup note to services module --- client_services.php | 1 + db.sql | 1 + post.php | 6 ++++-- service_add_modal.php | 10 ++++++++++ service_edit_modal.php | 10 ++++++++++ service_view_modal.php | 5 +++-- 6 files changed, 29 insertions(+), 4 deletions(-) diff --git a/client_services.php b/client_services.php index afd6e7a0..677ac40d 100644 --- a/client_services.php +++ b/client_services.php @@ -58,6 +58,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); $service_description = $row['service_description']; $service_category = $row['service_category']; $service_importance = $row['service_importance']; + $service_backup = $row['service_backup']; $service_notes = $row['service_notes']; $service_updated_at = $row['service_updated_at']; $service_review_due = $row['service_review_due']; diff --git a/db.sql b/db.sql index a81b30be..2b28281a 100644 --- a/db.sql +++ b/db.sql @@ -939,6 +939,7 @@ CREATE TABLE IF NOT EXISTS `services` ( `service_description` varchar(200) CHARACTER SET latin1 NOT NULL, `service_category` varchar(20) CHARACTER SET latin1 NOT NULL, `service_importance` varchar(10) CHARACTER SET latin1 NOT NULL, + `service_backup` varchar(200) CHARACTER SET latin1 DEFAULT NULL, `service_notes` text CHARACTER SET latin1 NOT NULL, `service_created_at` datetime NOT NULL, `service_updated_at` datetime DEFAULT NULL, diff --git a/post.php b/post.php index 2e6e59d6..5d65a0f9 100644 --- a/post.php +++ b/post.php @@ -5582,10 +5582,11 @@ if(isset($_POST['add_service'])){ $service_description = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['description']))); $service_category = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['category']))); //TODO: Needs integration with company categories $service_importance = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['importance']))); + $service_backup = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['backup']))); $service_notes = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['note']))); // Create Service - $service_sql = mysqli_query($mysqli, "INSERT INTO services SET service_name = '$service_name', service_description = '$service_description', service_category = '$service_category', service_importance = '$service_importance', service_notes = '$service_notes', service_created_at = NOW(), service_client_id = '$client_id', company_id = '$session_company_id'"); + $service_sql = mysqli_query($mysqli, "INSERT INTO services SET service_name = '$service_name', service_description = '$service_description', service_category = '$service_category', service_importance = '$service_importance', service_backup = '$service_backup', service_notes = '$service_notes', service_created_at = NOW(), service_client_id = '$client_id', company_id = '$session_company_id'"); // TODO: Support for URLs @@ -5667,10 +5668,11 @@ if(isset($_POST['edit_service'])){ $service_description = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['description']))); $service_category = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['category']))); //TODO: Needs integration with company categories $service_importance = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['importance']))); + $service_backup = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['backup']))); $service_notes = trim(strip_tags(mysqli_real_escape_string($mysqli,$_POST['note']))); // Update main service details - mysqli_query($mysqli, "UPDATE services SET service_name = '$service_name', service_description = '$service_description', service_category = '$service_category', service_importance = '$service_importance', service_notes = '$service_notes', service_updated_at = NOW() WHERE service_id = '$service_id' AND company_id = '$session_company_id'"); + mysqli_query($mysqli, "UPDATE services SET service_name = '$service_name', service_description = '$service_description', service_category = '$service_category', service_importance = '$service_importance', service_backup = '$service_backup', service_notes = '$service_notes', service_updated_at = NOW() WHERE service_id = '$service_id' AND company_id = '$session_company_id'"); // Unlink existing relations/assets mysqli_query($mysqli, "DELETE FROM service_contacts WHERE service_id = '$service_id'"); diff --git a/service_add_modal.php b/service_add_modal.php index 02d20a83..cd6b35f5 100644 --- a/service_add_modal.php +++ b/service_add_modal.php @@ -78,6 +78,16 @@ +
+ +
+
+ +
+ +
+
+