/
var
/
www
/
doncode.com.ua
/
www
/
views
/
doncode_users
/
/var/www/doncode.com.ua/www/views/doncode_users
mkdir
upload
Name
Size
Mode
Actions
js/
-
0755
rm
doncode_users.php
10054
0644
edit
dl
rm
Edit:
/var/www/doncode.com.ua/www/views/doncode_users/doncode_users.php
(10054B)
<br> <div class="container-fluid"> <div class="row"> <div class="col-xs-12"> <div id="paginator" class="paginator"></div> </div> </div> </div> <script> $(function(){ function loadPageDoncode_users (param){ $.get(param, function(prevent) { for (var i = 0; i < prevent.length; i++) { $.tmpl('doncode_users',prevent[i]).appendTo('.table'); } }, "JSON"); } var url = '<?php echo !isset($_GET['url']) || ($_GET['url']=='doncode_users')?URL.'doncode_users/getList':URL.$_GET['url'];?>'; var count = <?php echo $this->count['count']; ?>; var limit = <?php echo LIMIT; ?>; $.cookie ('count',count); $.cookie ('limit',limit); $.cookie ('num_pages',Math.ceil(count/limit)); $.template('doncode_users','\ <tr>\ <td><a href="<?php echo URL;?>doncode_users/viewProfile/id/${id}">${login}</a></td>\ <td>${FIO}</td>\ <td>${email}</td>\ <td>${ip}</td>\ <td>${last}</td>\ <td>${role_name}</td>\ <td width="80">\ <a class="edit_doncode_users btn btn-xs btn-info" rel="${id}" href="#">\ <i class="glyphicon glyphicon-pencil" title="Редактировать"></i>\ </a> \ <a class="del_doncode_users btn btn-xs btn-danger" href="<?php echo URL;?>doncode_users/deleteRecords/id/${id}">\ <i class="glyphicon glyphicon-remove" title="Удалить"></i>\ </a>\ </td>\ </tr>'); loadPageDoncode_users (url); $('#paginator').paginator({ pagesTotal : <?php echo ceil($this->count['count']/LIMIT);?>, pagesSpan : 10, pageCurrent : <?php echo (isset($this->currentPage))?$this->currentPage: '1';?>, scroll : true, baseUrl : '<?php echo URL;?>doncode_users/getList/page/%number%', clickHandler : function (page){ var url = '<?php echo URL;?>doncode_users/getList/page/'+page; history.pushState(url, null, url); $.post(url, function(prevent) { $('.tr').remove(); for (var i = 0; i < prevent.length; i++) { $.tmpl('doncode_users',prevent[i]).appendTo('.table'); } }, "JSON"); return false; } }); $('.del_doncode_users').live('click',function(){ var url = $(this).attr("href"); var currentTarget = $(this); var currnet_num = $.cookie('num_pages')*1; var count = $.cookie('count')*1; var limit = $.cookie('limit')*1; if (confirm("Вы точно хотите удалить пользователя?")) { $.post(url, function(prevent) { if (prevent.msg='success'){ count --; $.cookie('count', count); var sub_p = Math.ceil(count/limit); if(sub_p<currnet_num){ var url = '<?php echo URL;?>doncode_users/getList/page/'+sub_p; history.pushState(url, null, url); $.cookie('num_pages', sub_p ) ; if(sub_p==1){ $('#paginator').remove(); currentTarget.parents('.tr').remove() ; loadPageDoncode_users (url); }else{ $('#paginator').paginator({ pagesTotal : sub_p, pagesSpan : 10, pageCurrent : sub_p, scroll : true, baseUrl : '<?php echo URL;?>doncode_users/getList/page/%number%', clickHandler : function (page){ var url = '<?php echo URL;?>doncode_users/getList/page/'+page; history.pushState(url, null, url); $.post(url, function(prevent) { $('.tr').remove(); for (var i = 0; i < prevent.length; i++) { $.tmpl('doncode_users',prevent[i]).appendTo('.table'); } }, "JSON"); return false; } }); currentTarget.parents('.tr').remove() ; loadPageDoncode_users (url); } }else{ currentTarget.parent().html('<span id="deleted">Удален</span>') ; } location.reload(); } else if(prevent.msg='fail'){ alert ('Не удалось удалить пользователя.'); } }, "JSON"); return false; }else{ return false; } } ); $('.edit_doncode_users').live('click',function(){ var id = $(this).attr("rel"); var url = "<?php echo URL;?>doncode_users/edit/id/"+id+""; showMod(); $('.modal-header').html('<button class="close" data-dismiss="modal">×</button><h3 style="text-align:center;"> Редактирование пользователя</h3>'); $('.modal-body').load(url); }); $('#createUser').click (function (e){ e.preventDefault(); var url = $(this).attr('href'); $('.modal h3').text('Создать нового пользователя.'); $('.modal div.modal-body').load(url); $('.modal').modal('show'); }); function showMod(){ if($('.modal').length=='0'){ $('body').append('<div class="modal" id="myModal" style="width:100%; left:0px; margin:auto; top:50px;" >\ <div class="modal-header"> \ </div>\ <div class="modal-body" style="min-height:50%;max-height:85%;"><img src="/public/images/ajax-loader.gif"/>\ </div>\ <div class="modal-footer">\ <a href="#" class="btn btn-primary" onclick="$(\'#myModal\').modal(\'hide\');$(\'#editDoncode_users\').submit();">Сохранить</a>\ <a data-dismiss="modal" class="btn">Закрыть</a>\ </div>\ </div>') } $('#myModal').modal('show'); $('#myModal').on('hide',function (){ $('.modal-header').empty(); $('.modal-body').html('<img src="/public/images/ajax-loader.gif"/>'); //$('.modal-footer').html('<a href="#" class="btn" data-dismiss="modal">Закрыть</a>'); }) } function getCallById(id){ $('.modal h3').text('Редактирование данных пользователя.'); $('.modal div.modal-body').load("<?php echo URL;?>/doncode_users/edit/id/"+id); $('.modal').modal('show'); } }); </script> <table class="table table-striped table-bordered table-condensed" > <tr class="header info" style="font-size:12px;" > <td><i class="glyphicon glyphicon-tags"></i> Логин</td> <td><i class="glyphicon glyphicon-user"></i> ФИО</td> <td><i class="glyphicon glyphicon-user"></i> email</td> <td><i class="glyphicon glyphicon-random"></i> IP</td> <td><i class="glyphicon glyphicon-calendar"></i> Полседний визит</td> <td><i class="glyphicon glyphicon-exclamation-sign"></i> Доступ</td> <td width="70px;"><i class="glyphicon glyphicon-warning-sign"></i> Действия</td> </tr> </table>
Save
cmd:
run