<?php $__env->startSection('title', __('User Management')); ?>

<?php $__env->startSection('content'); ?>
    <div class="card user-screen">
        <div class="card-body">
            <div class="text-center">
                <h3 class="card-title font-weight-bold"><?php echo e(__('string.checkin.title')); ?></h3>
            </div>
            <!--col-->
            <div class="mt-5">
                <p><?php echo e(__('string.checkin.description')); ?></p>
                <?php echo Form::open(['method' => 'GET', 'id' => 'form-list-checkin']); ?>

                <div class="form-row">
                    <div class="input-group mb-3 col-md-1" style="align-items:center; justify-content:right;"><?php echo e(__('string.checkin.label.user')); ?></div>
                    <div class="form-group col-md-4">
                        <input type="text" class="form-control" value="<?php echo e($user->username . ' : ' . $user->name); ?>"
                            readonly>
                    </div>
                    <div class="input-group mb-3 col-md-1" style="align-items:center; justify-content:right;"><?php echo e(__('string.checkin.label.date')); ?></div>
                    <div class="input-group mb-3 col-md-2">
                        <div class="input-group">
                            <?php echo Form::text(null, strlen(request()->get('time')) == 7 ? request()->get('time') : null, [
                                'id' => 'month',
                                'class' => 'form-control datepicker',
                                'placeholder' => 'yyyy/mm',
                                'autocomplete' => 'off',
                            ]); ?>

                            <div class="input-group-append">
                                <label for="month" class="fas fa-calendar btn-outline-secondary btn"></label>
                            </div>
                        </div>
                    </div>

                    <div class="input-group mb-3 col-md-2">
                        <div class="input-group">
                            <?php echo Form::text(null, strlen(request()->get('time')) == 10 ? request()->get('time') : null, [
                                'id' => 'date',
                                'class' => 'form-control datepicker',
                                'placeholder' => 'yyyy/mm/dd',
                                'autocomplete' => 'off',
                            ]); ?>

                            <div class="input-group-append">
                                <label for="date" class="fas fa-calendar btn-outline-secondary btn"></label>
                            </div>
                        </div>
                    </div>
                </div>
                <?php echo Form::close(); ?>

            </div>
            <div class="row mt-4">
                <div class="col">
                    <div class="table-responsive scroll">
                        <table class="table" aria-label="list-user">
                            <thead>
                                <tr>
                                    <th scope="col" class="w-18 text-center">
                                        <a
                                            href="<?php echo e(route('admin.checkin.history', [
                                                'user' => $user->id,
                                                'time' => request()->get('time'),
                                                'order_by' => $orderBy == 'desc' ? 'asc' : 'desc',
                                                ])); ?>">
                                            <?php echo e(__('string.checkin.columns.checkin_at_time')); ?>

                                            <em class="<?php echo e(setIconSort($orderBy)); ?>"></em>
                                        </a>
                                    </th>
                                    <th scope="col" class="w-15 text-center">
                                        <?php echo e(__('string.checkin.columns.checkin_out')); ?>

                                    </th>
                                    <th scope="col" class="w-15 text-center">
                                        <?php echo e(__('string.checkin.columns.temperature')); ?>

                                    </th>
                                    <th scope="col" class="w-18 text-center">
                                        <?php echo e(__('string.checkin.columns.image')); ?>

                                    </th>
                                </tr>
                            </thead>
                            <tbody>
                                <?php $__empty_1 = true; $__currentLoopData = $checkinHistories; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $checkin): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <tr>
                                        <td class="align-middle text-center">
                                            <?php echo e(convertTimeMilisecond($checkin->checkin_at_time)); ?>

                                        </td>
                                        <td class="align-middle text-center">
                                            <?php echo e($checkin->in_or_out == CHECKIN['flag_in']
                                                ? __('string.checkin.cell.in')
                                                : __('string.checkin.cell.out')); ?>

                                        </td>
                                        <td class="align-middle text-center">
											<?php if(is_null($checkin->temperature)): ?>
												<?php if(! is_null($checkin->flag)): ?>
													<?php echo e(__('string.checkin.temperature.'.$checkin->flag.'.nothing')); ?>

												<?php endif; ?>
											<?php else: ?>
												<?php echo e($checkin->temperature); ?>

											<?php endif; ?>
                                        </td>
                                        <td class="align-middle text-center">
                                            <span class="btn target-viewImageCheckinModal" data-toggle="modal"
                                                data-target="#viewImageCheckinModal"
                                                data-face_image="<?php echo e(Storage::url(URL_IMAGE_CHECKIN . $checkin->image)); ?>">
                                                <?php echo e(__('string.checkin.cell.view_image')); ?>

                                                <em class="far fa-eye"></em>
                                            </span>
                                        </td>
                                    </tr>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                    <tr class="text-center">
                                        <td colspan="4"><?php echo e(__('string.checkin.search.no_data')); ?></td>
                                    </tr>
                                <?php endif; ?>
                            </tbody>
                        </table>
                    </div>
                    <div class="text-right">
                        <a href='<?php echo e(route('admin.user.index')); ?>' class="btn btn-danger btn-close btn-md">
                            <?php echo e(__('string.checkin.button_back')); ?>

                        </a>
                    </div>
                </div>
                <!--col-->
            </div>
            <!--row-->
        </div>
        <!--card-body-->

        <!-- Modal -->
        <div class="modal fade" id="viewImageCheckinModal" tabindex="-1" role="dialog"
            aria-labelledby="viewImageCheckinModalTitle" aria-hidden="true">
            <div class="modal-dialog modal-dialog-centered" role="document">
                <div class="modal-content">
                    <div class="modal-header border-0">
                        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                            <span aria-hidden="true">&times;</span>
                        </button>
                    </div>
                    <div class="modal-body border-0 align-center">
                        <img alt="image_checkin"
                            style="max-width:450px; display: block; margin-left: auto; margin-right: auto;"
                            class="img-fluid mx-auto d-block" src="<?php echo e(Storage::url('/images/checkin/01.jpeg')); ?>">
                    </div>
                    <div class="modal-footer border-0"></div>
                </div>
            </div>
        </div>
    </div>
    <!--card-->
<?php $__env->stopSection(); ?>

<?php $__env->startPush('after-scripts'); ?>
    <script src="<?php echo e(mix('js/user.js')); ?>"></script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('backend.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /var/www/html/cc-faceeye-web/resources/views/backend/user/checkin-history.blade.php ENDPATH**/ ?>