Skip to content

Commit

Permalink
Change the view of Attributes Customer
Browse files Browse the repository at this point in the history
  • Loading branch information
ibnux committed Mar 6, 2024
1 parent e5c8aae commit 37a5ee8
Show file tree
Hide file tree
Showing 6 changed files with 132 additions and 124 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

# CHANGELOG

## 2024.3.6

- change attributes view

## 2024.3.4

- add [[username]] for reminder
Expand Down
3 changes: 2 additions & 1 deletion system/lan/english.json
Original file line number Diff line number Diff line change
Expand Up @@ -460,5 +460,6 @@
"Users_Announcement": "Users Announcement",
"Customer_Announcement": "Customer Announcement",
"1_Period___1_Month__Expires_the_20th_of_each_month": "1 Period = 1 Month, Expires the 20th of each month",
"Period": "Period"
"Period": "Period",
"Add": "Add"
}
140 changes: 70 additions & 70 deletions ui/ui/customers-add.tpl
Original file line number Diff line number Diff line change
@@ -1,64 +1,63 @@
{include file="sections/header.tpl"}

<div class="row">
<div class="col-sm-12 col-md-12">
<div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{Lang::T('Add New Contact')}</div>
<div class="panel-body">

<form class="form-horizontal" method="post" role="form" action="{$_url}customers/add-post">
<form class="form-horizontal" method="post" role="form" action="{$_url}customers/add-post">
<div class="row">
<div class="col-md-6">
<div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{Lang::T('Add New Contact')}</div>
<div class="panel-body">
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Username')}</label>
<div class="col-md-6">
<label class="col-md-3 control-label">{Lang::T('Username')}</label>
<div class="col-md-9">
<div class="input-group">
{if $_c['country_code_phone']!= ''}
<span class="input-group-addon" id="basic-addon1">+</span>
<span class="input-group-addon" id="basic-addon1">+</span>
{else}
<span class="input-group-addon" id="basic-addon1"><i
class="glyphicon glyphicon-phone-alt"></i></span>
<span class="input-group-addon" id="basic-addon1"><i
class="glyphicon glyphicon-phone-alt"></i></span>
{/if}
<input type="text" class="form-control" name="username" required
placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}">
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Full Name')}</label>
<div class="col-md-6">
<label class="col-md-3 control-label">{Lang::T('Full Name')}</label>
<div class="col-md-9">
<input type="text" required class="form-control" id="fullname" name="fullname">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Email')}</label>
<div class="col-md-6">
<label class="col-md-3 control-label">{Lang::T('Email')}</label>
<div class="col-md-9">
<input type="email" class="form-control" id="email" name="email">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Phone Number')}</label>
<div class="col-md-6">
<label class="col-md-3 control-label">{Lang::T('Phone Number')}</label>
<div class="col-md-9">
<div class="input-group">
{if $_c['country_code_phone']!= ''}
<span class="input-group-addon" id="basic-addon1">+</span>
<span class="input-group-addon" id="basic-addon1">+</span>
{else}
<span class="input-group-addon" id="basic-addon1"><i
class="glyphicon glyphicon-phone-alt"></i></span>
<span class="input-group-addon" id="basic-addon1"><i
class="glyphicon glyphicon-phone-alt"></i></span>
{/if}
<input type="text" class="form-control" name="phonenumber"
placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}">
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Password')}</label>
<div class="col-md-6">
<input type="password" class="form-control" autocomplete="off" required id="password"
<label class="col-md-3 control-label">{Lang::T('Password')}</label>
<div class="col-md-9">
<input type="password" class="form-control" autocomplete="off" required id="password" value="{rand(000000,999999)}"
name="password" onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('PPPOE Password')}</label>
<div class="col-md-6">
<label class="col-md-3 control-label">{Lang::T('PPPOE Password')}</label>
<div class="col-md-9">
<input type="password" class="form-control" id="pppoe_password" name="pppoe_password"
value="{$d['pppoe_password']}" onmouseleave="this.type = 'password'"
onmouseenter="this.type = 'text'">
Expand All @@ -68,14 +67,14 @@
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Address')}</label>
<div class="col-md-6">
<label class="col-md-3 control-label">{Lang::T('Address')}</label>
<div class="col-md-9">
<textarea name="address" id="address" class="form-control"></textarea>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Service Type')}</label>
<div class="col-md-6">
<label class="col-md-3 control-label">{Lang::T('Service Type')}</label>
<div class="col-md-9">
<select class="form-control" id="service_type" name="service_type">
<option value="Hotspot" {if $d['service_type'] eq 'Hotspot' }selected{/if}>Hotspot
</option>
Expand All @@ -84,64 +83,65 @@
</select>
</div>
</div>
</div>
</div>
</div>
<div class="col-md-6">
<div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{Lang::T('Attributes')}</div>
<div class="panel-body">
<!-- Customers Attributes add start -->
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Attributes')}</label>
<div id="custom-fields-container" class="col-md-6">
<button class="btn btn-success btn-sm" type="button"
id="add-custom-field">+</button>
</div>
</div>
<!-- Customers Attributes add end -->
<div id="custom-fields-container">

<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-primary" type="submit">
{Lang::T('Save Changes')}
</button>
Or <a href="{$_url}customers/list">{Lang::T('Cancel')}</a>
</div>
</div>
</form>
<!-- Customers Attributes add end -->
</div>
<div class="panel-footer">
<button class="btn btn-success btn-block" type="button"
id="add-custom-field">{Lang::T('Add')}</button>
</div>
</div>
</div>
</div>
</div>
</div>
<center>
<button class="btn btn-primary" type="submit">
{Lang::T('Save Changes')}
</button>
<br><a href="{$_url}customers/list" class="btn btn-link">{Lang::T('Cancel')}</a>
</center>
</form>
{literal}
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() {
var customFieldsContainer = document.getElementById('custom-fields-container');
var addCustomFieldButton = document.getElementById('add-custom-field');
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() {
var customFieldsContainer = document.getElementById('custom-fields-container');
var addCustomFieldButton = document.getElementById('add-custom-field');
addCustomFieldButton.addEventListener('click', function() {
var fieldIndex = customFieldsContainer.children.length;
var newField = document.createElement('div');
newField.className = 'form-group';
newField.innerHTML = `
<label class="col-md-2 control-label">Name:</label>
<div class="col-md-3">
addCustomFieldButton.addEventListener('click', function() {
var fieldIndex = customFieldsContainer.children.length;
var newField = document.createElement('div');
newField.className = 'form-group';
newField.innerHTML = `
<div class="col-md-4">
<input type="text" class="form-control" name="custom_field_name[]" placeholder="Name">
</div>
<label class="col-md-2 control-label">Value:</label>
<div class="col-md-3">
<div class="col-md-6">
<input type="text" class="form-control" name="custom_field_value[]" placeholder="Value">
</div>
<div class="col-md-2">
<button type="button" class="remove-custom-field btn btn-danger btn-sm">-</button>
</div>
`;
customFieldsContainer.appendChild(newField);
});
customFieldsContainer.appendChild(newField);
});

customFieldsContainer.addEventListener('click', function(event) {
if (event.target.classList.contains('remove-custom-field')) {
var fieldContainer = event.target.parentNode.parentNode;
fieldContainer.parentNode.removeChild(fieldContainer);
}
customFieldsContainer.addEventListener('click', function(event) {
if (event.target.classList.contains('remove-custom-field')) {
var fieldContainer = event.target.parentNode.parentNode;
fieldContainer.parentNode.removeChild(fieldContainer);
}
});
});
});
</script>
</script>
{/literal}


Expand Down
Loading

0 comments on commit 37a5ee8

Please sign in to comment.