示例#1
0
         $bool = $cod->setUsed($code11);
         $bool = $cod->setUsed($code12);
         $bool = $cod->setUsed($code13);
         $msg = "Votation Done.";
         header("Location: ../views/popularVote.php?msg={$msg}");
     }
 } else {
     if (isset($_POST["name"]) && isset($_POST["pass"]) && isset($_POST["email"]) && isset($_POST["phone"])) {
         //Editar perfil populat
         $popular = array();
         $popular["name"] = $_POST["name"];
         $popular["pass"] = $_POST["pass"];
         $popular["email"] = $_POST["email"];
         $popular["phone"] = $_POST["phone"];
         $p = new Popular();
         $boolean = $p->isValid($popular);
         if ($boolean == false) {
             $msg = "User already exists";
             header("Location: ../views/signIn.php?msg={$msg}");
         } else {
             $id = $_SESSION["name"];
             $bool = $p->update($popular, $id);
             if ($bool == true) {
                 $_SESSION["name"] = $popular["name"];
                 $msg = "Your profile was updated";
                 header("Location: ../views/signIn.php?msg={$msg}");
             } else {
                 $msg = "Server error. Try again";
                 header("Location: ../views/editProfileProfessional.php?msg={$msg}");
             }
         }