@extends('layouts.app')

@section('content')

<div class="container-fluid">
    <div class="row">
        <div class="col-12">
            @if ($message = Session::get('success'))
                <div class="alert alert-success alert-dismissible">
                    <button type="button" class="close" data-dismiss="alert">×</button>  
                    <small>{{ $message }}</small>
                </div>
            @endif
        </div>
        {{-- Biens immobiliers --}}
        <div class="col-md-12">
            <div class="card strpied-tabled-with-hover">
                <div class="card-header ">
                    <h4 class="card-title">Biens immobiliers</h4>
                    <p class="card-category">Liste des biens immobiliers</p>
                </div>
                <div class="card-body table-full-width table-responsive">
                    <table class="table table-hover table-striped text-capitalize">
                        <thead>
                            <th>ID</th>
                            <th>Reference</th>
                            <th>Numéro de lot</th>
                            <th>Régime juridique</th>
                            <th>Type de bien</th>
                            <th></th>
                        </thead>
                        <tbody>
                            @foreach ($biens as $bien)
                            <tr>
                                <td>{{ $bien->id }}</td>
                                <td>{{ $bien->reference }}</td>
                                <td>{{ $bien->num_lot }}</td>
                                <td style="text-transform: capitalize">{{ $bien->regime_juridique }}</td>
                                <td>{{ $bien->type() }}</td>
                                <td>
                                    <a href="{{ route('bien.edit',$bien->id) }}" class="btn btn-primary btn-sm">Détails</a>
                                </td>
                            </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        {{-- Propriétaires --}}
        <div class="col-md-12">
            <div class="card strpied-tabled-with-hover">
                <div class="card-header ">
                    <h4 class="card-title">Propriétaires</h4>
                    <p class="card-category">Liste des propriétaires</p>
                </div>
                <div class="card-body table-full-width table-responsive">
                    <table class="table table-hover table-striped" style="text-transform: capitalize">
                        <thead>
                            <th>ID</th>
                            <th>Numéro</th>
                            <th>Nom</th>
                            <th>Ville</th>
                            <th>Code postal</th>
                            <th></th>
                        </thead>
                        <tbody>
                            @foreach ($proprietaires as $proprietaire)
                            <tr>
                                <td>{{ $proprietaire->id }}</td>
                                <td>{{ $proprietaire->pro_num }}</td>
                                <td>{{ $proprietaire->civilite() }} {{ $proprietaire->nom }} {{ $proprietaire->prenom }}</td>
                                <td>{{ $proprietaire->ville }}</td>
                                <td>{{ $proprietaire->cp }}</td>
                                <td>
                                    <a href="{{ route('proprietaire.edit',$proprietaire->id) }}" class="btn btn-primary btn-sm">Détails</a>
                                </td>
                            </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        {{-- Mandats de location --}}
        <div class="col-md-12">
            <div class="card strpied-tabled-with-hover">
                <div class="card-header ">
                    <h4 class="card-title">Mandats de location</h4>
                    <p class="card-category">Liste des mandats de location</p>
                </div>
                <div class="card-body table-full-width table-responsive">
                    <table class="table table-hover table-striped" style="text-transform: capitalize">
                        <thead>
                            <th>ID</th>
                            <th>Numéro de mandat</th>
                            <th>Type de mandat</th>
                            <th>Référence du bien</th>
                            <th></th>
                        </thead>
                        <tbody>
                            @foreach ($locations as $location)
                            <tr>
                                <td>{{ $location->id }}</td>
                                <td>{{ $location->num_mandat }}</td>
                                <td>{{ $location->type_mandat }}</td>
                                <td>{{ $location->bien->reference }}</td>
                                <td>
                                    <a href="{{ route('location.edit',$location->id) }}" class="btn btn-primary btn-sm">Détails</a>
                                </td>
                            </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
        {{-- Mandats de vente --}}
        <div class="col-md-12">
            <div class="card strpied-tabled-with-hover">
                <div class="card-header ">
                    <h4 class="card-title">Mandats de vente</h4>
                    <p class="card-category">Liste des mandats de vente</p>
                </div>
                <div class="card-body table-full-width table-responsive">
                    <table class="table table-hover table-striped" style="text-transform: capitalize">
                        <thead>
                            <th>ID</th>
                            <th>Numéro de mandat</th>
                            <th>Type de mandat</th>
                            <th>Référence du bien</th>
                            <th></th>
                        </thead>
                        <tbody>
                            @foreach ($ventes as $vente)
                            <tr>
                                <td>{{ $vente->id }}</td>
                                <td>{{ $vente->num_mandat }}</td>
                                <td>{{ $vente->type_mandat }}</td>
                                <td>{{ $vente->bien->reference }}</td>
                                <td>
                                    <a href="{{ route('vente.edit',$vente->id) }}" class="btn btn-primary btn-sm">Détails</a>
                                </td>
                            </tr>
                            @endforeach
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>

    {{-- Statistiques --}}
    {{-- <div class="row">
        <div class="col-md-4">
            <div class="card ">
                <div class="card-header ">
                    <h4 class="card-title">Email Statistics</h4>
                    <p class="card-category">Last Campaign Performance</p>
                </div>
                <div class="card-body ">
                    <div id="chartPreferences" class="ct-chart ct-perfect-fourth"></div>
                    <div class="legend">
                        <i class="fa fa-circle text-info"></i> Open
                        <i class="fa fa-circle text-danger"></i> Bounce
                        <i class="fa fa-circle text-warning"></i> Unsubscribe
                    </div>
                    <hr>
                    <div class="stats">
                        <i class="fa fa-clock-o"></i> Campaign sent 2 days ago
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-8">
            <div class="card ">
                <div class="card-header ">
                    <h4 class="card-title">Users Behavior</h4>
                    <p class="card-category">24 Hours performance</p>
                </div>
                <div class="card-body ">
                    <div id="chartHours" class="ct-chart"></div>
                </div>
                <div class="card-footer ">
                    <div class="legend">
                        <i class="fa fa-circle text-info"></i> Open
                        <i class="fa fa-circle text-danger"></i> Click
                        <i class="fa fa-circle text-warning"></i> Click Second Time
                    </div>
                    <hr>
                    <div class="stats">
                        <i class="fa fa-history"></i> Updated 3 minutes ago
                    </div>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-6">
            <div class="card ">
                <div class="card-header ">
                    <h4 class="card-title">2017 Sales</h4>
                    <p class="card-category">All products including Taxes</p>
                </div>
                <div class="card-body ">
                    <div id="chartActivity" class="ct-chart"></div>
                </div>
                <div class="card-footer ">
                    <div class="legend">
                        <i class="fa fa-circle text-info"></i> Tesla Model S
                        <i class="fa fa-circle text-danger"></i> BMW 5 Series
                    </div>
                    <hr>
                    <div class="stats">
                        <i class="fa fa-check"></i> Data information certified
                    </div>
                </div>
            </div>
        </div>
        <div class="col-md-6">
            <div class="card  card-tasks">
                <div class="card-header ">
                    <h4 class="card-title">Tasks</h4>
                    <p class="card-category">Backend development</p>
                </div>
                <div class="card-body ">
                    <div class="table-full-width">
                        <table class="table">
                            <tbody>
                                <tr>
                                    <td>
                                        <div class="form-check">
                                            <label class="form-check-label">
                                                <input class="form-check-input" type="checkbox" value="">
                                                <span class="form-check-sign"></span>
                                            </label>
                                        </div>
                                    </td>
                                    <td>Sign contract for "What are conference organizers afraid of?"</td>
                                    <td class="td-actions text-right">
                                        <button type="button" rel="tooltip" title="Edit Task" class="btn btn-info btn-simple btn-link">
                                            <i class="fa fa-edit"></i>
                                        </button>
                                        <button type="button" rel="tooltip" title="Remove" class="btn btn-danger btn-simple btn-link">
                                            <i class="fa fa-times"></i>
                                        </button>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div class="form-check">
                                            <label class="form-check-label">
                                                <input class="form-check-input" type="checkbox" value="" checked>
                                                <span class="form-check-sign"></span>
                                            </label>
                                        </div>
                                    </td>
                                    <td>Lines From Great Russian Literature? Or E-mails From My Boss?</td>
                                    <td class="td-actions text-right">
                                        <button type="button" rel="tooltip" title="Edit Task" class="btn btn-info btn-simple btn-link">
                                            <i class="fa fa-edit"></i>
                                        </button>
                                        <button type="button" rel="tooltip" title="Remove" class="btn btn-danger btn-simple btn-link">
                                            <i class="fa fa-times"></i>
                                        </button>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div class="form-check">
                                            <label class="form-check-label">
                                                <input class="form-check-input" type="checkbox" value="" checked>
                                                <span class="form-check-sign"></span>
                                            </label>
                                        </div>
                                    </td>
                                    <td>Flooded: One year later, assessing what was lost and what was found when a ravaging rain swept through metro Detroit
                                    </td>
                                    <td class="td-actions text-right">
                                        <button type="button" rel="tooltip" title="Edit Task" class="btn btn-info btn-simple btn-link">
                                            <i class="fa fa-edit"></i>
                                        </button>
                                        <button type="button" rel="tooltip" title="Remove" class="btn btn-danger btn-simple btn-link">
                                            <i class="fa fa-times"></i>
                                        </button>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div class="form-check">
                                            <label class="form-check-label">
                                                <input class="form-check-input" type="checkbox" checked>
                                                <span class="form-check-sign"></span>
                                            </label>
                                        </div>
                                    </td>
                                    <td>Create 4 Invisible User Experiences you Never Knew About</td>
                                    <td class="td-actions text-right">
                                        <button type="button" rel="tooltip" title="Edit Task" class="btn btn-info btn-simple btn-link">
                                            <i class="fa fa-edit"></i>
                                        </button>
                                        <button type="button" rel="tooltip" title="Remove" class="btn btn-danger btn-simple btn-link">
                                            <i class="fa fa-times"></i>
                                        </button>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div class="form-check">
                                            <label class="form-check-label">
                                                <input class="form-check-input" type="checkbox" value="">
                                                <span class="form-check-sign"></span>
                                            </label>
                                        </div>
                                    </td>
                                    <td>Read "Following makes Medium better"</td>
                                    <td class="td-actions text-right">
                                        <button type="button" rel="tooltip" title="Edit Task" class="btn btn-info btn-simple btn-link">
                                            <i class="fa fa-edit"></i>
                                        </button>
                                        <button type="button" rel="tooltip" title="Remove" class="btn btn-danger btn-simple btn-link">
                                            <i class="fa fa-times"></i>
                                        </button>
                                    </td>
                                </tr>
                                <tr>
                                    <td>
                                        <div class="form-check">
                                            <label class="form-check-label">
                                                <input class="form-check-input" type="checkbox" value="" disabled>
                                                <span class="form-check-sign"></span>
                                            </label>
                                        </div>
                                    </td>
                                    <td>Unfollow 5 enemies from twitter</td>
                                    <td class="td-actions text-right">
                                        <button type="button" rel="tooltip" title="Edit Task" class="btn btn-info btn-simple btn-link">
                                            <i class="fa fa-edit"></i>
                                        </button>
                                        <button type="button" rel="tooltip" title="Remove" class="btn btn-danger btn-simple btn-link">
                                            <i class="fa fa-times"></i>
                                        </button>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                </div>
                <div class="card-footer ">
                    <hr>
                    <div class="stats">
                        <i class="now-ui-icons loader_refresh spin"></i> Updated 3 minutes ago
                    </div>
                </div>
            </div>
        </div>
    </div> --}}
</div>
 
@endsection
