- - Invoice Number:
INV-
+ - Invoice Number:
- Invoice Date:
- Payment Due:
diff --git a/guest_view_quote.php b/guest_view_quote.php
index 265d596e..86d2971d 100644
--- a/guest_view_quote.php
+++ b/guest_view_quote.php
@@ -13,35 +13,51 @@ if(isset($_GET['quote_id'], $_GET['url_key'])){
AND quotes.quote_url_key = '$url_key'"
);
- $row = mysqli_fetch_array($sql);
- $quote_id = $row['quote_id'];
- $quote_number = $row['quote_number'];
- $quote_status = $row['quote_status'];
- $quote_date = $row['quote_date'];
- $quote_amount = $row['quote_amount'];
- $quote_note = $row['quote_note'];
- $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;
- }
-
if(mysqli_num_rows($sql) == 1){
+ $row = mysqli_fetch_array($sql);
+
+ $quote_id = $row['quote_id'];
+ $quote_number = $row['quote_number'];
+ $quote_status = $row['quote_status'];
+ $quote_date = $row['quote_date'];
+ $quote_amount = $row['quote_amount'];
+ $quote_note = $row['quote_note'];
+ $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;
+ }
+ $company_id = $row['company_id'];
+
+ $sql_company = mysqli_query($mysqli,"SELECT * FROM settings, companies WHERE settings.company_id = companies.company_id AND companies.company_id = $company_id");
+ $row = mysqli_fetch_array($sql_company);
+
+ $company_name = $row['company_name'];
+ $config_company_address = $row['config_company_address'];
+ $config_company_city = $row['config_company_city'];
+ $config_company_state = $row['config_company_state'];
+ $config_company_zip = $row['config_company_zip'];
+ $config_company_phone = $row['config_company_phone'];
+ if(strlen($config_company_phone)>2){
+ $config_company_phone = substr($row['config_company_phone'],0,3)."-".substr($row['config_company_phone'],3,3)."-".substr($row['config_company_phone'],6,4);
+ }
+ $config_company_email = $row['config_company_email'];
+
//Mark viewed in history
- mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$quote_status', history_description = 'Quote viewed', history_created_at = NOW(), quote_id = $quote_id");
+ mysqli_query($mysqli,"INSERT INTO history SET history_date = CURDATE(), history_status = '$quote_status', history_description = 'Quote viewed', history_created_at = NOW(), quote_id = $quote_id, company_id = $company_id");
//Set Badge color based off of quote status
if($quote_status == "Sent"){
@@ -86,7 +102,7 @@ if(isset($_GET['quote_id'], $_GET['url_key'])){
diff --git a/login_no_label.php b/login_no_label.php
deleted file mode 100644
index e254988f..00000000
--- a/login_no_label.php
+++ /dev/null
@@ -1,114 +0,0 @@
-
-
- 0){
- header("Location: client.php?client_id=$client_id");
- }else{
- header("Location: $config_start_page");
- }
-
- }else{
- require_once("rfc6238.php");
-
- if(TokenAuth6238::verify($token,$current_code)){
- $_SESSION['logged'] = TRUE;
- header("Location: $config_start_page");
- }
- }
- }
-}
-
-?>
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/post.php b/post.php
index 0c3f01d3..77d5e53a 100644
--- a/post.php
+++ b/post.php
@@ -297,6 +297,41 @@ if(isset($_POST['edit_user'])){
}
+if(isset($_POST['add_company'])){
+
+ $name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
+
+ mysqli_query($mysqli,"INSERT INTO companies SET company_name = '$name', company_created_at = NOW()");
+
+ $_SESSION['alert_message'] = "Company added";
+
+ header("Location: companies.php");
+
+}
+
+if(isset($_POST['edit_company'])){
+ $company_id = intval($_POST['company_id']);
+ $name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
+
+ mysqli_query($mysqli,"UPDATE companies SET company_name = '$name', company_updated_at = NOW() WHERE company_id = $company_id");
+
+ $_SESSION['alert_message'] = "Company modified";
+
+ header("Location: companies.php");
+
+}
+
+if(isset($_GET['delete_company'])){
+ $company_id = intval($_GET['delete_company']);
+
+ mysqli_query($mysqli,"DELETE FROM companies WHERE company_id = $company_id");
+
+ $_SESSION['alert_message'] = "Company deleted";
+
+ header("Location: " . $_SERVER["HTTP_REFERER"]);
+
+}
+
if(isset($_POST['add_client'])){
$name = strip_tags(mysqli_real_escape_string($mysqli,$_POST['name']));
diff --git a/settings-carddav.php b/settings-carddav.php
deleted file mode 100644
index 4788c1e0..00000000
--- a/settings-carddav.php
+++ /dev/null
@@ -1,58 +0,0 @@
-
-
-
-
-
-
-General
Categories
Users
+
Companies
\ No newline at end of file
diff --git a/test.php b/test.php
deleted file mode 100644
index c18a37c4..00000000
--- a/test.php
+++ /dev/null
@@ -1,44 +0,0 @@
-
-
-
-This is a great starting point for new custom pages.
-
-',TokenAuth6238::getBarCodeUrl('','',$secretkey,'My%20App'));
- print TokenAuth6238::getTokenCodeDebug($secretkey,0);
-
-
-?>
-
-
-