74 行
3.0 KiB
PHP
74 行
3.0 KiB
PHP
<?= $this->extend('templates/baseAdmin') ?>
|
|
|
|
<?= $this->section('content') ?>
|
|
|
|
<table class="table table-striped" style="table-layout: fixed; word-wrap: break-word;">
|
|
<thead class="">
|
|
<th>Título</th>
|
|
<th colspan="3">Descripción</th>
|
|
<th>Opciones</th>
|
|
</thead>
|
|
<tbody>
|
|
<?php foreach ($encuestas as $encuesta) : ?>
|
|
<tr>
|
|
<td><?= esc($encuesta['title']) ?></td>
|
|
<td colspan="3"><?= esc($encuesta['description']) ?></td>
|
|
<td>
|
|
<div class="button-group mr-2" role="group">
|
|
<a href="<?= route_to('admin_encuesta_editar', $encuesta['id']) ?>" class="btn btn-info ">
|
|
<i class="nav-icon fas fa-edit"></i>
|
|
</a>
|
|
<a href="<?= route_to('admin_encuesta', $encuesta['id']) ?>" class="btn btn-success ">
|
|
<i class="nav-icon fas fa-eye"></i>
|
|
</a>
|
|
<button type="button" class="btn btn-danger" data-toggle="modal" data-target="#eliminarModal" data-id="<?= $encuesta['id'] ?>" data-title="<?= $encuesta['title'] ?>" data-link="<?= route_to('admin_encuesta_eliminar', $encuesta['id']) ?>">
|
|
<i class="nav-icon fas fa-trash"></i>
|
|
|
|
</button>
|
|
|
|
</div>
|
|
</td>
|
|
</tr>
|
|
<?php endforeach ?>
|
|
</tbody>
|
|
</table>
|
|
|
|
<!-- Modal: eliminar encuesta -->
|
|
<div class="modal fade" id="eliminarModal" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
|
|
<div class="modal-dialog" role="document">
|
|
<div class="modal-content">
|
|
<div class="modal-header">
|
|
<h5 class="modal-title" id="exampleModalLabel">Eliminar Encuesta</h5>
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
|
<span aria-hidden="true">×</span>
|
|
</button>
|
|
</div>
|
|
<div class="modal-body">
|
|
</div>
|
|
<div class="modal-footer">
|
|
<button type="button" class="btn btn-secondary" data-dismiss="modal">Cancelar</button>
|
|
<a href="#" id="eliminar-link" class="btn btn-danger">Eliminar</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="plugins/jquery/jquery.min.js"></script>
|
|
|
|
<script>
|
|
$(document).ready(function() {
|
|
$('#eliminarModal').on('show.bs.modal', (event) => {
|
|
let button = $(event.relatedTarget)
|
|
let encuestaId = button.data('id')
|
|
let encuestaTitle = button.data('title')
|
|
let encuestaLink = button.data('link')
|
|
|
|
let modal = $(this)
|
|
// modal.find('.modal-title').text('New message to ' + recipient)
|
|
modal.find('.modal-body').text('Eliminar: ' + encuestaTitle)
|
|
modal.find('#eliminar-link').attr('href', encuestaLink)
|
|
})
|
|
|
|
})
|
|
</script>
|
|
|
|
<?= $this->endSection() ?>
|