@@ -78,7 +78,7 @@ class Filters extends BaseConfig | |||||
* @var array | * @var array | ||||
*/ | */ | ||||
public $filters = [ | public $filters = [ | ||||
'inicio' => ['before' => ['/', '/horas']], | |||||
'inicio' => ['before' => ['/',]], | |||||
'formulario_inicial' => ['before' => ['registro/']] | 'formulario_inicial' => ['before' => ['registro/']] | ||||
]; | ]; | ||||
} | } |
@@ -63,6 +63,9 @@ class Prestador extends BaseController | |||||
$data['id'] = user()->rh_prestador_solicitud_id; | $data['id'] = user()->rh_prestador_solicitud_id; | ||||
} | } | ||||
// Poner status de revisión (0) | |||||
$data['status'] = 0; | |||||
// Validar datos | // Validar datos | ||||
if (!$prestadorModel->save($data)) { | if (!$prestadorModel->save($data)) { | ||||
return redirect()->back()->withInput()->with('errors', $prestadorModel->errors()); | return redirect()->back()->withInput()->with('errors', $prestadorModel->errors()); | ||||
@@ -22,7 +22,7 @@ class FormularioInicialFilter implements FilterInterface | |||||
{ | { | ||||
// Usuario ya contestó el formulario y fue aprobado | // Usuario ya contestó el formulario y fue aprobado | ||||
if (user()->idprestador) { | if (user()->idprestador) { | ||||
return redirect('/'); | |||||
return redirect()->route('home'); | |||||
} | } | ||||
} | } | ||||
@@ -2,6 +2,7 @@ | |||||
namespace App\Filters; | namespace App\Filters; | ||||
use App\Models\PrestadorSolicitudModel; | |||||
use App\Models\UserModel; | use App\Models\UserModel; | ||||
use CodeIgniter\Filters\FilterInterface; | use CodeIgniter\Filters\FilterInterface; | ||||
use CodeIgniter\HTTP\RequestInterface; | use CodeIgniter\HTTP\RequestInterface; | ||||
@@ -29,8 +30,14 @@ class InicioFilter implements FilterInterface | |||||
return redirect('registro'); | return redirect('registro'); | ||||
} | } | ||||
// Ya registró sus datos, está pendiente la aprobación de RH | |||||
return \Config\Services::response()->setBody(view('Prestador/success')); | |||||
// Ya registr� sus datos, est� pendiente la aprobaci�n de RH | |||||
// Ver status de la solicitud | |||||
$status = model(PrestadorSolicitudModel::class)->find(user()->rh_prestador_solicitud_id)['status']; | |||||
if ($status == 0) // aún no ha sido aprobada | |||||
return \Config\Services::response()->setBody(view('Prestador/success')); | |||||
else if ($status == 2) | |||||
return \Config\Services::response()->setBody(view('Prestador/registroNoAprobado')); | |||||
} | } | ||||
} | } | ||||
@@ -60,7 +60,7 @@ class PrestadorSolicitudModel extends Model | |||||
return $this | return $this | ||||
->where('status', 0) | ->where('status', 0) | ||||
->orWhere('status', 2) | ->orWhere('status', 2) | ||||
->orderBy('id ASC, status DESC') | |||||
->orderBy('status ASC, id ASC') | |||||
->findAll(); | ->findAll(); | ||||
} | } | ||||
return $this->where('id', $id)->first(); | return $this->where('id', $id)->first(); | ||||
@@ -21,7 +21,7 @@ | |||||
<tbody> | <tbody> | ||||
<?php foreach ($solicitudes as $solicitud) : ?> | <?php foreach ($solicitudes as $solicitud) : ?> | ||||
<tr> | |||||
<tr class="<?= $solicitud['status'] == 2 ? 'table-danger' : '' ?>"> | |||||
<td><?= $solicitud['nombre'] . ' ' . $solicitud['apaterno'] . ' ' . $solicitud['amaterno'] ?></td> | <td><?= $solicitud['nombre'] . ' ' . $solicitud['apaterno'] . ' ' . $solicitud['amaterno'] ?></td> | ||||
<td><?= $solicitud['email'] ?></td> | <td><?= $solicitud['email'] ?></td> | ||||
<td><?= $solicitud['status'] == 0 ? 'Por aprobar' : 'Rechazada' ?></td> | <td><?= $solicitud['status'] == 0 ? 'Por aprobar' : 'Rechazada' ?></td> | ||||
@@ -46,16 +46,24 @@ | |||||
'searching': true, | 'searching': true, | ||||
'ordering': true, | 'ordering': true, | ||||
'language': { | 'language': { | ||||
"decimal": "", | |||||
"emptyTable": "No hay información", | |||||
"info": "Mostrando _START_ a _END_ de _TOTAL_ registros", | |||||
"infoEmpty": "Mostrando 0 to 0 of 0 registros", | |||||
"infoFiltered": "(Filtrado de _MAX_ total registros)", | |||||
"infoPostFix": "", | |||||
"thousands": ",", | |||||
"lengthMenu": "Mostrar _MENU_ registros", | "lengthMenu": "Mostrar _MENU_ registros", | ||||
"info": "Página: _PAGE_ / _PAGES_", | |||||
"zeroRecords": "No se encontraron registros", | |||||
"loadingRecords": "Cargando...", | |||||
"processing": "Procesando...", | |||||
"search": "Buscar:", | |||||
"zeroRecords": "No se encontraron resultados", | |||||
"paginate": { | "paginate": { | ||||
"first": "Inicio", | |||||
"last": "Fin", | |||||
"next": ">", | |||||
"previous": "<" | |||||
}, | |||||
'search': 'Buscar:', | |||||
"first": "Primero", | |||||
"last": "Ultimo", | |||||
"next": "Siguiente", | |||||
"previous": "Anterior" | |||||
} | |||||
}, | }, | ||||
'order': [], | 'order': [], | ||||
}); | }); | ||||
@@ -191,9 +191,9 @@ | |||||
<?php if (isset($revisar)) : ?> | <?php if (isset($revisar)) : ?> | ||||
<!-- BOTONES PARA APROBAR / RECHAZAR SOLICITUD--> | <!-- BOTONES PARA APROBAR / RECHAZAR SOLICITUD--> | ||||
<div class="text-end"> | <div class="text-end"> | ||||
<a href="" class="btn btn-primary">Regresar a lista</a> | |||||
<a href="<?= route_to('admin_solicitudes') ?>" class="btn btn-primary">Regresar a lista</a> | |||||
<button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#rechazarModal"> | <button type="button" class="btn btn-danger" data-bs-toggle="modal" data-bs-target="#rechazarModal"> | ||||
Launch demo modal | |||||
Rechazar solicitud | |||||
</button> | </button> | ||||
<a href="<?= route_to('admin_solicitud_aprobar', $id) ?>" class="btn btn-success">Aprobar solicitud</a> | <a href="<?= route_to('admin_solicitud_aprobar', $id) ?>" class="btn btn-success">Aprobar solicitud</a> | ||||
</div> | </div> | ||||
@@ -201,7 +201,7 @@ | |||||
<!-- BOTONES PARA ENVIAR O EDITAR --> | <!-- BOTONES PARA ENVIAR O EDITAR --> | ||||
<div class="text-end"> | <div class="text-end"> | ||||
<?php if ($datos) : ?> | <?php if ($datos) : ?> | ||||
<a class="btn btn-danger me-3" href="<?= route_to('/') ?>">Cancelar</a> | |||||
<a class="btn btn-danger me-3" href="<?= route_to('home') ?>">Cancelar</a> | |||||
<?php endif ?> | <?php endif ?> | ||||
<button class="btn btn-primary" type="submit"><?= !empty($datos) ? 'Actualizar' : 'Enviar' ?></button> | <button class="btn btn-primary" type="submit"><?= !empty($datos) ? 'Actualizar' : 'Enviar' ?></button> | ||||
</div> | </div> | ||||
@@ -0,0 +1,17 @@ | |||||
<?= $this->extend('templates/base') ?> | |||||
<!-- title --> | |||||
<?= $this->section('title') ?>Prestador<?= $this->endSection() ?> | |||||
<!-- content --> | |||||
<?= $this->section('content') ?> | |||||
<h1>Tu solicitud no ha sido aprobada</h1> | |||||
<h5>Revisa tu correo electrónico para consultar el motivo por el que esta fue rechazada.</h5> | |||||
<h6> | |||||
Puedes | |||||
<a href="<?= route_to('registro') ?>">corregir tus datos</a> | |||||
y enviarlos nuevamente a revisión. | |||||
</h6> | |||||
<?= $this->endSection() ?> |
@@ -26,7 +26,7 @@ scratch. This page gets rid of all links and provides the needed markup only. | |||||
<!-- Main Sidebar Container --> | <!-- Main Sidebar Container --> | ||||
<aside class="main-sidebar sidebar-dark-primary elevation-4"> | <aside class="main-sidebar sidebar-dark-primary elevation-4"> | ||||
<!-- Brand Logo --> | <!-- Brand Logo --> | ||||
<a href="index3.html" class="brand-link"> | |||||
<a href="<?= route_to('admin_home') ?>" class="brand-link"> | |||||
<img src="dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3" style="opacity: .8"> | <img src="dist/img/AdminLTELogo.png" alt="AdminLTE Logo" class="brand-image img-circle elevation-3" style="opacity: .8"> | ||||
<span class="brand-text font-weight-light">COPARMEX</span> | <span class="brand-text font-weight-light">COPARMEX</span> | ||||
</a> | </a> | ||||
@@ -34,14 +34,6 @@ scratch. This page gets rid of all links and provides the needed markup only. | |||||
<!-- Sidebar --> | <!-- Sidebar --> | ||||
<div class="sidebar"> | <div class="sidebar"> | ||||
<!-- Sidebar user panel (optional) --> | <!-- Sidebar user panel (optional) --> | ||||
<div class="user-panel mt-3 pb-3 mb-3 d-flex"> | |||||
<div class="image"> | |||||
<img src="dist/img/user2-160x160.jpg" class="img-circle elevation-2" alt="User Image"> | |||||
</div> | |||||
<div class="info"> | |||||
<a href="#" class="d-block">Administrador</a> | |||||
</div> | |||||
</div> | |||||
<!-- Sidebar Menu --> | <!-- Sidebar Menu --> | ||||
@@ -49,7 +41,7 @@ scratch. This page gets rid of all links and provides the needed markup only. | |||||
<ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false"> | <ul class="nav nav-pills nav-sidebar flex-column" data-widget="treeview" role="menu" data-accordion="false"> | ||||
<!-- Add icons to the links using the .nav-icon class | <!-- Add icons to the links using the .nav-icon class | ||||
with font-awesome or any other icon font library --> | with font-awesome or any other icon font library --> | ||||
<li class="nav-item"> | |||||
<li class="nav-item menu-open"> | |||||
<a href="" class="nav-link"> | <a href="" class="nav-link"> | ||||
<i class="nav-icon fas fa-users"></i> | <i class="nav-icon fas fa-users"></i> | ||||
Prestadores | Prestadores | ||||
@@ -1,6 +1,6 @@ | |||||
<nav class="navbar navbar-expand-lg navbar-dark bg-dark px-5"> | <nav class="navbar navbar-expand-lg navbar-dark bg-dark px-5"> | ||||
<div class="container-fluid"> | <div class="container-fluid"> | ||||
<a class="navbar-brand" href="<?= route_to('/') ?>">COPARMEX</a> | |||||
<a class="navbar-brand" href="<?= route_to('home') ?>">COPARMEX</a> | |||||
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> | <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarSupportedContent" aria-controls="navbarSupportedContent" aria-expanded="false" aria-label="Toggle navigation"> | ||||
<span class="navbar-toggler-icon"></span> | <span class="navbar-toggler-icon"></span> | ||||
</button> | </button> | ||||