From 62b088e79dba0276e049f4115f0a7d9ef318354c Mon Sep 17 00:00:00 2001 From: "johnny@pittpc.com" Date: Sat, 14 Sep 2019 20:40:22 -0400 Subject: [PATCH] GUI Touchups in Invoice, Quote, clients, vendors, client. Added 2 new fields to client mobile and contact_name, added more pictyure extension in file jpeg anb JPEG and other fixesincluding a new DB dump --- add_client_modal.php | 42 ++-- client.php | 21 ++ client_files.php | 2 +- client_vendors.php | 14 +- clients.php | 53 ++++- db.sql | 28 +-- edit_client_modal.php | 30 ++- guest_view_invoice.php | 14 +- invoice.php | 113 +++++------ invoice_old.php | 439 +++++++++++++++++++++++++++++++++++++++++ login.php | 33 ++-- login_new.php | 162 +++++++++++++++ login_old.php | 151 ++++++++++++++ post.php | 10 +- quote.php | 109 +++++----- recurring.php | 2 +- settings-user.php | 70 ++++--- users.php | 12 +- vendors.php | 17 +- 19 files changed, 1103 insertions(+), 219 deletions(-) create mode 100644 invoice_old.php create mode 100644 login_new.php create mode 100644 login_old.php diff --git a/add_client_modal.php b/add_client_modal.php index 75dc6df8..d83dc61d 100644 --- a/add_client_modal.php +++ b/add_client_modal.php @@ -12,16 +12,16 @@ @@ -29,7 +29,7 @@
-
+
@@ -58,7 +58,7 @@
-
+
@@ -109,6 +109,16 @@
+
+ +
+
+ +
+ +
+
+
@@ -118,6 +128,16 @@
+ +
+ +
+
+ +
+ +
+
@@ -128,7 +148,11 @@
- + +
+ +
+
@@ -138,10 +162,6 @@
- -
- -
diff --git a/client.php b/client.php index 887ed6a2..663d03a7 100644 --- a/client.php +++ b/client.php @@ -20,11 +20,16 @@ if(isset($_GET['client_id'])){ $client_city = $row['client_city']; $client_state = $row['client_state']; $client_zip = $row['client_zip']; + $client_contact = $row['client_contact']; $client_email = $row['client_email']; $client_phone = $row['client_phone']; if(strlen($client_phone)>2){ $client_phone = substr($row['client_phone'],0,3)."-".substr($row['client_phone'],3,3)."-".substr($row['client_phone'],6,4); } + $client_mobile = $row['client_mobile']; + if(strlen($client_mobile)>2){ + $client_mobile = substr($row['client_mobile'],0,3)."-".substr($row['client_mobile'],3,3)."-".substr($row['client_mobile'],6,4); + } $client_website = $row['client_website']; $client_net_terms = $row['client_net_terms']; if($client_net_terms == 0){ @@ -108,6 +113,14 @@ if(isset($_GET['client_id'])){

Contact

+ +
+ + @@ -124,6 +137,14 @@ if(isset($_GET['client_id'])){ } ?> + +
+ + diff --git a/client_files.php b/client_files.php index 47cea191..70f1f08c 100644 --- a/client_files.php +++ b/client_files.php @@ -1,4 +1,4 @@ - + diff --git a/client_vendors.php b/client_vendors.php index 8ef15711..6d869858 100644 --- a/client_vendors.php +++ b/client_vendors.php @@ -74,7 +74,6 @@ $total_pages = ceil($total_found_rows / 10); Vendor Description Contact - Account Number Action @@ -108,7 +107,17 @@ $total_pages = ceil($total_found_rows / 10); ?> - + + + +
+ + + - "> - Name "> - Type - Email - Phone - Balance - Action + Name "> + Type + Contact + Balance + Action @@ -85,10 +84,15 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); $client_city = $row['client_city']; $client_state = $row['client_state']; $client_zip = $row['client_zip']; + $client_contact = $row['client_contact']; $client_phone = $row['client_phone']; if(strlen($client_phone)>2){ $client_phone = substr($row['client_phone'],0,3)."-".substr($row['client_phone'],3,3)."-".substr($row['client_phone'],6,4); } + $client_mobile = $row['client_mobile']; + if(strlen($client_mobile)>2){ + $client_mobile = substr($row['client_mobile'],0,3)."-".substr($row['client_mobile'],3,3)."-".substr($row['client_mobile'],6,4); + } $client_email = $row['client_email']; $client_website = $row['client_website']; $client_net_terms = $row['client_net_terms']; @@ -117,8 +121,39 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); - - + + + +
+ + + +
+ + + +
+ + + + + $ + +
+
@@ -143,10 +167,6 @@
- -
- -
diff --git a/guest_view_invoice.php b/guest_view_invoice.php index e7a5edbb..a6bea186 100644 --- a/guest_view_invoice.php +++ b/guest_view_invoice.php @@ -108,13 +108,10 @@ if(isset($_GET['invoice_id'], $_GET['url_key'])){ ?>
-
-

Invoice

-
-
+
Print - Download PDF + Download @@ -124,12 +121,15 @@ if(isset($_GET['invoice_id'], $_GET['url_key'])){
-
+
-
+
+
+

Invoice

+
diff --git a/invoice.php b/invoice.php index e16b532d..94967afd 100644 --- a/invoice.php +++ b/invoice.php @@ -97,7 +97,7 @@ if(isset($_GET['invoice_id'])){
- +
-
+
+ +
+
+
+ +
+
+

Invoice

+
+
-
-
- From -
-
-
    -
  • -
  • -
  • -
  • -
  • -
-
-
+
    +
  • +
  • +
  • +
  • P:
  • +
  • +
-
-
- Bill To -
-
-
    -
  • -
  • -
  • -
  • -
  • -
-
-
+
    +
  • +
  • +
  • +
  • P:
  • +
  • E:
  • +
-
-
-
- Details -
-
-
    -
  • Invoice Number:
  • -
  • Invoice Date:
  • -
  • Payment Due:
  • -
-
-
+
+
+
+
+
+ + + + + + + + + +
Invoice Date
Due Date
@@ -176,10 +174,6 @@ if(isset($_GET['invoice_id'])){
-
- Items -
- @@ -210,7 +204,7 @@ if(isset($_GET['invoice_id'])){ ?> - + @@ -228,10 +222,10 @@ if(isset($_GET['invoice_id'])){ - - - - + + + +
- - +
+
@@ -296,8 +285,8 @@ if(isset($_GET['invoice_id'])){ -
-
+
+
History diff --git a/invoice_old.php b/invoice_old.php new file mode 100644 index 00000000..e16b532d --- /dev/null +++ b/invoice_old.php @@ -0,0 +1,439 @@ + + +

Nothing to see here

"; + }else{ + + $row = mysqli_fetch_array($sql); + $invoice_id = $row['invoice_id']; + $invoice_number = $row['invoice_number']; + $invoice_status = $row['invoice_status']; + $invoice_date = $row['invoice_date']; + $invoice_due = $row['invoice_due']; + $invoice_amount = $row['invoice_amount']; + $invoice_note = $row['invoice_note']; + $invoice_url_key = $row['invoice_url_key']; + $category_id = $row['category_id']; + $client_id = $row['client_id']; + $client_name = $row['client_name']; + $client_address = $row['client_address']; + $client_city = $row['client_city']; + $client_state = $row['client_state']; + $client_zip = $row['client_zip']; + $client_email = $row['client_email']; + $client_phone = $row['client_phone']; + if(strlen($client_phone)>2){ + $client_phone = substr($row['client_phone'],0,3)."-".substr($row['client_phone'],3,3)."-".substr($row['client_phone'],6,4); + } + $client_website = $row['client_website']; + $client_net_terms = $row['client_net_terms']; + if($client_net_terms == 0){ + $client_net_terms = $config_default_net_terms; + } + + $sql_history = mysqli_query($mysqli,"SELECT * FROM history WHERE invoice_id = $invoice_id ORDER BY history_id DESC"); + + $sql_payments = mysqli_query($mysqli,"SELECT * FROM payments, accounts WHERE payments.account_id = accounts.account_id AND payments.invoice_id = $invoice_id ORDER BY payments.payment_id DESC"); + + //Add up all the payments for the invoice and get the total amount paid to the invoice + $sql_amount_paid = mysqli_query($mysqli,"SELECT SUM(payment_amount) AS amount_paid FROM payments WHERE invoice_id = $invoice_id"); + $row = mysqli_fetch_array($sql_amount_paid); + $amount_paid = $row['amount_paid']; + + $balance = $invoice_amount - $amount_paid; + + //check to see if overdue + if($invoice_status !== "Paid" AND $invoice_status !== "Draft" AND $invoice_status !== "Cancelled"){ + $unixtime_invoice_due = strtotime($invoice_due) + 86400; + if($unixtime_invoice_due < time()){ + $invoice_overdue = "Overdue"; + } + } + + //Set Badge color based off of invoice status + if($invoice_status == "Sent"){ + $invoice_badge_color = "warning text-white"; + }elseif($invoice_status == "Viewed"){ + $invoice_badge_color = "info"; + }elseif($invoice_status == "Partial"){ + $invoice_badge_color = "primary"; + }elseif($invoice_status == "Paid"){ + $invoice_badge_color = "success"; + }elseif($invoice_status == "Cancelled"){ + $invoice_badge_color = "danger"; + }else{ + $invoice_badge_color = "secondary"; + } + +?> + + + +
+ +
+
+ +
+
+ +
+
+ +
+
+
+
+ From +
+
+
    +
  • +
  • +
  • +
  • +
  • +
+
+
+
+
+
+
+ Bill To +
+
+
    +
  • +
  • +
  • +
  • +
  • +
+
+
+
+
+
+
+ Details +
+
+
    +
  • Invoice Number:
  • +
  • Invoice Date:
  • +
  • Payment Due:
  • +
+
+
+
+
+ + + +
+
+
+
+ Items +
+ +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ProductDescriptionQtyPriceTaxTotal
$$$
+ +
+
+ + + +
+
+
+
+ Notes +
+
+
+ + + +
+
+
+
+ + + + + + + 0){ ?> + + + + + + 0){ ?> + + + + + + 0){ ?> + + + + + + + + + + +
Subtotal$
Discount$
Tax$
Paid to Date
$
Balance Due$
+
+
+ + + +
+
+
+
+ History +
+
+ + + + + + + + + + + + + + + + + + +
DateStatusDescription
+
+
+
+
+
+
+ Payments +
+
+ + + + + + + + + + + + + + + + + + + +
DateAmountAccountAction
$
+
+
+
+
+ + + + + + + + + + \ No newline at end of file diff --git a/login.php b/login.php index 40f77aa4..7e899bae 100644 --- a/login.php +++ b/login.php @@ -102,29 +102,40 @@ if(isset($_POST['login'])){
+
+ +
-
-
-
- From -
-
-
    -
  • -
  • -
  • -
  • -
  • -
-
-
+
+
-
-
-
- Quote To -
-
-
    -
  • -
  • -
  • -
  • -
  • -
-
-
-
-
-
-
- Details -
-
-
    -
  • Quote Number:
  • -
  • Quote Date:
  • -
-
-
+
+

Quote

+
+
+
    +
  • +
  • +
  • +
  • P:
  • +
  • +
+
+
+
    +
  • +
  • +
  • +
  • P:
  • +
  • E:
  • +
+
+
+
+
+
+
+ + + + + +
Quote Date
+
+
-
- Items -
@@ -180,7 +172,7 @@ if(isset($_GET['quote_id'])){ ?> - + @@ -198,10 +190,10 @@ if(isset($_GET['quote_id'])){ - - - - + + + + - + diff --git a/settings-user.php b/settings-user.php index 938ff390..51ba4373 100644 --- a/settings-user.php +++ b/settings-user.php @@ -3,11 +3,11 @@ @@ -73,34 +73,6 @@ $sql_recent_logs = mysqli_query($mysqli,"SELECT * FROM logs -
-
Recent Logs
- -
+
+
diff --git a/recurring.php b/recurring.php index a21db554..389af3b2 100644 --- a/recurring.php +++ b/recurring.php @@ -107,7 +107,7 @@ ?>
lyly
- - - - - - - - - - -
-
-
Recent Logins
@@ -125,6 +97,44 @@ $sql_recent_logs = mysqli_query($mysqli,"SELECT * FROM logs
+ +
+
Recent Logs
+ + + + + + + + + + + +
+
+
diff --git a/users.php b/users.php index 5655bbd9..35d99087 100644 --- a/users.php +++ b/users.php @@ -72,6 +72,7 @@ Email Type Status + Last Login Action @@ -86,7 +87,15 @@ $avatar = $row['avatar']; $client_id = $row['client_id']; $initials = initials($name); - + + $sql_last_login = mysqli_query($mysqli,"SELECT * FROM logs + WHERE user_id = $user_id AND log_type = 'Login' + ORDER BY log_id DESC LIMIT 1" + ); + $row = mysqli_fetch_array($sql_last_login); + $log_created_at = $row['log_created_at']; + $log_description = $row['log_description']; + ?> @@ -107,6 +116,7 @@ Client Status +