@extends('layouts.app')
@section('styles')
    <style>
        .navbar,
        aside {
            /*display: none;*/
        }

         .dataTables_wrapper{margin-top: 25px !important;}

    </style>
@endsection
@section('content')

    <h3>
        Listado de Unidades Funcionales
    </h3>

    <div style="background-color:#fff;">
        <table class="table table-condensed table-data" data-order='[[ 1, "asc" ]]' data-page-length='15'>
            <thead style="border-bottom:2px solid #ddd;">
            <th class="text-center">Fecha Creación</th>

            <th>Unidad Funcional</th>
            <th>Color</th>
            <th class="text-center">Acciones</th>
            </thead>
            <tbody>
            @foreach($units as $unit)
            <tr>
                <td class="text-center" style="padding:10px 4px;">{{ date('d-m-Y H:i', strtotime(str_replace('/', '-', $unit->updated_at))) }}</td>

                <td>{{ $unit->name }}</td>
                <td><div style="padding:7px;width:100%;background-color:{{ $unit->color}};"></div></td>
                <td class="text-center">
                    <a href="{{URL::to('/')}}/admin/unit/{{ $unit->id }}/edit"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> &nbsp;Editar</a>
                    &nbsp;&nbsp;&nbsp;
                    <a href="javascript:void(0);" onclick="deleteUnidad({{ $unit->id }})"><i class="fa fa-pencil-square-o" aria-hidden="true"></i> &nbsp;Eliminar</a>
                </td>
            </tr>
                @endforeach
            </tbody>
        </table>

    </div>
{{--        {!! $units->render() !!}`--}}


    <br>

    <p class="text-center">
        <a href="{{URL::to('/')}}/admin/unit/create" class="btn btn-primary">
            Nueva Unidad funcional
        </a>
    </p>



@endsection
@section('scripts')

@endsection
