123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- @extends('statistics.module.layouts.content')
- @push('meta')
- @endpush
- @push('css')
- @endpush
- @push('js')
- <script src="{{ theme_asset('statistics/js/layer/layer.js') }}"></script>
- @endpush
- @section('content')
- <div class="wide container">
- @include('statistics.module.section.left_menu')
- <div class="cq_rt admin_right">
- <div class="detail-info">
- <div class="table_title_new" style="margin-bottom: 15px;">管理员列表</div>
- <table border="0" cellpadding="0" cellspacing="0">
- <tr>
- <th style="width: 150px;">ID</th>
- <th style="width: 300px;">用户名</th>
- <th style="width: 270px;">添加时间</th>
- @if(auth('web-statistics')->user()->username == 'admin')
- <th style="width: 180px;">操作</th>
- @endif
- </tr>
- @if($list->isNotEmpty())
- @foreach($list as $k=>$user)
- <tr>
- <td>{{$user->id}}</td>
- <td>{{$user->username}}</td>
- <td>{{$user->created_at}}</td>
- @if(auth('web-statistics')->user()->username == 'admin')
- <td>
- <div class="opera">
- <span data-uid="{{$user->id}}" class="edit">修改</span>
- @if($user->username != 'admin')
- |<span class="del" data-url="{{route('statistics.user.delete', ['id'=>$user->id])}}">删除</span>
- @endif
- </div>
- </td>
- @endif
- </tr>
- @endforeach
- @else
- <tr>
- <td colspan="@if(auth('web-statistics')->user()->username == 'admin') 4 @else 3 @endif" text-aligin="center">暂无数据</td>
- </tr>
- @endif
- </table>
- </div>
- </div>
- <div class="clear"></div>
- </div>
- @endsection
- @section('script')
- <script type="text/javascript">
- $('.edit').click(function(){
- var uid=$(this).attr('data-uid');
- $.getJSON("{{route('statistics.user.edit')}}",{uid:uid, _token:"{{csrf_token()}}"},function(result){
- if(result.status == 1){
- layer.ready(function(){
- layer.open({
- type: 1,
- title: '修改密码',
- area: ['360px', '270px'], //宽高
- content: result.html
- });});
- }else{
- alert(result.error);
- return false;
- }
- });
- });
- $('.del').click(function(){
- var url=$(this).data('url');
- console.log(url);
- if (confirm('确定删除该管理员?')) {
- $.getJSON(url,{},function(result){
- if(result.status == 1){
- alert(result.html);
- window.location.href = "{{route('statistics.user')}}";
- }else{
- alert(result.error);
- return false;
- }
- });
- }
- });
- </script>
- @endsection
|