first commit
This commit is contained in:
267
admininistrator/view/template/marketing/affiliate.twig
Normal file
267
admininistrator/view/template/marketing/affiliate.twig
Normal file
@ -0,0 +1,267 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
|
||||
<button type="button" data-bs-toggle="tooltip" title="{{ button_filter }}" onclick="$('#filter-affiliate').toggleClass('d-none');" class="btn btn-light d-md-none"><i class="fa-solid fa-filter"></i></button>
|
||||
|
||||
<button type="button" id="button-calculate" data-bs-toggle="tooltip" title="{{ button_calculate }}" class="btn btn-warning"><i class="fa-solid fa-sync"></i></button>
|
||||
|
||||
<button type="submit" form="form-affiliate" formaction="{{ csv }}" id="button-csv" data-bs-toggle="tooltip" title="{{ button_csv }}" class="btn btn-info"><i class="fa-solid fa-file-csv"></i></button>
|
||||
|
||||
<button type="submit" form="form-affiliate" formaction="{{ complete }}" data-oc-toggle="ajax" id="button-complete" data-bs-toggle="tooltip" title="{{ button_complete }}" class="btn btn-success"><i class="fa-solid fa-credit-card"></i></button>
|
||||
|
||||
<a href="{{ add }}" data-bs-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa-solid fa-plus"></i></a>
|
||||
|
||||
<button type="submit" form="form-affiliate" formaction="{{ delete }}" data-bs-toggle="tooltip" title="{{ button_delete }}" onclick="return confirm('{{ text_confirm }}');" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div id="filter-affiliate" class="col-lg-3 col-md-12 order-lg-last d-none d-lg-block mb-3">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-filter"></i> {{ text_filter }}</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label class="form-label">{{ entry_customer }}</label>
|
||||
<input type="text" name="filter_customer" value="{{ filter_customer }}" placeholder="{{ entry_customer }}" id="input-customer" data-oc-target="autocomplete-customer" class="form-control" autocomplete="off"/>
|
||||
<ul id="autocomplete-customer" class="dropdown-menu"></ul>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-tracking" class="form-label">{{ entry_tracking }}</label>
|
||||
<input type="text" name="filter_tracking" value="{{ filter_tracking }}" placeholder="{{ entry_tracking }}" id="input-tracking" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-payment-method" class="form-label">{{ entry_payment_method }}</label>
|
||||
<select name="filter_payment_method" id="input-payment-method" class="form-select">
|
||||
<option value=""></option>
|
||||
{% for payment_method in payment_methods %}
|
||||
<option value="{{ payment_method.value }}"{% if filter_payment_method == payment_method.value %} selected{% endif %}>{{ payment_method.text }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-commission" class="form-label">{{ entry_commission }}</label>
|
||||
<input type="text" name="filter_commission" value="{{ filter_commission }}" placeholder="{{ entry_commission }}" id="input-commission" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-date-from" class="form-label">{{ entry_date_from }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="filter_date_from" value="{{ filter_date_from }}" placeholder="{{ entry_date_from }}" id="input-date-from" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-date-to" class="form-label">{{ entry_date_to }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="filter_date_to" value="{{ filter_date_to }}" placeholder="{{ entry_date_to }}" id="input-date-to" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-status" class="form-label">{{ entry_status }}</label>
|
||||
<select name="filter_status" id="input-status" class="form-select">
|
||||
<option value=""></option>
|
||||
<option value="1"{% if filter_status == '1' %} selected{% endif %}>{{ text_enabled }}</option>
|
||||
<option value="0"{% if filter_status == '0' %} selected{% endif %}>{{ text_disabled }}</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-limit" class="form-label">{{ entry_limit }}</label>
|
||||
<select name="limit" id="input-limit" class="form-select">
|
||||
{% for limits in limits %}
|
||||
<option value="{{ limits.value }}"{% if limits.value == limit %} selected{% endif %}>{{ limits.text }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-filter" class="btn btn-light"><i class="fa-solid fa-filter"></i> {{ button_filter }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="affiliate" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#affiliate').on('click', 'thead a, .pagination a', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#affiliate').load(this.href);
|
||||
});
|
||||
|
||||
$('#button-filter').on('click', function() {
|
||||
url = '';
|
||||
|
||||
var filter_customer = $('#input-customer').val();
|
||||
|
||||
if (filter_customer) {
|
||||
url += '&filter_customer=' + encodeURIComponent(filter_customer);
|
||||
}
|
||||
|
||||
var filter_tracking = $('#input-tracking').val();
|
||||
|
||||
if (filter_tracking) {
|
||||
url += '&filter_tracking=' + encodeURIComponent(filter_tracking);
|
||||
}
|
||||
|
||||
var filter_payment_method = $('#input-payment-method').val();
|
||||
|
||||
if (filter_payment_method) {
|
||||
url += '&filter_payment_method=' + filter_payment_method;
|
||||
}
|
||||
|
||||
var filter_commission = $('#input-commission').val();
|
||||
|
||||
if (filter_commission) {
|
||||
url += '&filter_commission=' + filter_commission;
|
||||
}
|
||||
|
||||
var filter_date_from = $('#input-date-from').val();
|
||||
|
||||
if (filter_date_from) {
|
||||
url += '&filter_date_from=' + encodeURIComponent(filter_date_from);
|
||||
}
|
||||
|
||||
var filter_date_to = $('#input-date-to').val();
|
||||
|
||||
if (filter_date_to) {
|
||||
url += '&filter_date_to=' + encodeURIComponent(filter_date_to);
|
||||
}
|
||||
|
||||
var filter_status = $('#input-status').val();
|
||||
|
||||
if (filter_status !== '') {
|
||||
url += '&filter_status=' + filter_status;
|
||||
}
|
||||
|
||||
var limit = $('#input-limit').val();
|
||||
|
||||
if (limit) {
|
||||
url += '&limit=' + limit;
|
||||
}
|
||||
|
||||
window.history.pushState({}, null, 'index.php?route=marketing/affiliate&user_token={{ user_token }}' + url);
|
||||
|
||||
$('#affiliate').load('index.php?route=marketing/affiliate.list&user_token={{ user_token }}' + url);
|
||||
});
|
||||
|
||||
$('#input-customer').autocomplete({
|
||||
'source': function(request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=customer/customer.autocomplete&user_token={{ user_token }}&filter_affiliate=1&filter_name=' + encodeURIComponent(request),
|
||||
dataType: 'json',
|
||||
success: function(json) {
|
||||
response($.map(json, function(item) {
|
||||
return {
|
||||
label: item['name'],
|
||||
value: item['customer_id']
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function(item) {
|
||||
$('#input-customer').val(item['label']);
|
||||
}
|
||||
});
|
||||
|
||||
$('#button-calculate').on('click', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=marketing/affiliate.calculate&user_token={{ user_token }}',
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (json) {
|
||||
console.log(json);
|
||||
|
||||
if (json['error']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
url = '';
|
||||
|
||||
var filter_customer = $('#input-customer').val();
|
||||
|
||||
if (filter_customer) {
|
||||
url += '&filter_customer=' + encodeURIComponent(filter_customer);
|
||||
}
|
||||
|
||||
var filter_tracking = $('#input-tracking').val();
|
||||
|
||||
if (filter_tracking) {
|
||||
url += '&filter_tracking=' + encodeURIComponent(filter_tracking);
|
||||
}
|
||||
|
||||
var filter_payment_method = $('#input-payment-method').val();
|
||||
|
||||
if (filter_payment_method) {
|
||||
url += '&filter_payment_method=' + filter_payment_method;
|
||||
}
|
||||
|
||||
var filter_commission = $('#input-commission').val();
|
||||
|
||||
if (filter_commission) {
|
||||
url += '&filter_commission=' + filter_commission;
|
||||
}
|
||||
|
||||
var filter_date_from = $('#input-date-from').val();
|
||||
|
||||
if (filter_date_from) {
|
||||
url += '&filter_date_from=' + encodeURIComponent(filter_date_from);
|
||||
}
|
||||
|
||||
var filter_date_to = $('#input-date-to').val();
|
||||
|
||||
if (filter_date_to) {
|
||||
url += '&filter_date_to=' + encodeURIComponent(filter_date_to);
|
||||
}
|
||||
|
||||
var filter_status = $('#input-status').val();
|
||||
|
||||
if (filter_status !== '') {
|
||||
url += '&filter_status=' + filter_status;
|
||||
}
|
||||
|
||||
var limit = $('#input-limit').val();
|
||||
|
||||
if (limit) {
|
||||
url += '&limit=' + limit;
|
||||
}
|
||||
|
||||
$('#affiliate').load('index.php?route=marketing/affiliate.list&user_token={{ user_token }}' + url);
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
495
admininistrator/view/template/marketing/affiliate_form.twig
Normal file
495
admininistrator/view/template/marketing/affiliate_form.twig
Normal file
@ -0,0 +1,495 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="submit" form="form-affiliate" formaction="{{ save }}" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_form }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-affiliate" action="{{ save }}" method="post" data-oc-toggle="ajax">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item"><a href="#tab-general" data-bs-toggle="tab" class="nav-link active">{{ tab_general }}</a></li>
|
||||
<li class="nav-item"><a href="#tab-history" data-bs-toggle="tab" class="nav-link">{{ tab_history }}</a></li>
|
||||
<li class="nav-item"><a href="#tab-transaction" data-bs-toggle="tab" class="nav-link">{{ tab_transaction }}</a></li>
|
||||
<li class="nav-item"><a href="#tab-report" data-bs-toggle="tab" class="nav-link">{{ tab_report }}</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="tab-general" class="tab-pane active">
|
||||
<fieldset>
|
||||
<legend>{{ text_affiliate }}</legend>
|
||||
<div class="row mb-3 required" class="tab-pane active">
|
||||
<label for="input-customer" class="col-sm-2 col-form-label">{{ entry_customer }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="customer" value="{{ customer }}" placeholder="{{ entry_customer }}" id="input-customer" data-oc-target="autocomplete-customer" class="form-control"{% if customer_id %} disabled{% endif %} autocomplete="off"/> <input type="hidden" name="customer_id" value="{{ customer_id }}" id="input-customer-id"/> <input type="hidden" name="customer_group_id" value="{{ customer_group_id }}" id="input-customer-group"/>
|
||||
<ul id="autocomplete-customer" class="dropdown-menu"></ul>
|
||||
<div id="error-customer" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="input-company" class="col-sm-2 col-form-label">{{ entry_company }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="company" value="{{ company }}" placeholder="{{ entry_company }}" id="input-company" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="input-website" class="col-sm-2 col-form-label">{{ entry_website }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="website" value="{{ website }}" placeholder="{{ entry_website }}" id="input-website" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-tracking" class="col-sm-2 col-form-label">{{ entry_tracking }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="tracking" value="{{ tracking }}" placeholder="{{ entry_tracking }}" id="input-tracking" class="form-control"/>
|
||||
<div class="form-text">{{ help_tracking }}</div>
|
||||
<div id="error-tracking" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row mb-3">
|
||||
<label for="input-commission" class="col-sm-2 col-form-label">{{ entry_commission }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="commission" value="{{ commission }}" placeholder="{{ entry_commission }}" id="input-commission" class="form-control"/>
|
||||
<div class="form-text">{{ help_commission }}</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{% for custom_field in custom_fields %}
|
||||
{% if custom_field.location == 'affiliate' %}
|
||||
|
||||
{% if custom_field.type == 'select' %}
|
||||
<div class="row mb-3 custom-field custom-field-{{ custom_field.custom_field_id }}">
|
||||
<label for="input-custom-field-{{ custom_field.custom_field_id }}" class="col-sm-2 col-form-label">{{ custom_field.name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="custom_field[{{ custom_field.custom_field_id }}]" id="input-custom-field-{{ custom_field.custom_field_id }}" class="form-select">
|
||||
<option value="">{{ text_select }}</option>
|
||||
{% for custom_field_value in custom_field.custom_field_value %}
|
||||
<option value="{{ custom_field_value.custom_field_value_id }}"{% if affiliate_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id == affiliate_custom_field[custom_field.custom_field_id] %} selected{% endif %}>{{ custom_field_value.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div id="error-custom-field-{{ custom_field.custom_field_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if custom_field.type == 'radio' %}
|
||||
<div class="row mb-3 custom-field custom-field-{{ custom_field.custom_field_id }}">
|
||||
<label class="col-sm-2 col-form-label">{{ custom_field.name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div id="input-custom-field-{{ custom_field.custom_field_id }}" class="form-control" style="height: 150px; overflow: auto;">
|
||||
{% for custom_field_value in custom_field.custom_field_value %}
|
||||
<div class="form-check">
|
||||
<input type="radio" name="custom_field[{{ custom_field.custom_field_id }}]" value="{{ custom_field_value.custom_field_value_id }}" id="input-custom-value-{{ custom_field_value.custom_field_value_id }}" class="form-check-input"{% if affiliate_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id == affiliate_custom_field[custom_field.custom_field_id] %} checked{% endif %}/> <label for="input-custom-value-{{ custom_field_value.custom_field_value_id }}" class="form-check-label">{{ custom_field_value.name }}</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div id="error-custom-field-{{ custom_field.custom_field_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if custom_field.type == 'checkbox' %}
|
||||
<div class="row mb-3 custom-field custom-field-{{ custom_field.custom_field_id }}">
|
||||
<label class="col-sm-2 col-form-label">{{ custom_field.name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div id="input-custom-field-{{ custom_field.custom_field_id }}" class="form-control" style="height: 150px; overflow: auto;">
|
||||
{% for custom_field_value in custom_field.custom_field_value %}
|
||||
<div class="form-check">
|
||||
<input type="checkbox" name="custom_field[{{ custom_field.custom_field_id }}][]" value="{{ custom_field_value.custom_field_value_id }}" id="input-custom-value-{{ custom_field_value.custom_field_value_id }}" class="form-check-input"{% if affiliate_custom_field[custom_field.custom_field_id] and custom_field_value.custom_field_value_id in affiliate_custom_field[custom_field.custom_field_id] %} checked{% endif %}/> <label for="input-custom-value-{{ custom_field_value.custom_field_value_id }}" class="form-check-label">{{ custom_field_value.name }}</label>
|
||||
</div>
|
||||
{% endfor %}
|
||||
</div>
|
||||
<div id="error-custom-field-{{ custom_field.custom_field_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if custom_field.type == 'text' %}
|
||||
<div class="row mb-3 custom-field custom-field-{{ custom_field.custom_field_id }}">
|
||||
<label for="input-custom-field-{{ custom_field.custom_field_id }}" class="col-sm-2 col-form-label">{{ custom_field.name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="custom_field[{{ custom_field.custom_field_id }}]" value="{{ affiliate_custom_field[custom_field.custom_field_id] ? affiliate_custom_field[custom_field.custom_field_id] : custom_field.value }}" placeholder="{{ custom_field.name }}" id="input-custom-field-{{ custom_field.custom_field_id }}" class="form-control"/>
|
||||
<div id="error-custom-field-{{ custom_field.custom_field_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if custom_field.type == 'textarea' %}
|
||||
<div class="row mb-3 custom-field custom-field-{{ custom_field.custom_field_id }}">
|
||||
<label for="input-custom-field-{{ custom_field.custom_field_id }}" class="col-sm-2 col-form-label">{{ custom_field.name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="custom_field[{{ custom_field.custom_field_id }}]" rows="5" placeholder="{{ custom_field.name }}" id="input-custom-field-{{ custom_field.custom_field_id }}" class="form-control">{{ affiliate_custom_field[custom_field.custom_field_id] ? affiliate_custom_field[custom_field.custom_field_id] : custom_field.value }}</textarea>
|
||||
<div id="error-custom-field-{{ custom_field.custom_field_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if custom_field.type == 'file' %}
|
||||
<div class="row mb-3 custom-field custom-field-{{ custom_field.custom_field_id }}">
|
||||
<label class="col-sm-2 col-form-label">{{ custom_field.name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<button type="button" data-oc-toggle="upload" data-oc-url="{{ upload }}" data-oc-target="#input-custom-field-{{ custom_field.custom_field_id }}" data-oc-size-max="{{ config_file_max_size }}" data-oc-size-error="{{ error_upload_size }}" class="btn btn-primary"><i class="fa-solid fa-upload"></i> {{ button_upload }}</button>
|
||||
<input type="text" name="custom_field[{{ custom_field.custom_field_id }}]" value="{{ affiliate_custom_field[custom_field.custom_field_id] ? affiliate_custom_field[custom_field.custom_field_id] }}" id="input-custom-field-{{ custom_field.custom_field_id }}" class="form-control" readonly/>
|
||||
<button type="button" data-oc-toggle="download" data-oc-target="#input-custom-field-{{ custom_field.custom_field_id }}"{% if not affiliate_custom_field[custom_field.custom_field_id] %} disabled{% endif %} class="btn btn-outline-secondary"><i class="fa-solid fa-download"></i> {{ button_download }}</button>
|
||||
<button type="button" data-oc-toggle="clear" data-bs-toggle="tooltip" title="{{ button_clear }}" data-oc-target="#input-custom-field-{{ custom_field.custom_field_id }}"{% if not affiliate_custom_field[custom_field.custom_field_id] %} disabled{% endif %} class="btn btn-outline-danger"><i class="fa-solid fa-eraser"></i></button>
|
||||
</div>
|
||||
<div id="error-custom-field-{{ custom_field.custom_field_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if custom_field.type == 'date' %}
|
||||
<div class="row mb-3 custom-field custom-field-{{ custom_field.custom_field_id }}">
|
||||
<label for="input-custom-field-{{ custom_field.custom_field_id }}" class="col-sm-2 col-form-label">{{ custom_field.name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<input type="text" name="custom_field[{{ custom_field.custom_field_id }}]" value="{{ affiliate_custom_field[custom_field.custom_field_id] ? affiliate_custom_field[custom_field.custom_field_id] : custom_field.value }}" placeholder="{{ custom_field.name }}" id="input-custom-field-{{ custom_field.custom_field_id }}" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
<div id="error-custom-field-{{ custom_field.custom_field_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if custom_field.type == 'time' %}
|
||||
<div class="row mb-3 custom-field custom-field-{{ custom_field.custom_field_id }}">
|
||||
<label for="input-custom-field-{{ custom_field.custom_field_id }}" class="col-sm-2 col-form-label">{{ custom_field.name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<input type="text" name="custom_field[{{ custom_field.custom_field_id }}]" value="{{ affiliate_custom_field[custom_field.custom_field_id] ? affiliate_custom_field[custom_field.custom_field_id] : custom_field.value }}" placeholder="{{ custom_field.name }}" id="input-custom-field-{{ custom_field.custom_field_id }}" class="form-control time"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
<div id="error-custom-field-{{ custom_field.custom_field_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% if custom_field.type == 'datetime' %}
|
||||
<div class="row mb-3 custom-field custom-field-{{ custom_field.custom_field_id }}">
|
||||
<label for="input-custom-field-{{ custom_field.custom_field_id }}" class="col-sm-2 col-form-label">{{ custom_field.name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="input-group">
|
||||
<input type="text" name="custom_field[{{ custom_field.custom_field_id }}]" value="{{ affiliate_custom_field[custom_field.custom_field_id] ? affiliate_custom_field[custom_field.custom_field_id] : custom_field.value }}" placeholder="{{ custom_field.name }}" id="input-custom-field-{{ custom_field.custom_field_id }}" class="form-control datetime"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
<div id="error-custom-field-{{ custom_field.custom_field_id }}" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ text_payment }}</legend>
|
||||
<div class="row mb-3">
|
||||
<label for="input-tax" class="col-sm-2 col-form-label">{{ entry_tax }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="tax" value="{{ tax }}" placeholder="{{ entry_tax }}" id="input-tax" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_payment_method }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check">
|
||||
<input type="radio" name="payment_method" value="cheque" id="input-payment-cheque" class="form-check-input"{% if payment_method == 'cheque' %} checked{% endif %}/>
|
||||
<label for="input-payment-cheque" class="form-check-label">{{ text_cheque }}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="radio" name="payment_method" value="paypal" id="input-payment-paypal" class="form-check-input"{% if payment_method == 'paypal' %} checked{% endif %}/>
|
||||
<label for="input-payment-paypal" class="form-check-label">{{ text_paypal }}</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input type="radio" name="payment_method" value="bank" id="input-payment-bank" class="form-check-input"{% if payment_method == 'bank' %} checked{% endif %}/>
|
||||
<label for="input-payment-bank" class="form-check-label">{{ text_bank }}</label>
|
||||
</div>
|
||||
<div id="error-payment-method" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="payment-cheque" class="payment">
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-cheque" class="col-sm-2 col-form-label">{{ entry_cheque }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="cheque" value="{{ cheque }}" placeholder="{{ entry_cheque }}" id="input-cheque" class="form-control"/>
|
||||
<div id="error-cheque" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="payment-paypal" class="payment">
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-paypal" class="col-sm-2 col-form-label">{{ entry_paypal }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="paypal" value="{{ paypal }}" placeholder="{{ entry_paypal }}" id="input-paypal" class="form-control"/>
|
||||
<div id="error-paypal" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="payment-bank" class="payment">
|
||||
<div class="row mb-3">
|
||||
<label for="input-bank-name" class="col-sm-2 col-form-label">{{ entry_bank_name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="bank_name" value="{{ bank_name }}" placeholder="{{ entry_bank_name }}" id="input-bank-name" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-bank-branch-number" class="col-sm-2 col-form-label">{{ entry_bank_branch_number }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="bank_branch_number" value="{{ bank_branch_number }}" placeholder="{{ entry_bank_branch_number }}" id="input-bank-branch-number" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-bank-swift-code" class="col-sm-2 col-form-label">{{ entry_bank_swift_code }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="bank_swift_code" value="{{ bank_swift_code }}" placeholder="{{ entry_bank_swift_code }}" id="input-bank-swift-code" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-bank-account-name" class="col-sm-2 col-form-label">{{ entry_bank_account_name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="bank_account_name" value="{{ bank_account_name }}" placeholder="{{ entry_bank_account_name }}" id="input-bank-account-name" class="form-control"/>
|
||||
<div id="error-bank-account-name" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-bank-account-number" class="col-sm-2 col-form-label">{{ entry_bank_account_number }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="bank_account_number" value="{{ bank_account_number }}" placeholder="{{ entry_bank_account_number }}" id="input-bank-account-number" class="form-control"/>
|
||||
<div id="error-bank-account-number" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset>
|
||||
<legend>{{ text_other }}</legend>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_status }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check form-switch form-switch-lg">
|
||||
<input type="hidden" name="status" value="0"/> <input type="checkbox" name="status" value="1" id="input-status" class="form-check-input"{% if status %} checked{% endif %}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
<div id="tab-history" class="tab-pane">
|
||||
<fieldset>
|
||||
<legend>{{ text_history }}</legend>
|
||||
<div id="history">{{ history }}</div>
|
||||
</fieldset>
|
||||
<br/>
|
||||
<fieldset>
|
||||
<legend>{{ text_history_add }}</legend>
|
||||
<div class="row mb-3">
|
||||
<label for="input-history" class="col-sm-2 col-form-label">{{ entry_comment }}</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="comment" rows="8" placeholder="{{ entry_comment }}" id="input-history" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-history" class="btn btn-primary"><i class="fa-solid fa-plus-circle"></i> {{ button_history_add }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab-transaction" class="tab-pane">
|
||||
<fieldset>
|
||||
<legend>{{ text_transaction }}</legend>
|
||||
<div id="transaction">{{ transaction }}</div>
|
||||
</fieldset>
|
||||
<br/>
|
||||
<fieldset>
|
||||
<legend>{{ text_transaction_add }}</legend>
|
||||
<div class="row mb-3">
|
||||
<label for="input-transaction" class="col-sm-2 col-form-label">{{ entry_description }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="description" value="" placeholder="{{ entry_description }}" id="input-transaction" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-amount" class="col-sm-2 col-form-label">{{ entry_amount }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="amount" value="" placeholder="{{ entry_amount }}" id="input-amount" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
</fieldset>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-transaction" class="btn btn-primary"><i class="fa-solid fa-plus-circle"></i> {{ button_transaction_add }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab-report" class="tab-pane">
|
||||
<fieldset>
|
||||
<legend>{{ text_report }}</legend>
|
||||
<div id="report">{{ report }}</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#input-customer').autocomplete({
|
||||
'source': function(request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=customer/customer.autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request),
|
||||
dataType: 'json',
|
||||
success: function(json) {
|
||||
response($.map(json, function(item) {
|
||||
return {
|
||||
category: item['customer_group'],
|
||||
label: item['name'],
|
||||
value: item['customer_id'],
|
||||
customer_group_id: item['customer_group_id'],
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function(item) {
|
||||
$('#input-customer').val(item['label']);
|
||||
$('#input-customer-id').val(item['value']);
|
||||
$('#input-customer-group').val(item['customer_group_id']);
|
||||
|
||||
$('#input-customer-group').trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
$('#input-customer-group').on('change', function() {
|
||||
$.ajax({
|
||||
url: 'index.php?route=customer/customer.customfield&user_token={{ user_token }}&customer_group_id=' + this.value,
|
||||
dataType: 'json',
|
||||
success: function(json) {
|
||||
$('.custom-field').hide();
|
||||
$('.custom-field').removeClass('required');
|
||||
|
||||
for (i = 0; i < json.length; i++) {
|
||||
custom_field = json[i];
|
||||
|
||||
$('.custom-field-' + custom_field['custom_field_id']).show();
|
||||
|
||||
if (custom_field['required']) {
|
||||
$('.custom-field-' + custom_field['custom_field_id']).addClass('required');
|
||||
}
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#input-customer-group').trigger('change');
|
||||
|
||||
$('#history').on('click', '.pagination a', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#history').load(this.href);
|
||||
});
|
||||
|
||||
$('#button-history').on('click', function(e) {
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=customer/customer.addHistory&user_token={{ user_token }}&customer_id=' + $('#input-customer-id').val(),
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: 'comment=' + encodeURIComponent($('#input-comment').val()),
|
||||
beforeSend: function() {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#tab-history').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#tab-history').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$('#history').load('index.php?route=customer/customer.history&user_token={{ user_token }}&customer_id=' + $('#input-customer-id').val());
|
||||
|
||||
$('#input-history').val('');
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#transaction').on('click', '.pagination a', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#transaction').load(this.href);
|
||||
});
|
||||
|
||||
$('#button-transaction').on('click', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
url: 'index.php?route=customer/customer.addTransaction&user_token={{ user_token }}&customer_id=' + $('#input-customer-id').val(),
|
||||
type: 'post',
|
||||
dataType: 'json',
|
||||
data: 'description=' + encodeURIComponent($('#input-transaction').val()) + '&amount=' + encodeURIComponent($('#input-amount').val()),
|
||||
beforeSend: function() {
|
||||
$('#button-transaction').button('loading');
|
||||
},
|
||||
complete: function() {
|
||||
$('#button-transaction').button('reset');
|
||||
},
|
||||
success: function(json) {
|
||||
$('.alert-dismissible').remove();
|
||||
|
||||
if (json['error']) {
|
||||
$('#tab-transaction').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#tab-transaction').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$('#transaction').load('index.php?route=customer/customer.transaction&user_token={{ user_token }}&customer_id=' + $('#input-customer-id').val());
|
||||
|
||||
$('#input-transaction').val('');
|
||||
$('#input-amount').val('');
|
||||
}
|
||||
},
|
||||
error: function(xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#report').on('click', '.pagination a', function(e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#report').load(this.href);
|
||||
});
|
||||
|
||||
$('input[name=\'payment_method\']').on('change', function() {
|
||||
$('.payment').hide();
|
||||
|
||||
$('#payment-' + this.value).show();
|
||||
});
|
||||
|
||||
$('input[name=\'payment_method\']:checked').trigger('change');
|
||||
//--></script>
|
||||
{{ footer }}
|
47
admininistrator/view/template/marketing/affiliate_list.twig
Normal file
47
admininistrator/view/template/marketing/affiliate_list.twig
Normal file
@ -0,0 +1,47 @@
|
||||
<form id="form-affiliate" method="post" data-oc-load="{{ action }}" data-oc-target="#affiliate">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', $(this).prop('checked'));" class="form-check-input"/></td>
|
||||
<td class="text-start"><a href="{{ sort_name }}"{% if sort == 'name' %} class="{{ order|lower }}"{% endif %}>{{ column_name }}</a></td>
|
||||
<td class="text-start d-none d-lg-table-cell"><a href="{{ sort_tracking }}"{% if sort == 'ca.tracking' %} class="{{ order|lower }}"{% endif %}>{{ column_tracking }}</a></td>
|
||||
<td class="text-end"><a href="{{ sort_commission }}"{% if sort == 'ca.commission' %} class="{{ order|lower }}"{% endif %}>{{ column_commission }}</a></td>
|
||||
<td class="text-end d-none d-lg-table-cell">{{ column_balance }}</td>
|
||||
<td class="text-start d-none d-lg-table-cell"><a href="{{ sort_date_added }}"{% if sort == 'ca.date_added' %} class="{{ order|lower }}"{% endif %}>{{ column_date_added }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if affiliates %}
|
||||
{% for affiliate in affiliates %}
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ affiliate.customer_id }}" class="form-check-input"/></td>
|
||||
<td class="text-start"><a href="{{ affiliate.customer }}">{{ affiliate.name }}</a>
|
||||
<br/>
|
||||
{% if affiliate.status %}
|
||||
<small class="text-success">{{ text_enabled }}</small>
|
||||
{% else %}
|
||||
<small class="text-danger">{{ text_disabled }}</small>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-start d-none d-lg-table-cell">{{ affiliate.tracking }}</td>
|
||||
<td class="text-end">{{ affiliate.commission }}</td>
|
||||
<td class="text-end d-none d-lg-table-cell">{{ affiliate.balance }}</td>
|
||||
<td class="text-start d-none d-lg-table-cell">{{ affiliate.date_added }}</td>
|
||||
<td class="text-end"><a href="{{ affiliate.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa-solid fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="8">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
@ -0,0 +1,34 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-start">{{ column_ip }}</td>
|
||||
<td class="text-end">{{ column_account }}</td>
|
||||
<td class="text-start">{{ column_store }}</td>
|
||||
<td class="text-start">{{ column_country }}</td>
|
||||
<td class="text-start">{{ column_date_added }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if reports %}
|
||||
{% for report in reports %}
|
||||
<tr>
|
||||
<td class="text-start"><a href="http://www.geoiptool.com/en/?IP={{ report.ip }}" target="_blank">{{ report.ip }}</a></td>
|
||||
<td class="text-end"><a href="{{ report.filter_ip }}" target="_blank">{{ report.account }}</a></td>
|
||||
<td class="text-start">{{ report.store }}</td>
|
||||
<td class="text-start">{{ report.country }}</td>
|
||||
<td class="text-start">{{ report.date_added }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="5">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
301
admininistrator/view/template/marketing/contact.twig
Normal file
301
admininistrator/view/template/marketing/contact.twig
Normal file
@ -0,0 +1,301 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="button" id="button-send" class="btn btn-primary"><i class="fa-solid fa-envelope"></i> {{ button_send }}</button></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-envelope"></i> {{ text_mail }}</div>
|
||||
<div class="card-body">
|
||||
<form>
|
||||
<div class="row mb-3">
|
||||
<label for="input-store" class="col-sm-2 col-form-label">{{ entry_store }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="store_id" id="input-store" class="form-select">
|
||||
<option value="0">{{ text_default }}</option>
|
||||
{% for store in stores %}
|
||||
<option value="{{ store.store_id }}">{{ store.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-to" class="col-sm-2 col-form-label">{{ entry_to }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="to" id="input-to" class="form-select">
|
||||
<option value="newsletter">{{ text_newsletter }}</option>
|
||||
<option value="customer_all">{{ text_customer_all }}</option>
|
||||
<option value="customer_group">{{ text_customer_group }}</option>
|
||||
<option value="customer">{{ text_customer }}</option>
|
||||
<option value="affiliate_all">{{ text_affiliate_all }}</option>
|
||||
<option value="affiliate">{{ text_affiliate }}</option>
|
||||
<option value="product">{{ text_product }}</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 to" id="to-customer-group">
|
||||
<label for="input-customer-group" class="col-sm-2 col-form-label">{{ entry_customer_group }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="customer_group_id" id="input-customer-group" class="form-select">
|
||||
{% for customer_group in customer_groups %}
|
||||
<option value="{{ customer_group.customer_group_id }}">{{ customer_group.name }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 to" id="to-customer">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_customer }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="customers" value="" placeholder="{{ entry_customer }}" id="input-customer" data-oc-target="autocomplete-customer" class="form-control" autocomplete="off"/>
|
||||
<ul id="autocomplete-customer" class="dropdown-menu"></ul>
|
||||
<div class="form-control p-0" style="height: 150px; overflow: auto;">
|
||||
<table id="mail-customer" class="table m-0">
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="form-text">{{ help_customer }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 to" id="to-affiliate">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_affiliate }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="affiliates" value="" placeholder="{{ entry_affiliate }}" id="input-affiliate" data-oc-target="autocomplete-affiliate" class="form-control" autocomplete="off"/>
|
||||
<ul id="autocomplete-affiliate" class="dropdown-menu"></ul>
|
||||
<div class="form-control p-0" style="height: 150px; overflow: auto;">
|
||||
<table id="mail-affiliate" class="table m-0">
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="form-text">{{ help_affiliate }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 to" id="to-product">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_product }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="products" value="" placeholder="{{ entry_product }}" id="input-product" data-oc-target="autocomplete-product" class="form-control" autocomplete="off"/>
|
||||
<ul id="autocomplete-product" class="dropdown-menu"></ul>
|
||||
<div class="form-control p-0" style="height: 150px; overflow: auto;">
|
||||
<table id="mail-product" class="table m-0">
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="form-text">{{ help_product }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-subject" class="col-sm-2 col-form-label">{{ entry_subject }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="subject" value="" placeholder="{{ entry_subject }}" id="input-subject" class="form-control"/>
|
||||
<div id="error-subject" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-message" class="col-sm-2 col-form-label">{{ entry_message }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div id="input-message">
|
||||
<textarea name="message" placeholder="{{ entry_message }}" data-oc-toggle="ckeditor" data-lang="{{ ckeditor }}" class="form-control"></textarea>
|
||||
<div id="error-message" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#input-to').on('change', function () {
|
||||
$('.to').hide();
|
||||
|
||||
$('#to-' + this.value.replaceAll('_', '-')).show();
|
||||
});
|
||||
|
||||
$('#input-to').trigger('change');
|
||||
|
||||
// Customers
|
||||
$('#input-customer').autocomplete({
|
||||
'source': function (request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=customer/customer.autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
response($.map(json, function (item) {
|
||||
return {
|
||||
label: item['name'],
|
||||
value: item['customer_id']
|
||||
}
|
||||
}));
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function (item) {
|
||||
$('#input-customer').val('');
|
||||
|
||||
$('#mail-customer-' + item['value']).remove();
|
||||
|
||||
html = '<tr id="mail-customer-' + item['value'] + '">';
|
||||
html += ' <td>' + item['label'] + '<input type="hidden" name="customer[]" value="' + item['value'] + '"/></td>';
|
||||
html += ' <td class="text-end"><button type="button" class="btn btn-danger"><i class="fa-solid fa-minus-circle"></i></button></td>';
|
||||
html += '</tr>';
|
||||
|
||||
$('#mail-customer tbody').append(html);
|
||||
}
|
||||
});
|
||||
|
||||
$('#mail-customer').on('click', '.btn', function () {
|
||||
$(this).parent().parent().remove();
|
||||
});
|
||||
|
||||
// Affiliates
|
||||
$('#input-affiliate').autocomplete({
|
||||
'source': function (request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=customer/customer.autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request) + '&filter_affiliate=1',
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
response($.map(json, function (item) {
|
||||
return {
|
||||
label: item['name'],
|
||||
value: item['customer_id']
|
||||
}
|
||||
}));
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function (item) {
|
||||
$('#input-affiliate').val('');
|
||||
|
||||
$('#mail-affiliate-' + item['value']).remove();
|
||||
|
||||
html = '<tr id="mail-affiliate-' + item['value'] + '">';
|
||||
html += ' <td>' + item['label'] + '<input type="hidden" name="affiliate[]" value="' + item['value'] + '"/></td>';
|
||||
html += ' <td class="text-end"><button type="button" class="btn btn-danger"><i class="fa-solid fa-minus-circle"></i></button></td>';
|
||||
html += '</tr>';
|
||||
|
||||
$('#mail-affiliate tbody').append(html);
|
||||
}
|
||||
});
|
||||
|
||||
$('#input-affiliate').on('click', '.btn', function () {
|
||||
$(this).parent().parent().remove();
|
||||
});
|
||||
|
||||
// Products
|
||||
$('#input-product').autocomplete({
|
||||
'source': function (request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=catalog/product.autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
response($.map(json, function (item) {
|
||||
return {
|
||||
label: item['name'],
|
||||
value: item['product_id']
|
||||
}
|
||||
}));
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function (item) {
|
||||
$('#input-product').val('');
|
||||
|
||||
$('#mail-product-' + item['value']).remove();
|
||||
|
||||
html = '<tr id="mail-product-' + item['value'] + '">';
|
||||
html += ' <td>' + item['label'] + '<input type="hidden" name="product[]" value="' + item['value'] + '"/></td>';
|
||||
html += ' <td class="text-end"><button type="button" class="btn btn-danger"><i class="fa-solid fa-minus-circle"></i></button></td>';
|
||||
html += '</tr>';
|
||||
|
||||
$('#mail-product tbody').append(html);
|
||||
}
|
||||
});
|
||||
|
||||
$('#mail-product').on('click', '.btn', function () {
|
||||
$(this).parent().parent().remove();
|
||||
});
|
||||
|
||||
$('textarea[data-oc-toggle=\'ckeditor\']').ckeditor({
|
||||
language: '{{ ckeditor }}'
|
||||
});
|
||||
|
||||
$('#button-send').on('click', function () {
|
||||
var element = this;
|
||||
|
||||
$(element).button('loading');
|
||||
|
||||
for (instance in CKEDITOR.instances) {
|
||||
CKEDITOR.instances[instance].updateElement();
|
||||
}
|
||||
|
||||
var next = 'index.php?route=marketing/contact.send&user_token={{ user_token }}';
|
||||
|
||||
var send = function () {
|
||||
return $.ajax({
|
||||
url: next,
|
||||
type: 'post',
|
||||
data: $('#content form').serialize(),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
console.log(json);
|
||||
|
||||
$('.invalid-feedback').removeClass('d-block');
|
||||
|
||||
if (json['error']) {
|
||||
if (json['error']['warning']) {
|
||||
$('#alert').prepend('<div class="alert alert-danger alert-dismissible"><i class="fa-solid fa-circle-exclamation"></i> ' + json['error']['warning'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
for (key in json['error']) {
|
||||
$('#input-' + key.replaceAll('_', '-')).addClass('is-invalid').find('.form-control, .form-select, .form-check-input, .form-check-label').addClass('is-invalid');
|
||||
$('#error-' + key.replaceAll('_', '-')).html(json['error'][key]).addClass('d-block');
|
||||
}
|
||||
|
||||
$(element).button('reset');
|
||||
}
|
||||
|
||||
if (json['text']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle-circle"></i> ' + json['text'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
}
|
||||
|
||||
if (json['success']) {
|
||||
$('#alert').prepend('<div class="alert alert-success alert-dismissible"><i class="fa-solid fa-check-circle-circle"></i> ' + json['success'] + ' <button type="button" class="btn-close" data-bs-dismiss="alert"></button></div>');
|
||||
|
||||
$(element).button('reset');
|
||||
}
|
||||
|
||||
if (json['next']) {
|
||||
next = json['next'];
|
||||
|
||||
chain.attach(send);
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
|
||||
$(element).button('reset');
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
chain.attach(send);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
31
admininistrator/view/template/marketing/coupon.twig
Normal file
31
admininistrator/view/template/marketing/coupon.twig
Normal file
@ -0,0 +1,31 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<a href="{{ add }}" data-bs-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa-solid fa-plus"></i></a>
|
||||
<button type="submit" form="form-coupon" formaction="{{ delete }}" data-bs-toggle="tooltip" title="{{ button_delete }}" onclick="return confirm('{{ text_confirm }}');" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="coupon" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#coupon').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#coupon').load(this.href);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
264
admininistrator/view/template/marketing/coupon_form.twig
Normal file
264
admininistrator/view/template/marketing/coupon_form.twig
Normal file
@ -0,0 +1,264 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="float-end">
|
||||
<button type="submit" form="form-coupon" formaction="{{ save }}" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a>
|
||||
</div>
|
||||
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_form }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-coupon" action="{{ save }}" method="post" data-oc-toggle="ajax">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item"><a href="#tab-general" data-bs-toggle="tab" class="nav-link active">{{ tab_general }}</a></li>
|
||||
<li class="nav-item"><a href="#tab-history" data-bs-toggle="tab" class="nav-link">{{ tab_history }}</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="tab-general" class="tab-pane active">
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-name" class="col-sm-2 col-form-label">{{ entry_name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="name" value="{{ name }}" placeholder="{{ entry_name }}" id="input-name" class="form-control"/>
|
||||
<div id="error-name" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-code" class="col-sm-2 col-form-label">{{ entry_code }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="code" value="{{ code }}" placeholder="{{ entry_code }}" id="input-code" class="form-control"/>
|
||||
<div class="form-text">{{ help_code }}</div>
|
||||
<div id="error-code" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-type" class="col-sm-2 col-form-label">{{ entry_type }}</label>
|
||||
<div class="col-sm-10">
|
||||
<select name="type" id="input-type" class="form-select">
|
||||
{% if type == 'P' %}
|
||||
<option value="P" selected>{{ text_percent }}</option>
|
||||
{% else %}
|
||||
<option value="P">{{ text_percent }}</option>
|
||||
{% endif %}
|
||||
{% if type == 'F' %}
|
||||
<option value="F" selected>{{ text_amount }}</option>
|
||||
{% else %}
|
||||
<option value="F">{{ text_amount }}</option>
|
||||
{% endif %}
|
||||
</select>
|
||||
<div class="form-text">{{ help_type }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-discount" class="col-sm-2 col-form-label">{{ entry_discount }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="discount" value="{{ discount }}" placeholder="{{ entry_discount }}" id="input-discount" class="form-control"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-total" class="col-sm-2 col-form-label">{{ entry_total }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="total" value="{{ total }}" placeholder="{{ entry_total }}" id="input-total" class="form-control"/>
|
||||
<div class="form-text">{{ help_total }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_logged }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check form-switch form-switch-lg">
|
||||
<input type="hidden" name="logged" value="0"/>
|
||||
<input type="checkbox" name="logged" value="1" id="input-logged" class="form-check-input"{% if logged %} checked{% endif %}/>
|
||||
</div>
|
||||
<div class="form-text">{{ help_logged }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_shipping }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check form-switch form-switch-lg">
|
||||
<input type="hidden" name="shipping" value="0"/>
|
||||
<input type="checkbox" name="shipping" value="1" id="input-shipping" class="form-check-input"{% if shipping %} checked{% endif %}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_product }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="product" value="" placeholder="{{ entry_product }}" id="input-product" data-oc-target="autocomplete-product" class="form-control" autocomplete="off"/>
|
||||
<ul id="autocomplete-product" class="dropdown-menu"></ul>
|
||||
<div class="form-control p-0" style="height: 150px; overflow: auto;">
|
||||
<table id="coupon-product" class="table m-0">
|
||||
<tbody>
|
||||
{% for coupon_product in coupon_products %}
|
||||
<tr id="coupon-product-{{ coupon_product.product_id }}">
|
||||
<td>{{ coupon_product.name }}<input type="hidden" name="coupon_product[]" value="{{ coupon_product.product_id }}"/></td>
|
||||
<td class="text-end"><button type="button" class="btn btn-danger btn-sm"><i class="fa-solid fa-minus-circle"></i></button></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="form-text">{{ help_product }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_category }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="category" value="" placeholder="{{ entry_category }}" id="input-category" data-oc-target="autocomplete-category" class="form-control" autocomplete="off"/>
|
||||
<ul id="autocomplete-category" class="dropdown-menu"></ul>
|
||||
<div class="form-control p-0" style="height: 150px; overflow: auto;">
|
||||
<table id="coupon-category" class="table m-0">
|
||||
<tbody>
|
||||
{% for coupon_category in coupon_categories %}
|
||||
<tr id="coupon-category-{{ coupon_category.category_id }}">
|
||||
<td>{{ coupon_category.name }}<input type="hidden" name="coupon_category[]" value="{{ coupon_category.category_id }}"/></td>
|
||||
<td class="text-end"><button type="button" class="btn btn-danger btn-sm"><i class="fa-solid fa-minus-circle"></i></button></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="form-text">{{ help_category }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-date-start" class="col-sm-2 col-form-label">{{ entry_date_start }}</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<div class="input-group">
|
||||
<input type="text" name="date_start" value="{{ date_start }}" placeholder="{{ entry_date_start }}" id="input-date-start" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-date-end" class="col-sm-2 col-form-label">{{ entry_date_end }}</label>
|
||||
<div class="col-sm-10 col-md-4">
|
||||
<div class="input-group">
|
||||
<input type="text" name="date_end" value="{{ date_end }}" placeholder="{{ entry_date_end }}" id="input-date-end" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-uses-total" class="col-sm-2 col-form-label">{{ entry_uses_total }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="uses_total" value="{{ uses_total }}" placeholder="{{ entry_uses_total }}" id="input-uses-total" class="form-control"/>
|
||||
<div class="form-text">{{ help_uses_total }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-uses-customer" class="col-sm-2 col-form-label">{{ entry_uses_customer }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="uses_customer" value="{{ uses_customer }}" placeholder="{{ entry_uses_customer }}" id="input-uses-customer" class="form-control"/>
|
||||
<div class="form-text">{{ help_uses_customer }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label class="col-sm-2 col-form-label">{{ entry_status }}</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="form-check form-switch form-switch-lg">
|
||||
<input type="hidden" name="status" value="0"/>
|
||||
<input type="checkbox" name="status" value="1" id="input-status" class="form-check-input"{% if status %} checked{% endif %}/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab-history" class="tab-pane">
|
||||
<fieldset>
|
||||
<legend>{{ text_coupon }}</legend>
|
||||
<div id="history">{{ history }}</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="coupon_id" value="{{ coupon_id }}" id="input-coupon-id"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#input-product').autocomplete({
|
||||
'source': function (request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=catalog/product.autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
response($.map(json, function (item) {
|
||||
return {
|
||||
label: item['name'],
|
||||
value: item['product_id']
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function (item) {
|
||||
$('#input-product').val('');
|
||||
|
||||
$('#coupon-product-' + item['value']).remove();
|
||||
|
||||
html = '<tr id="coupon-product-' + item['value'] + '">';
|
||||
html += ' <td>' + item['label'] + '<input type="hidden" name="coupon_product[]" value="' + item['value'] + '"/></td>';
|
||||
html += ' <td class="text-end"><button type="button" class="btn btn-danger btn-sm"><i class="fa-solid fa-minus-circle"></i></button></td>';
|
||||
html += '</tr>';
|
||||
|
||||
$('#coupon-product tbody').append(html);
|
||||
}
|
||||
});
|
||||
|
||||
$('#coupon-product').on('click', '.btn', function () {
|
||||
$(this).parent().parent().remove();
|
||||
});
|
||||
|
||||
// Category
|
||||
$('#input-category').autocomplete({
|
||||
'source': function (request, response) {
|
||||
$.ajax({
|
||||
url: 'index.php?route=catalog/category.autocomplete&user_token={{ user_token }}&filter_name=' + encodeURIComponent(request),
|
||||
dataType: 'json',
|
||||
success: function (json) {
|
||||
response($.map(json, function (item) {
|
||||
return {
|
||||
label: item['name'],
|
||||
value: item['category_id']
|
||||
}
|
||||
}));
|
||||
}
|
||||
});
|
||||
},
|
||||
'select': function (item) {
|
||||
$('#input-category').val('');
|
||||
|
||||
$('#coupon-category-' + item['value']).remove();
|
||||
|
||||
html = '<tr id="coupon-category-' + item['value'] + '">';
|
||||
html += ' <td>' + item['label'] + '<input type="hidden" name="coupon_category[]" value="' + item['value'] + '"/></td>';
|
||||
html += ' <td class="text-end"><button type="button" class="btn btn-danger btn-sm"><i class="fa-solid fa-minus-circle"></i></button></td>';
|
||||
html += '</tr>';
|
||||
|
||||
$('#coupon-category tbody').append(html);
|
||||
}
|
||||
});
|
||||
|
||||
$('#coupon-category').on('click', '.btn', function () {
|
||||
$(this).parent().parent().remove();
|
||||
});
|
||||
|
||||
$('#history').on('click', '.pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#history').load(this.href);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
32
admininistrator/view/template/marketing/coupon_history.twig
Normal file
32
admininistrator/view/template/marketing/coupon_history.twig
Normal file
@ -0,0 +1,32 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-end">{{ column_order_id }}</td>
|
||||
<td class="text-start">{{ column_customer }}</td>
|
||||
<td class="text-end">{{ column_amount }}</td>
|
||||
<td class="text-start">{{ column_date_added }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if histories %}
|
||||
{% for history in histories %}
|
||||
<tr>
|
||||
<td class="text-end">{{ history.order_id }}</td>
|
||||
<td class="text-start">{{ history.customer }}</td>
|
||||
<td class="text-end">{{ history.amount }}</td>
|
||||
<td class="text-start">{{ history.date_added }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="4">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
48
admininistrator/view/template/marketing/coupon_list.twig
Normal file
48
admininistrator/view/template/marketing/coupon_list.twig
Normal file
@ -0,0 +1,48 @@
|
||||
<form id="form-coupon" method="post" data-oc-toggle="ajax" data-oc-load="{{ action }}" data-oc-target="#coupon">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', $(this).prop('checked'));" class="form-check-input"/></td>
|
||||
<td class="text-start"><a href="{{ sort_name }}"{% if sort == 'name' %} class="{{ order|lower }}"{% endif %}>{{ column_name }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_code }}"{% if sort == 'code' %} class="{{ order|lower }}"{% endif %}>{{ column_code }}</a></td>
|
||||
<td class="text-end"><a href="{{ sort_discount }}"{% if sort == 'discount' %} class="{{ order|lower }}"{% endif %}>{{ column_discount }}</a></td>
|
||||
<td class="text-start d-none d-lg-table-cell"><a href="{{ sort_date_start }}"{% if sort == 'date_start' %} class="{{ order|lower }}"{% endif %}>{{ column_date_start }}</a></td>
|
||||
<td class="text-start d-none d-lg-table-cell"><a href="{{ sort_date_end }}"{% if sort == 'date_end' %} class="{{ order|lower }}"{% endif %}>{{ column_date_end }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if coupons %}
|
||||
{% for coupon in coupons %}
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ coupon.coupon_id }}" class="form-check-input"/></td>
|
||||
<td class="text-start">{{ coupon.name }}
|
||||
<br/>
|
||||
{% if coupon.status %}
|
||||
<small class="text-success">{{ text_enabled }}</small>
|
||||
{% else %}
|
||||
<small class="text-danger">{{ text_disabled }}</small>
|
||||
{% endif %}
|
||||
</td>
|
||||
<td class="text-start">{{ coupon.code }}</td>
|
||||
<td class="text-end">{{ coupon.discount }}</td>
|
||||
<td class="text-start d-none d-lg-table-cell">{{ coupon.date_start }}</td>
|
||||
<td class="text-start d-none d-lg-table-cell">{{ coupon.date_end }}</td>
|
||||
<td class="text-start">{{ coupon.status }}</td>
|
||||
<td class="text-end"><a href="{{ coupon.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa-solid fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="8">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
102
admininistrator/view/template/marketing/marketing.twig
Normal file
102
admininistrator/view/template/marketing/marketing.twig
Normal file
@ -0,0 +1,102 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="button" data-bs-toggle="tooltip" title="{{ button_filter }}" onclick="$('#filter-marketing').toggleClass('d-none');" class="btn btn-light d-md-none"><i class="fa-solid fa-filter"></i></button>
|
||||
|
||||
<a href="{{ add }}" data-bs-toggle="tooltip" title="{{ button_add }}" class="btn btn-primary"><i class="fa-solid fa-plus"></i></a>
|
||||
<button type="submit" form="form-marketing" formaction="{{ delete }}" data-bs-toggle="tooltip" title="{{ button_delete }}" onclick="return confirm('{{ text_confirm }}');" class="btn btn-danger"><i class="fa-regular fa-trash-can"></i></button>
|
||||
|
||||
</div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div id="filter-marketing" class="col-lg-3 col-md-12 order-lg-last d-none d-lg-block mb-3">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-filter"></i> {{ text_filter }}</div>
|
||||
<div class="card-body">
|
||||
<div class="mb-3">
|
||||
<label for="input-name" class="form-label">{{ entry_name }}</label>
|
||||
<input type="text" name="filter_name" value="{{ filter_name }}" placeholder="{{ entry_name }}" id="input-name" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-code" class="form-label">{{ entry_code }}</label>
|
||||
<input type="text" name="filter_code" value="{{ filter_code }}" placeholder="{{ entry_code }}" id="input-code" class="form-control"/>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-date-from" class="form-label">{{ entry_date_from }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="filter_date_from" value="{{ filter_date_from }}" placeholder="{{ entry_date_from }}" id="input-date-from" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="mb-3">
|
||||
<label for="input-date-to" class="form-label">{{ entry_date_to }}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" name="filter_date_to" value="{{ filter_date_to }}" placeholder="{{ entry_date_to }}" id="input-date-to" class="form-control date"/>
|
||||
<div class="input-group-text"><i class="fa-regular fa-calendar"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="text-end">
|
||||
<button type="button" id="button-filter" class="btn btn-light"><i class="fa-solid fa-filter"></i> {{ button_filter }}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-9 col-md-12">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-list"></i> {{ text_list }}</div>
|
||||
<div id="marketing" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#marketing').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#marketing').load(this.href);
|
||||
});
|
||||
|
||||
$('#button-filter').on('click', function () {
|
||||
url = '';
|
||||
|
||||
var filter_name = $('#input-name').val();
|
||||
|
||||
if (filter_name) {
|
||||
url += '&filter_name=' + encodeURIComponent(filter_name);
|
||||
}
|
||||
|
||||
var filter_code = $('#input-code').val();
|
||||
|
||||
if (filter_code) {
|
||||
url += '&filter_code=' + encodeURIComponent(filter_code);
|
||||
}
|
||||
|
||||
var filter_date_from = $('#input-date-from').val();
|
||||
|
||||
if (filter_date_from) {
|
||||
url += '&filter_date_from=' + encodeURIComponent(filter_date_from);
|
||||
}
|
||||
|
||||
var filter_date_to = $('#input-date-to').val();
|
||||
|
||||
if (filter_date_to) {
|
||||
url += '&filter_date_to=' + encodeURIComponent(filter_date_to);
|
||||
}
|
||||
|
||||
window.history.pushState({}, null, 'index.php?route=marketing/marketing&user_token={{ user_token }}' + url);
|
||||
|
||||
$('#marketing').load('index.php?route=marketing/marketing.list&user_token={{ user_token }}' + url);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
86
admininistrator/view/template/marketing/marketing_form.twig
Normal file
86
admininistrator/view/template/marketing/marketing_form.twig
Normal file
@ -0,0 +1,86 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<div class="float-end">
|
||||
<button type="submit" form="form-marketing" formaction="{{ save }}" data-bs-toggle="tooltip" title="{{ button_save }}" class="btn btn-primary"><i class="fa-solid fa-floppy-disk"></i></button>
|
||||
<a href="{{ back }}" data-bs-toggle="tooltip" title="{{ button_back }}" class="btn btn-light"><i class="fa-solid fa-reply"></i></a></div>
|
||||
<h1>{{ heading_title }}</h1>
|
||||
<ol class="breadcrumb">
|
||||
{% for breadcrumb in breadcrumbs %}
|
||||
<li class="breadcrumb-item"><a href="{{ breadcrumb.href }}">{{ breadcrumb.text }}</a></li>
|
||||
{% endfor %}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid">
|
||||
<div class="card">
|
||||
<div class="card-header"><i class="fa-solid fa-pencil"></i> {{ text_form }}</div>
|
||||
<div class="card-body">
|
||||
<form id="form-marketing" action="{{ save }}" method="post" data-oc-toggle="ajax">
|
||||
<ul class="nav nav-tabs">
|
||||
<li class="nav-item"><a href="#tab-general" data-bs-toggle="tab" class="nav-link active">{{ tab_general }}</a></li>
|
||||
<li class="nav-item"><a href="#tab-report" data-bs-toggle="tab" class="nav-link">{{ tab_report }}</a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div id="tab-general" class="tab-pane active">
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-name" class="col-sm-2 col-form-label">{{ entry_name }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="name" value="{{ name }}" placeholder="{{ entry_name }}" id="input-name" class="form-control"/>
|
||||
<div id="error-name" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-description" class="col-sm-2 col-form-label">{{ entry_description }}</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="description" rows="5" placeholder="{{ entry_description }}" id="input-description" class="form-control">{{ description }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3 required">
|
||||
<label for="input-code" class="col-sm-2 col-form-label">{{ entry_code }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="code" value="{{ code }}" placeholder="{{ entry_code }}" id="input-code" class="form-control"/>
|
||||
<div class="form-text">{{ help_code }}</div>
|
||||
<div id="error-code" class="invalid-feedback"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row mb-3">
|
||||
<label for="input-example" class="col-sm-2 col-form-label">{{ entry_example }}</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" name="example1" value="" placeholder="{{ entry_example }}" id="input-example1" class="form-control"/>
|
||||
<br/>
|
||||
<input type="text" name="example2" value="" placeholder="{{ entry_example }}" id="input-example2" class="form-control"/>
|
||||
<div class="form-text">{{ help_example }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tab-report" class="tab-pane">
|
||||
<fieldset>
|
||||
<legend>{{ text_report }}</legend>
|
||||
<div id="report">{{ report }}</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="marketing_id" value="{{ marketing_id }}" id="input-marketing-id"/>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#input-code').on('keyup', function (e) {
|
||||
$('#input-example1').attr('value', '{{ store }}?tracking=' + $('#input-code').val());
|
||||
|
||||
$('#input-example2').attr('value', '{{ store }}index.php?route=common/home&tracking=' + $('#input-code').val());
|
||||
});
|
||||
|
||||
$('#input-code').trigger('keyup');
|
||||
|
||||
$('#report').on('click', '.pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#report').load(this.href);
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
40
admininistrator/view/template/marketing/marketing_list.twig
Normal file
40
admininistrator/view/template/marketing/marketing_list.twig
Normal file
@ -0,0 +1,40 @@
|
||||
<form id="form-marketing" method="post" data-oc-toggle="ajax" data-oc-load="{{ action }}" data-oc-target="#marketing">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-center" style="width: 1px;"><input type="checkbox" onclick="$('input[name*=\'selected\']').prop('checked', $(this).prop('checked'));" class="form-check-input"/></td>
|
||||
<td class="text-start"><a href="{{ sort_name }}"{% if sort == 'm.name' %} class="{{ order|lower }}"{% endif %}>{{ column_name }}</a></td>
|
||||
<td class="text-start"><a href="{{ sort_code }}"{% if sort == 'm.code' %} class="{{ order|lower }}"{% endif %}>{{ column_code }}</a></td>
|
||||
<td class="text-end">{{ column_clicks }}</td>
|
||||
<td class="text-end">{{ column_orders }}</td>
|
||||
<td class="text-start d-none d-lg-table-cell"><a href="{{ sort_date_added }}"{% if sort == 'm.date_added' %} class="{{ order|lower }}"{% endif %}>{{ column_date_added }}</a></td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if marketings %}
|
||||
{% for marketing in marketings %}
|
||||
<tr>
|
||||
<td class="text-center"><input type="checkbox" name="selected[]" value="{{ marketing.marketing_id }}" class="form-check-input"/></td>
|
||||
<td class="text-start">{{ marketing.name }}</td>
|
||||
<td class="text-start">{{ marketing.code }}</td>
|
||||
<td class="text-end">{{ marketing.clicks }}</td>
|
||||
<td class="text-end">{{ marketing.orders }}</td>
|
||||
<td class="text-start d-none d-lg-table-cell">{{ marketing.date_added }}</td>
|
||||
<td class="text-end"><a href="{{ marketing.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa-solid fa-pencil"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="8">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
||||
</form>
|
@ -0,0 +1,34 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-start">{{ column_ip }}</td>
|
||||
<td class="text-end">{{ column_account }}</td>
|
||||
<td class="text-start">{{ column_store }}</td>
|
||||
<td class="text-start">{{ column_country }}</td>
|
||||
<td class="text-start">{{ column_date_added }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if reports %}
|
||||
{% for report in reports %}
|
||||
<tr>
|
||||
<td class="text-start"><a href="http://www.geoiptool.com/en/?IP={{ report.ip }}" target="_blank">{{ report.ip }}</a></td>
|
||||
<td class="text-end"><a href="{{ report.filter_ip }}" target="_blank">{{ report.account }}</a></td>
|
||||
<td class="text-start">{{ report.store }}</td>
|
||||
<td class="text-start">{{ report.country }}</td>
|
||||
<td class="text-start">{{ report.date_added }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="5">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-sm-6 text-start">{{ pagination }}</div>
|
||||
<div class="col-sm-6 text-end">{{ results }}</div>
|
||||
</div>
|
Reference in New Issue
Block a user