Added Additional Information

City
District
State
Zip
This commit is contained in:
Focuslinkstech 2024-05-20 13:09:38 +01:00 committed by Ibnu Maksum
parent 066f333a85
commit 8fb930cddf
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
6 changed files with 128 additions and 3 deletions

View File

@ -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',

View File

@ -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();

View File

@ -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`;"
]
}

View File

@ -121,6 +121,51 @@
</div>
</div>
</div>
<div class="col-md-6">
<div class="box box-primary box-solid collapsed-box">
<div class="box-header with-border">
<h3 class="box-title">{Lang::T('Additional Information')}</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i>
</button>
</div>
</div>
<div class="box-body" style="display: none;">
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('City')}</label>
<div class="col-md-9">
<input type="text" class="form-control" id="city" name="city"
value="{$d['city']}">
<small class="form-text text-muted">{Lang::T('City of Resident')}</small>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('District')}</label>
<div class="col-md-9">
<input type="text" class="form-control" id="district" name="district"
value="{$d['district']}">
<small class="form-text text-muted">{Lang::T('District')}</small>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('State')}</label>
<div class="col-md-9">
<input type="text" class="form-control" id="state" name="state"
value="{$d['state']}">
<small class="form-text text-muted">{Lang::T('State of Resident')}</small>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('Zip')}</label>
<div class="col-md-9">
<input type="text" class="form-control" id="zip" name="zip"
value="{$d['zip']}">
<small class="form-text text-muted">{Lang::T('Zip Code')}</small>
</div>
</div>
</div>
</div>
</div>
</div>
<center>
<button class="btn btn-primary" type="submit">

View File

@ -160,6 +160,51 @@
</div>
</div>
</div>
<div class="col-md-6">
<div class="box box-primary box-solid collapsed-box">
<div class="box-header with-border">
<h3 class="box-title">{Lang::T('Additional Information')}</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-plus"></i>
</button>
</div>
</div>
<div class="box-body" style="display: none;">
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('City')}</label>
<div class="col-md-9">
<input type="text" class="form-control" id="city" name="city"
value="{$d['city']}">
<small class="form-text text-muted">{Lang::T('City of Resident')}</small>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('District')}</label>
<div class="col-md-9">
<input type="text" class="form-control" id="district" name="district"
value="{$d['district']}">
<small class="form-text text-muted">{Lang::T('District')}</small>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('State')}</label>
<div class="col-md-9">
<input type="text" class="form-control" id="state" name="state"
value="{$d['state']}">
<small class="form-text text-muted">{Lang::T('State of Resident')}</small>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('Zip')}</label>
<div class="col-md-9">
<input type="text" class="form-control" id="zip" name="zip"
value="{$d['zip']}">
<small class="form-text text-muted">{Lang::T('Zip Code')}</small>
</div>
</div>
</div>
</div>
</div>
</div>
<center>
<button class="btn btn-primary" type="submit">

View File

@ -22,9 +22,19 @@
<li class="list-group-item">
<b>{Lang::T('Email')}</b> <span class="pull-right">{$d['email']}</span>
</li>
</ul>
<p class="text-muted">{Lang::nl2br($d['address'])}</p>
<ul class="list-group list-group-unbordered">
<li class="list-group-item">{Lang::nl2br($d['address'])}</li>
<li class="list-group-item">
<b>{Lang::T('City')}</b> <span class="pull-right">{Lang::T($d['city'])}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('District')}</b> <span class="pull-right">{Lang::T($d['district'])}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('State')}</b> <span class="pull-right">{Lang::T($d['state'])}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Zip')}</b> <span class="pull-right">{Lang::T($d['zip'])}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Password')}</b> <input type="password" value="{$d['password']}"
style=" border: 0px; text-align: right;" class="pull-right"