diff --git a/install/phpnuxbill.sql b/install/phpnuxbill.sql index b87ddb99..c13c25b7 100644 --- a/install/phpnuxbill.sql +++ b/install/phpnuxbill.sql @@ -24,6 +24,10 @@ CREATE TABLE `tbl_customers` ( `pppoe_password` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'For PPPOE Login', `fullname` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `address` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci, + `city` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL, + `district` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL, + `state` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL, + `zip` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL, `phonenumber` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0', `email` varchar(128) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1', `coordinates` VARCHAR(50) NOT NULL DEFAULT '' COMMENT 'Latitude and Longitude coordinates', diff --git a/system/controllers/customers.php b/system/controllers/customers.php index 082f29d7..2375ad86 100644 --- a/system/controllers/customers.php +++ b/system/controllers/customers.php @@ -392,6 +392,11 @@ switch ($action) { //post Customers Attributes $custom_field_names = (array) $_POST['custom_field_name']; $custom_field_values = (array) $_POST['custom_field_value']; + //additional information + $city = _post('city'); + $district = _post('district'); + $state = _post('state'); + $zip = _post('zip'); run_hook('add_customer'); #HOOK $msg = ''; @@ -423,6 +428,10 @@ switch ($action) { $d->phonenumber = Lang::phoneFormat($phonenumber); $d->service_type = $service_type; $d->coordinates = $coordinates; + $d->city = $city; + $d->district = $district; + $d->state = $state; + $d->zip = $zip; $d->save(); // Retrieve the customer ID of the newly created customer @@ -461,6 +470,11 @@ switch ($action) { $service_type = _post('service_type'); $coordinates = _post('coordinates'); $status = _post('status'); + //additional information + $city = _post('city'); + $district = _post('district'); + $state = _post('state'); + $zip = _post('zip'); run_hook('edit_customer'); #HOOK $msg = ''; if (Validator::Length($username, 35, 2) == false) { @@ -523,6 +537,10 @@ switch ($action) { $d->phonenumber = $phonenumber; $d->service_type = $service_type; $d->coordinates = $coordinates; + $d->city = $city; + $d->district = $district; + $d->state = $state; + $d->zip = $zip; $d->save(); diff --git a/system/updates.json b/system/updates.json index 9146363c..a5d3fc56 100644 --- a/system/updates.json +++ b/system/updates.json @@ -99,5 +99,8 @@ ], "2024.5.18" : [ "ALTER TABLE `tbl_customers` CHANGE `status` `status` ENUM('Active','Banned','Disabled','Inactive','Limited','Suspended') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Active';" + ], + "2024.5.20" : [ + "ALTER TABLE `tbl_customers` ADD `city` VARCHAR(255) NULL AFTER `address`, ADD `district` VARCHAR(255) NULL AFTER `city`, ADD `state` VARCHAR(255) NULL AFTER `district`, ADD `zip` VARCHAR(10) NULL AFTER `state`;" ] } \ No newline at end of file diff --git a/ui/ui/customers-add.tpl b/ui/ui/customers-add.tpl index db70e9cd..4985dfb5 100644 --- a/ui/ui/customers-add.tpl +++ b/ui/ui/customers-add.tpl @@ -121,6 +121,51 @@ +
+
+
+

{Lang::T('Additional Information')}

+
+ +
+
+ +
+
+ + + + +