<?php $__env->startSection('title','Day\'s Attendance Status'); ?>
<?php $__env->startPush('styles'); ?>
    <style>
        .accordion-button:not(.collapsed) {
            color: var(--bs-accordion-active-color);
            background-color: #fff !important;
            box-shadow: none;
        }

        .accordion-item label {
            font-size: 14px !important;
        }

        .disease-select, .disease-select option {
            font-size: 14px;
        }

        .accordion-button {
            padding: 5px !important;

        }

        .accordion-body {
            padding: 5px !important;
        }

        li {
            list-style-type: none;
        }

        .cm_grid {
            display: flex;
        }

        .full_report {
            position: relative;
        }

        .print-button {
            position: absolute;
            top: 7vh;
            right: 16px;
        }

        #printsection strong {
            color: #6E7796;
            font-size: 14px;
            font-style: normal;
            font-weight: 600;
            line-height: normal;
        }

        #printsection span {
            color: #0050C9;
            font-size: 14px;
            font-style: normal;
            font-weight: 400;
            line-height: normal;
        }

        .input-daterange input {
            color: #1C274D;
            font-size: 14px;
            font-style: normal;
            font-weight: 400;
            line-height: 20px; /* 142.857% */
        }

        .report-status {
            color: #000;
            font-size: 14px;
            font-style: normal;
            font-weight: 700;
            margin: 0;
            line-height: 20px; /* 142.857% */
        }

        .filemanager-sidebar {
            width: 300px;
        }

        table th, table td {
            color: #1C274D;
            font-size: 14px;
            font-style: normal;
            font-weight: 600;
            line-height: 24px; /* 171.429% */
        }
    </style>
<?php $__env->stopPush(); ?>
<?php
    $start_date = request()->get('start_date');
    $end_date = request()->get('end_date');
?>

<?php $__env->startSection('content'); ?>
    <div class="row mb-4">
        <div class="col-12">
            <div class="page-title-box d-sm-flex align-items-center justify-content-between">
                <h2 class="mb-sm-0 font-size-18 fw-bold">Day's Attendance Status - Searching Criteria</h2>
            </div>
        </div>
    </div>
    <div class="d-xl-flex">
        <div class="w-100">
            <div class="card">
                <div class="card-body">
                    <div class="d-flex flex-column h-100">
                        <div class="mb-12">
                            <form action="<?php echo e(route('hr_reports.attendStatusReports')); ?>" method="GET" role="form"
                                id="form1" enctype="multipart/form-data" autocomplete="off">

                                <div class="col-md-12">
                                    <div class="row mt-3">

                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label class="form-label" for="org_id">Branch</label>
                                                <select id="org_id" name="org_id" class="form-select select2" style="width:100%;">
                                                    <option value="" selected="">All </option>
                                                    <?php $__currentLoopData = $organizations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dta): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($dta->id); ?>"><?php echo e($dta->name); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                        </div>

                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label class="form-label" for="session_id">Session</label>
                                                <select id="session_id" name="session_id" class="form-select select2" style="width:100%;">
                                                    <option value="" selected="">All </option>
                                                    <?php $__currentLoopData = $sessions; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dta): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($dta->session_id); ?>"><?php echo e($dta->session_name); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                        </div>

                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label class="form-label" for="department_id">Department</label>
                                                <select id="department_id" name="department_id" class="form-select select2" style="width:100%;">
                                                    <option value="" selected="">All </option>
                                                    <?php $__currentLoopData = $departments; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dta): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($dta->department_id); ?>"><?php echo e($dta->department_name); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                        </div>

                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label class="form-label" for="designation_id">Designation</label>
                                                <select id="designation_id" name="designation_id" class="form-select select2" style="width:100%;">
                                                    <option value="" selected="">All </option>
                                                    <?php $__currentLoopData = $designations; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dta): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($dta->id); ?>"><?php echo e($dta->name); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                        </div>

                                        <div class="col-md-3 d-none">
                                            <div class="form-group">
                                                <label class="form-label" for="emp_type">Employee Type</label>
                                                <select id="emp_type" name="emp_type" class="form-control" style="width:100%;">
                                                    <option value="" selected="">All </option>
                                                    <option value="F">Founder</option>
                                                    <option value="T">Teacher</option>
                                                    <option value="S">Staff</option>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                    <div class="row mt-3" style='margin-top:10px'>

                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label class="form-label" for="duty_shift">Shift Of Duty</label>
                                                <select id="duty_shift" name="duty_shift" class="form-control"
                                                    style="width:100%;" panelHeight='auto'>
                                                    <option value="" selected=""> All </option>
                                                    <option value="Morning">Morning</option>
                                                    <option value="Day">Day</option>
                                                    <option value="Both">Both</option>
                                                </select>
                                            </div>
                                        </div>
                                        <div class="col-md-3 d-none">
                                            <div class="form-group">
                                                <label class="form-label" for="abPrStatus">Absent/Present</label>
                                                <select id="abPrStatus" name="abPrStatus" class="form-control" style="width:100%;"
                                                    panelHeight='auto'>
                                                    <option value="" selected="">--Both Of All--</option>
                                                    <option value="ab">Absent</option>
                                                    <option value="pr">Present</option>
                                                </select>
                                            </div>
                                        </div>

                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label class="form-label" for="record_status">Active/Inactive</label>
                                                <select id="record_status" name="record_status" class="form-control"
                                                    style="width:100%;">
                                                    <option value="0">-All-</option>
                                                    <option value="1">Active</option>
                                                    <option value="2">Inactive</option>
                                                </select>
                                            </div>
                                        </div>

                                        <div class="col-md-3">
                                            <div class="form-group">
                                                <label class="form-label" for="employee_id">Employee</label>
                                                <select class="form-select select2" name="employee_id" id="employee_id" style="width:100%;">
                                                    <option value="0">-All-</option>
                                                    <?php $__currentLoopData = $employees; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $dta): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <option value="<?php echo e($dta->id); ?>"><?php echo e($dta->employee_name); ?></option>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                </select>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div class="row mt-3" style='margin-top:10px'>
                                    <div class="col-md-3">
                                        <div class="form-group">
                                            <label class="form-label" for="att_date">Select A Day</label>
                                            <input type="date" class="form-control"
                                                    placeholder="A Day" name="att_date" id="att_date" value="<?=date("Y-m-d")?>"/>
                                        </div>
                                    </div>
                                </div>
                            </div>

                                <div class="col-md-12" style='margin-top:10px'>
                                    <div class="col-md-1" style="margin-top: 22px;" >
                                        
                                        <a class="btn btn-primary waves-effect waves-light" onClick="multiAttendance()">
                                            Search
                                        </a>
                                    </div>

                                </div>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>
<?php $__env->startPush('scripts'); ?>
    <script type="text/javascript">

        function multiAttendance() {
            var org_id      = $('#org_id').val();
            var department_id = $('#department_id').val();
            var designation_id = $('#designation_id').val();
            var employee_id = $('#employee_id').val();
            var session_id  = $('#session_id').val();
            var emp_type    = $('#emp_type').val();
            var duty_shift  = $('#duty_shift').val();
            var abPrStatus  = $('#abPrStatus').val();
            var record_status = $('#record_status').val();
            var att_date       = $('#att_date').val();

            emp_type        = emp_type || 0;
            duty_shift      = duty_shift || 0;
            abPrStatus      = abPrStatus || 0;
            org_id          = org_id || 0;
            department_id   = department_id || 0;
            designation_id  = designation_id || 0;
            employee_id     = employee_id || 0;
            session_id      = session_id || 0;
            record_status   = record_status || 0;

            if (att_date === '') att_date = '0';

            screenWidth = screen.width;
            screenHeight = screen.height;
            var wSize = (screenWidth * 70) / 100;
            var hSize = (screenHeight * 98) / 100;
            var left = (screenWidth * 10) / 100;
            var top = 20;

            // <?php /*var url = "{{ route('popup') }}" + "?param1=" + param1 + "&param2=" + param2*/ ?>;

            var url = '/system/hr_reports/attendStatusReports' + "?org_id=" + org_id + "&department_id=" + department_id +
            "&designation_id=" + designation_id + "&employee_id=" + employee_id + "&session_id=" + session_id + "&emp_type=" + emp_type +
            "&duty_shift=" + duty_shift + "&att_date=" + att_date + "&abPrStatus=" + abPrStatus +
            "&record_status=" + record_status;

            var newwindow = window.open(url, 'Attendance List', 'width='+wSize+', height='+hSize+', scrollbars=yes,top = ' + top + ',left=' + left);

            if (window.focus) {
                newwindow.focus();
            }
        }

        $(document).ready(function ($) {
            $('.select2').select2({
                dropdownParent: $('#form1'),
                width: 'resolve',
            });
        });

        $('.print_btn').click(function (e) {
            e.preventDefault();
            $("#printsection").print({
                globalStyles: true,
                mediaPrint: false,
                stylesheet: '<?php echo e(asset('assets/css/print.min.css')); ?>',
                noPrintSelector : '.print_btn',
            });
        });
        $(document).ready(function ($) {
            $('#farmCheckAll').click(function () {
                if ($(this).is(':checked')) {
                    $('input[name="farmCheck[]"]').prop('checked', true);
                } else {
                    $('input[name="farmCheck[]"]').prop('checked', false);
                }
            });
            $('#herdCheckAll').click(function () {
                if ($(this).is(':checked')) {
                    $('input[name="herdCheck[]"]').prop('checked', true);
                } else {
                    $('input[name="herdCheck[]"]').prop('checked', false);
                }
            });
            $('#lotCheckAll').click(function () {
                if ($(this).is(':checked')) {
                    $('input[name="lotCheck[]"]').prop('checked', true);
                } else {
                    $('input[name="lotCheck[]"]').prop('checked', false);
                }
            });
        });

    </script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('backend.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH D:\laragon\www\hr_and_att\resources\views/backend/hr/report/attendStatusFilter.blade.php ENDPATH**/ ?>