-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathportal.php
58 lines (55 loc) · 1.68 KB
/
portal.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
47
48
49
50
51
52
53
54
55
56
57
58
<?php
//view_form.php
/**
* * Descripción: Controlador principal
* *
* * Descripción extensa: Iremos añadiendo cosas complejas en PHP.
* *
* * @author Lola <[email protected]> <[email protected]>
* * @copyright 2020 Lola
* * @license http://www.fsf.org/licensing/licenses/gpl.txt GPL 2 or later
* * @version 2
* */
include(dirname(__FILE__)."/includes/pdo_postgres0.php");
$central = "";
include(dirname(__FILE__)."/partials/header.php");
include(dirname(__FILE__)."/partials/menu.php");
if (isset($_REQUEST['action'])) $action = $_REQUEST["action"];
else $action = "home";
$table="a_cliente";
switch ($action) {
case "home":
$central = "/holaMundo.php";
break;
case "login":
$central = "/partials/login.php";
break;
case "registro":
$central = "/partials/registerForm.php";
break;
case "listar":
$query = "SELECT * FROM $table ";
$rows=ejecutarSQL($query,NULL);
if (is_array($rows)) {/* Creamos un listado como una tabla HTML*/
print '<table><thead>';
foreach ( array_keys($rows[0])as $key) {
echo "<th>", $key,"</th>";
}
print "</thead>";
foreach ($rows as $row) {
print "<tr>";
foreach ($row as $key => $val) {
echo "<td>", $val, "</td>";
}
print "</tr>";
}
print "</table>";
}
break;
default:
$data["error"] = "Accion No permitida";
$central = "/holaMundo.php";
}
if ($central <> "") include(dirname(__FILE__).$central);
include(dirname(__FILE__)."/partials/footer.php");
?>