forked from kevinowino869/mitrobill
Merge pull request #107 from Focuslinkstech/Development
New Feature Added "Custom Fields"
This commit is contained in:
commit
e7c715f1b3
@ -188,6 +188,15 @@ CREATE TABLE `tb_languages` (
|
|||||||
`id` int(11) NOT NULL
|
`id` int(11) NOT NULL
|
||||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
|
|
||||||
|
DROP TABLE IF EXISTS `tbl_customers_custom_fields`;
|
||||||
|
CREATE TABLE tbl_customers_custom_fields (
|
||||||
|
id INT PRIMARY KEY AUTO_INCREMENT,
|
||||||
|
customer_id INT NOT NULL,
|
||||||
|
field_name VARCHAR(255) NOT NULL,
|
||||||
|
field_value VARCHAR(255) NOT NULL,
|
||||||
|
FOREIGN KEY (customer_id) REFERENCES tbl_customers(id)
|
||||||
|
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||||
|
|
||||||
ALTER TABLE `tbl_voucher` ADD `generated_by` INT NOT NULL DEFAULT '0' COMMENT 'id admin' AFTER `status`;
|
ALTER TABLE `tbl_voucher` ADD `generated_by` INT NOT NULL DEFAULT '0' COMMENT 'id admin' AFTER `status`;
|
||||||
ALTER TABLE `tbl_users` ADD `root` INT NOT NULL DEFAULT '0' COMMENT 'for sub account' AFTER `id`;
|
ALTER TABLE `tbl_users` ADD `root` INT NOT NULL DEFAULT '0' COMMENT 'for sub account' AFTER `id`;
|
||||||
ALTER TABLE `tbl_users` CHANGE `user_type` `user_type` ENUM('SuperAdmin','Admin','Report','Agent','Sales') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
|
ALTER TABLE `tbl_users` CHANGE `user_type` `user_type` ENUM('SuperAdmin','Admin','Report','Agent','Sales') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;
|
||||||
|
@ -166,6 +166,13 @@ switch ($action) {
|
|||||||
$customer = ORM::for_table('tbl_customers')->find_one($id);
|
$customer = ORM::for_table('tbl_customers')->find_one($id);
|
||||||
}
|
}
|
||||||
if ($customer) {
|
if ($customer) {
|
||||||
|
|
||||||
|
|
||||||
|
// Fetch the custom field values from the tbl_customer_custom_fields table
|
||||||
|
$customFields = ORM::for_table('tbl_customers_custom_fields')
|
||||||
|
->where('customer_id', $customer['id'])
|
||||||
|
->find_many();
|
||||||
|
|
||||||
$v = $routes['3'];
|
$v = $routes['3'];
|
||||||
if (empty($v) || $v == 'order') {
|
if (empty($v) || $v == 'order') {
|
||||||
$v = 'order';
|
$v = 'order';
|
||||||
@ -193,6 +200,7 @@ switch ($action) {
|
|||||||
$ui->assign('package', $package);
|
$ui->assign('package', $package);
|
||||||
$ui->assign('v', $v);
|
$ui->assign('v', $v);
|
||||||
$ui->assign('d', $customer);
|
$ui->assign('d', $customer);
|
||||||
|
$ui->assign('customFields', $customFields);
|
||||||
$ui->display('customers-view.tpl');
|
$ui->display('customers-view.tpl');
|
||||||
} else {
|
} else {
|
||||||
r2(U . 'customers/list', 'e', $_L['Account_Not_Found']);
|
r2(U . 'customers/list', 'e', $_L['Account_Not_Found']);
|
||||||
@ -202,8 +210,13 @@ switch ($action) {
|
|||||||
$id = $routes['2'];
|
$id = $routes['2'];
|
||||||
run_hook('edit_customer'); #HOOK
|
run_hook('edit_customer'); #HOOK
|
||||||
$d = ORM::for_table('tbl_customers')->find_one($id);
|
$d = ORM::for_table('tbl_customers')->find_one($id);
|
||||||
|
// Fetch the custom field values from the tbl_customers_custom_fields table
|
||||||
|
$customFields = ORM::for_table('tbl_customers_custom_fields')
|
||||||
|
->where('customer_id', $id)
|
||||||
|
->find_many();
|
||||||
if ($d) {
|
if ($d) {
|
||||||
$ui->assign('d', $d);
|
$ui->assign('d', $d);
|
||||||
|
$ui->assign('customFields', $customFields);
|
||||||
$ui->display('customers-edit.tpl');
|
$ui->display('customers-edit.tpl');
|
||||||
} else {
|
} else {
|
||||||
r2(U . 'customers/list', 'e', $_L['Account_Not_Found']);
|
r2(U . 'customers/list', 'e', $_L['Account_Not_Found']);
|
||||||
@ -218,6 +231,8 @@ switch ($action) {
|
|||||||
run_hook('delete_customer'); #HOOK
|
run_hook('delete_customer'); #HOOK
|
||||||
$d = ORM::for_table('tbl_customers')->find_one($id);
|
$d = ORM::for_table('tbl_customers')->find_one($id);
|
||||||
if ($d) {
|
if ($d) {
|
||||||
|
// Delete the associated custom field records from tbl_customer_custom_fields table
|
||||||
|
ORM::for_table('tbl_customers_custom_fields')->where('customer_id', $id)->delete_many();
|
||||||
$c = ORM::for_table('tbl_user_recharges')->where('username', $d['username'])->find_one();
|
$c = ORM::for_table('tbl_user_recharges')->where('username', $d['username'])->find_one();
|
||||||
if ($c) {
|
if ($c) {
|
||||||
$p = ORM::for_table('tbl_plans')->find_one($c['plan_id']);
|
$p = ORM::for_table('tbl_plans')->find_one($c['plan_id']);
|
||||||
@ -270,6 +285,10 @@ switch ($action) {
|
|||||||
$address = _post('address');
|
$address = _post('address');
|
||||||
$phonenumber = _post('phonenumber');
|
$phonenumber = _post('phonenumber');
|
||||||
$service_type = _post('service_type');
|
$service_type = _post('service_type');
|
||||||
|
//post custom field
|
||||||
|
$custom_field_names = (array) $_POST['custom_field_name'];
|
||||||
|
$custom_field_values = (array) $_POST['custom_field_value'];
|
||||||
|
|
||||||
run_hook('add_customer'); #HOOK
|
run_hook('add_customer'); #HOOK
|
||||||
$msg = '';
|
$msg = '';
|
||||||
if (Validator::Length($username, 35, 2) == false) {
|
if (Validator::Length($username, 35, 2) == false) {
|
||||||
@ -299,6 +318,25 @@ switch ($action) {
|
|||||||
$d->phonenumber = Lang::phoneFormat($phonenumber);
|
$d->phonenumber = Lang::phoneFormat($phonenumber);
|
||||||
$d->service_type = $service_type;
|
$d->service_type = $service_type;
|
||||||
$d->save();
|
$d->save();
|
||||||
|
|
||||||
|
// Retrieve the customer ID of the newly created customer
|
||||||
|
$customerId = $d->id();
|
||||||
|
// Save custom field details
|
||||||
|
if (!empty($custom_field_names) && !empty($custom_field_values)) {
|
||||||
|
$totalFields = min(count($custom_field_names), count($custom_field_values));
|
||||||
|
for ($i = 0; $i < $totalFields; $i++) {
|
||||||
|
$name = $custom_field_names[$i];
|
||||||
|
$value = $custom_field_values[$i];
|
||||||
|
|
||||||
|
if (!empty($name)) {
|
||||||
|
$customField = ORM::for_table('tbl_customers_custom_fields')->create();
|
||||||
|
$customField->customer_id = $customerId;
|
||||||
|
$customField->field_name = $name;
|
||||||
|
$customField->field_value = $value;
|
||||||
|
$customField->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
r2(U . 'customers/list', 's', Lang::T('Account Created Successfully'));
|
r2(U . 'customers/list', 's', Lang::T('Account Created Successfully'));
|
||||||
} else {
|
} else {
|
||||||
r2(U . 'customers/add', 'e', $msg);
|
r2(U . 'customers/add', 'e', $msg);
|
||||||
@ -330,6 +368,12 @@ switch ($action) {
|
|||||||
|
|
||||||
$id = _post('id');
|
$id = _post('id');
|
||||||
$d = ORM::for_table('tbl_customers')->find_one($id);
|
$d = ORM::for_table('tbl_customers')->find_one($id);
|
||||||
|
|
||||||
|
//lets find user custom field using id
|
||||||
|
$customFields = ORM::for_table('tbl_customers_custom_fields')
|
||||||
|
->where('customer_id', $id)
|
||||||
|
->find_many();
|
||||||
|
|
||||||
if (!$d) {
|
if (!$d) {
|
||||||
$msg .= Lang::T('Data Not Found') . '<br>';
|
$msg .= Lang::T('Data Not Found') . '<br>';
|
||||||
}
|
}
|
||||||
@ -343,7 +387,7 @@ switch ($action) {
|
|||||||
if ($oldusername != $username) {
|
if ($oldusername != $username) {
|
||||||
$c = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
|
$c = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
|
||||||
if ($c) {
|
if ($c) {
|
||||||
$msg .= Lang::T('Account already axist') . '<br>';
|
$msg .= Lang::T('Account already exist') . '<br>';
|
||||||
}
|
}
|
||||||
$userDiff = true;
|
$userDiff = true;
|
||||||
}
|
}
|
||||||
@ -368,6 +412,52 @@ switch ($action) {
|
|||||||
$d->phonenumber = $phonenumber;
|
$d->phonenumber = $phonenumber;
|
||||||
$d->service_type = $service_type;
|
$d->service_type = $service_type;
|
||||||
$d->save();
|
$d->save();
|
||||||
|
|
||||||
|
|
||||||
|
// Update custom field values in tbl_customers_custom_fields table
|
||||||
|
foreach ($customFields as $customField) {
|
||||||
|
$fieldName = $customField['field_name'];
|
||||||
|
if (isset($_POST['custom_fields'][$fieldName])) {
|
||||||
|
$customFieldValue = $_POST['custom_fields'][$fieldName];
|
||||||
|
$customField->set('field_value', $customFieldValue);
|
||||||
|
$customField->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add new custom fields
|
||||||
|
if (isset($_POST['custom_field_name']) && isset($_POST['custom_field_value'])) {
|
||||||
|
$newCustomFieldNames = $_POST['custom_field_name'];
|
||||||
|
$newCustomFieldValues = $_POST['custom_field_value'];
|
||||||
|
|
||||||
|
// Check if the number of field names and values match
|
||||||
|
if (count($newCustomFieldNames) == count($newCustomFieldValues)) {
|
||||||
|
$numNewFields = count($newCustomFieldNames);
|
||||||
|
|
||||||
|
for ($i = 0; $i < $numNewFields; $i++) {
|
||||||
|
$fieldName = $newCustomFieldNames[$i];
|
||||||
|
$fieldValue = $newCustomFieldValues[$i];
|
||||||
|
|
||||||
|
// Insert the new custom field
|
||||||
|
$newCustomField = ORM::for_table('tbl_customers_custom_fields')->create();
|
||||||
|
$newCustomField->set('customer_id', $id);
|
||||||
|
$newCustomField->set('field_name', $fieldName);
|
||||||
|
$newCustomField->set('field_value', $fieldValue);
|
||||||
|
$newCustomField->save();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Delete custom fields
|
||||||
|
if (isset($_POST['delete_custom_fields'])) {
|
||||||
|
$fieldsToDelete = $_POST['delete_custom_fields'];
|
||||||
|
foreach ($fieldsToDelete as $fieldName) {
|
||||||
|
// Delete the custom field with the given field name
|
||||||
|
ORM::for_table('tbl_customers_custom_fields')
|
||||||
|
->where('field_name', $fieldName)
|
||||||
|
->delete_many();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($userDiff || $pppoeDiff || $passDiff) {
|
if ($userDiff || $pppoeDiff || $passDiff) {
|
||||||
$c = ORM::for_table('tbl_user_recharges')->where('username', ($userDiff) ? $oldusername : $username)->find_one();
|
$c = ORM::for_table('tbl_user_recharges')->where('username', ($userDiff) ? $oldusername : $username)->find_one();
|
||||||
if ($c) {
|
if ($c) {
|
||||||
|
@ -55,5 +55,8 @@
|
|||||||
],
|
],
|
||||||
"2024.2.16": [
|
"2024.2.16": [
|
||||||
"ALTER TABLE `tbl_customers` ADD `created_by` INT NOT NULL DEFAULT '0' AFTER `auto_renewal`;"
|
"ALTER TABLE `tbl_customers` ADD `created_by` INT NOT NULL DEFAULT '0' AFTER `auto_renewal`;"
|
||||||
|
],
|
||||||
|
"2024.2.17": [
|
||||||
|
"CREATE TABLE `tbl_customers_custom_fields` (`id` INT PRIMARY KEY AUTO_INCREMENT, `customer_id` INT NOT NULL, `field_name` VARCHAR(255) NOT NULL, `field_value` VARCHAR(255) NOT NULL, FOREIGN KEY (customer_id) REFERENCES tbl_customers(id));"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -62,8 +62,8 @@
|
|||||||
<input type="password" class="form-control" id="pppoe_password" name="pppoe_password"
|
<input type="password" class="form-control" id="pppoe_password" name="pppoe_password"
|
||||||
value="{$d['pppoe_password']}" onmouseleave="this.type = 'password'"
|
value="{$d['pppoe_password']}" onmouseleave="this.type = 'password'"
|
||||||
onmouseenter="this.type = 'text'">
|
onmouseenter="this.type = 'text'">
|
||||||
<span
|
<span class="help-block">{Lang::T('User Cannot change this, only admin. if it Empty it will
|
||||||
class="help-block">{Lang::T('User Cannot change this, only admin. if it Empty it will use user password')}</span>
|
use user password')}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -76,17 +76,27 @@
|
|||||||
<label class="col-md-2 control-label">{Lang::T('Service Type')}</label>
|
<label class="col-md-2 control-label">{Lang::T('Service Type')}</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select class="form-control" id="service_type" name="service_type">
|
<select class="form-control" id="service_type" name="service_type">
|
||||||
<option value="Hotspot" {if $d['service_type'] eq 'Hotspot'}selected{/if}>Hotspot</option>
|
<option value="Hotspot" {if $d['service_type'] eq 'Hotspot' }selected{/if}>Hotspot
|
||||||
<option value="PPPoE" {if $d['service_type'] eq 'PPPoE'}selected{/if}>PPPoE</option>
|
</option>
|
||||||
<option value="Others" {if $d['service_type'] eq 'Others'}selected{/if}>Others</option>
|
<option value="PPPoE" {if $d['service_type'] eq 'PPPoE' }selected{/if}>PPPoE</option>
|
||||||
|
<option value="Others" {if $d['service_type'] eq 'Others' }selected{/if}>Others</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- Custom fields add start -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-md-2 control-label">{Lang::T('Custom Field')}</label>
|
||||||
|
<div id="custom-fields-container" class="col-md-6">
|
||||||
|
<button class="btn btn-success btn-sm waves-effect waves-light" type="button"
|
||||||
|
id="add-custom-field">+</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Custom fields add end -->
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-lg-offset-2 col-lg-10">
|
<div class="col-lg-offset-2 col-lg-10">
|
||||||
<button class="btn btn-primary waves-effect waves-light"
|
<button class="btn btn-primary waves-effect waves-light" type="submit">{Lang::T('Save
|
||||||
type="submit">{Lang::T('Save Changes')}</button>
|
Changes')}</button>
|
||||||
Or <a href="{$_url}customers/list">{Lang::T('Cancel')}</a>
|
Or <a href="{$_url}customers/list">{Lang::T('Cancel')}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -96,6 +106,41 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
{literal}
|
||||||
|
<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">
|
||||||
|
<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">
|
||||||
|
<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 waves-effect waves-light">-</button>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{/literal}
|
||||||
|
|
||||||
|
|
||||||
{include file="sections/footer.tpl"}
|
{include file="sections/footer.tpl"}
|
@ -67,8 +67,8 @@
|
|||||||
<input type="password" autocomplete="off" class="form-control" id="pppoe_password"
|
<input type="password" autocomplete="off" class="form-control" id="pppoe_password"
|
||||||
name="pppoe_password" value="{$d['pppoe_password']}"
|
name="pppoe_password" value="{$d['pppoe_password']}"
|
||||||
onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'">
|
onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'">
|
||||||
<span
|
<span class="help-block">{Lang::T('User Cannot change this, only admin. if it Empty it will
|
||||||
class="help-block">{Lang::T('User Cannot change this, only admin. if it Empty it will use user password')}</span>
|
use user password')}</span>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
@ -81,17 +81,41 @@
|
|||||||
<label class="col-md-2 control-label">{Lang::T('Service Type')}</label>
|
<label class="col-md-2 control-label">{Lang::T('Service Type')}</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select class="form-control" id="service_type" name="service_type">
|
<select class="form-control" id="service_type" name="service_type">
|
||||||
<option value="Hotspot" {if $d['service_type'] eq 'Hotspot'}selected{/if}>Hotspot</option>
|
<option value="Hotspot" {if $d['service_type'] eq 'Hotspot' }selected{/if}>Hotspot
|
||||||
<option value="PPPoE" {if $d['service_type'] eq 'PPPoE'}selected{/if}>PPPoE</option>
|
</option>
|
||||||
<option value="Others" {if $d['service_type'] eq 'Others'}selected{/if}>Others</option>
|
<option value="PPPoE" {if $d['service_type'] eq 'PPPoE' }selected{/if}>PPPoE</option>
|
||||||
|
<option value="Others" {if $d['service_type'] eq 'Others' }selected{/if}>Others</option>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!--custom field edit start -->
|
||||||
|
{if $customFields}
|
||||||
|
{foreach $customFields as $customField}
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-md-2 control-label"
|
||||||
|
for="{$customField.field_name}">{$customField.field_name}</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<input class="form-control" type="text" name="custom_fields[{$customField.field_name}]"
|
||||||
|
id="{$customField.field_name}" value="{$customField.field_value}">
|
||||||
|
</div>
|
||||||
|
<input type="checkbox" name="delete_custom_fields[]" value="{$customField.field_name}"> Delete
|
||||||
|
</div>
|
||||||
|
{/foreach}
|
||||||
|
{/if}
|
||||||
|
<!--custom field edit end -->
|
||||||
|
<!--custom field add start -->
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-md-2 control-label">{Lang::T('Custom Field')}</label>
|
||||||
|
<div id="custom-fields-container" class="col-md-6">
|
||||||
|
<button class="btn btn-success btn-sm waves-effect waves-light" type="button"
|
||||||
|
id="add-custom-field">+</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--custom field add end -->
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-lg-offset-2 col-lg-10">
|
<div class="col-lg-offset-2 col-lg-10">
|
||||||
<button class="btn btn-primary waves-effect waves-light"
|
<button class="btn btn-primary waves-effect waves-light" type="submit">{Lang::T('Save
|
||||||
type="submit">{Lang::T('Save Changes')}</button>
|
Changes')}</button>
|
||||||
Or <a href="{$_url}customers/list">{Lang::T('Cancel')}</a>
|
Or <a href="{$_url}customers/list">{Lang::T('Cancel')}</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -102,4 +126,40 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{literal}
|
||||||
|
<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">
|
||||||
|
<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">
|
||||||
|
<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 waves-effect waves-light">-</button>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{/literal}
|
||||||
|
|
||||||
{include file="sections/footer.tpl"}
|
{include file="sections/footer.tpl"}
|
@ -37,6 +37,15 @@
|
|||||||
onclick="this.select()">
|
onclick="this.select()">
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
|
<!--custom field view start -->
|
||||||
|
{if $customFields}
|
||||||
|
{foreach $customFields as $customField}
|
||||||
|
<li class="list-group-item">
|
||||||
|
<b>{$customField.field_name}</b> <span class="pull-right">{$customField.field_value}</span>
|
||||||
|
</li>
|
||||||
|
{/foreach}
|
||||||
|
{/if}
|
||||||
|
<!--custom field view end -->
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<b>{Lang::T('Service Type')}</b> <span class="pull-right">{Lang::T($d['service_type'])}</span>
|
<b>{Lang::T('Service Type')}</b> <span class="pull-right">{Lang::T($d['service_type'])}</span>
|
||||||
</li>
|
</li>
|
||||||
@ -44,8 +53,8 @@
|
|||||||
<b>{Lang::T('Balance')}</b> <span class="pull-right">{Lang::moneyFormat($d['balance'])}</span>
|
<b>{Lang::T('Balance')}</b> <span class="pull-right">{Lang::moneyFormat($d['balance'])}</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<b>{Lang::T('Auto Renewal')}</b> <span
|
<b>{Lang::T('Auto Renewal')}</b> <span class="pull-right">{if
|
||||||
class="pull-right">{if $d['auto_renewal']}yes{else}no{/if}</span>
|
$d['auto_renewal']}yes{else}no{/if}</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<b>{Lang::T('Created On')}</b> <span
|
<b>{Lang::T('Created On')}</b> <span
|
||||||
@ -59,8 +68,8 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
<a href="{$_url}customers/delete/{$d['id']}" id="{$d['id']}"
|
<a href="{$_url}customers/delete/{$d['id']}" id="{$d['id']}"
|
||||||
class="btn btn-danger btn-block btn-sm" onclick="return confirm('{Lang::T('Delete')}?')"><span
|
class="btn btn-danger btn-block btn-sm"
|
||||||
class="fa fa-trash"></span></a>
|
onclick="return confirm('{Lang::T('Delete')}?')"><span class="fa fa-trash"></span></a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-8">
|
<div class="col-xs-8">
|
||||||
<a href="{$_url}customers/edit/{$d['id']}"
|
<a href="{$_url}customers/edit/{$d['id']}"
|
||||||
@ -75,8 +84,8 @@
|
|||||||
<h4 class="text-center">{$package['type']} - {$package['namebp']}</h4>
|
<h4 class="text-center">{$package['type']} - {$package['namebp']}</h4>
|
||||||
<ul class="list-group list-group-unbordered">
|
<ul class="list-group list-group-unbordered">
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
{Lang::T('Active')} <span
|
{Lang::T('Active')} <span class="pull-right">{if
|
||||||
class="pull-right">{if $package['status']=='on'}yes{else}no{/if}</span>
|
$package['status']=='on'}yes{else}no{/if}</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
{Lang::T('Created On')} <span
|
{Lang::T('Created On')} <span
|
||||||
@ -84,7 +93,8 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
{Lang::T('Expires On')} <span
|
{Lang::T('Expires On')} <span
|
||||||
class="pull-right">{Lang::dateAndTimeFormat($package['expiration'], $package['time'])}</span>
|
class="pull-right">{Lang::dateAndTimeFormat($package['expiration'],
|
||||||
|
$package['time'])}</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
{$package['routers']} <span class="pull-right">{$package['method']}</span>
|
{$package['routers']} <span class="pull-right">{$package['method']}</span>
|
||||||
@ -117,9 +127,9 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="col-sm-8 col-md-8">
|
<div class="col-sm-8 col-md-8">
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li role="presentation" {if $v=='order'}class="active" {/if}><a
|
<li role="presentation" {if $v=='order' }class="active" {/if}><a
|
||||||
href="{$_url}customers/view/{$d['id']}/order">30 {Lang::T('Order History')}</a></li>
|
href="{$_url}customers/view/{$d['id']}/order">30 {Lang::T('Order History')}</a></li>
|
||||||
<li role="presentation" {if $v=='activation'}class="active" {/if}><a
|
<li role="presentation" {if $v=='activation' }class="active" {/if}><a
|
||||||
href="{$_url}customers/view/{$d['id']}/activation">30 {Lang::T('Activation History')}</a></li>
|
href="{$_url}customers/view/{$d['id']}/activation">30 {Lang::T('Activation History')}</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
<div class="table-responsive" style="background-color: white;">
|
<div class="table-responsive" style="background-color: white;">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user