diff --git a/app/Config/Routes.php b/app/Config/Routes.php index 4c51808..108de47 100644 --- a/app/Config/Routes.php +++ b/app/Config/Routes.php @@ -59,6 +59,9 @@ $routes->get('admin/logout', 'AdminAuth::logout', ['as' => 'admin_logout']); $routes->group('admin', ['filter' => 'admin_filter'], static function ($routes) { $routes->get('/', 'Admin::home', ['as' => 'admin_home']); + // PRESTADORES + $routes->get('prestadores/', 'Admin::prestadores', ['as' => 'admin_prestadores']); + // SOLICITUDES $routes->get('solicitudes/', 'Admin::solicitudes', ['as' => 'admin_solicitudes']); $routes->post('solicitud/rechazar/(:segment)', 'Admin::rechazarSolicitud/$1', ['as' => 'admin_solicitud_rechazar']); diff --git a/app/Controllers/Admin.php b/app/Controllers/Admin.php index 744aaf2..e2e34de 100644 --- a/app/Controllers/Admin.php +++ b/app/Controllers/Admin.php @@ -21,6 +21,12 @@ class Admin extends BaseController return view('Admin/index', $data); } + // PRESTADORES + public function prestadores() + { + $prestadores = model(PrestadorModel::class)->getPrestadoresActivos(); + return view('Admin/prestadores', ['prestadores' => $prestadores]); + } // SOLICITUDES public function solicitudes() diff --git a/app/Models/PrestadorModel.php b/app/Models/PrestadorModel.php index 3217fac..fa90bcf 100644 --- a/app/Models/PrestadorModel.php +++ b/app/Models/PrestadorModel.php @@ -27,6 +27,13 @@ class PrestadorModel extends Model return $this->where('idprestador', $id)->first(); } + public function getPrestadoresActivos() + { + return $this + ->where('status', 0) + ->findAll(); + } + function countPrestadoresActivos() { return $this diff --git a/app/Views/Admin/index.php b/app/Views/Admin/index.php index c2aad8c..494f621 100644 --- a/app/Views/Admin/index.php +++ b/app/Views/Admin/index.php @@ -29,7 +29,7 @@
- + Ver lista diff --git a/app/Views/Admin/prestadores.php b/app/Views/Admin/prestadores.php new file mode 100644 index 0000000..5555b01 --- /dev/null +++ b/app/Views/Admin/prestadores.php @@ -0,0 +1,66 @@ +extend('templates/baseAdmin') ?> + +section('content') ?> + +

lista de prestadores

+ + + + + + +
+
+ + + + + + + + + + + + + + + + + +
NombreTipo
+ +
+
+ + + +endSection() ?> \ No newline at end of file diff --git a/app/Views/templates/baseAdmin.php b/app/Views/templates/baseAdmin.php index 9a67738..425f9ae 100644 --- a/app/Views/templates/baseAdmin.php +++ b/app/Views/templates/baseAdmin.php @@ -51,7 +51,7 @@ scratch. This page gets rid of all links and provides the needed markup only.