= 10) { $aka = $team_num."..".$zteamname; //} //else { // $aka = "*".$team_num."..".$zteamname; // } } if ($team_ID=="") { $team_ID = 0;} if ($tourn_ID=="") { $tourn_ID = 0;} if ($league_ID=="") { $league_ID = 0; } $insert = "insert into team_scoring (teamname, aka, players, team_ID, loc_ID, show_ID, usr_ID, game_date, 1_1, 1_1_yn, 1_2, 1_2_yn, 1_3, 1_3_yn, 2_1, 2_1_yn, 2_2, 2_2_yn, 2_3, 2_3_yn, 3_1, 3_1_yn, 3_2, 3_2_yn, 3_3, 3_3_yn, H, H_in, first_half_score, 4_1, 4_1_yn, 4_2,4_2_yn, 4_3, 4_3_yn, 5_1, 5_1_yn, 5_2, 5_2_yn, 5_3, 5_3_yn, 6_1, 6_1_yn, 6_2, 6_2_yn, 6_3, 6_3_yn, second_half_score, F, F_yn, final_score, team_rank, team_active, tourn_ID, league_ID, H_finalized, F_finalized) values ('".$teamname."', '".$aka."', '".$players."', '".$team_ID."', '".$loc_ID."', '".$show_ID."', '".$usr_ID."', '".$this_game_date."', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', 'N', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '0', '1', '".$tourn_ID."', '".$league_ID."', 'N', 'N')"; //echo $insert."
"; mysqli_query($local, $insert); $query = "select id as 'scoring_ID' from team_scoring order by id desc limit 1"; $result = mysqli_query($local, $query); $row = mysqli_fetch_assoc($result); $scoring_ID = $row['scoring_ID']; $insert = "insert into scoring_tracker (user_ID, loc_ID, show_ID, region_ID, game_date, game_round, qno, scoring_ID, score_action, points, yn) values (".$user_ID.", ".$loc_ID.", ".$show_ID.", ".$region_ID.", '".$this_game_date."', '', 0, ".$scoring_ID.", 'add_team', 0, '-')"; } } if ($tourn_ID=="" || $tourn_ID==0) { $oktoscore="Y"; } else { //check to see if scores are finalized... if ($r==1 || $r==2 || $r==3 || $r=="H") { $section = 1; } elseif ($r==4 || $r==5 || $r==6) { $section = 2; } elseif ($r=="F") { $section = 3; } $query = "select finalized from tournament_finalized where section = ".$section." and tourn_ID = ".$tourn_ID." and loc_ID = ".$loc_ID; $result = mysqli_query($games, $query); $row = mysqli_fetch_assoc($result); $num = mysqli_num_rows($result); if ($num==0) { $finalized = "N"; } else { $finalized = $row['finalized']; } //check tournament_oktoscore table $query = "select oktoscore, region_ID from tournament_oktoscore where tourn_ID = ".$tourn_ID; $result = mysqli_query($games, $query); $row = mysqli_fetch_assoc($result); $region_ID = $row['region_ID']; $oktoscore = $row['oktoscore']; //if not ok to score, redirect to "wait.php"; if ($finalized=="Y" && $oktoscore=="N") { $oktoscore="N"; //echo "LA LA LA"; } elseif ($finalized=="N" && $oktoscore=="Y") { $oktoscore="Y"; } elseif ($finalized=="Y" && $oktoscore=="N") { $oktoscore="N"; } if ($section==1 && $finalized=="Y") { $v = "firsthalf"; } elseif ($section==2 && $finalized=="Y") { $v = "secondhalf"; } elseif ($section==3 && $finalized=="Y") { $v = "final"; } if ($oktoscore=="N") { $url = "wait.php?v=".$v."&r=".$r."&q=".$q; } } $query = "select * from team_scoring where team_active = 1 and game_date = '".$this_game_date."' and loc_ID = ".$loc_ID." and show_ID = ".$show_ID." and usr_ID = ".$usr_ID; //echo $query."
"; $result = mysqli_query($local, $query); $num_active_teams = mysqli_num_rows($result); $split_after = $_COOKIE['split_after']; if ($split_after=="") { $split_after = 12; } $greater_than_a = $split_after; $greater_than_b = ($split_after * 2); $greater_than_c = ($split_after * 3); $greater_than_d = ($split_after * 4); $greater_than_e = ($split_after * 5); $greater_than_f = ($split_after * 6); $less_than_a = ($greater_than_b + 1); $less_than_b = ($greater_than_c + 1); $less_than_c = ($greater_than_d + 1); $less_than_d = ($greater_than_e + 1); $less_than_e = ($greater_than_f + 1); //echo $greater_than_d." - ".$less_than_d."
".$greater_than_e." - ".$less_than_e."
".$greater_than_f." - ".$less_than_f."
"; if (($num_active_teams > $greater_than_a && $num_active_teams < $less_than_a) && $screens!=2) { $splitscreen = "nav.php?screens=2&r=".$r."&q=".$q; $limit = $split_after; } elseif (($num_active_teams > $greater_than_b && $num_active_teams < $less_than_b) && $screens!=3) { $splitscreen = "nav.php?screens=3&r=".$r."&q=".$q; $limit = $greater_than_b.", ".$split_after; } elseif (($num_active_teams > $greater_than_c && $num_active_teams < $less_than_c) && $screens!=4) { $splitscreen = "nav.php?screens=4&r=".$r."&q=".$q; $limit = $greater_than_c.", ".$split_after; } elseif (($num_active_teams > $greater_than_d && $num_active_teams < $less_than_d) && $screens!=5) { $splitscreen = "nav.php?screens=5&r=".$r."&q=".$q; $limit = $greater_than_d.", ".$split_after; } elseif (($num_active_teams > $greater_than_e && $num_active_teams < $less_than_e) && $screens!=6) { $splitscreen = "nav.php?screens=6&r=".$r."&q=".$q; $limit = $greater_than_e.", ".$split_after; } ?> Scoring iframe Past Dates:

"; $result = mysqli_query($local, $query); $num = mysqli_num_rows($result); while ($sysw = mysqli_fetch_assoc($result)) { $teamname = addslashes($sysw['teamname']); $aka = addslashes($sysw['aka']); $players = $sysw['players']; $team_ID = $sysw['team_ID']; $squery = "select team_ID from league_teams"; $sresult = mysqli_query($local, $squery); $snum = mysqli_num_rows($sresult); if ($snum == 0) { $o_team_ID = $srow['team_ID']; $tquery = "select team_ID from league_teams where region_ID = " . $region_ID . " and orig_team_ID = " . $o_team_ID; $tresult = mysqli_query($local, $tquery); $tnum = mysqli_num_rows($tresult); if ($tnum == 0) { //do something about getting them a new ID } else { $trow = mysqli_fetch_assoc($tresult); $team_ID = $trow['team_ID']; } } $loc_ID = $sysw['loc_ID']; $show_ID = $sysw['show_ID']; $r1_1 = $sysw['1_1']; $r1_1_yn = $sysw['1_1_yn']; $r1_2 = $sysw['1_2']; $r1_2_yn = $sysw['1_2_yn']; $r1_3 = $sysw['1_3']; $r1_3_yn = $sysw['1_3_yn']; $r2_1 = $sysw['2_1']; $r2_1_yn = $sysw['2_1_yn']; $r2_2 = $sysw['2_2']; $r2_2_yn = $sysw['2_2_yn']; $r2_3 = $sysw['2_3']; $r2_3_yn = $sysw['2_3_yn']; $r3_1 = $sysw['3_1']; $r3_1_yn = $sysw['3_1_yn']; $r3_2 = $sysw['3_2']; $r3_2_yn = $sysw['3_2_yn']; $r3_3 = $sysw['3_3']; $r3_3_yn = $sysw['3_3_yn']; $H = $sysw['H']; $H_in = $sysw['H_in']; $first_half_score = $sysw['first_half_score']; $r4_1 = $sysw['4_1']; $r4_1_yn = $sysw['4_1_yn']; $r4_2 = $sysw['4_2']; $r4_2_yn = $sysw['4_2_yn']; $r4_3 = $sysw['4_3']; $r4_3_yn = $sysw['4_3_yn']; $r5_1 = $sysw['5_1']; $r5_1_yn = $sysw['5_1_yn']; $r5_2 = $sysw['5_2']; $r5_2_yn = $sysw['5_2_yn']; $r5_3 = $sysw['5_3']; $r5_3_yn = $sysw['5_3_yn']; $r6_1 = $sysw['6_1']; $r6_1_yn = $sysw['6_1_yn']; $r6_2 = $sysw['6_2']; $r6_2_yn = $sysw['6_2_yn']; $r6_3 = $sysw['6_3']; $r6_3_yn = $sysw['6_3_yn']; $second_half_score = $sysw['second_half_score']; $F = $sysw['F']; $F_yn = $sysw['F_yn']; $final_score = $sysw['final_score']; $team_rank = $sysw['team_rank']; $active = $sysw['active']; $tourn_ID = $sysw['tourn_ID']; $league_ID = $sysw['league_ID']; $scores = $scores . "^^" . $team_ID . "|" . $teamname . "|" . $r1_1 . "|" . $r1_1_yn . "|" . $r1_2 . "|" . $r1_2_yn . "|" . $r1_3 . "|" . $r1_3_yn . "|" . $r2_1 . "|" . $r2_1_yn . "|" . $r2_2 . "|" . $r2_2_yn . "|" . $r2_3 . "|" . $r2_3_yn . "|" . $r3_1 . "|" . $r3_1_yn . "|" . $r3_2 . "|" . $r3_2_yn . "|" . $r3_3 . "|" . $r3_3_yn . "|" . $H . "|" . $H_in . "|" . $first_half_score . "|" . $r4_1 . "|" . $r4_1_yn . "|" . $r4_2 . "|" . $r4_2_yn . "|" . $r4_3 . "|" . $r4_3_yn . "|" . $r5_1 . "|" . $r5_1_yn . "|" . $r5_2 . "|" . $r5_2_yn . "|" . $r5_3 . "|" . $r5_3_yn . "|" . $r6_1 . "|" . $r6_1_yn . "|" . $r6_2 . "|" . $r6_2_yn . "|" . $r6_3 . "|" . $r6_3_yn . "|" . $second_half_score . "|" . $F . "|" . $F_yn . "|" . $final_score . "|" . $team_rank . "|" . $active . "|" . $tourn_ID . "|" . $league_ID."|".$aka."|".$players; } $scores = $num . "***" . $scores; $questions_used = ""; $query = "select orig_ID from questions where game_date = '".$this_game_date."' and game_round <> 'R'"; // echo $query."
"; $result = mysqli_query($local, $query); while ($row = mysqli_fetch_assoc($result)) { $orig_ID = $row['orig_ID']; $questions_used = $questions_used."|".$orig_ID; } ?> 0) { $query = "select id, team_rank, final_score, teamname, aka, players, team_ID from team_scoring where game_date = '".$this_game_date."' and loc_ID = ".$loc_ID." and show_ID = ".$show_ID." and team_ID > 0 and usr_ID = ".$usr_ID." order by team_rank asc"; } else { $query = "select id, team_rank, final_score, teamname, aka, players, team_ID from team_scoring where game_date = '".$this_game_date."' and loc_ID = ".$loc_ID." and show_ID = ".$show_ID." order by team_rank asc"; } // echo $query."
"; $result = mysqli_query($local, $query); $i = 0; while ( $row = mysqli_fetch_assoc($result) ) { $scoreID = $row['id']; $team_rank = $row['team_rank']; $final_score = $row['final_score']; $teamname = $row['teamname']; $team_ID = $row['team_ID']; $aka = $row['aka']; if ($team_ID > 0) { ?>
Rank Team Name Final Score
()

"; $query = "select count(id) as 'num_teams', sum(players) as 'num_players' from team_scoring where game_date = '".$this_game_date."' and loc_ID = ".$loc_ID." and show_ID = ".$show_ID; $result = mysqli_query($local, $query); $row = mysqli_fetch_assoc($result); $num_teams = $row['num_teams']; $num_players = $row['num_players']; echo "Number of Teams: ".$num_teams."
"; echo "Number of Players:
"; $query = "select count(id) as 'num_leagues' from team_scoring where game_date = '".$this_game_date."' and loc_ID = ".$loc_ID." and show_ID = ".$show_ID." and team_ID > 0"; $result = mysqli_query($local, $query); $row = mysqli_fetch_assoc($result); $num_leagues = $row['num_leagues']; echo "Number of League Teams: ".$num_leagues."
"; ?> Amount Received from Location:
Misc Expenses:     Reason:
Notes:
Technical Notes / Issues:
Jump To:
Open Freq Teams
Teams.    $greater_than_a && $num_active_teams < $less_than_a) && $screens!=2) { $splitscreen = "nav.php?screens=2&r=".$r."&q=".$q; $limit = $split_after; } elseif (($num_active_teams > $greater_than_b && $num_active_teams < $less_than_b) && $screens!=3) { $splitscreen = "nav.php?screens=3&r=".$r."&q=".$q; $limit = $greater_than_b.", ".$split_after; } elseif (($num_active_teams > $greater_than_c && $num_active_teams < $less_than_c) && $screens!=4) { $splitscreen = "nav.php?screens=4&r=".$r."&q=".$q; $limit = $greater_than_c.", ".$split_after; } elseif (($num_active_teams > $greater_than_d && $num_active_teams < $less_than_d) && $screens!=5) { $splitscreen = "nav.php?screens=5&r=".$r."&q=".$q; $limit = $greater_than_d.", ".$split_after; } elseif (($num_active_teams > $greater_than_e && $num_active_teams < $less_than_e) && $screens!=6) { $splitscreen = "nav.php?screens=6&r=".$r."&q=".$q; $limit = $greater_than_e.", ".$split_after; } if ($splitscreen!="") { ?> Split Screen View All Teams View All Teams
View National Status
= $split_after) { $form_url = "scoring_master.php"; } else { $form_url = "scoring.php"; } ?>
/>
You are scoring - 1 || $tourn_ID > 0) { $nexturl = "scoring_master"; $scoring_iframe = "scoring_master"; } else { $nexturl = "scoring"; $scoring_iframe = "scoring"; } $scoring_iframe = "scoring_master"; if ($r==3 && $q==3) { ?> Next is Halftime Next is Final Next is Round Next is Round 4 - Question 1 Next is Round - Question
"; $result = mysqli_query($local, $query); while ($row=mysqli_fetch_assoc($result)) { $scoreID = $row['id']; ?>
Jump To:
Open Freq Teams
0) { ?>
Teams.    Split Screen
By clicking Finalize, you & your teams are agreeing that all scores are correct. No changes are permitted after clicking Finalize.
View All Teams View All Teams
View National Status
= '".$last_date."'"; } $query = "select distinct team_ID from scores_".$selected_region." where show_ID = ".$show_ID." and loc_ID = ".$loc_ID." and team_ID < 100000 and team_ID > 0 and team_ID not in (select team_ID from team_scoring where game_date = '".$this_game_date."' and show_ID = ".$show_ID.") order by team_ID asc"; //echo $query."
"; $result = mysqli_query($local, $query); ?>
View ALL League Teams
Teams That have played here since : Close
ID NAME AKA #



Add New League Team
"; $result = mysqli_query($local, $query); while ($row=mysqli_fetch_assoc($result)) { $scoreID = $row['id']; ?>
"; $result = mysqli_query($local, $query); while ($row=mysqli_fetch_assoc($result)) { $scoreID = $row['id']; ?>
"; $result = mysqli_query($local, $query); while ($row=mysqli_fetch_assoc($result)) { $scoreID = $row['id']; ?>