@extends('layouts.app')

@section('content')
<div class="row">
    <div class="col-sm-12">
        <div class="page-title-box">
            <div class="float-end">
                <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="#">HR</a></li>
                    <li class="breadcrumb-item"><a href="#">Reports</a></li>
                    <li class="breadcrumb-item active">{{ $reportTitle }}</li>
                </ol>
            </div>
            <h4 class="page-title">{{ $reportTitle }}</h4>
        </div>
    </div>
</div>

<div class="row">
    <div class="col-lg-6">
        <div class="card">
            <div class="card-header">
                <h4 class="card-title">Filter Options</h4>
            </div>
            <div class="card-body">
                <form action="{{ route('hr.reports.' . $reportName . '.post') }}" method="POST" target="_blank">
                    @csrf
                    <input type="hidden" name="report_name" value="{{ $reportName }}">
                    
                    <div class="mb-3">
                        <label for="branch_id" class="form-label">Branch</label>
                        <select class="form-select" id="branch_id" name="branch_id">
                            <option value="">All Branches</option>
                            @foreach($branches as $branch)
                                <option value="{{ $branch->id }}">{{ $branch->name }}</option>
                            @endforeach
                        </select>
                    </div>

                    <div class="mb-3">
                        <label for="department_id" class="form-label">Department</label>
                        <select class="form-select" id="department_id" name="department_id">
                            <option value="">All Departments</option>
                            @foreach($departments as $department)
                                <option value="{{ $department->id }}">{{ $department->name }}</option>
                            @endforeach
                        </select>
                    </div>

                    <div class="mb-3">
                        <label for="format" class="form-label">Output Format</label>
                        <select class="form-select" id="format" name="format" required>
                            <option value="pdf">PDF</option>
                            <option value="excel">Excel</option>
                            <option value="csv">CSV</option>
                            <option value="dat">DAT</option>
                        </select>
                    </div>

                    <button type="submit" class="btn btn-primary">Preview / Download</button>
                </form>
            </div>
        </div>
    </div>
</div>
@endsection
