diff --git a/add_client_modal.php b/add_client_modal.php
index 3f50517d..91d8058b 100644
--- a/add_client_modal.php
+++ b/add_client_modal.php
@@ -20,9 +20,6 @@
Contact
-
- More
-
Notes
@@ -54,6 +51,43 @@
+
+
+
+
@@ -169,34 +203,6 @@
-
-
-
-
-
-
-
-
@@ -207,23 +213,6 @@
-
-
diff --git a/client.php b/client.php
index 10bf7d5b..cd7443c7 100644
--- a/client.php
+++ b/client.php
@@ -16,11 +16,11 @@ if(isset($_GET['client_id'])){
$row = mysqli_fetch_array($sql);
$client_name = $row['client_name'];
$client_type = $row['client_type'];
- $client_country = $row['client_country'];
$client_address = $row['client_address'];
$client_city = $row['client_city'];
$client_state = $row['client_state'];
$client_zip = $row['client_zip'];
+ $client_country = $row['client_country'];
$client_contact = $row['client_contact'];
$client_email = $row['client_email'];
$client_phone = $row['client_phone'];
@@ -32,11 +32,11 @@ if(isset($_GET['client_id'])){
$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_referral = $row['client_referral'];
$client_net_terms = $row['client_net_terms'];
if($client_net_terms == 0){
$client_net_terms = $config_default_net_terms;
}
- $client_company_size = $row['client_company_size'];
$client_notes = $row['client_notes'];
//Add up all the payments for the invoice and get the total amount paid to the invoice
diff --git a/clients.php b/clients.php
index 2f4c5fc3..2a11fddc 100644
--- a/clients.php
+++ b/clients.php
@@ -135,8 +135,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()"));
$client_email = $row['client_email'];
$client_website = $row['client_website'];
$client_net_terms = $row['client_net_terms'];
- $client_hours = $row['client_hours'];
- $client_company_size = $row['client_company_size'];
+ $client_referral = $row['client_referral'];
$client_notes = $row['client_notes'];
//Add up all the payments for the invoice and get the total amount paid to the invoice
diff --git a/db.sql b/db.sql
index d84df353..8fcad57a 100644
--- a/db.sql
+++ b/db.sql
@@ -145,9 +145,8 @@ CREATE TABLE `clients` (
`client_mobile` varchar(200) DEFAULT NULL,
`client_email` varchar(200) DEFAULT NULL,
`client_website` varchar(200) DEFAULT NULL,
+ `client_referral` varchar(200) DEFAULT NULL,
`client_net_terms` int(10) NOT NULL,
- `client_hours` varchar(200) DEFAULT NULL,
- `client_company_size` varchar(200) DEFAULT NULL,
`client_notes` text DEFAULT NULL,
`client_created_at` datetime NOT NULL,
`client_updated_at` datetime DEFAULT NULL,
@@ -882,4 +881,4 @@ CREATE TABLE `vendors` (
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2021-01-15 15:05:00
+-- Dump completed on 2021-01-15 19:01:39
diff --git a/edit_client_modal.php b/edit_client_modal.php
index aaf60035..dc05974b 100644
--- a/edit_client_modal.php
+++ b/edit_client_modal.php
@@ -21,9 +21,6 @@
Contact
-
- More
-
Notes
@@ -55,6 +52,44 @@
+
+
+
+
@@ -169,35 +204,6 @@
-
-
-
-
-
-
-
-
@@ -208,23 +214,6 @@
-
-
diff --git a/get_settings.php b/get_settings.php
index 34a00d47..d10baf13 100644
--- a/get_settings.php
+++ b/get_settings.php
@@ -161,7 +161,8 @@ $timezones_array = array(
$category_types_array = array(
'Expense',
'Income',
- 'Payment Method'
+ 'Payment Method',
+ 'Referral'
);
$asset_types_array = array(
diff --git a/post.php b/post.php
index a65432cc..be0c6632 100644
--- a/post.php
+++ b/post.php
@@ -511,12 +511,11 @@ if(isset($_POST['add_client'])){
$mobile = preg_replace("/[^0-9]/", '',$mobile);
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
$website = strip_tags(mysqli_real_escape_string($mysqli,$_POST['website']));
+ $referral = strip_tags(mysqli_real_escape_string($mysqli,$_POST['referral']));
$net_terms = intval($_POST['net_terms']);
- $hours = strip_tags(mysqli_real_escape_string($mysqli,$_POST['hours']));
- $company_size = strip_tags(mysqli_real_escape_string($mysqli,$_POST['company_size']));
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
- mysqli_query($mysqli,"INSERT INTO clients SET client_name = '$name', client_type = '$type', client_country = '$country', client_address = '$address', client_city = '$city', client_state = '$state', client_zip = '$zip', client_contact = '$contact', client_phone = '$phone', client_extension = '$extension', client_mobile = '$mobile', client_email = '$email', client_website = '$website', client_net_terms = $net_terms, client_hours = '$hours', client_company_size = '$company_size', client_notes = '$notes', client_created_at = NOW(), company_id = $session_company_id");
+ mysqli_query($mysqli,"INSERT INTO clients SET client_name = '$name', client_type = '$type', client_country = '$country', client_address = '$address', client_city = '$city', client_state = '$state', client_zip = '$zip', client_contact = '$contact', client_phone = '$phone', client_extension = '$extension', client_mobile = '$mobile', client_email = '$email', client_website = '$website', client_referral = '$referral', client_net_terms = $net_terms, client_notes = '$notes', client_created_at = NOW(), company_id = $session_company_id");
$client_id = mysqli_insert_id($mysqli);
@@ -551,12 +550,11 @@ if(isset($_POST['edit_client'])){
$mobile = preg_replace("/[^0-9]/", '',$mobile);
$email = strip_tags(mysqli_real_escape_string($mysqli,$_POST['email']));
$website = strip_tags(mysqli_real_escape_string($mysqli,$_POST['website']));
+ $referral = strip_tags(mysqli_real_escape_string($mysqli,$_POST['referral']));
$net_terms = intval($_POST['net_terms']);
- $hours = strip_tags(mysqli_real_escape_string($mysqli,$_POST['hours']));
- $company_size = strip_tags(mysqli_real_escape_string($mysqli,$_POST['company_size']));
$notes = strip_tags(mysqli_real_escape_string($mysqli,$_POST['notes']));
- mysqli_query($mysqli,"UPDATE clients SET client_name = '$name', client_type = '$type', client_country = '$country', client_address = '$address', client_city = '$city', client_state = '$state', client_zip = '$zip', client_contact = '$contact', client_phone = '$phone', client_extension = '$extension', client_mobile = '$mobile', client_email = '$email', client_website = '$website', client_net_terms = $net_terms, client_hours = '$hours', client_company_size = '$company_size', client_notes = '$notes', client_updated_at = NOW() WHERE client_id = $client_id AND company_id = $session_company_id");
+ mysqli_query($mysqli,"UPDATE clients SET client_name = '$name', client_type = '$type', client_country = '$country', client_address = '$address', client_city = '$city', client_state = '$state', client_zip = '$zip', client_contact = '$contact', client_phone = '$phone', client_extension = '$extension', client_mobile = '$mobile', client_email = '$email', client_website = '$website', client_referral = '$referral', client_net_terms = $net_terms, client_notes = '$notes', client_updated_at = NOW() WHERE client_id = $client_id AND company_id = $session_company_id");
//Logging
mysqli_query($mysqli,"INSERT INTO logs SET log_type = 'Client', log_action = 'Modified', log_description = '$name', log_created_at = NOW(), client_id = $client_id, company_id = $session_company_id, user_id = $session_user_id");