@extends('layouts.app')

@section('content')
 <div class="card">
    <div class="card-header">
        <h4 class="card-title">{{ $reportTitle }} Report</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="from_date" class="form-label">From Date</label>
                <input type="date" name="from_date" class="form-control">
            </div>

            <div class="mb-3">
                <label for="to_date" class="form-label">To Date</label>
                <input type="date" name="to_date" class="form-control">
            </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>
                </select>
            </div>

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