England Goals

/* //get individual opponents else { //get match $get_opp = mysql_query("SELECT * FROM opp where oppid = '$oppid'", $connection); while ($row = mysql_fetch_assoc($get_opp)) { extract($row); } $oppname = get_oppname($oppid,1); $oppflag = get_oppflag($oppid); $oppbadge = get_oppbadge($oppid); //get matchlist $get_matchlist = mysql_query("SELECT mid, date, gfor, gag, asoppid, tid, tidb FROM matches where oppid = '$oppid' order by mid DESC", $connection); $matchlist = array(); while ($row = mysql_fetch_array($get_matchlist)) { extract($row); $asoppname = get_oppname($asoppid,2); $oppflag = get_oppflag($asoppid); $date = adodb_date2('jS M Y', $date); if (empty($tidb)) { $type = get_tname($tid,2); } else { $type = get_tname($tid,2); $typeb = get_tname($tidb,2); $type .= "/" . $typeb;} $filename = "_html/matchlist_row.html"; $handle = fopen ($filename, "r"); $contents = fread ($handle, filesize ($filename)); $contents = str_replace('XmidX', $mid, $contents); $contents = str_replace('XoppnameX', $asoppname, $contents); $contents = str_replace('XoppidX', $oppid, $contents); $contents = str_replace('XoppflagX', $oppflag, $contents); $contents = str_replace('XtidX', $type, $contents); $contents = str_replace('XgforX', $gfor, $contents); $contents = str_replace('XgagX', $gag, $contents); $contents = str_replace('XdateX', $date, $contents); array_push($matchlist,$contents); fclose ($handle); } $query = mysql_query("SELECT tid, COUNT(mid) as played, SUM(gfor) as gfor, SUM(gag) as gag FROM matches where oppid = '$oppid' group by tid", $connection); $headtohead = array(); while ($row = mysql_fetch_array($query)) { extract($row); $type = get_tname($tid,1); //get the win draw lost $i = 1; while ($i < 4) { $get_res = mysql_query("SELECT COUNT(rid) FROM matches where oppid = '$oppid' and tid = '$tid' and rid = '$i'", $connection); while ($row = mysql_fetch_array($get_res,MYSQL_NUM)) { $got[$i] = $row[0]; } $i++; } $bot = ""; $filename = "_html/headtohead_row.html"; $handle = fopen ($filename, "r"); $contents = fread ($handle, filesize ($filename)); $contents = str_replace('XnameX', $type, $contents); $contents = str_replace('XpX', $played, $contents); $contents = str_replace('XwX', $got[1], $contents); $contents = str_replace('XdX', $got[2], $contents); $contents = str_replace('XlX', $got[3], $contents); $contents = str_replace('XfX', $gfor, $contents); $contents = str_replace('XaX', $gag, $contents); $contents = str_replace('XbotX', $bot, $contents); array_push($headtohead,$contents); fclose ($handle); } //competitive $query = mysql_query("SELECT COUNT(mid) as comp_played, COALESCE(SUM(gfor),0) as comp_gfor, COALESCE(SUM(gag),0) as comp_gag FROM matches where oppid = '$oppid' and tid <> 1", $connection); while ($row = mysql_fetch_array($query)) { extract($row); //get the win draw lost $i = 1; while ($i < 4) { $get_res = mysql_query("SELECT COUNT(rid) FROM matches where oppid = '$oppid' and tid <> 1 and rid = '$i'", $connection); while ($row = mysql_fetch_array($get_res,MYSQL_NUM)) { $got[$i] = $row[0]; } $i++; } $type = "Competitive Matches"; $bot = "border-bottom:1px solid #d7dadc;border-top:1px solid #d7dadc;"; $filename = "_html/headtohead_row.html"; $handle = fopen ($filename, "r"); $contents = fread ($handle, filesize ($filename)); $contents = str_replace('XnameX', $type, $contents); $contents = str_replace('XpX', $comp_played, $contents); $contents = str_replace('XwX', $got[1], $contents); $contents = str_replace('XdX', $got[2], $contents); $contents = str_replace('XlX', $got[3], $contents); $contents = str_replace('XfX', $comp_gfor, $contents); $contents = str_replace('XaX', $comp_gag, $contents); $contents = str_replace('XbotX', $bot, $contents); array_push($headtohead,$contents); fclose ($handle); } //home and away $query = mysql_query("SELECT COUNT(mid) as hand_played, COALESCE(SUM(gfor),0) as hand_gfor, COALESCE(SUM(gag),0) as hand_gag, hand FROM matches where oppid = '$oppid' group by hand", $connection); while ($row = mysql_fetch_array($query)) { extract($row); //get the win draw lost $i = 1; while ($i < 4) { $get_wins = mysql_query("SELECT COUNT(rid) FROM matches where oppid = '$oppid' and hand = '$hand' and rid = '$i'", $connection); while ($row = mysql_fetch_array($get_wins,MYSQL_NUM)) { $got[$i] = $row[0]; } $i++; } $name = get_hand($hand,1); $bot = ""; $filename = "_html/headtohead_row.html"; $handle = fopen ($filename, "r"); $contents = fread ($handle, filesize ($filename)); $contents = str_replace('XnameX', $name, $contents); $contents = str_replace('XpX', $hand_played, $contents); $contents = str_replace('XwX', $got[1], $contents); $contents = str_replace('XdX', $got[2], $contents); $contents = str_replace('XlX', $got[3], $contents); $contents = str_replace('XfX', $hand_gfor, $contents); $contents = str_replace('XaX', $hand_gag, $contents); $contents = str_replace('XbotX', $bot, $contents); array_push($headtohead,$contents); fclose ($handle); } $total = mysql_query("SELECT COUNT(mid) as tot_played, SUM(gfor) as tot_gfor, SUM(gag) as tot_gag FROM matches where oppid = '$oppid'", $connection); while ($row = mysql_fetch_array($total)) { extract($row); //get the win draw lost $i = 1; while ($i < 4) { $get_wins = mysql_query("SELECT COUNT(rid) FROM matches where oppid = '$oppid' and rid = '$i'", $connection); while ($row = mysql_fetch_array($get_wins,MYSQL_NUM)) { $got[$i] = $row[0]; } $i++; } $name = "Total"; $bot = "border-top:1px solid #d7dadc;"; $filename = "_html/headtohead_row.html"; $handle = fopen ($filename, "r"); $contents = fread ($handle, filesize ($filename)); $contents = str_replace('XnameX', $name, $contents); $contents = str_replace('XpX', $tot_played, $contents); $contents = str_replace('XwX', $got[1], $contents); $contents = str_replace('XdX', $got[2], $contents); $contents = str_replace('XlX', $got[3], $contents); $contents = str_replace('XfX', $tot_gfor, $contents); $contents = str_replace('XaX', $tot_gag, $contents); $contents = str_replace('XbotX', $bot, $contents); array_push($headtohead,$contents); fclose ($handle); } //get other stats $top_apps = mysql_query("SELECT COUNT(pid) as apps, pid as apps_pid FROM app where oppid = '$oppid' group by pid order by apps DESC LIMIT 20", $connection); $appslist = array(); while ($row = mysql_fetch_array($top_apps)) { extract($row); $playername = get_player($apps_pid); $filename = "_html/apps_row.html"; $handle = fopen ($filename, "r"); $contents = fread ($handle, filesize ($filename)); $contents = str_replace('Xapps_pidX', $apps_pid, $contents); $contents = str_replace('XappsX', $apps, $contents); $contents = str_replace('XplayernameX', $playername, $contents); array_push($appslist,$contents); fclose ($handle); } $top_goals = mysql_query("SELECT SUM(goals) as topg, pid as g_pid FROM app where oppid = '$oppid' AND goals > 0 group by pid order by topg DESC LIMIT 20", $connection); $goalslist = array(); while ($row = mysql_fetch_array($top_goals)) { extract($row); $playername = get_player($g_pid); $filename = "_html/apps_row.html"; $handle = fopen ($filename, "r"); $contents = fread ($handle, filesize ($filename)); $contents = str_replace('Xapps_pidX', $g_pid, $contents); $contents = str_replace('XappsX', $topg, $contents); $contents = str_replace('XplayernameX', $playername, $contents); array_push($goalslist,$contents); fclose ($handle); } $matchlist = implode("\n", $matchlist); $headtohead = implode("\n", $headtohead); $appslist = implode("\n", $appslist); $goalslist = implode("\n", $goalslist); $filename = "_html/opp.html"; $handle = fopen ($filename, "r"); $contents = fread ($handle, filesize ($filename)); $contents = str_replace('XoppnameX', $oppname, $contents); $contents = str_replace('XoppflagX', $oppflag, $contents); $contents = str_replace('XoppbadgeX', $oppbadge, $contents); $contents = str_replace('XfedX', $fed, $contents); $contents = str_replace('XmatchlistX', $matchlist, $contents); $contents = str_replace('XlastmatchX', $lastmatch, $contents); $contents = str_replace('XlastmidX', $lastmid, $contents); $contents = str_replace('XnextmidX', $nextmid, $contents); $contents = str_replace('XheadtoheadX', $headtohead, $contents); $contents = str_replace('XnotesX', $notes, $contents); $contents = str_replace('XlogoX', $logo, $contents); $contents = str_replace('XfoundedX', $founded, $contents); $contents = str_replace('XassocX', $assoc, $contents); $contents = str_replace('XappslistX', $appslist, $contents); $contents = str_replace('XgoalslistX', $goalslist, $contents); print $contents; fclose ($handle); }*/ //GET FOOTER INCLUDES include("footer_menu.php"); include("footer.php"); ?>