diff --git a/client_add_modal.php b/client_add_modal.php index 061f4649..c2547b2b 100644 --- a/client_add_modal.php +++ b/client_add_modal.php @@ -2,7 +2,7 @@ @@ -43,7 +43,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
- +
@@ -60,7 +60,7 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()"));
- +
- +
@@ -95,8 +95,8 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli, "SELECT FOUND_ROWS()")); "> Name - Primary Address - Primary Contact + Primary address + Primary contact Billing Action diff --git a/database_updates.php b/database_updates.php index afd03d55..79c6fe05 100644 --- a/database_updates.php +++ b/database_updates.php @@ -979,11 +979,48 @@ if (LATEST_DATABASE_VERSION > CURRENT_DATABASE_VERSION) { mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.5.2'"); } - //if (CURRENT_DATABASE_VERSION == '0.5.2') { + if (CURRENT_DATABASE_VERSION == '0.5.2') { //Insert queries here required to update to DB version 0.5.3 + //Custom Fields and Values + + mysqli_query($mysqli, "CREATE TABLE `custom_fields` ( + `custom_field_id` int(11) NOT NULL AUTO_INCREMENT, + `custom_field_table` varchar(255) NOT NULL, + `custom_field_label` varchar(255) NOT NULL, + `custom_field_type` varchar(255) NOT NULL DEFAULT 'TEXT', + `custom_field_location` int(11) NOT NULL DEFAULT 0, + `custom_field_order` int(11) NOT NULL DEFAULT 999, + PRIMARY KEY (`custom_field_id`), + UNIQUE KEY (`custom_field_table`), + UNIQUE KEY (`custom_field_label`), + UNIQUE KEY (`custom_field_type`) + )"); + + mysqli_query($mysqli, "CREATE TABLE `custom_values` ( + `custom_value_id` int(11) NOT NULL AUTO_INCREMENT, + `custom_value_value` text NOT NULL, + `custom_value_field` int(11) NOT NULL, + PRIMARY KEY (`custom_value_id`) + )"); + + mysqli_query($mysqli, "CREATE TABLE `asset_custom` ( + `asset_custom_id` int(11) NOT NULL AUTO_INCREMENT, + `asset_custom_field_value` int(11) NOT NULL, + `asset_custom_field_id` int(11) NOT NULL, + `asset_custom_asset_id` int(11) NOT NULL, + PRIMARY KEY (`asset_custom_id`), + UNIQUE KEY (`asset_custom_field_id`) + )"); // Then, update the database to the next sequential version - //mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.5.3'"); + mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.5.3'"); + } + + //if (CURRENT_DATABASE_VERSION == '0.5.3') { + //Insert queries here required to update to DB version 0.5.4 + + // Then, update the database to the next sequential version + //mysqli_query($mysqli, "UPDATE `settings` SET `config_current_database_version` = '0.5.4'"); //} } else { diff --git a/database_version.php b/database_version.php index 3e9bb371..5e1e24fa 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.5.2"); +DEFINE("LATEST_DATABASE_VERSION", "0.5.3"); diff --git a/db.sql b/db.sql index 09c5c3e3..45e7bc11 100644 --- a/db.sql +++ b/db.sql @@ -53,6 +53,23 @@ CREATE TABLE `api_keys` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `asset_custom` +-- + +DROP TABLE IF EXISTS `asset_custom`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `asset_custom` ( + `asset_custom_id` int(11) NOT NULL AUTO_INCREMENT, + `asset_custom_field_value` int(11) NOT NULL, + `asset_custom_field_id` int(11) NOT NULL, + `asset_custom_asset_id` int(11) NOT NULL, + PRIMARY KEY (`asset_custom_id`), + UNIQUE KEY `asset_custom_field_id` (`asset_custom_field_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `asset_documents` -- @@ -353,6 +370,42 @@ CREATE TABLE `contacts` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; /*!40101 SET character_set_client = @saved_cs_client */; +-- +-- Table structure for table `custom_fields` +-- + +DROP TABLE IF EXISTS `custom_fields`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `custom_fields` ( + `custom_field_id` int(11) NOT NULL AUTO_INCREMENT, + `custom_field_table` varchar(255) NOT NULL, + `custom_field_label` varchar(255) NOT NULL, + `custom_field_type` varchar(255) NOT NULL DEFAULT 'TEXT', + `custom_field_location` int(11) NOT NULL DEFAULT 0, + `custom_field_order` int(11) NOT NULL DEFAULT 999, + PRIMARY KEY (`custom_field_id`), + UNIQUE KEY `custom_field_table` (`custom_field_table`), + UNIQUE KEY `custom_field_label` (`custom_field_label`), + UNIQUE KEY `custom_field_type` (`custom_field_type`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + +-- +-- Table structure for table `custom_values` +-- + +DROP TABLE IF EXISTS `custom_values`; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `custom_values` ( + `custom_value_id` int(11) NOT NULL AUTO_INCREMENT, + `custom_value_value` text NOT NULL, + `custom_value_field` int(11) NOT NULL, + PRIMARY KEY (`custom_value_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci; +/*!40101 SET character_set_client = @saved_cs_client */; + -- -- Table structure for table `documents` -- @@ -1491,4 +1544,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2023-05-02 12:35:34 +-- Dump completed on 2023-05-07 19:45:11 diff --git a/portal/login_create.php b/portal/login_create.php new file mode 100644 index 00000000..e69de29b