require_once "InterestManager.class.php"; if (!isset($_SESSION['user_id'])) { header("Location: login.php"); //Ära enne suunamist midagi rohkem tee exit; } if (isset($_GET["logout"])) { session_destroy(); header("Location: login.php"); exit; } ##HALDUS## $InterestManager = new InterestManager($mysqli, $_SESSION['user_id']); if (isset($_GET["insert"])) { $int_name = $_GET["insert"]; $InterestManager->addInterest($int_name); $interest_response = $InterestManager->addInterest($int_name); } if (isset($_GET["dropdown_interest"])) { $InterestManager->addUserInterests($_SESSION['user_id'], $_GET["dropdown_interest"]); $user_int_response = $InterestManager->addUserInterests($_SESSION['user_id'], $_GET["dropdown_interest"]); var_dump($user_int_response); } ?> Tere, <?php echo $_SESSION['user_email']; ?> <a href="?logout=1">Logi välja</a> <br>
if (!isset($_SESSION["id_from_db"])) { header("Location: login_sample.php"); //--------------------- //----OLULINE---------- //--------------------- exit; } if (isset($_GET["logout"])) { session_destroy(); header("Location: login_sample.php"); } //teen uue instantsi class InterestManagerist $InterestManager = new InterestManager($mysqli); //aadressireal on new_interest if (isset($_GET["new_interest"])) { $added_interest = $InterestManager->addInterest($_GET["new_interest"]); } if (isset($_GET["dropdownselect"])) { $added_user_interest = $InterestManager->addUserInterest($_GET["dropdownselect"], $_SESSION["id_from_db"]); } ?> <p> Tere, <?php echo $_SESSION["user_email"]; ?> <a href="?logout=1"> Logi välja </a> </p> <h2>Lisa uus huviala</h2>
require_once "InterestManager.class.php"; if (!isset($_SESSION["user_id"])) { header("Location: login.php"); exit; } if (isset($_GET["logout"])) { session_destroy(); header("Location: login.php"); exit; } //*************** //** HALDUS ***** //*************** $InterestManager = new InterestManager($mysqli, $_SESSION["user_id"]); if (isset($_GET["new_interest"])) { $add_interest_response = $InterestManager->addInterest($_GET["new_interest"]); } ?> <?php if (isset($add_interest_response->success)) { ?> <p style="color:green;"> <?php echo $add_interest_response->success->message; ?> </p> <?php } elseif (isset($add_interest_response->error)) {
require_once "functions.php"; require_once "InterestManager.class.php"; if (!isset($_SESSION["id_from_db"])) { header("Location: login.php"); } if (isset($_GET["logout"])) { session_destroy(); header("Location: login.php"); } // teen uue instansti class InterestManagerist $InterestManager = new InterestManager($mysqli); // aadressireal on new_interest if (isset($_GET["new_interest"])) { // returniga tule response muutujasse $added_interest $added_interest = $InterestManager->addInterest($_GET["new_interest"]); } //rippmenüü valiku id if (isset($_GET["dropdownselect"])) { // saadan id ja kasutaja id $added_user_interest = $InterestManager->addInterest($_GET["dropdownselect"], $_SESSION["id_from_db"]); } ?> <p> Tere, <?php echo $_SESSION["user_email"]; ?> <a href="?logout=1"> Logi välja</a> </p>