/
var
/
www
/
doncode.com.ua
/
www
/
views
/
mobile_users
/
/var/www/doncode.com.ua/www/views/mobile_users
mkdir
upload
Name
Size
Mode
Actions
js/
-
0755
rm
mobile_users.php
13475
0644
edit
dl
rm
Edit:
/var/www/doncode.com.ua/www/views/mobile_users/mobile_users.php
(13475B)
<script> var url = '<?php echo ($_GET['url']=='mobile_users')?URL.$_GET['url'].'/getList':URL.$_GET['url'];?>'; var count = <?php echo $this->count['count']; ?>; var limit = <?php echo LIMIT; ?>; function loadPageMobile_users (param){ $.get(param, function(prevent) { $.tmpl('mobile_users',prevent).appendTo('#main-table'); }, "JSON"); } $(function(){ $.template('mobile_users','\ <tr>\ <td>${nn}</td>\ <td>${city_name_ru}</td>\ <td>${taxi_name}</td>\ <td>${name}</td>\ <td>${taxi_name}</td>\ <td>${phone}</td>\ <td>${pincode}</td>\ <td>${reg_date}</td>\ <td>${last_date}</td>\ <td>${count_login}</td>\ <td>${auto_type}</td>\ <td>${partner}</td>\ <td id="action">\ <a class="btn edit_mobile_users" rel="${id}" title="Редактировать ${tName}а ${name}" href="#">\ <i class="icon-pencil"></i>\ </a>\ <a class="btn del_mobile_users" href="<?php echo URL;?>mobile_users/deleteRecords/id/${id}" title="Удалить ${tName}а ${name}">\ <i class="icon-remove"></i>\ </a>\ </td>\ </tr>'); loadPageMobile_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;?>mobile_users/getList/page/%number%', clickHandler : function (page){ var url = '<?php echo URL;?>mobile_users/getList/page/'+page; history.pushState(url, null, url); $('#main-table tr:not(.header)').remove(); $('#loading').html('Загрузка...'); $.get(url, function(prevent) { $('#loading').html(''); $('#main-table tr:not(.header)').remove(); $.tmpl('mobile_users',prevent ).appendTo('#main-table'); }, "JSON"); return false; } }); $('.del_mobile_users').live('click',function(){ var url = $(this).attr("href"); if (confirm("Вы точно хотите удалить контрагента?")) { $.get(url, function(prevent) { if (prevent.msg=='success'){ $('#main-table tr:not(.header)').remove(); var parse = document.location.href.split('/'); if( !!!parse[4]){ var url = document.location.href+'/getList/page/1'; }else{ var url = document.location.href; } loadPageMobile_users (url); } if(prevent.msg=='fail'){ alert ('Не удалось удалить пользователя.'); } }, "JSON"); return false; }else{ return false; } } ); $('.edit_mobile_users').live('click',function(e){ var id = $(this).attr("rel"); e.preventDefault(); $('.modal h3').text('Редактирование данных пользователя.'); $('.modal div.modal-body').load("<?php echo URL;?>/mobile_users/edit/id/"+id); $('.modal').modal('show'); }); $('#create_mobile_users').click (function (e){ e.preventDefault(); var url = $(this).attr('href'); $('.modal h3').text('Создание нового пользователя.'); $('.modal div.modal-body').load(url); $('.modal').modal('show'); }); $('#toogle_type_search').on('click',function(){ var a = $(this).parent().innerWidth(); var b = $(this).outerWidth(); var t = $(this); if($(this).hasClass('phone')){ $(this).animate({ 'left':'+='+(a-b) },'fast','linear',function(){ t.html('<i class="icon-th icon-white"></i>'); t.attr('title','Поиск по номеру телефона'); t.closest('form').find('input[name="type"]').val('FIO'); $('#mobile_users').val('').focus(); }); $(this).removeClass('phone') .addClass('FIO'); }else{ $(this).animate({ 'left':'-='+(a-b) },'fast','linear',function(){ t.html('<i class="icon-user icon-white"></i>'); t.attr('title','Поиск по имени фамилии'); t.closest('form').find('input[name="type"]').val('phone'); $('#mobile_users').val('').focus(); }); $(this).removeClass('FIO') .addClass('phone'); } return false; }) /*----------------------------Search mobile_users---------------------------------------*/ $('#mobile_users').autocomplete({ autoFocus: true, source: function(request,response) { $.ajax({ url : "<?php echo URL;?>mobile_users/search/type/"+$('#typesearch').val(), dataType : "json", type :'POST', data : {chars: request.term}, success: function(data) { if(data.fail){ }else{ response($.map(data, function(item) { return { id: item.id, value: item.FIO } })); } } }) }, minLength : 2, select : function( event, ui ) { $.get('<?php echo URL;?>mobile_users/fetechMobile_users/id/'+ui.item.id,function(data){ $('#result-search').html('<h2 style="text-align:center;">Результат поиска</h2><table class="table table-striped table-bordered table-condensed">'+ '<tr class="success" >'+ '<td>№</td>'+ '<td>Город рег.</td>'+ '<td>Служба рег.</td>'+ '<td>ФИО</td>'+ '<td>Город</td>'+ '<td>Служба</td>'+ '<td>Телефон</td>'+ '<td>PinCode</td>'+ '<td>Дата регистрации</td>'+ '<td>Дата последнего посещения</td>'+ '<td>Кол-во входов</td>'+ '<td>Тип автомобиля</td>'+ '<td>Партнер рег.</td>'+ '<td>Партнер</td>'+ '<td>Действия</td>'+ '</tr>'+ '</table>'); $.tmpl('mobile_users',data ).appendTo('#result-search table'); // $('#result-search table tr:eq(1)').addClass('warning'); },'json') } }) }); </script> <div id="arm"> <div class="row-fluid"> <div class="span12"> <?php if(session::get('msgFail')!=false):?> <div class="alert alert-error"> <a class="close" data-dismiss="alert" href="#">×</a> <h4 class="alert-heading">Ошибка!</h4> <?php echo session::get('msgFail')?> </div> <?php session::del('msgFail')?> <?php endif;?> <?php if(session::get('msgSuccess')!=false):?> <div class="alert alert-success"> <a class="close" data-dismiss="alert" href="#">×</a> <h4 class="alert-heading">Готово!</h4> <?php echo session::get('msgSuccess')?> </div> <?php session::del('msgSuccess')?> <?php endif;?> <div class="modal hide fade"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button> <h3></h3> </div> <div class="modal-body"> </div> </div> <div class="row-fluid"> <div class="span4"> <h3><?php echo $this->title; ?></h3> <div class="search" style="margin-top: 25px;" > <form class="form-search" onsubmit="return false;"> <input type="text" id="mobile_users" style="display: inline-block;" class="search-query"> <input type="hidden" id="typesearch" name="type" value="phone"> <div style="width:90px; position: relative; display: inline-block; background-color: #9F9F9F; border: 1px solid #929292; border-radius: 4px; "> <span class="btn btn-inverse phone" style="left: 0px; position: relative;" title="Поиск по имени фамилии" id="toogle_type_search"><i class="icon-user icon-white"></i></span> </div> </form> </div> </div> <div class="span5"> <?php if ($this->count['count']>LIMIT): ?> <div id="paginator" class="paginator" ></div> <?php endif;?> </div> <div class="span4"> </div> </div> <div id="result-search"> </div> <table class="table table-striped table-bordered table-condensed" id="main-table"> <tr class="header info" > <td>№</td> <td>Город </td> <td>Служба </td> <td>ФИО</td> <td>Служба</td> <td>Телефон</td> <td>PinCode</td> <td>Дата регистрации</td> <td>Дата последнего посещения</td> <td>Кол-во входов</td> <td>Тип автомобиля</td> <td>Партнер</td> <td>Действие</td> </tr> </table> <center><span id="loading"></span></center> </div> </div> </div>
Save
cmd:
run