コード例 #1
0
     //if pool has NOT yet been scored:
     if ($pool_fetch_result['Multiple Choice?'] == 0) {
         //if pool is NOT multiple choice:
         echo "<h3>Pool has ended.  Waiting on pool leader to tally the score</h3>";
         if ($user_is_leader == 1) {
             echo "<br><h4><a href='score_pool_manual.php?pool_id=" . $pool_id . "'>Click here to tally the pool's score</a></h4>";
         }
     } else {
         //if pool was multiple choice:
         if (isset($pool_fetch_result['Template ID'])) {
             //if pool was a pre-canned template:
             echo "<h4>Pool results are being calculated.  Please check back again soon.</h4>";
             //**BEGIN ADMIN TEMPLATE SCORE LINK (ONLY FOR USER_ID=1**)
             include_once 'inc/class.users.inc.php';
             $user = new SiteUser();
             $current_user_id = $user->GetUserIDFromEmail($_SESSION['Username']);
             if ($current_user_id == 1) {
                 echo "<h4><a href='score_pool_manual.php?pool_id=" . $pool_id . "'>Click here to mark the correct answers (INTERNAL)</a></h4>";
             }
             //**END OF ADMIN TEMPLATE SCORE LINK**
         } else {
             //if pool was NOT a pre-canned template, the leader needs to mark the correct picks manually:
             echo "<h3>Pool has ended.  Waiting on pool leader to tally the score</h3>";
             if ($user_is_leader == 1) {
                 echo "<br><h4><a href='score_pool_manual.php?pool_id=" . $pool_id . "'>Click here to mark the correct answers</a></h4>";
             }
         }
     }
 } else {
     //if pool HAS been scored:
     $pool_rankings_array = $pool->GetFinalPoolRankings($pool_id);
コード例 #2
0
ファイル: invite_people.php プロジェクト: epsilon670/Poolski
        $invite_receive_result = $user->InviteReceive($invitee_email, $pool_id, $inviter);
        //add pool id to user's "Pool Invites" field in DB
        echo $invite_receive_result;
    }
    exit;
} else {
    //if this file is being accessed by user navigation and not thru ajax:
    if (!isset($current_user)) {
        /*We send the user back to home page if $current_user is not set 
          This would indicate that the user is trying to access invite_people.php by itself and not via the pool.php page
          */
        header("Location: home.php");
    } else {
        $inviter = $current_user;
        //get the inviter's email address/username (this is so that the invitee knows who is inviting them)
        $user_id = $user->GetUserIDFromEmail($inviter);
        $users_friends_array = $user->GetFriends($user_id);
        ?>
    <br>
    <div class="row" >
        <div class="col-md-7" id="invite_email_input_container">
            <h3>Enter email addresses to invite people to the pool:</h3>
            <br>
            <div id="invitee_email_form">   
                    <input type="text" name="new_invitee_email" id="new_invitee_email" size="75" required>
                    <input id="submit_invitee_email" type="submit" value="Add to invite list">
                    <span id="invite_error_message" style='color:red'></span>
            </div>
            <br>
            <div id="invitee_email_list">
コード例 #3
0
ファイル: new.php プロジェクト: epsilon670/Poolski
<?php

include_once "inc/loggedin_check.php";
include_once "inc/constants.inc.php";
$pageTitle = "New Pool";
include_once "inc/header.php";
$user = new SiteUser();
$current_user = $_SESSION['Username'];
$current_user_id = $user->GetUserIDFromEmail($current_user);
?>
<br>
<div style="text-align: center">
    <h1>Create New Pool</h1>
    <h4>You are presented with a choice...</h4>
</div>

<div id="container">
    <div class="row" style="padding:5%;">
        <div class="col-sm-6 col-md-6">
            <div class="thumbnail">
                <div class="caption">
                    <h3>Create pool from existing template</h3>
                    <p>Choose one of our many pool templates.  We create all of the categories and mark answers correct so that you don't have to.</p>
                    <br>
                    <p><a href="browse_templates.php" class="btn btn-lg btn-primary center-block" role="button">Browse Templates</a> </p>
                </div>
            </div>
        </div>
        <div class="col-sm-6 col-md-6">
            <div class="thumbnail">
                <div class="caption">
コード例 #4
0
ファイル: password.php プロジェクト: epsilon670/Poolski
<?php

include_once "inc/constants.inc.php";
$pageTitle = "Forgot Password?";
include_once "inc/header.php";
if (!empty($_POST['username'])) {
    $entryValue = $_POST['username'];
    //check to make sure email address is valid
    if (preg_match("/^.+@.+\\..+\$/", $entryValue)) {
        //if email is valid:
        include_once "inc/class.users.inc.php";
        $user = new SiteUser();
        $user_id = $user->GetUserIDFromEmail($entryValue);
        if (isset($user_id)) {
            //if an account for the given email exists:
            $reset_password_result = $user->ResetPassword($user_id, $entryValue);
            echo "<h4 style='color:#5cb85c; margin-left:20px;'>We have sent a link to reset your password to your email address.</h4>";
            exit;
        } else {
            //if no account exists for this email:
            echo "<p style='color:red; margin-left:20px;'>No account exists for that email address.  Please try again.</p>";
        }
    } else {
        //if email is not valid:
        echo "<p style='color:red; margin-left:20px;'>Please enter a valid email address</p>";
    }
}
//if page loads and form is blank:
?>