$bool = $cod->setUsed($code21); $bool = $cod->setUsed($code22); $bool = $cod->setUsed($code23); $msg = "Votation Done."; header("Location: ../views/popularVote.php?msg={$msg}"); } } else { if (isset($_POST["idp3"])) { $idp3 = $_POST["idp3"]; $ide3 = $_POST["ide3"]; $idpop3 = $_POST["idpop3"]; $code31 = $_POST["code31"]; $code32 = $_POST["code32"]; $code33 = $_POST["code33"]; $pv = new PopularValorations(); $boolean = $pv->insert($idp3, $ide3, $idpop3); if ($boolean == false) { echo "Database error: Try again"; } else { $cod = new Codes(); $bool = $cod->setUsed($code31); $bool = $cod->setUsed($code32); $bool = $cod->setUsed($code33); $msg = "Votation Done."; header("Location: ../views/popularVote.php?msg={$msg}"); } } else { if (isset($_GET["idpincho"])) { //Código para leer comentarios $idpincho = $_GET["idpincho"]; viewComments($idpincho);