-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
46 lines (41 loc) · 973 Bytes
/
index.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<!DOCTYPE html>
<html lang="en">
<head>
<?php
include_once("./app/views/includes/metatags.php");
?>
<?php
include_once("./app/views/includes/scripts.php");
?>
</head>
<body class="bg-dark text-light">
<?php
require_once "./app/model/crud.class.php";
$conexion = new Crud();
if (isset($_GET['view'])) {
switch ($_GET['view']) {
case 'create':
require_once './app/views/create.php';
break;
case 'read':
$datos = $conexion->mostrar();
require_once './app/views/read.php';
break;
case 'update':
$datos = $conexion->buscar($_REQUEST["id"]);
require_once './app/views/actualizar.php';
break;
case 'delete':
$eliminar = $conexion->eliminar($_REQUEST['id']);
header('location: /read');
break;
default:
header('location: /read');
break;
}
} else {
include_once './app/views/home.php';
}
?>
</body>
</html>