From f4557a961d89409bc27f7c514c86080d3ebfcf20 Mon Sep 17 00:00:00 2001 From: "johnny@pittpc.com" Date: Sat, 14 Sep 2019 22:57:48 -0400 Subject: [PATCH] Updated Quote and Invoice GUI further adding footers to the html printables, added Quote view with details and an alert --- guest_view_invoice.php | 8 ++-- guest_view_quote.php | 104 ++++++++++++++++++++--------------------- invoice.php | 4 ++ post.php | 5 +- quote.php | 4 ++ settings-general.php | 10 ---- setup.php | 8 +++- 7 files changed, 71 insertions(+), 72 deletions(-) diff --git a/guest_view_invoice.php b/guest_view_invoice.php index a6bea186..f4ef4918 100644 --- a/guest_view_invoice.php +++ b/guest_view_invoice.php @@ -56,6 +56,7 @@ if(isset($_GET['invoice_id'], $_GET['url_key'])){ } $config_company_email = $row['config_company_email']; $config_invoice_logo = $row['config_invoice_logo']; + $config_invoice_footer = $row['config_invoice_footer']; $config_stripe_enable = $row['config_stripe_enable']; $config_stripe_publishable = $row['config_stripe_publishable']; $config_stripe_secret = $row['config_stripe_secret']; @@ -132,9 +133,7 @@ if(isset($_GET['invoice_id'], $_GET['url_key'])){
-
- - +
  • @@ -269,6 +268,9 @@ if(isset($_GET['invoice_id'], $_GET['url_key'])){
+
+ +
-
-

Quote

-
-
+
Print Download @@ -98,59 +104,52 @@ if(isset($_GET['quote_id'], $_GET['url_key'])){
-
+
-
+
+
+

Quote

+
+
-
-
- From -
-
-
    -
  • -
  • -
  • -
  • -
  • -
-
-
+
    +
  • +
  • +
  • +
  • P:
  • +
  • +
+
+
-
-
- Quote To -
-
-
    -
  • -
  • -
  • -
  • -
  • -
-
-
+ +
    +
  • +
  • +
  • +
  • P:
  • +
  • E:
  • +
+
-
-
-
- Details -
-
-
    -
  • Quote Number:
  • -
  • Quote Date:
  • -
-
-
+
+
+
+
+
+ + + + + +
Quote Date
@@ -159,10 +158,6 @@ if(isset($_GET['quote_id'], $_GET['url_key'])){
-
- Items -
- @@ -215,9 +210,6 @@ if(isset($_GET['quote_id'], $_GET['url_key'])){
-
- Notes -
@@ -252,6 +244,10 @@ if(isset($_GET['quote_id'], $_GET['url_key'])){
+
+ +
+ +
+ +
+
diff --git a/post.php b/post.php index db26102e..a1f0e174 100644 --- a/post.php +++ b/post.php @@ -102,7 +102,7 @@ if(isset($_POST['add_company'])){ mkdir("uploads/settings/$company_id"); mkdir("uploads/tmp/$company_id"); - mysqli_query($mysqli,"INSERT INTO settings SET company_id = $company_id, config_company_name = '$name', config_invoice_prefix = 'INV-', config_invoice_next_number = 1, config_invoice_overdue_reminders = '1,3,7', config_quote_prefix = 'QUO-', config_quote_next_number = 1, config_api_key = '$config_api_key', config_recurring_auto_send_invoice = 1, config_default_net_terms = 7, config_send_invoice_reminders = 0, config_enable_cron = 0, config_ticket_next_number = 1, config_base_url = '$config_base_url'"); + mysqli_query($mysqli,"INSERT INTO settings SET company_id = $company_id, config_company_name = '$name', config_invoice_prefix = 'INV-', config_invoice_next_number = 1, config_invoice_overdue_reminders = '1,3,7', config_quote_prefix = 'QUO-', config_quote_next_number = 1, config_api_key = '$config_api_key', config_recurring_auto_send_invoice = 1, config_default_net_terms = 7, config_send_invoice_reminders = 0, config_enable_cron = 0, config_ticket_next_number = 1"); //logging mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Company', log_action = 'Created', log_description = '$name', log_created_at = NOW()"); @@ -162,7 +162,6 @@ if(isset($_POST['verify'])){ if(isset($_POST['edit_general_settings'])){ - $config_base_url = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_base_url'])); $config_api_key = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_api_key'])); $path = "$config_invoice_logo"; @@ -177,7 +176,7 @@ if(isset($_POST['edit_general_settings'])){ move_uploaded_file($_FILES['file']['tmp_name'], $path); } - mysqli_query($mysqli,"UPDATE settings SET config_invoice_logo = '$path', config_api_key = '$config_api_key', config_base_url = '$config_base_url' WHERE company_id = $session_company_id"); + mysqli_query($mysqli,"UPDATE settings SET config_invoice_logo = '$path', config_api_key = '$config_api_key' WHERE company_id = $session_company_id"); //logging mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Settings', log_action = 'Modified', log_description = 'General', log_created_at = NOW(), company_id = $session_company_id, user_id = $session_user_id"); diff --git a/quote.php b/quote.php index b9f87e44..e37795dd 100644 --- a/quote.php +++ b/quote.php @@ -247,6 +247,10 @@ if(isset($_GET['quote_id'])){
+
+ +
+
diff --git a/settings-general.php b/settings-general.php index 2395e598..0bf410e5 100644 --- a/settings-general.php +++ b/settings-general.php @@ -9,16 +9,6 @@
-
- -
-
- -
- -
-
-
diff --git a/setup.php b/setup.php index 0582e778..d95e6dce 100644 --- a/setup.php +++ b/setup.php @@ -71,6 +71,7 @@ if(isset($_POST['add_database'])){ $database = $_POST['database']; $username = $_POST['username']; $password = $_POST['password']; + $config_base_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']); $myfile = fopen("config.php", "w"); @@ -90,6 +91,10 @@ if(isset($_POST['add_database'])){ fwrite($myfile, $txt); + $txt = "\$config_base_url = '\$config_base_url';\n"; + + fwrite($myfile, $txt); + fclose($myfile); include("config.php"); @@ -165,7 +170,6 @@ if(isset($_POST['add_company_settings'])){ $config_company_phone = preg_replace("/[^0-9]/", '',$config_company_phone); $config_company_site = strip_tags(mysqli_real_escape_string($mysqli,$_POST['config_company_site'])); $config_api_key = keygen(); - $config_base_url = $_SERVER['HTTP_HOST'] . dirname($_SERVER['REQUEST_URI']); mysqli_query($mysqli,"INSERT INTO companies SET company_name = '$config_company_name', company_created_at = NOW()"); @@ -178,7 +182,7 @@ if(isset($_POST['add_company_settings'])){ mysqli_query($mysqli,"INSERT INTO user_companies SET user_id = $user_id, company_id = $company_id"); - mysqli_query($mysqli,"INSERT INTO settings SET company_id = $company_id, config_company_name = '$config_company_name', config_company_address = '$config_company_address', config_company_city = '$config_company_city', config_company_state = '$config_company_state', config_company_zip = '$config_company_zip', config_company_phone = $config_company_phone, config_company_site = '$config_company_site', config_start_page = 'dashboard.php', config_invoice_prefix = 'INV-', config_invoice_next_number = 1, config_invoice_overdue_reminders = '1,3,7', config_quote_prefix = 'QUO-', config_quote_next_number = 1, config_api_key = '$config_api_key', config_recurring_auto_send_invoice = 1, config_default_net_terms = 7, config_send_invoice_reminders = 0, config_enable_cron = 0, config_ticket_next_number = 1, config_base_url = '$config_base_url'"); + mysqli_query($mysqli,"INSERT INTO settings SET company_id = $company_id, config_company_name = '$config_company_name', config_company_address = '$config_company_address', config_company_city = '$config_company_city', config_company_state = '$config_company_state', config_company_zip = '$config_company_zip', config_company_phone = $config_company_phone, config_company_site = '$config_company_site', config_start_page = 'dashboard.php', config_invoice_prefix = 'INV-', config_invoice_next_number = 1, config_invoice_overdue_reminders = '1,3,7', config_quote_prefix = 'QUO-', config_quote_next_number = 1, config_api_key = '$config_api_key', config_recurring_auto_send_invoice = 1, config_default_net_terms = 7, config_send_invoice_reminders = 0, config_enable_cron = 0, config_ticket_next_number = 1"); //Create Some Data