コード例 #1
0
ファイル: index.php プロジェクト: rbianco3/phppickem
     echo '			<td>' . date('n/j g:i a', strtotime($result['cutoffTime'])) . '</td>' . "\n";
     if ($result['expired']) {
         //if week is expired, show score (if scores are entered)
         if ($lastCompletedWeek >= (int) $result['weekNum']) {
             //scores entered, show score
             $weekTotal = getGameTotal($result['weekNum']);
             //get player score
             $userScore = getUserScore($result['weekNum'], $user->userID);
             echo '			<td class="lighter" style="color: #000;">Score: ' . $userScore . '/' . $weekTotal . ' (' . number_format($userScore / $weekTotal * 100, 2) . '%)</td>' . "\n";
         } else {
             //scores not entered, show ???
             echo '			<td class="lighter" style="color: #000;">week closed, scores not entered.</td>' . "\n";
         }
     } else {
         //week is not expired yet, check to see if all picks have been entered
         $picks = getUserPicks($result['weekNum'], $user->userID);
         if (sizeof($picks) < (int) $result['gamesTotal']) {
             //not all picks were entered
             $tmpStyle = '';
             if ((int) $currentWeek == (int) $result['weekNum']) {
                 //only show in red if this is the current week
                 $tmpStyle = ' style="color: red;"';
             }
             echo '			<td class="lighter"' . $tmpStyle . '>Missing ' . ((int) $result['gamesTotal'] - sizeof($picks)) . ' / ' . $result['gamesTotal'] . ' picks.  <a href="entry_form.php?week=' . $result['weekNum'] . '">enter now &gt;&gt;</a></td>' . "\n";
         } else {
             //all picks were entered
             echo '			<td class="lighter" style="color: green;">All picks entered.</td>' . "\n";
         }
     }
     $i++;
 }
コード例 #2
0
ファイル: entry_form.php プロジェクト: gammadean/phppickem
?>
		<div class="row">
			<div class="col-md-4 col-xs-12 col-right">
<?php 
include 'includes/column_right.php';
?>
			</div>
			<div id="content" class="col-md-8 col-xs-12">
				<h2>Week <?php 
echo $week;
?>
 - Make Your Picks:</h2>
				<p>Please make your picks below for each game.</p>
	<?php 
//get existing picks
$picks = getUserPicks($week, $user->userID);
$pickSummary = get_pick_summary($user->userID, $week);
//get show picks status
$showPicks = (int) $pickSummary['showPicks'];
//display schedule for week
$sql = "select s.*, (DATE_ADD(NOW(), INTERVAL " . SERVER_TIMEZONE_OFFSET . " HOUR) > gameTimeEastern or DATE_ADD(NOW(), INTERVAL " . SERVER_TIMEZONE_OFFSET . " HOUR) > '" . $cutoffDateTime . "')  as expired ";
$sql .= "from " . DB_PREFIX . "schedule s ";
$sql .= "inner join " . DB_PREFIX . "teams ht on s.homeID = ht.teamID ";
$sql .= "inner join " . DB_PREFIX . "teams vt on s.visitorID = vt.teamID ";
$sql .= "where s.weekNum = " . $week . " ";
$sql .= "order by s.gameTimeEastern, s.gameID";
//echo $sql;
$query = $mysqli->query($sql) or die($mysqli->error);
if ($query->num_rows > 0) {
    echo '<form name="entryForm" action="entry_form.php" method="post" onsubmit="return checkform();">' . "\n";
    echo '<input type="hidden" name="week" value="' . $week . '" />' . "\n";
コード例 #3
0
ファイル: index.php プロジェクト: numericOverflow/phppickem
 //echo '		</tr>'."\n";
 if ($row['expired']) {
     //if week is expired, show score (if scores are entered)
     if ($lastCompletedWeek >= (int) $row['weekNum']) {
         //scores entered, show score
         $weekTotal = getGameTotal($row['weekNum']);
         //get player score
         $userScore = getUserScore($row['weekNum'], $user->userID);
         echo '			<div class="bg-info"><b>Score: ' . $userScore . '/' . $weekTotal . ' (' . number_format($userScore / $weekTotal * 100, 2) . '%)</b><br /><a href="results.php?week=' . $row['weekNum'] . '">See Results &raquo;</a></div>' . "\n";
     } else {
         //scores not entered, show ???
         echo '			<div class="bg-info">Week is closed,</b> but scores have not yet been entered.<br /><a href="results.php?week=' . $row['weekNum'] . '">See Results &raquo;</a></div>' . "\n";
     }
 } else {
     //week is not expired yet, check to see if all picks have been entered
     $picks = getUserPicks($row['weekNum'], $user->userID);
     if (sizeof($picks) < (int) $row['gamesTotal']) {
         //not all picks were entered
         $tmpStyle = '';
         if ((int) $currentWeek == (int) $row['weekNum']) {
             //only show in red if this is the current week
             $tmpStyle = ' style="color: red;"';
         }
         echo '			<div class="bg-warning"' . $tmpStyle . '><b>Missing ' . ((int) $row['gamesTotal'] - sizeof($picks)) . ' / ' . $row['gamesTotal'] . ' picks.</b><br /><a href="entry_form.php?week=' . $row['weekNum'] . '">Enter now &raquo;</a></div>' . "\n";
     } else {
         //all picks were entered
         echo '			<div class="bg-info" style="color: green;"><b>All picks entered.</b><br /><a href="entry_form.php?week=' . $row['weekNum'] . '">Change your picks &raquo;</a></div>' . "\n";
     }
 }
 echo '		</div>' . "\n";
 $i++;