MINI MINI MANI MO

Path : /var/www/html/sistemas/saplxi/resources/views/Administrador/gaceta/
File Upload :
Current File : /var/www/html/sistemas/saplxi/resources/views/Administrador/gaceta/index.blade.php

{{-- layout extend --}}
@extends('../Administrador/layouts.app')

{{-- page title --}}
@section('title', 'MCG - Gaceta')

@section('vendor-style')
    <link rel="stylesheet" type="text/css" href="{{asset('vendors/data-tables/css/jquery.dataTables.min.css')}}">
    <link rel="stylesheet" type="text/css"
          href="{{asset('vendors/data-tables/extensions/responsive/css/responsive.dataTables.min.css')}}">
    <link rel="stylesheet" type="text/css" href="{{asset('vendors/data-tables/css/select.dataTables.min.css')}}">
    <link rel="stylesheet" type="text/css" href="{{asset('vendors/sweetalert/sweetalert.css')}}">
@endsection

{{-- page styles --}}
@section('page-style')
    <link rel="stylesheet" type="text/css" href="{{asset('css/pages/app-invoice.css')}}">
@endsection

@section('content')
    <!-- invoice list -->
    <section class="invoice-list-wrapper section">
        <!-- create invoice button-->
        <!-- Options and filter dropdown button-->
        <div class="seaction">
            <div class="row">
                <div class="col s12 m12 l12">
                    <div id="button-trigger2" class="card card card-default scrollspy">
                        <div class="card-content">
                            <!-- create invoice button-->
                            <div class="invoice-create-btn">
                                <a href="{{route('mcg.gaceta.create')}}"
                                   class="btn waves-effect waves-light invoice-create border-round z-depth-4">
                                    <i class="material-icons">add</i>
                                    <span class="hide-on-small-only">Registrar Iniciativa</span>
                                </a>
                            </div>
                            <br>
                            <div class="responsive-table">
                                <table class="table invoice-data-table white border-radius-4 pt-1" id="tableservicios">
                                    <thead>
                                    <tr>
                                        <th>
                                            <span>#</span>
                                        </th>
                                        <th>Fecha</th>
                                        <th>Número</th>
                                        <th>Documento</th>
                                        <th>Opciones</th>
                                    </tr>
                                    </thead>

                                    <tbody>

                                    @foreach ($data as $key => $item)
                                        <tr>
                                            <td>{{ $key+1 }}</td>
                                            <td>{{ $item->date }}</td>
                                            <td>{{$item->numero}}</td>
                                            <td><a href="{{asset("storage/documentos/gaceta/".$item->documento)}}"><i class="material-icons">visibility</i></a></td>
                                            <td>
                                                <div class="invoice-action">
                                                    <a href="{{route('mcg.gaceta.edit',base64_encode(base64_encode($item->id)))}}"
                                                       class="invoice-action-edit">
                                                        <i class="material-icons">edit</i>
                                                    </a>
                                                    {!! Form::open(['route' => ['mcg.gaceta.destroy', base64_encode(base64_encode($item->id))], 'method'=>'DELETE','id' => base64_encode(base64_encode($item->id))]) !!}
                                                    <a href="javascript:{}"
                                                       onclick="eliminar('{{base64_encode(base64_encode($item->id))}}')"><i
                                                            class="material-icons">delete</i></a>
                                                    {!! Form::close() !!}
                                                </div>
                                            </td>
                                        </tr>
                                    @endforeach

                                    </tbody>
                                </table>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </section>
@endsection
@section('vendor-script')
    <script src="{{asset('vendors/data-tables/js/jquery.dataTables.min.js')}}"></script>
    <script src="{{asset('vendors/data-tables/extensions/responsive/js/dataTables.responsive.min.js')}}"></script>
    <script src="{{asset('vendors/data-tables/js/dataTables.select.min.js')}}"></script>
    <script src="{{asset('vendors/sweetalert/sweetalert.min.js')}}"></script>
@endsection
{{-- page script --}}
@section('page-script')
    <script>
        $(document).ready(function () {
            $("#tableservicios").dataTable().fnDestroy();
            $('#tableservicios').DataTable({
                language: datatable_esp,
                "ordering": true,
                "order": [[0, 'desc']],
                "columnDefs": [
                    {"width": "20%", "targets": 4}
                ]
            });

            @if(session('delete') == 'ok')
            Swal.fire({
                title: 'Operación exitosa',
                text: 'Registro eliminado correctamente',
                icon: 'success',

            })
            @endif
        });

        function eliminar(id) {
            Swal.fire({
                title: "¿Está seguro?",
                text: "Al oprimir el botón de aceptar se eliminará el registro",
                icon: 'warning',
                buttons: {
                    cancel: true,
                    delete: 'Aceptar'
                }
            }).then(function (willDelete) {
                if (willDelete) {
                    document.getElementById(id).submit();
                }
            });

        }
    </script>
@endsection

OHA YOOOO