-
Notifications
You must be signed in to change notification settings - Fork 1
/
clients.tpl
176 lines (167 loc) · 6.95 KB
/
clients.tpl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
{if isset($permoverview['b_virtualserver_client_list']) AND empty($permoverview['b_virtualserver_client_list']) OR isset($permoverview['b_virtualserver_client_dblist']) AND empty($permoverview['b_virtualserver_client_dblist'])}
<section class="content container-fluid">
<div class="row">
<div class="col-xs-12 col-xs-offset-0 col-sm-8 col-sm-offset-2 col-md-6 col-md-offset-3 col-lg-4 col-lg-offset-4">
<div class="box box-danger">
<div class="box-header"><h3 class="box-title">{$lang['error']}</h3></div>
<div class="box-body">
<p class="lead">{$lang['nopermissions']}</p>
</div>
</div>
</div>
</div>
</section>
{else}
<script>
$(function () {
var table = $("#clients").DataTable({
"language": {
"url": dataTableLang
},
"autoWidth": false,
"order": [[ 0, "desc" ]],
"processing": true,
"columnDefs": [
{ targets: 0, responsivePriority: 1},
{ targets: 6, responsivePriority: 2},
{ targets: 'no-sort', orderable: false },
{ targets: 'no-search', searchable: false }
],
initComplete: function() {
var api = this.api();
new $.fn.dataTable.Buttons(api, {
"buttons": [
{
text: "{$lang['showmoreentrys']} <span id='more_entry_act_page'>1</span>/<span id='more_entry_max_pages'>{if $pages|string_format:'%d' == 0}1{else}{$pages}{/if}</span>",
className: "btn btn-primary btn-flat {if $pages|string_format:'%d' == 0}disabled{/if}",
action: function ( e, dt, node, config ) {
add_entries();
}
}
]
});
$('#clients_length').parent('.col-sm-6').removeClass('col-sm-6').addClass('col-sm-6 col-md-4');
$('#clients_filter').parent('.col-sm-6').removeClass('col-sm-6').addClass('col-sm-6 col-md-4 col-md-push-4').after('<div class="col-sm-12 col-md-4 col-md-pull-4 text-center"><div id="clients_buttons"></div></div>');
$('#clients_processing').css('top', '7%');
api.buttons().container().prependTo( '#clients_buttons' );
$('.pagination').addClass('pagination-flat');
}
});
var next_page = 0;
function add_entries(){
var max_pages = parseInt("{$pages}");
max_pages = max_pages-1;
var url = "index.php?site=clients&sid={$sid}&getstart="+((next_page+1)*100);
table.processing(true);
$('#more_entry_act_page').parents('a').addClass('disabled');
if (max_pages != next_page) {
$.get(url, function(data) {
data = $.parseHTML(data);
$.each(data, function(key, itm) {
if (itm.className == 'wrapper') {
var base = itm.children[2].children[0].children[0].children[1];
var elems = base.children[1].children[1].children[1].children;
var lastID = elems.length - 1;
$.each(elems, function(uKey, uItm){
table.row.add( [
uItm.children[0].innerText,
uItm.children[1].innerText,
uItm.children[2].innerText,
uItm.children[3].innerText,
uItm.children[4].innerText,
uItm.children[5].innerHTML,
uItm.children[6].innerHTML
] ).draw( false );
if (uKey == lastID) {
next_page += 1;
if (next_page != max_pages){
$('#more_entry_act_page').parents('a').removeClass('disabled');
}
$('#more_entry_act_page').text(next_page+1);
table.processing( false );
}
})
}
});
});
}
}
});
</script>
<section class="content container-fluid">
<div class="col-xs-12 col-xs-offset-0 col-sm-10 col-sm-offset-1 col-md-10 col-md-offset-1 col-lg-10 col-lg-offset-1 no-padding">
<div class="box box-info">
<div class="box-header">
<h3 class="box-title">{$lang['searchfor']}{$lang['client']}</h3>
</div>
<div class="box-body">
<form method="post" action="index.php?site=clients&sid={$sid}">
<div class="row">
<div class="col-lg-3">
<select class="form-control" name="searchby">
<option value="uniqueid">{$lang['uniqueid']}</option>
<option value="cldbid">{$lang['cldbid']}</option>
<option value="name">{$lang['name']}</option>
</select>
</div>
<div class="col-lg-6">
<input type="text" class="form-control" name="search" required />
</div>
<div class="col-lg-3">
<input type="submit" class="btn btn-flat btn-info btn-block" name="sendsearch" value="{$lang['search']}" />
</div>
</div>
</form>
</div>
</div>
<div class="box box-primary">
<div class="box-header">
<h3 class="box-title">{$lang['clients']}</h3>
</div>
<div class="box-body">
<input type="hidden" name="next_page" id="next_page" value="0">
<table class="table table-striped dt-responsive" id="clients">
<thead>
<tr>
<th class="text-center">{$lang['dbid']}</th>
<th class="text-center">{$lang['uniqueid']}</th>
<th class="text-center">{$lang['nickname']}</th>
<th class="text-center">{$lang['created']}</th>
<th class="text-center">{$lang['lastonline']}</th>
<th class="text-center no-sort">{$lang['status']}</th>
<th></th>
</tr>
</thead>
{while $showclients <= $duration AND isset($clientdblist[$getstart])}
<tr>
<td style="vertical-align: middle;" class="text-center">{$clientdblist[$getstart]['cldbid']}</td>
<td style="vertical-align: middle;" class="text-center">{$clientdblist[{$getstart}]['client_unique_identifier']}</td>
<td style="vertical-align: middle;" class="text-center">{$clientdblist[{$getstart}]['client_nickname']}</td>
<td style="vertical-align: middle;" class="text-center">{$clientdblist[{$getstart}]['client_created']|date_format:"%d.%m.%Y - %H:%M:%S"}</td>
<td style="vertical-align: middle;" class="text-center">{$clientdblist[{$getstart}]['client_lastconnected']|date_format:"%d.%m.%Y - %H:%M:%S"}</td>
<td style="vertical-align: middle;" class="text-center">
{if isset($clientdblist[{$getstart}]['clid'])}
<span class="text-green">{$lang['online']}</span>
{else}
<span class="text-red">{$lang['offline']}</span>
{/if}
</td>
<td style="vertical-align: middle;" class="text-right no-padding">
<a class="btn btn-sm btn-flat btn-info no-margin" href="index.php?site=cleditperm&sid={$sid}&cldbid={$clientdblist[{$getstart}]['cldbid']}">{$lang['editperms']}</a>
{if !isset($permoverview['b_client_delete_dbproperties']) OR $permoverview['b_client_delete_dbproperties'] == 1}
<form method="post" style="display: inline;" action="index.php?site=clients&sid={$sid}">
<input type="hidden" name="cldbid" value="{$clientdblist[{$getstart}]['cldbid']}" />
<input type="submit" class="btn btn-sm btn-flat btn-danger" name="clientdel" value="{$lang['delete']}" onclick="return confirm('{$lang['deletemsgclient']}')" />
</form>
{/if}
</td>
</tr>
{assign var=showclients value="`$showclients+1`"}
{assign var=getstart value="`$getstart+1`"}
{/while}
</table>
</div>
</div>
{/if}
</div>
</section>