if (isset($_COOKIE['buckets'])){ $buckets = base64_decode($_COOKIE['buckets']); define("BUCKETS", $buckets); } if (!$buckets && MODULE != "login"){ header("Location: /login"); } $people = array(); $totals = array(); // Get Game Results // Open File for Grid and show winngers $parse_file = $_SERVER['DOCUMENT_ROOT'] . "/2017/_grid.txt"; $handle = @fopen($parse_file, "r"); $replace = array(" ", "'"); if ($handle) { while (!feof($handle)) { $content = fgetcsv($handle, 4096); $number = $content[0]; $person = $content[1]; $winners_array[$number] = $person; if (!in_array($person, $people)){ $people[] = $person; } } } // Open File and Start the Parse Job. $parse_file = $_SERVER['DOCUMENT_ROOT'] . "/2017/_results.txt"; $handle = @fopen($parse_file, "r"); $replace = array(" ", "'"); if ($handle) { while (!feof($handle)) { $line++; $content = fgetcsv($handle, 4096); // list($date,$away,$away_score,$home,$home_score) = explode(",", $content); $date = trim($content[0]); $winnings = trim($content[1]); $away = trim($content[2]); $away_score = trim($content[3]); $home = trim($content[4]); $home_score = trim($content[5]); $away_final = substr($away_score, -1); $home_final = substr($home_score, -1); if (strpos($away, 'Reverse') !== false) { if ($home_score < $away_score){ $home = "$home"; $home_score = "$home_score"; $winner = "$home_final-$away_final"; $find_winner = $home_final . $away_final; } else if ($home_score > $away_score){ $away = "$away"; $away_score = "$away_score"; $winner = "$away_final-$home_final"; $find_winner = $away_final . $home_final; } } else { if ($home_score > $away_score){ $home = "$home"; $home_score = "$home_score"; $winner = "$home_final-$away_final"; $find_winner = $home_final . $away_final; } else if ($home_score < $away_score){ $away = "$away"; $away_score = "$away_score"; $winner = "$away_final-$home_final"; $find_winner = $away_final . $home_final; } } // if ($find_winner){ $winning_person = $winners_array[$find_winner]; // Find person and then add their values to totals array $find_person = array_search($winning_person,$people); $totals[$find_person] = $totals[$find_person] + $winnings; $winningscore[$find_winner] = $winningscore[$find_winner] + $winnings; } $results .= ("
$25 a square, Paypal me at aidanshealy@gmail.com
Once pool is full, we will draw numbers, just like the Super Bowl pool, top row and side column.
*/ print <<< CONTENTWelcome to the 2017 NCAA Bucket Challenge. With 68 chances to win money, this is by far my favorite format for the tourney.
Pool is filled, numbers are drawn. Enjoy the tourney.
The top row will represent the Winning teams last digit in score, and the left column will represent the Losing teams last digit in score. (Example, Syracuse 75, Villanova 77), go over to the 7, down to the 5. Winner winner chicken dinner.
Each square is $25.
Will payout at the end of the tourney. I used to pay out every round, but that is quite the PITA.