From 3a58cb2802c8be14f78015105afe759b1c7ce692 Mon Sep 17 00:00:00 2001 From: Matthijs Kuiper Date: Tue, 9 Jan 2018 00:43:43 +0100 Subject: Implement design for pages and update includes --- html/includes/weaponstats.php | 48 +++++++++++++++++++------------------------ 1 file changed, 21 insertions(+), 27 deletions(-) mode change 100755 => 100644 html/includes/weaponstats.php (limited to 'html/includes/weaponstats.php') diff --git a/html/includes/weaponstats.php b/html/includes/weaponstats.php old mode 100755 new mode 100644 index 872fa5a..bccdd6d --- a/html/includes/weaponstats.php +++ b/html/includes/weaponstats.php @@ -26,7 +26,6 @@ function weaponstats($_mid, $_pid, $title = 'Weapons Summary') { AND (wn.id = w.weapon) AND wn.hide <> 'Y'"; - if ($_pid == 0 and $_mid != 0) { $sql_weapons = "SELECT w.matchid, w.pid AS playerid, @@ -99,15 +98,15 @@ uts_weaponstats AS w } echo' - - - - - '; - +
'.htmlentities($title).'
+ + + + '; if ($one) { ws_header($wsort, $weapons, $colspan, $one, $playercol); + echo ''; foreach($wsort as $wid => $bar) { for ($i = 1; $i <= $colspan; $i++) { @@ -119,8 +118,7 @@ uts_weaponstats AS w case 5: $extra = 'Dmg'; break; } $extra = ''. $extra .''; - echo ' - '; + echo ''; } } echo ''; @@ -128,10 +126,10 @@ uts_weaponstats AS w $i = 0; foreach($psort as $pid => $foo) { $i++; - echo ''; + echo ''; if ($playercol) { echo ' - '; + '; } foreach($wsort as $wid => $bar) { ws_cell($wd, $pid, $wid, 'kills', $i); @@ -146,23 +144,22 @@ uts_weaponstats AS w if (!$one) { ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Kills', 'kills'); - ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Shots', 'shots'); - ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Hits', 'hits'); + //ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Shots', 'shots'); + //ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Hits', 'hits'); ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Damage', 'damage'); ws_block($wd, $weapons, $wsort, $psort, $colspan, $playercol, $one, $_mid, $gamename, 'Accuracy', 'acc'); } - echo '
'.htmlentities($title).'
'.$extra.''.$extra.'
'.FormatPlayerName($wd[$pid]['country'], $pid, $wd[$pid]['playername'], $gid, $gamename).''.FormatPlayerName($wd[$pid]['country'], $pid, $wd[$pid]['playername'], $gid, $gamename).'
'; } function ws_header(&$wsort, &$weapons, $colspan, $one, $playercol) { echo ''; - if ($playercol and $playercol != -1) echo 'Player'; - if ($playercol == -1) echo ' '; + if ($playercol and $playercol != -1) echo ''; + if ($playercol == -1) echo ' '; foreach($wsort as $wid => $bar) { if (!empty($weapons[$wid]['image'])) { - $content = ''.$weapons[$wid]['name'].''; + $content = ''.$weapons[$wid]['name'].''; } else { $content = ''.$weapons[$wid]['name'].''; } @@ -172,27 +169,23 @@ function ws_header(&$wsort, &$weapons, $colspan, $one, $playercol) { echo ''; } - function ws_cell(&$wd, $pid, $wid, $field, $i) { $content = ''; if (isset($wd[$pid][$wid][$field])) $content = $wd[$pid][$wid][$field]; $class = ($i % 2) ? 'grey' : 'grey2'; echo ' - '.$content.''; + '.$content.''; } - - - function ws_block(&$wd, &$weapons, &$wsort, &$psort, &$colspan, $playercol, $one,$_mid, $gamename, $caption, $field) { global $gamename, $gid; if (count($psort) != 1) { echo ' - + - '.$caption.' + '.$caption.' '; ws_header($wsort, $weapons, $colspan, $one, $playercol); } @@ -204,8 +197,8 @@ function ws_block(&$wd, &$weapons, &$wsort, &$psort, &$colspan, $playercol, $one $i = 0; foreach($psort as $pid => $foo) { $i++; - echo ''; - if ($playercol and $playercol != -1) echo ''.FormatPlayerName($wd[$pid]['country'], $pid, $wd[$pid]['playername'], $gid, $gamename).''; + echo ''; + if ($playercol and $playercol != -1) echo ''.FormatPlayerName($wd[$pid]['country'], $pid, $wd[$pid]['playername'], $gid, $gamename).''; if ($playercol == -1) echo ''.$caption.''; foreach($wsort as $wid => $bar) { ws_cell($wd, $pid, $wid, $field, $i); @@ -213,4 +206,5 @@ function ws_block(&$wd, &$weapons, &$wsort, &$psort, &$colspan, $playercol, $one echo ''; } } -?> \ No newline at end of file + +?> -- cgit