@extends('layouts.company')
@section('content')


<!-- start page title -->
<div class="row">
    <div class="col-12">
        <div class="page-title-box d-sm-flex align-items-center justify-content-between bg-galaxy-transparent">
            <h4 class="mb-sm-0">Staffs Report</h4>

            <div class="page-title-right">
                <ol class="breadcrumb m-0">
                    <li class="breadcrumb-item"><a href="javascript: void(0);">Home</a></li>
                    <li class="breadcrumb-item active">Staffs Report</li>
                </ol>
            </div>
        </div>
    </div>
</div>
<!-- end page title -->

<div class="row">
    <div class="col-lg-12">
        <div class="card" id="orderList">
            <div class="card-header border-0">
                <div class="row align-items-center gy-3">
                    <div class="col-sm">
                        <h5 class="card-title mb-0">Staffs Report</h5>
                    </div>
                    <div class="col-sm-auto">
                        <div class="d-flex gap-1 flex-wrap">
                            <button type="button" class="btn btn-info"><i class="ri-file-download-line align-bottom me-1"></i> Export</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="card-body border border-dashed border-end-0 border-start-0">
                <form>
                    <div class="row g-3 align-items-end">
                        <div class="col-lg-4 mb-3">
                            <label class="form-label">User</label>
                            <select class="form-select js-example-basic-single" data-placeholder="Select User">
                                <option value=""></option>
                                <option value="1">Murphy Yoder</option>
                                <option value="2">Alex Yoder</option>
                            </select>
                        </div>
                        <div class="col-lg-4 mb-3">
                            <label class="form-label">Challenge</label>
                            <select class="form-select js-example-basic-single" data-placeholder="Select Challenge">
                                <option value=""></option>
                                <option value="1">Running</option>
                                <option value="2">Floor</option>
                                <option value="3">Walking</option>
                            </select>
                        </div>
                        <div class="col-lg-4 mb-3">
                            <button type="submit" class="btn btn-primary">Filter</button>
                            <button type="submit" class="btn btn-soft-dark">Clear</button>
                        </div>
                    </div>
                    <!--end row-->
                </form>
            </div>
            <div class="card-body">
                <div class="table-responsive">
                    <table id="StaffTable" class="table table-bordered nowrap align-middle" style="width: 100%;">
                        <thead class="">
                            <tr class="text-uppercase">
                                <th>Sl No</th>
                                <th>Name</th>
                                <th>Phone Number</th>
                                <th>Email</th>
                                <th>Challenge</th>
                                <th>Challenge Target</th>
                                <th>Progress</th>
                                <th>Started Date</th>
                                <th>End Date</th>
                            </tr>
                        </thead>
                        <tbody class="list form-check-all">
                          
                             @foreach ($staffs as $staff)
                            <tr>
                                <td class="id">{{ $staff->id }}</td>

                                <td>{{ $staff->name }}</td>
                                <td>{{ $staff->dial_code }} {{ $staff->phone }}</td>
                                <td>{{ $staff->email }}</td>
                                <td>Floors</td>
                                <td>20</td>
                                <td>
                                    <div class="progress animated-progress custom-progress progress-label">
                                        <div class="progress-bar bg-dark" role="progressbar" style="width: 0%;" aria-valuenow="15" aria-valuemin="0" aria-valuemax="100">
                                            <div class="label">0%</div>
                                        </div>
                                    </div>
                                </td>
                                <td>-</td>
                                <td>-</td>
                            </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
    <!--end col-->
</div>
<!--end row-->
@endsection
@section('script')
<script src="https://cdn.jsdelivr.net/npm/jquery-validation@1.19.5/dist/jquery.validate.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/jquery-validation@1.19.5/dist/additional-methods.min.js"></script>
  
<script>
    $(document).ready(function() {
        $('#StaffTable').DataTable({
            responsive: true, 
            paging: true,     
            searching: true,  
            ordering: true,   
            lengthChange: true, 
            
        });
    });

   </script>
   <script>
    $(document).ready(function() {
        // Event listener for the "Clear" button
        $('#clearButton').on('click', function(e) {
            e.preventDefault(); // Prevent form submission
            $('#filterForm')[0].reset(); // Reset the form fields

            // Reload the page without query parameters
            window.location.href = window.location.pathname; // Remove the query string from the URL
        });
    });
</script>

@endsection
