
<?php $__env->startSection('content'); ?>
<?php $__env->startSection('title'); ?>
    <?php echo app('translator')->getFromJson('attendance.employee_attendance'); ?>
<?php $__env->stopSection(); ?>
<style>
    .departmentName {
        position: relative;
    }

    #department_id-error {
        position: absolute;
        top: 66px;
        left: 0;
        width: 100%he;
        width: 100%;
        height: 100%;
    }
</style>
<script>
    jQuery(function() {
        $("#employeeAttendance").validate();
    });
</script>
<div class="container-fluid">
    <div class="row bg-title">
        <div class="col-lg-5 col-md-5 col-sm-5 col-xs-12">
            <ol class="breadcrumb">
                <li class="active breadcrumbColor"><a href="<?php echo e(url('dashboard')); ?>"><i class="fa fa-home"></i>
                        <?php echo app('translator')->getFromJson('dashboard.dashboard'); ?></a></li>
                <li><?php echo $__env->yieldContent('title'); ?></li>
            </ol>
        </div>

        <div class="col-md-7">
            <a href="<?php echo e(route('attendance.csv')); ?>"
                class="btn btn-success pull-right m-l-20 hidden-xs hidden-sm waves-effect waves-light">
                <i class="fa fa-file" aria-hidden="true"></i> CSV Attendance</a>
        </div>
    </div>

    <div class="row">
        <div class="col-sm-12">
            <div class="panel panel-info">
                <div class="panel-heading"><i class="mdi mdi-table fa-fw"></i> <?php echo $__env->yieldContent('title'); ?></div>
                <div class="panel-wrapper collapse in" aria-expanded="true">
                    <div class="panel-body">
                        <?php if(session()->has('success')): ?>
                            <div class="alert alert-success alert-dismissable">
                                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                <i
                                    class="cr-icon glyphicon glyphicon-ok"></i>&nbsp;<strong><?php echo e(session()->get('success')); ?></strong>
                            </div>
                        <?php endif; ?>
                        <?php if(session()->has('error')): ?>
                            <div class="alert alert-danger alert-dismissable">
                                <button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
                                <i
                                    class="glyphicon glyphicon-remove"></i>&nbsp;<strong><?php echo e(session()->get('error')); ?></strong>
                            </div>
                        <?php endif; ?>
                        <div class="row">
                            <div id="searchBox">
                                <?php echo e(Form::open(['route' => 'manualAttendance.filter', 'id' => 'employeeAttendance', 'method' => 'GET'])); ?>

                                <div class="col-md-2"></div>
                                <div class="col-md-3">
                                    <div class="form-group departmentName">
                                        <label class="control-label" for="email"><?php echo app('translator')->getFromJson('employee.department'); ?><span
                                                class="validateRq">*</span></label>
                                        <select class="form-control employee_id select2 required" required
                                            name="department_id">
                                            <option value="">---- <?php echo app('translator')->getFromJson('common.please_select'); ?> ----</option>
                                            <?php $__currentLoopData = $departmentList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <option value="<?php echo e($value->department_id); ?>"
                                                    <?php if(isset($_REQUEST['department_id'])): ?> <?php if($_REQUEST['department_id'] == $value->department_id): ?> <?php echo e('selected'); ?> <?php endif; ?>
                                                    <?php endif; ?>><?php echo e($value->department_name); ?> </option>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        </select>
                                    </div>
                                </div>
                                <div class="col-md-3">
                                    <label class="control-label" for="email"><?php echo app('translator')->getFromJson('common.date'); ?><span
                                            class="validateRq">*</span></label>
                                    <div class="input-group">
                                        <span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                        <input type="text" class="form-control dateField required" readonly
                                            placeholder="<?php echo app('translator')->getFromJson('common.date'); ?>" name="date"
                                            value="<?php if(isset($_REQUEST['date'])): ?> <?php echo e($_REQUEST['date']); ?><?php else: ?><?php echo e(dateConvertDBtoForm(date('Y-m-d'))); ?> <?php endif; ?>">
                                    </div>
                                </div>

                                <div class="col-md-2">
                                    <div class="form-group">
                                        <input type="submit" id="filter" style="margin-top: 25px; width: 100px;"
                                            class="btn btn-info " value="<?php echo app('translator')->getFromJson('common.filter'); ?>">
                                    </div>
                                </div>
                                <?php echo e(Form::close()); ?>

                            </div>
                        </div>
                        <hr>
                        <?php if(isset($attendanceData)): ?>
                            <?php echo e(Form::open(['route' => 'manualAttendance.store', 'id' => 'employeeAttendance'])); ?>


                            <input type="hidden" name="department_id" value="<?php echo e($_REQUEST['department_id']); ?>">
                            <input type="hidden" name="date" value="<?php echo e($_REQUEST['date']); ?>">

                            <div class="table-responsive">
                                <table class="table table-bordered" style="margin-bottom: 47px">
                                    <thead class="tr_header">
                                        <tr>
                                            <th><?php echo app('translator')->getFromJson('common.serial'); ?></th>
                                            <th><?php echo app('translator')->getFromJson('employee.finger_print_no'); ?></th>
                                            <th><?php echo app('translator')->getFromJson('common.employee_name'); ?></th>
                                            <th><?php echo app('translator')->getFromJson('attendance.in_time'); ?></th>
                                            <th><?php echo app('translator')->getFromJson('attendance.out_time'); ?></th>
                                        </tr>
                                    </thead>
                                    <tbody>
                                        <?php if(count($attendanceData) > 0): ?>
                                            <?php $__currentLoopData = $attendanceData; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $value): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <tr>
                                                    <td>1</td>
                                                    <td><?php echo e($value->finger_id); ?></td>
                                                    <td><?php echo e($value->fullName); ?></td>
                                                    <td style="width: 300px">
                                                        <div class="input-group">
                                                            <div class="input-group-addon">
                                                                <i class="fa fa-clock-o"></i>
                                                            </div>
                                                            <div class="bootstrap-timepicker">
                                                                <input type="hidden" name="finger_print_id[]"
                                                                    value="<?php echo e($value->finger_id); ?>">
                                                                <input class="form-control timePicker" type="text"
                                                                    placeholder="<?php echo app('translator')->getFromJson('attendance.in_time'); ?>" name="inTime[]"
                                                                    value="<?php echo e($value->inTime); ?>" readonly>
                                                            </div>
                                                        </div>
                                                    </td>
                                                    <td style="width: 300px">
                                                        <div class="input-group">
                                                            <div class="input-group-addon">
                                                                <i class="fa fa-clock-o"></i>
                                                            </div>
                                                            <div class="bootstrap-timepicker">
                                                                <input class="form-control timePicker" type="text"
                                                                    placeholder="<?php echo app('translator')->getFromJson('attendance.out_time'); ?>" name="outTime[]"
                                                                    value="<?php echo e($value->outTime); ?>" readonly>
                                                            </div>
                                                        </div>
                                                    </td>
                                                </tr>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php else: ?>
                                            <tr>
                                                <td colspan="5"><?php echo app('translator')->getFromJson('common.no_data_available'); ?></td>
                                            </tr>
                                        <?php endif; ?>
                                    </tbody>
                                </table>
                            </div>
                            <?php if(count($attendanceData) > 0): ?>
                                <div class="form-actions">
                                    <div class="row">
                                        <div class="col-md-12 ">
                                            <button type="submit" class="btn btn-info btn_style"><i
                                                    class="fa fa-check"></i> <?php echo app('translator')->getFromJson('common.save'); ?></button>
                                        </div>
                                    </div>
                                </div>
                            <?php endif; ?>
                            <?php echo e(Form::close()); ?>

                        <?php endif; ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.master', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>