@extends('layouts.master')
@section('page-css')
    <link rel="stylesheet" href="{{asset('assets/styles/vendor/datatables.min.css')}}">
    <link rel="stylesheet" href="{{asset('assets/styles/vendor/toastr.css')}}">
@endsection

@section('main-content')
    <div class="breadcrumb">
        <h1>لیست کاربران</h1>
        <ul>
            <li>لیست کاربران</li>
        </ul>
    </div>
    <div class="separator-breadcrumb border-top"></div>
    <div class="row mb-4">
        <div class="col-md-12 mb-4">
            <div class="card text-left">
                <div class="card-body">
                    <div class="d-flex justify-content-between">
                        <h4 class="card-title mb-3">لیست کاربران</h4>
                        <button type="button" class="btn btn-primary" data-toggle="modal" data-target="#addUserModal">
                            افزودن کاربر جدید
                        </button>
                    </div>
                    <p>از ستون تنظیمات میتوانید کاربران را بلاک یا آنبلاک کنید.</p>
                    <div class="table-responsive">
                        <table id="app_users_datatable"
                               class="display table table-striped table-borderless border yajra-datatable"
                               style="width:100%">
                            <thead>
                            <tr>
                                <th>No</th>
                                <th>آیدی</th>
                                <th>نام کاربری</th>
                                <th>سکه فالو</th>
                                <th>سکه مشترک</th>
                                <th>آخرین ورود</th>
                                <th>وضعیت</th>
                            </tr>
                            </thead>
                            <tbody dir="ltr">
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
        <!-- end of col -->
    </div>
    <!-- end of row -->
@endsection

@section('page-js')
    <script type="text/javascript">
        $(function () {
            var table = $('#app_users_datatable').DataTable({
                processing: true,
                serverSide: true,
                ajax: "{{ route('appUsers.list') }}",
                columns: [
                    {data: 'DT_RowIndex', name: 'DT_RowIndex'},
                    {data: 'ID', name: 'ID'},
                    {data: 'Username', name: 'Username'},
                    {data: 'Coin_Follow', name: 'Coin_Follow'},
                    {data: 'Coin_Other', name: 'Coin_Other'},
                    {data: 'LastLogin', name: 'LastLogin'},
                    {data: 'Status', name: 'Status', orderable: false, searchable: false},
                ]
            });

        });
    </script>
    <script src="{{asset('assets/js/vendor/datatables.min.js')}}"></script>
    {{--    <script src="{{asset('assets/js/datatables.script.js')}}"></script>--}}
@endsection

@section('bottom-js')
    <script src="{{asset('assets/js/vendor/toastr.min.js')}}"></script>
    {!! Brian2694\Toastr\Facades\Toastr::message() !!}

    <!-- #addUser Modal -->
    <div class="modal fade" id="addUserModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <h5 class="modal-title" id="exampleModalLabel">عنوان معین</h5>
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                        <span aria-hidden="true">&times;</span>
                    </button>
                </div>
                <div class="modal-body">
                    <p>Lorem ipsum dolor sit amet consectetur adipisicing elit. Facere autem consequuntur unde? Dolore, dolor iusto.</p>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-secondary" data-dismiss="modal">بسته</button>
                    <button type="button" class="btn btn-primary">ذخیره تغییرات</button>
                </div>
            </div>
        </div>
    </div>
@endsection
