MINI MINI MANI MO
<?php $__env->startSection('title', 'Banners '); ?>
<?php $__env->startSection('vendor-style'); ?>
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('vendors/data-tables/css/jquery.dataTables.min.css')); ?>">
<link rel="stylesheet" type="text/css"
href="<?php echo e(asset('vendors/data-tables/extensions/responsive/css/responsive.dataTables.min.css')); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('vendors/data-tables/css/select.dataTables.min.css')); ?>">
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('vendors/sweetalert/sweetalert.css')); ?>">
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page-style'); ?>
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('css/pages/app-invoice.css')); ?>">
<link rel="stylesheet" href="//code.jquery.com/ui/1.13.2/themes/base/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="<?php echo e(asset('css/pages/ui.css')); ?>">
<?php $__env->stopSection(); ?>
<?php $__env->startSection('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="<?php echo e(route("mcg.banner.create")); ?>"
class="btn waves-effect waves-light invoice-create border-round z-depth-4">
<i class="material-icons">add</i>
</a>
</div>
<br>
<ul id="sortable">
</ul>
<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>Titulo</th>
<th>URL</th>
<th>Foto</th>
<th>Estatus</th>
<th>Funciones</th>
</tr>
</thead>
<?php $__currentLoopData = $banners; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
<tr>
<td><?php echo e($key+1); ?></td>
<td>
<?php echo e($item->titulo); ?>
</td>
<td>
<?php echo e($item->documento_path); ?>
</td>
<td>
<img src="<?php echo e(asset("$item->foto_path")); ?>" width="20%">
</td>
<td>
<?php if(is_null($item->deleted_at)): ?>
<span class="badge-success text-success">Activo</span>
<?php else: ?>
<span class="badge-danger text-danger">Inactivo</span>
<?php endif; ?>
</td>
<td>
<a href="<?php echo e(route("mcg.banner.edit", base64_encode(base64_encode($item->id)))); ?>">
<i class="material-icons">edit</i>
</a>
<?php if(is_null($item->deleted_at)): ?>
<?php echo Form::open(['route' => ['mcg.banner.destroy', base64_encode(base64_encode($item->id))], 'method'=>'DELETE','id' => base64_encode(base64_encode($item->id))]); ?>
<a href="javascript:{}"
onclick="eliminar('<?php echo e(base64_encode(base64_encode($item->id))); ?>')"><i
class="material-icons">delete</i></a>
<?php echo Form::close(); ?>
<?php else: ?>
<a href="<?php echo e(asset("mcg/banner/restore/" . base64_encode(base64_encode($item->id)))); ?>">
<i class="material-icons">restore</i>
</a>
<?php endif; ?>
</td>
</tr>
<?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
</table>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('vendor-script'); ?>
<script src="<?php echo e(asset('vendors/data-tables/js/jquery.dataTables.min.js')); ?>"></script>
<script src="<?php echo e(asset('vendors/data-tables/extensions/responsive/js/dataTables.responsive.min.js')); ?>"></script>
<script src="<?php echo e(asset('vendors/data-tables/js/dataTables.select.min.js')); ?>"></script>
<script src="<?php echo e(asset('vendors/sweetalert/sweetalert.min.js')); ?>"></script>
<script src="https://code.jquery.com/ui/1.13.2/jquery-ui.js"></script>
<script src="<?php echo e(asset('js/scripts/advance-ui-toasts.js')); ?>"></script>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('page-script'); ?>
<script>
$(document).ready(function () {
$.ajaxSetup({
headers: {
'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
}
});
$("#tableservicios").dataTable().fnDestroy();
$('#tableservicios').DataTable({language: datatable_esp, "ordering": true, "order": [[0, 'asc']]});
<?php if(session('delete') == 'ok'): ?>
Swal.fire({
title: 'Desactivado',
text: 'Registro desactivado correctamente',
icon: 'success',
})
<?php endif; ?>
<?php if(session('create') == 'ok'): ?>
Swal.fire({
title: 'Registrado',
text: 'Registro creado correctamente',
icon: 'success',
})
<?php endif; ?>
<?php if(session('update') == 'ok'): ?>
Swal.fire({
title: 'Actualización',
text: 'Registro actualizado correctamente',
icon: 'success',
})
<?php endif; ?>
<?php if(session('restore') == 'ok'): ?>
Swal.fire({
title: 'Restablecer',
text: 'Registro restaurado correctamente',
icon: 'success',
})
<?php endif; ?>
$("#sortable").sortable({
update: function (event, ui) {
var order = $(this).sortable("serialize");
$.ajax({
url: "<?php echo e(asset("mcg/banner/orden")); ?>",
type: "POST",
data: order,
success: function (success) {
getOrden();
}
})
}
});
getOrden();
});
function getOrden() {
$.ajax({
url: "<?php echo e(asset("mcg/banner/orden")); ?>",
type: "GET",
success: function (success) {
$("#sortable").empty();
let html = "";
$.each(success, function (i, v) {
let orden = parseInt(i) + 1;
html += '<li class="ui-state-default" id="banner-' + v.id + '">';
html += '<span class="ui-icon ui-icon-arrowthick-2-n-s"></span>';
html += orden + '.-' + v.titulo;
html += '</li>';
});
$("#sortable").append(html);
M.toast({
html: '¡Orden actualizado!',
classes: 'rounded',
displayLength: 1000
});
}
})
}
function eliminar(id) {
Swal.fire({
title: "¿Está seguro?",
text: "Al oprimir el botón de aceptar se desactivará el banner",
icon: 'warning',
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Aceptar'
}).then((result) => {
if (result.isConfirmed) {
document.getElementById(id).submit();
}
})
}
</script>
<?php $__env->stopSection(); ?>
<?php echo $__env->make('../Administrador/layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/legislaedomex/public_html/saplxi/resources/views/Administrador/banner/index.blade.php ENDPATH**/ ?>
OHA YOOOO