} } else { if ($action == "gastromap") { getData(); } else { echo "action no reconocida"; } } } } else { if (isset($_POST["code1"]) && isset($_POST["code2"]) && isset($_POST["code3"])) { $code1 = $_POST["code1"]; $code2 = $_POST["code2"]; $code3 = $_POST["code3"]; $c = new Codes(); $bool = $c->check($code1); if ($bool == false) { $msg = "Some code not found in system."; header("Location: ../views/popularVote.php?msg={$msg}"); } else { $idp1 = $bool[0]["Pincho_code"]; $ide1 = $bool[0]["Pincho_Establishment_idEstablishment"]; $idpop1 = $bool[0]["Popular_idPopular"]; $bool = $c->check($code2); if ($bool == false) { $msg = "Some code not found in system."; header("Location: ../views/popularVote.php?msg={$msg}"); } else { $idp2 = $bool[0]["Pincho_code"]; $ide2 = $bool[0]["Pincho_Establishment_idEstablishment"]; $idpop2 = $bool[0]["Popular_idPopular"];