change Customer menu
This commit is contained in:
parent
fbd215e741
commit
28f4624e8d
@ -12,6 +12,9 @@ $ui->assign('_system_menu', 'customers');
|
|||||||
$action = $routes['1'];
|
$action = $routes['1'];
|
||||||
$ui->assign('_admin', $admin);
|
$ui->assign('_admin', $admin);
|
||||||
|
|
||||||
|
if(empty($action)){
|
||||||
|
$action = 'list';
|
||||||
|
}
|
||||||
|
|
||||||
switch ($action) {
|
switch ($action) {
|
||||||
case 'list':
|
case 'list':
|
||||||
|
@ -13,10 +13,10 @@
|
|||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
{if $_c['country_code_phone']!= ''}
|
{if $_c['country_code_phone']!= ''}
|
||||||
<span class="input-group-addon" id="basic-addon1">+</span>
|
<span class="input-group-addon" id="basic-addon1">+</span>
|
||||||
{else}
|
{else}
|
||||||
<span class="input-group-addon" id="basic-addon1"><i
|
<span class="input-group-addon" id="basic-addon1"><i
|
||||||
class="glyphicon glyphicon-phone-alt"></i></span>
|
class="glyphicon glyphicon-phone-alt"></i></span>
|
||||||
{/if}
|
{/if}
|
||||||
<input type="text" class="form-control" name="username" value="{$d['username']}"
|
<input type="text" class="form-control" name="username" value="{$d['username']}"
|
||||||
required
|
required
|
||||||
@ -42,10 +42,10 @@
|
|||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
{if $_c['country_code_phone']!= ''}
|
{if $_c['country_code_phone']!= ''}
|
||||||
<span class="input-group-addon" id="basic-addon1">+</span>
|
<span class="input-group-addon" id="basic-addon1">+</span>
|
||||||
{else}
|
{else}
|
||||||
<span class="input-group-addon" id="basic-addon1"><i
|
<span class="input-group-addon" id="basic-addon1"><i
|
||||||
class="glyphicon glyphicon-phone-alt"></i></span>
|
class="glyphicon glyphicon-phone-alt"></i></span>
|
||||||
{/if}
|
{/if}
|
||||||
<input type="text" class="form-control" name="phonenumber" value="{$d['phonenumber']}"
|
<input type="text" class="form-control" name="phonenumber" value="{$d['phonenumber']}"
|
||||||
placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}">
|
placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}">
|
||||||
@ -91,25 +91,24 @@
|
|||||||
</div>
|
</div>
|
||||||
<!--Customers Attributes edit start -->
|
<!--Customers Attributes edit start -->
|
||||||
{if $customFields}
|
{if $customFields}
|
||||||
{foreach $customFields as $customField}
|
{foreach $customFields as $customField}
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-2 control-label"
|
<label class="col-md-2 control-label"
|
||||||
for="{$customField.field_name}">{$customField.field_name}</label>
|
for="{$customField.field_name}">{$customField.field_name}</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<input class="form-control" type="text" name="custom_fields[{$customField.field_name}]"
|
<input class="form-control" type="text" name="custom_fields[{$customField.field_name}]"
|
||||||
id="{$customField.field_name}" value="{$customField.field_value}">
|
id="{$customField.field_name}" value="{$customField.field_value}">
|
||||||
</div>
|
</div>
|
||||||
<input type="checkbox" name="delete_custom_fields[]" value="{$customField.field_name}"> Delete
|
<input type="checkbox" name="delete_custom_fields[]" value="{$customField.field_name}"> Delete
|
||||||
</div>
|
</div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
<!--Customers Attributes edit end -->
|
<!--Customers Attributes edit end -->
|
||||||
<!--Customers Attributes add start -->
|
<!--Customers Attributes add start -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-2 control-label">{Lang::T('Attributes')}</label>
|
<label class="col-md-2 control-label">{Lang::T('Attributes')}</label>
|
||||||
<div id="custom-fields-container" class="col-md-6">
|
<div id="custom-fields-container" class="col-md-6">
|
||||||
<button class="btn btn-success btn-sm" type="button"
|
<button class="btn btn-success btn-sm" type="button" id="add-custom-field">+</button>
|
||||||
id="add-custom-field">+</button>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<!--Customers Attributes add end -->
|
<!--Customers Attributes add end -->
|
||||||
@ -129,16 +128,16 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{literal}
|
{literal}
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
document.addEventListener("DOMContentLoaded", function () {
|
document.addEventListener("DOMContentLoaded", function() {
|
||||||
var customFieldsContainer = document.getElementById('custom-fields-container');
|
var customFieldsContainer = document.getElementById('custom-fields-container');
|
||||||
var addCustomFieldButton = document.getElementById('add-custom-field');
|
var addCustomFieldButton = document.getElementById('add-custom-field');
|
||||||
|
|
||||||
addCustomFieldButton.addEventListener('click', function () {
|
addCustomFieldButton.addEventListener('click', function() {
|
||||||
var fieldIndex = customFieldsContainer.children.length;
|
var fieldIndex = customFieldsContainer.children.length;
|
||||||
var newField = document.createElement('div');
|
var newField = document.createElement('div');
|
||||||
newField.className = 'form-group';
|
newField.className = 'form-group';
|
||||||
newField.innerHTML = `
|
newField.innerHTML = `
|
||||||
<label class="col-md-2 control-label">Name:</label>
|
<label class="col-md-2 control-label">Name:</label>
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<input type="text" class="form-control" name="custom_field_name[]" placeholder="Name">
|
<input type="text" class="form-control" name="custom_field_name[]" placeholder="Name">
|
||||||
@ -151,17 +150,17 @@
|
|||||||
<button type="button" class="remove-custom-field btn btn-danger btn-sm">-</button>
|
<button type="button" class="remove-custom-field btn btn-danger btn-sm">-</button>
|
||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
customFieldsContainer.appendChild(newField);
|
customFieldsContainer.appendChild(newField);
|
||||||
});
|
});
|
||||||
|
|
||||||
customFieldsContainer.addEventListener('click', function (event) {
|
customFieldsContainer.addEventListener('click', function(event) {
|
||||||
if (event.target.classList.contains('remove-custom-field')) {
|
if (event.target.classList.contains('remove-custom-field')) {
|
||||||
var fieldContainer = event.target.parentNode.parentNode;
|
var fieldContainer = event.target.parentNode.parentNode;
|
||||||
fieldContainer.parentNode.removeChild(fieldContainer);
|
fieldContainer.parentNode.removeChild(fieldContainer);
|
||||||
}
|
}
|
||||||
|
});
|
||||||
});
|
});
|
||||||
});
|
</script>
|
||||||
</script>
|
|
||||||
{/literal}
|
{/literal}
|
||||||
|
|
||||||
{include file="sections/footer.tpl"}
|
{include file="sections/footer.tpl"}
|
@ -130,20 +130,11 @@
|
|||||||
</li>
|
</li>
|
||||||
{$_MENU_AFTER_DASHBOARD}
|
{$_MENU_AFTER_DASHBOARD}
|
||||||
{if !in_array($_admin['user_type'],['Report'])}
|
{if !in_array($_admin['user_type'],['Report'])}
|
||||||
<li class="{if $_system_menu eq 'customers'}active{/if} treeview">
|
<li {if $_system_menu eq 'customers'}class="active" {/if}>
|
||||||
<a href="#">
|
<a href="{$_url}customers">
|
||||||
<i class="ion ion-android-contacts"></i> <span>{Lang::T('Customer')}</span>
|
<i class="fa fa-users"></i>
|
||||||
<span class="pull-right-container">
|
<span>{Lang::T('Customer')}</span>
|
||||||
<i class="fa fa-angle-left pull-right"></i>
|
|
||||||
</span>
|
|
||||||
</a>
|
</a>
|
||||||
<ul class="treeview-menu">
|
|
||||||
<li {if $_routes[1] eq 'add'}class="active" {/if}><a href="{$_url}customers/add"><i
|
|
||||||
class="fa fa-user-plus"></i> {Lang::T('Add New Contact')}</a></li>
|
|
||||||
<li {if $_routes[1] eq 'list'}class="active" {/if}><a href="{$_url}customers/list"><i
|
|
||||||
class="fa fa-users"></i> {Lang::T('List Contact')}</a></li>
|
|
||||||
{$_MENU_CUSTOMERS}
|
|
||||||
</ul>
|
|
||||||
</li>
|
</li>
|
||||||
{$_MENU_AFTER_CUSTOMERS}
|
{$_MENU_AFTER_CUSTOMERS}
|
||||||
<li class="{if $_system_menu eq 'prepaid'}active{/if} treeview">
|
<li class="{if $_system_menu eq 'prepaid'}active{/if} treeview">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user