$file_path = $_SERVER['DOCUMENT_ROOT'] . "/2019/"; if (isset($_COOKIE['buckets'])){ $buckets = base64_decode($_COOKIE['buckets']); define("BUCKETS", $buckets); } if (!$buckets && MODULE != "login"){ header("Location: /login"); } $people = array(); $totals = array(); $requests = array(); $remaining = 0; // Hold File // Open File to get requests for squares $parse_file = $file_path . "_requests.txt"; $handle = @fopen($parse_file, "r"); $replace = array(" ", "'"); if ($handle) { while (!feof($handle)) { $content = fgetcsv($handle, 4096); $number = $content[0]; if ($number > 0){ $person = $content[1]; $requests[$number] = $person; } } } /* print "
"; print_r($requests); print ""; */ // Get Game Results // Open File for Grid and show winngers $parse_file = $file_path . "_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 = $file_path . "_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 .= ("
Only $remaining buckets remain.
"; } else { $remaining_display = "Pool is filled, numbers are drawn. Enjoy the tourney.
"; } /* // Extra text$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.
Welcome to the 2019 NCAA Bucket Challenge. With 68 chances to win money, this is by far my favorite format for the tourney.
$remaining_displayThe 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.
$25 a square, Paypal me at aidanshealy@gmail.com or Venmo me @aidanshealy
Once pool is full, we will draw numbers, just like the Super Bowl pool, top row and side column.
Will payout at the end of the tourney. I used to pay out every round, but that is quite the PITA.