@extends('admin.pages.build')
@push('css')
    <link rel="stylesheet" href="/site/assets/vendors/simple-datatables/style.css">
@endpush
@section('content')
    <div class="table-responsive" style="background: #fff">
        <table id="dataTable" class="table data-table table-striped mb-0">
            <thead>
            <tr>
                <th>Başvuru No</th>
                <th>Ad Soyad</th>
                <th>Telefon Numarası</th>
                <th>İl</th>
                <th>İlçe</th>
                <th>Mahalle</th>
                <th>Sokak</th>
                <th>Bina No</th>
                <th>Kat</th>
                <th>Daire No</th>
                <th>Alabilecek Kişi Sayısı</th>
                <th>Tarih Aralığı</th>
                <th>Ulaşım</th>
                <th>Oda Sayısı</th>
                <th>Metrekare</th>
                <th>Durum</th>
            </tr>
            </thead>
            <tbody>
            @foreach($hasHomes as $hasHome)
                <tr>
                    <td>#{{ $hasHome->no }}</td>
                    <td>{{ $hasHome->name }}</td>
                    <td>{{ $hasHome->telephone }}</td>
                    <td>{{ $hasHome->getCity->il_adi ?? '' }}</td>
                    <td>{{ $hasHome->getTown->ilce_adi ?? '' }}</td>
                    <td>{{ $hasHome->getDistrict->mahalle_adi ?? '' }}</td>
                    <td>{{ $hasHome->getStreet->sokak_adi ?? '' }}</td>
                    <td>{{ $hasHome->apartment_no }}</td>
                    <td>{{ $hasHome->floor }}</td>
                    <td>{{ $hasHome->apartment }}</td>
                    <td>{{ $hasHome->person_count }}</td>
                    <td>{{ \Carbon\Carbon::make($hasHome->start_date)->format('d.m.Y') . ' / ' . \Carbon\Carbon::make($hasHome->end_date)->format('d.m.Y') }}</td>
                    <td>{{ $hasHome->car_types }}</td>
                    <td>{{ $hasHome->room_count }}</td>
                    <td>{{ $hasHome->meter }}</td>
                    <td>{{ $hasHome->status == 2 ? 'Bekliyor' : ($hasHome->status == 1 ? 'Tamamlandı' : 'Reddedildi') }}</td>
                </tr>
            @endforeach
            </tbody>
        </table>
    </div>
@endsection
@push('js')
    <script src="/site/assets/vendors/simple-datatables/simple-datatables.js"></script>
    <script src="/site/assets/js/bootstrap.min.js"></script>
    <script>
        let dataTable = new simpleDatatables.DataTable("#dataTable");
    </script>
@endpush
