<?php $__env->startSection('title','User logs('.$user->name.')'); ?>
<?php echo $__env->make('layouts.datatable', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

<?php $__env->startSection('content'); ?>
<div class="row">
    <div class="col-lg-12">
        <div class="tile">
            <div class="tile-title-w-btn">
                <h3 class="title">User logs(<?php echo e($user->name); ?>)</h3>
            </div>
            <div class="tile-body">
                <div class="table-responsive">
                    <table id="logsTable" class="table table-bordered">
                        <thead class="table-primary">
                            <tr>
                                <th>Time</th>
                                <th>Action</th>
                                <th>Model</th>
                                <th>Details</th>
                            </tr>
                        </thead>

                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('scripts'); ?>
<script>
    new DataTable('#logsTable', {
        processing: true,
        serverSide: true,
        ajax: {
            url: '<?php echo e(route('users.logs')); ?>',
            data: function (d) {
                d.user_id = <?php echo e($user->id); ?>;
            }
        },
        columns: [
            {
                data: 'created_at',
                name: 'created_at',
                orderable: false,
                render: function (data, type, row) {
                    if (data) {
                        let date = new Date(data);
                        let year = date.getFullYear();
                        let month = ('0' + (date.getMonth() + 1)).slice(-2);
                        let day = ('0' + date.getDate()).slice(-2);
                        let hours = ('0' + date.getHours()).slice(-2);
                        let minutes = ('0' + date.getMinutes()).slice(-2);
                        let seconds = ('0' + date.getSeconds()).slice(-2);
                        return `${year}-${month}-${day} ${hours}:${minutes}:${seconds}`;
                    }
                    return '';
                },
            },
            { data: 'action', name: 'action',orderable: false, },
            { data: 'model_type', name: 'model_type',orderable: false, },
            { data: 'description', name: 'description', orderable: false, searchable: false }
        ],
    });

</script>
<?php $__env->stopPush(); ?>
<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\Laravel\mohe_library\resources\views/user/show.blade.php ENDPATH**/ ?>