require_once "../models/popular.php"; require_once "../models/popularValorations.php"; require_once "../models/codes.php"; require_once "../models/comments.php"; require_once "../models/establishment.php"; if (isset($_GET["action"])) { $action = $_GET["action"]; if ($action == "logout") { session_start(); $_SESSION["validated"] = ""; session_destroy(); header("Location: ../index.php"); } else { if ($action == "comments") { $p = new Pincho(); $boolean = $p->selectAll(); if ($boolean == false) { $msg = "Not validated pinchos yet in system."; header("Location: ../views/comments.php?msg={$msg}"); } else { $array = serialize($boolean); header("Location: ../views/comments.php?array={$array}"); } } else { if ($action == "gastromap") { getData(); } else { echo "action no reconocida"; } } }