Zona admin

This commit is contained in:
2020-05-26 23:04:49 -04:00
parent d0aba43371
commit 31f308f5c7
26 changed files with 1291 additions and 1 deletions

View File

@ -0,0 +1,16 @@
<?php
$app->group('/admin', function($app) {
$folder = implode(DIRECTORY_SEPARATOR, [
__DIR__,
'admin'
]);
if (file_exists($folder)) {
$files = new DirectoryIterator($folder);
foreach ($files as $file) {
if ($file->isDir()) {
continue;
}
include_once $file->getRealPath();
}
}
});

View File

@ -0,0 +1,8 @@
<?php
use ProVM\KI\Common\Controller\Web\Admin\Faq;
$app->group('/faqs', function($app) {
$app->post('/add', [Faq::class, 'add']);
$app->post('/delete', [Faq::class, 'delete']);
$app->get('[/]', Faq::class);
});

View File

@ -0,0 +1,13 @@
<?php
use ProVM\KI\Common\Controller\Web\Admin\Home;
$app->group('/home', function($app) {
$app->group('/avisos', function($app) {
$app->post('/add', [Home::class, 'add']);
$app->post('/delete', [Home::class, 'delete']);
});
$app->group('/resumen', function($app) {
$app->post('/edit', [Home::class, 'edit']);
});
$app->get('[/]', Home::class);
});

View File

@ -0,0 +1,7 @@
<?php
use ProVM\KI\Common\Controller\Web\Admin\Nosotros;
$app->group('/nosotros', function($app) {
$app->post('[/]', [Nosotros::class, 'guardar']);
$app->get('[/]', Nosotros::class);
});

View File

@ -0,0 +1,24 @@
<?php
use ProVM\KI\Common\Controller\Web\Admin\Productos;
$app->group('/productos', function($app) {
$app->group('/add', function($app) {
$app->get('[/]', [Productos::class, 'add']);
$app->post('[/]', [Productos::class, 'do_add']);
});
$app->get('[/]', Productos::class);
});
$app->group('/producto/{producto}', function($app) {
$app->group('/imagen', function($app) {
$app->post('/delete', [Productos::class, 'delete_image']);
});
$app->group('/imagenes', function($app) {
$app->post('/add', [Productos::class, 'add_image']);
});
$app->group('/video', function($app) {
$app->post('/set', [Productos::class, 'set_video']);
$app->post('/delete', [Productos::class, 'delete_video']);
});
$app->post('[/]', [Productos::class, 'do_edit']);
$app->get('[/]', [Productos::class, 'edit']);
});