first commit
This commit is contained in:
101
templates/reseller/client-list.php
Normal file
101
templates/reseller/client-list.php
Normal file
@@ -0,0 +1,101 @@
|
||||
<? global $config, $gdb, $mdb, $user;?>
|
||||
<div class="panel panel-info panel-border top">
|
||||
<div class="panel-heading">
|
||||
<span class="panel-title">Lista klientów</span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<?
|
||||
$grid = new \grid( 'pro_rr_clients', 'reseller-clients-' . $user['id'] );
|
||||
$grid -> sql = 'SELECT '
|
||||
. 'id, login, enabled '
|
||||
. 'FROM '
|
||||
. 'pro_rr_clients AS prc '
|
||||
. 'WHERE '
|
||||
. 'reseller_id = ' . $user['id'] . ' [where] '
|
||||
. 'ORDER BY '
|
||||
. '[order_p1] [order_p2]';
|
||||
$grid -> sql_count = 'SELECT '
|
||||
. 'COUNT(0) '
|
||||
. 'FROM '
|
||||
. 'pro_rr_clients '
|
||||
. 'WHERE '
|
||||
. 'reseller_id = ' . $user['id'] . ' [where] ';
|
||||
$grid -> debug = true;
|
||||
$grid -> gdb_opt = $gdb;
|
||||
$grid -> limit = 50;
|
||||
$grid -> search = [
|
||||
[ 'name' => 'Login', 'db' => 'login', 'type' => 'text' ]
|
||||
];
|
||||
$grid -> order = [ 'column' => 'login', 'type' => 'ASC' ];
|
||||
$grid -> columns_view = [
|
||||
[
|
||||
'name' => 'Lp.',
|
||||
'th' => [ 'class' => 'g-lp' ],
|
||||
'td' => [ 'class' => 'g-center' ],
|
||||
'autoincrement' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Login',
|
||||
'db' => 'login',
|
||||
'sort' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Aktywny',
|
||||
'th' => [ 'style' => 'width: 120px; text-align: center;' ],
|
||||
'td' => [ 'style' => 'text-align: center;' ],
|
||||
'db' => 'enabled',
|
||||
'replace' => [
|
||||
'array' => [
|
||||
0 => '<span class="text-danger">nie</span>',
|
||||
1 => '<span class="text-primary">tak</span>'
|
||||
]
|
||||
],
|
||||
'sort' => true
|
||||
],
|
||||
[
|
||||
'name' => 'Akcja',
|
||||
'action' => [ 'type' => 'edit', 'url' => '/?p=reseller_clients&rw=edit&id=[id]' ],
|
||||
'th' => [ 'class' => 'g-center' ],
|
||||
'td' => [ 'class' => 'g-center', 'style' => 'width: 50px;' ]
|
||||
],
|
||||
[
|
||||
'name' => 'Usuń',
|
||||
'action' => [ 'type' => 'delete', 'url' => '/?p=reseller_clients&rw=del&id=[id]' ],
|
||||
'th' => [ 'class' => 'g-center' ],
|
||||
'td' => [ 'class' => 'g-center', 'style' => 'width: 50px;' ]
|
||||
]
|
||||
];
|
||||
$grid -> buttons = [
|
||||
[
|
||||
'label' => 'Dodaj klienta',
|
||||
'class' => 'btn-success',
|
||||
'icon' => 'fa-plus-circle mr5',
|
||||
'url' => '/?p=reseller_clients&rw=add'
|
||||
]
|
||||
];
|
||||
$grid -> hide_columns = false;
|
||||
echo $grid -> draw();
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
$( document ).ready( function()
|
||||
{
|
||||
$( 'body' ).on( 'click', '#downloads-delete', function()
|
||||
{
|
||||
$.prompt( 'Na pewno chcesz usunąć pobrane linki?', {
|
||||
title: 'Potwierdź?',
|
||||
submit: function(e,v,m,f)
|
||||
{
|
||||
if ( v === true )
|
||||
$( '#f-downloads-delete' ).submit();
|
||||
},
|
||||
buttons: {
|
||||
'tak': true,
|
||||
'nie': false
|
||||
},
|
||||
focus: 0
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
Reference in New Issue
Block a user