first commit
This commit is contained in:
91
admininistrator/view/template/report/online.twig
Normal file
91
admininistrator/view/template/report/online.twig
Normal file
@ -0,0 +1,91 @@
|
||||
{{ 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-online').toggleClass('d-none');" class="btn btn-light d-md-none"><i class="fa-solid fa-filter"></i></button>
|
||||
<button type="button" id="button-refresh" data-bs-toggle="tooltip" title="{{ button_refresh }}" class="btn btn-light"><i class="fa-solid fa-rotate"></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-online" 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="" 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-ip" class="form-label">{{ entry_ip }}</label>
|
||||
<input type="text" name="filter_ip" value="" id="input-ip" placeholder="{{ entry_ip }}" class="form-control"/>
|
||||
</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="online" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#online').on('click', 'thead a, .pagination a', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$('#online').load(this.href);
|
||||
});
|
||||
|
||||
$('#button-filter, #button-refresh').on('click', function () {
|
||||
var url = '';
|
||||
|
||||
var filter_customer = $('#input-customer').val();
|
||||
|
||||
if (filter_customer) {
|
||||
url += '&filter_customer=' + encodeURIComponent(filter_customer);
|
||||
}
|
||||
|
||||
var filter_ip = $('#input-ip').val();
|
||||
|
||||
if (filter_ip) {
|
||||
url += '&filter_ip=' + encodeURIComponent(filter_ip);
|
||||
}
|
||||
|
||||
$('#online').load('index.php?route=report/online.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_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']);
|
||||
}
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
36
admininistrator/view/template/report/online_list.twig
Normal file
36
admininistrator/view/template/report/online_list.twig
Normal file
@ -0,0 +1,36 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-start">{{ column_ip }}</td>
|
||||
<td class="text-start">{{ column_customer }}</td>
|
||||
<td class="text-start">{{ column_url }}</td>
|
||||
<td class="text-start">{{ column_referer }}</td>
|
||||
<td class="text-start">{{ column_date_added }}</td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if customers %}
|
||||
{% for customer in customers %}
|
||||
<tr>
|
||||
<td class="text-start"><a href="https://whatismyipaddress.com/ip/{{ customer.ip }}" rel="noreferrer" target="_blank">{{ customer.ip }}</a></td>
|
||||
<td class="text-start">{{ customer.customer }}</td>
|
||||
<td class="text-start"><a href="{{ customer.url }}" rel="noreferrer" target="_blank">{{ customer.url|split('', 30)|join('<br/>') }}</a></td>
|
||||
<td class="text-start">{% if customer.referer %}<a href="{{ customer.referer }}" rel="noreferrer" target="_blank">{{ customer.referer|split('', 30)|join('<br/>') }}</a>{% endif %}</td>
|
||||
<td class="text-start">{{ customer.date_added }}</td>
|
||||
<td class="text-end">{% if customer.customer_id %}<a href="{{ customer.edit }}" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary"><i class="fa-solid fa-pencil"></i></a>{% else %}<button type="button" data-bs-toggle="tooltip" title="{{ button_edit }}" class="btn btn-primary" disabled="disabled"><i class="fa-solid fa-pencil"></i></button>{% endif %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="6">{{ 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>
|
46
admininistrator/view/template/report/report.twig
Normal file
46
admininistrator/view/template/report/report.twig
Normal file
@ -0,0 +1,46 @@
|
||||
{{ 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-report').toggleClass('d-none');" class="btn btn-light d-md-none d-lg-none"><i class="fa-solid fa-filter"></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 mb-3">
|
||||
<div class="card-header"><i class="fa-solid fa-chart-bar"></i> {{ text_type }}</div>
|
||||
<div class="card-body">
|
||||
<div class="card">
|
||||
<div class="card-body bg-light">
|
||||
<div class="input-group">
|
||||
<select name="report" id="input-report" class="form-select">
|
||||
{% for report in reports %}
|
||||
<option value="{{ report.href }}"{% if code == report.code %} selected{% endif %}>{{ report.text }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<div class="input-group-text"><i class="fa-solid fa-filter"></i> {{ text_filter }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div id="report"></div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#input-report').on('change', function (e) {
|
||||
if ($(this).val()) {
|
||||
$('#report').load(this.value);
|
||||
}
|
||||
});
|
||||
|
||||
$('#input-report').trigger('change');
|
||||
//--></script>
|
||||
{{ footer }}
|
52
admininistrator/view/template/report/statistics.twig
Normal file
52
admininistrator/view/template/report/statistics.twig
Normal file
@ -0,0 +1,52 @@
|
||||
{{ header }}{{ column_left }}
|
||||
<div id="content">
|
||||
<div class="page-header">
|
||||
<div class="container-fluid">
|
||||
<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="statistics" class="card-body">{{ list }}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript"><!--
|
||||
$('#statistics').on('click', '.btn-warning', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
var element = this;
|
||||
|
||||
$.ajax({
|
||||
url: $(element).attr('href'),
|
||||
dataType: 'json',
|
||||
beforeSend: function () {
|
||||
$(element).button('loading');
|
||||
},
|
||||
complete: function () {
|
||||
$(element).button('reset');
|
||||
},
|
||||
success: function (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>');
|
||||
|
||||
$('#statistics').load('index.php?route=report/statistics.list&user_token={{ user_token }}');
|
||||
}
|
||||
},
|
||||
error: function (xhr, ajaxOptions, thrownError) {
|
||||
console.log(thrownError + "\r\n" + xhr.statusText + "\r\n" + xhr.responseText);
|
||||
}
|
||||
});
|
||||
});
|
||||
//--></script>
|
||||
{{ footer }}
|
26
admininistrator/view/template/report/statistics_list.twig
Normal file
26
admininistrator/view/template/report/statistics_list.twig
Normal file
@ -0,0 +1,26 @@
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<td class="text-start">{{ column_name }}</td>
|
||||
<td class="text-end">{{ column_value }}</td>
|
||||
<td class="text-end">{{ column_action }}</td>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% if statistics %}
|
||||
{% for statistic in statistics %}
|
||||
<tr>
|
||||
<td class="text-start">{{ statistic.name }}</td>
|
||||
<td class="text-end">{{ statistic.value }}</td>
|
||||
<td class="text-end"><a href="{{ statistic.href }}" data-bs-toggle="tooltip" title="{{ button_refresh }}" class="btn btn-warning"><i class="fa-solid fa-rotate"></i></a></td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
{% else %}
|
||||
<tr>
|
||||
<td class="text-center" colspan="3">{{ text_no_results }}</td>
|
||||
</tr>
|
||||
{% endif %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
Reference in New Issue
Block a user