@extends('layouts.admin')

@section('breadcrumbs')
    <div class="col-sm-4">
        <div class="page-header float-left">
            <div class="page-title">
                <h1>Dashboard</h1>
            </div>
        </div>
    </div>
    <div class="col-sm-8">
        <div class="page-header float-right">
            <div class="page-title">
                <ol class="breadcrumb text-right">
                    <li class="active">Dashboard</li>
                </ol>
            </div>
        </div>
    </div>
@endsection

@section('content')
    <div class="col-sm-12">
        <div class="alert  alert-success alert-dismissible fade show" role="alert">
        <span class="badge badge-pill badge-success">Success</span> You successfully read this important alert message.
            <button type="button" class="close" data-dismiss="alert" aria-label="Close">
                <span aria-hidden="true">&times;</span>
            </button>
        </div>
    </div>

    <div class="col-sm-12 col-lg-6">
        <div class="card">
            <div class="card-header">
                <strong class="card-title">Liste de taches a compléter au PC!</strong>
            </div>
            <div class="card-body">
                <table id="bootstrap-data-table" class="table table-striped table-bordered">
                    <thead>
                      <tr>
                        <th>Tache</th>
                        <th>Date d'ajout</th>
                        <th>Priorité</th>
                      </tr>
                    </thead>
                    <tbody>
                        <?php foreach ($tasks as $task) {
                            echo '<tr>';
                            echo '<td>'.$task->body.'</td>';
                            echo '<td>'.$task->created_at.'</td>';
                            echo '<td>'.$task->priority.'</td>';
                            echo '</tr>';
                        } ?>
                    </tbody>
                </table>
                Ouff presque fini ...
            </div>

        </div>
    </div>
    
@endsection

@section('javascript')
<script src="assets/js/lib/data-table/datatables.min.js"></script>
<script src="assets/js/lib/data-table/dataTables.bootstrap.min.js"></script>
<script src="assets/js/lib/data-table/dataTables.buttons.min.js"></script>
<script src="assets/js/lib/data-table/buttons.bootstrap.min.js"></script>
<script src="assets/js/lib/data-table/jszip.min.js"></script>
<script src="assets/js/lib/data-table/pdfmake.min.js"></script>
<script src="assets/js/lib/data-table/vfs_fonts.js"></script>
<script src="assets/js/lib/data-table/buttons.html5.min.js"></script>
<script src="assets/js/lib/data-table/buttons.print.min.js"></script>
<script src="assets/js/lib/data-table/buttons.colVis.min.js"></script>
<script src="assets/js/lib/data-table/datatables-init.js"></script>

<script type="text/javascript">
      $('#bootstrap-data-table-export').DataTable(
        "order": [2, 'desc']
      );
</script>
@endsection
