Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pulling from randyr505 #1

Merged
merged 2 commits into from
Aug 30, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 29 additions & 2 deletions entry_form.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
//update summary table
$sql = "delete from " . DB_PREFIX . "picksummary where weekNum = " . $_POST['week'] . " and userID = " . $user->userID . ";";
$mysqli->query($sql) or die('Error updating picks summary: ' . $mysqli->error);
$sql = "insert into " . DB_PREFIX . "picksummary (weekNum, userID, showPicks) values (" . $_POST['week'] . ", " . $user->userID . ", " . (int)$_POST['showPicks'] . ");";
#$sql = "insert into " . DB_PREFIX . "picksummary (weekNum, userID, showPicks) values (" . $_POST['week'] . ", " . $user->userID . ", " . (int)$_POST['showPicks'] . ");";
$sql = "insert into " . DB_PREFIX . "picksummary (weekNum, userID, showPicks, tieBreakerPoints) values (" . $_POST['week'] . ", " . $user->userID . ", " . (int)$_POST['showPicks'] . ", " . $_POST['tieBreakerPoints'] . ");";
$mysqli->query($sql) or die('Error updating picks summary: ' . $mysqli->error);

//loop through non-expire weeks and update picks
Expand Down Expand Up @@ -127,6 +128,23 @@ function checkRadios() {
//get existing picks
$picks = getUserPicks($week, $user->userID);

//get tie-breaker status
$sql = "select * from " . DB_PREFIX . "picksummary where weekNum = " . $week . " and userID = " . $user->userID . ";";
$query = $mysqli->query($sql) or die('Error getting tie-breaker status: ' . $mysqli->error);
if ($query->num_rows > 0) {
$result = $query->fetch_assoc();
$tieBreakerPoints = (int)$result['tieBreakerPoints'];
} else {
$tieBreakerPoints = DEFAULT_TIEBREAKER_POINTS;
}
//initial db sets tiBreakerPoints=0 so the following is needed to set default points
//a user can still set this to 0 since we don't check after a number is entered
//if they attempt to change their points/picks again the default value will
//show the default from config.php and if submitted it will be set to the default
if ($tieBreakerPoints == 0 OR $tieBreakerPoints == "") {
$tieBreakerPoints = DEFAULT_TIEBREAKER_POINTS;
}

//get show picks status
$sql = "select * from " . DB_PREFIX . "picksummary where weekNum = " . $week . " and userID = " . $user->userID . ";";
$query = $mysqli->query($sql);
Expand Down Expand Up @@ -246,7 +264,16 @@ function checkRadios() {
}
echo ' </div>' . "\n";
echo ' </div>' . "\n";
echo '<p class="noprint"><input type="checkbox" name="showPicks" id="showPicks" value="1"' . (($showPicks) ? ' checked="checked"' : '') . ' /> <label for="showPicks">Allow others to see my picks</label></p>' . "\n";
if (ALWAYS_HIDE_PICKS) {
echo '<p class="noprint"><input type="hidden" name="showPicks" id="showPicks" value="0"' . (($showPicks) ? ' checked="checked"' : '') . ' /> <label for="showPicks">' . "\n";
} else {
echo '<p class="noprint"><input type="checkbox" name="showPicks" id="showPicks" value="1"' . (($showPicks) ? ' checked="checked"' : '') . ' /> <label for="showPicks">Allow others to see my picks</label></p>' . "\n";
}
if (SHOW_TIEBREAKER_POINTS) {
echo '<p><strong>Tie Breaker Points</strong> <input type="text" name="tieBreakerPoints" id="tieBreakerPoints" maxlength="3" size=3 value="' . $tieBreakerPoints . '" /> ' . " << Default is " . DEFAULT_TIEBREAKER_POINTS . "\n";
} else {
echo '<input type="hidden" name="tieBreakerPoints" id="tieBreakerPoints" value="0" />' . "\n";
}
echo '<p class="noprint"><input type="submit" name="action" value="Submit" /></p>' . "\n";
echo '</form>' . "\n";
}
Expand Down
Binary file added images/helmets_big/la1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/helmets_big/la2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/helmets_big/stl1.gif
Binary file not shown.
1 change: 1 addition & 0 deletions images/helmets_big/stl1.gif
Binary file removed images/helmets_big/stl2.gif
Binary file not shown.
1 change: 1 addition & 0 deletions images/helmets_big/stl2.gif
Binary file added images/helmets_small/LARL.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/helmets_small/LARR.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/helmets_small/STLL.gif
Binary file not shown.
1 change: 1 addition & 0 deletions images/helmets_small/STLL.gif
Binary file removed images/helmets_small/STLR.gif
Binary file not shown.
1 change: 1 addition & 0 deletions images/helmets_small/STLR.gif
Binary file added images/logos/LA.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions images/logos/LA.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed images/logos/STL.gif
Binary file not shown.
1 change: 1 addition & 0 deletions images/logos/STL.gif
25 changes: 0 additions & 25 deletions images/logos/STL.svg

This file was deleted.

1 change: 1 addition & 0 deletions images/logos/STL.svg
2 changes: 1 addition & 1 deletion includes/column_right.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p class="skip2content"><a href="<?php echo $_SERVER['REQUEST_URI']; ?>#content">Skip to content &raquo;</a></p>

<div class="bg-primary">
<b>Current Time (Eastern):</b><br />
<b>Current Time (<?php echo SERVER_TIMEZONE; ?>):</b><br />
<span id="jclock1"></span>
<script type="text/javascript">
$(function($) {
Expand Down
3 changes: 3 additions & 0 deletions includes/config.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@

define('SEASON_YEAR', '2016');
define('SERVER_TIMEZONE', 'America/Chicago'); // Your SERVER's timezone. NOTE: Game times will always be displayed in Eastern time, as they are on NFL.com. This setting makes sure cutoff times work properly.
define('ALLWAYS_HIDE_PICKS', false); // Set to true to hide picks until games are locked out
define('SHOW_TIEBREAKER_POINTS', false); // Set to true to use tiebreaker points, does not affect wins, mainly for bragging rights
define('DEFAULT_TIEBREAKER_POINTS', 50); // if using tiebreaker points set default value to fill in on entry form

// ***DO NOT EDIT ANYTHING BELOW THIS LINE***
error_reporting(E_ALL ^ E_NOTICE ^ E_STRICT);
Expand Down