-
+
\ No newline at end of file
diff --git a/client_leads.php b/client_leads.php
new file mode 100644
index 00000000..4817a7d1
--- /dev/null
+++ b/client_leads.php
@@ -0,0 +1,301 @@
+
+
+
+
+ CURRENT_DATABASE_VERSION) {
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.3.1'");
}
-
if (CURRENT_DATABASE_VERSION == '0.3.1') {
// Assets
@@ -1104,8 +1103,6 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.5.9'");
}
-
-
if (CURRENT_DATABASE_VERSION == '0.5.9') {
// Copy primary_location and primary_contact to their new vars in their own respecting tables
@@ -1374,7 +1371,6 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.8.6'");
}
- // Update DB to 0.8.7
if (CURRENT_DATABASE_VERSION == '0.8.6') {
// Insert queries here required to update to DB version 0.8.7
mysqli_query($mysqli, "ALTER TABLE `accounts` ADD `account_type` int(6) DEFAULT NULL AFTER `account_notes`");
@@ -1384,7 +1380,6 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.8.7'");
}
- // Update DB to 0.8.8
if (CURRENT_DATABASE_VERSION == '0.8.7') {
//Create Main Account Types
mysqli_query($mysqli,"INSERT INTO account_types SET account_type_name = 'Asset', account_type_id= '10', account_type_description = 'Assets are economic resources which are expected to benefit the business in the future.'");
@@ -1401,10 +1396,7 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.8.8'");
}
- // Be sure to change database_version.php to reflect the version you are updating to here
- // Please add this same comment block to the bottom of this file, and update the version number.
- // Uncomment Below Lines, to add additional database updates
- //
+
if (CURRENT_DATABASE_VERSION == '0.8.8') {
// Insert queries here required to update to DB version 0.8.9
mysqli_query($mysqli, "ALTER TABLE `invoice_items` ADD `item_order` INT(11) NOT NULL DEFAULT 0 AFTER `item_total`");
@@ -1430,10 +1422,7 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
}
//
- // Be sure to change database_version.php to reflect the version you are updating to here
- // Please add this same comment block to the bottom of this file, and update the version number.
- // Uncomment Below Lines, to add additional database updates
- //
+
if (CURRENT_DATABASE_VERSION == '0.8.9') {
// Insert queries here required to update to DB version 0.9.0
// Update existing quotes and recurrings so that item_order is set to item_id
@@ -1473,6 +1462,24 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) {
}
//
+ // Be sure to change database_version.php to reflect the version you are updating to here
+ // Please add this same comment block to the bottom of this file, and update the version number.
+ // Uncomment Below Lines, to add additional database updates
+ //
+ if (CURRENT_DATABASE_VERSION == '0.9.0') {
+ //add leads column to clients table
+ mysqli_query($mysqli, "ALTER TABLE `clients` ADD `client_lead` TINYINT(1) NOT NULL DEFAULT 0 AFTER `client_id`");
+
+ // Then, update the database to the next sequential version
+ mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.9.1'");
+ }
+
+ //if (CURRENT_DATABASE_VERSION == '0.9.1') {
+ // Insert queries here required to update to DB version 0.9.0
+
+ // Then, update the database to the next sequential version
+ // mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.9.2'");
+ //}
} else {
// Up-to-date
}
diff --git a/database_version.php b/database_version.php
index 5bea9d6e..6815157f 100644
--- a/database_version.php
+++ b/database_version.php
@@ -5,4 +5,4 @@
* It is used in conjunction with database_updates.php
*/
-DEFINE("LATEST_DATABASE_VERSION", "0.9.0");
+DEFINE("LATEST_DATABASE_VERSION", "0.9.1");
diff --git a/db.sql b/db.sql
index b1e9bf6f..dc782fc1 100644
--- a/db.sql
+++ b/db.sql
@@ -275,6 +275,7 @@ DROP TABLE IF EXISTS `clients`;
/*!40101 SET character_set_client = utf8 */;
CREATE TABLE `clients` (
`client_id` int(11) NOT NULL AUTO_INCREMENT,
+ `client_lead` tinyint(1) NOT NULL DEFAULT 0,
`client_name` varchar(200) NOT NULL,
`client_type` varchar(200) DEFAULT NULL,
`client_website` varchar(200) DEFAULT NULL,
diff --git a/post/client.php b/post/client.php
index a2b7948a..a99c8c54 100644
--- a/post/client.php
+++ b/post/client.php
@@ -25,7 +25,7 @@ if (isset($_POST['add_client'])) {
$extended_log_description = '';
- mysqli_query($mysqli, "INSERT INTO clients SET client_name = '$name', client_type = '$type', client_website = '$website', client_referral = '$referral', client_rate = $rate, client_currency_code = '$currency_code', client_net_terms = $net_terms, client_tax_id_number = '$tax_id_number', client_notes = '$notes', client_accessed_at = NOW()");
+ mysqli_query($mysqli, "INSERT INTO clients SET client_name = '$name', client_type = '$type', client_website = '$website', client_referral = '$referral', client_rate = $rate, client_currency_code = '$currency_code', client_net_terms = $net_terms, client_tax_id_number = '$tax_id_number', client_lead = '$lead', client_notes = '$notes', client_accessed_at = NOW()");
$client_id = mysqli_insert_id($mysqli);
@@ -113,7 +113,7 @@ if (isset($_POST['edit_client'])) {
$client_id = intval($_POST['client_id']);
- mysqli_query($mysqli, "UPDATE clients SET client_name = '$name', client_type = '$type', client_website = '$website', client_referral = '$referral', client_rate = $rate, client_currency_code = '$currency_code', client_net_terms = $net_terms, client_tax_id_number = '$tax_id_number', client_notes = '$notes' WHERE client_id = $client_id");
+ mysqli_query($mysqli, "UPDATE clients SET client_name = '$name', client_type = '$type', client_website = '$website', client_referral = '$referral', client_rate = $rate, client_currency_code = '$currency_code', client_net_terms = $net_terms, client_tax_id_number = '$tax_id_number', client_lead = '$lead', client_notes = '$notes' WHERE client_id = $client_id");
//Tags
//Delete existing tags
diff --git a/post/client_model.php b/post/client_model.php
index 3095f7b1..05179131 100644
--- a/post/client_model.php
+++ b/post/client_model.php
@@ -8,3 +8,4 @@ $currency_code = sanitizeInput($_POST['currency_code']);
$net_terms = intval($_POST['net_terms']);
$tax_id_number = sanitizeInput($_POST['tax_id_number']);
$notes = sanitizeInput($_POST['notes']);
+$lead = intval($_POST['lead']);
diff --git a/side_nav.php b/side_nav.php
index 6bf3d75b..eb45d634 100644
--- a/side_nav.php
+++ b/side_nav.php
@@ -68,6 +68,12 @@
if ($config_module_enable_accounting == 1) { ?>