PageRenderTime 40ms CodeModel.GetById 16ms RepoModel.GetById 0ms app.codeStats 0ms

/html/pages/report_cb.php

https://github.com/graywh/utstats
PHP | 168 lines | 145 code | 23 blank | 0 comment | 9 complexity | 224f4f7267064338bc5b98971733a5dc MD5 | raw file
  1. <?php
  2. echo'<form NAME="report" METHOD="get" ACTION="./?p=report">
  3. <input type="hidden" name="p" value="report" size="0">
  4. <input type="hidden" name="rtype" value="clanbase" size="0">
  5. <input type="hidden" name="id" value="'.$id.'" size="0">
  6. <input type="hidden" name="stage" value="1" size="0">
  7. <table CLASS="searchformb">
  8. <tr>
  9. <td class="heading" colspan="2" ALIGN="center" width="480">Enter the Clanbase WarID</td>
  10. </tr>
  11. <tr>
  12. <td ALIGN="left" class="grey">
  13. <input TYPE="text" NAME="wid" MAXLENGTH="20" SIZE="20" value="'.($_GET['wid']).'" CLASS="searchform">
  14. <input TYPE="submit" VALUE="Submit" CLASS="searchformb"></td>
  15. </tr>
  16. </table>
  17. </form>';
  18. echo'<table>
  19. <tr>
  20. <td width="480" align="center" class="heading" colspan="2">
  21. <b>Team BreakDown of Match</b></td>
  22. </tr>
  23. <tr>
  24. <td width="240" align="center" class="smheading">Red Team</td>
  25. <td width="240" align="center" class="smheading">Blue Team</td>
  26. <tr>
  27. <td width="50%" class="grey">';
  28. $sql_rteam = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 ORDER BY pi.name ASC";
  29. $q_rteam = mysql_query($sql_rteam);
  30. while ($r_rteam = mysql_fetch_array($q_rteam)) {
  31. echo''.$r_rteam[name].'<br />';
  32. }
  33. echo'</td>
  34. <td width="50%" class="grey">';
  35. $sql_bteam = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 ORDER BY pi.name ASC";
  36. $q_bteam = mysql_query($sql_bteam);
  37. while ($r_bteam = mysql_fetch_array($q_bteam)) {
  38. echo''.$r_bteam[name].'<br />';
  39. }
  40. echo'</td></tr></table><br>';
  41. IF ($wid == "") {
  42. }
  43. IF ($stage >= "1") {
  44. include("includes/clanbase.php");
  45. $warinfo = get_clans($wid);
  46. }
  47. IF ($stage == "1") {
  48. $claninfo0 = get_players($warinfo[0][1]);
  49. $claninfo1 = get_players($warinfo[1][1]);
  50. echo'<form action="" method="get">
  51. <input type="hidden" name="p" value="report" size="0">
  52. <input type="hidden" name="rtype" value="clanbase" size="0">
  53. <input type="hidden" name="id" value="'.$id.'" size="0">
  54. <input type="hidden" name="wid" value="'.$wid.'" size="0">
  55. <input type="hidden" name="stage" value="2" size="0">
  56. <table class="searchformb">
  57. <tr>
  58. <td width="480" align="center" class="heading" colspan="2">
  59. <b>Who Played As Red Team?</b></td>
  60. </tr>
  61. <tr>
  62. <td width="100%" class="grey" colspan="2">
  63. <select size="1" name="red" CLASS="searchform">
  64. <option value="'.$warinfo[0][1].'">'.$warinfo[0][2].'</option>
  65. <option value="'.$warinfo[1][1].'">'.$warinfo[1][2].'</option>
  66. </select>
  67. <input type=submit CLASS="searchformb" value="Assign"></td>
  68. </tr>
  69. </table>
  70. </form>';
  71. }
  72. IF ($stage == "2") {
  73. $redteam = $_GET["red"];
  74. IF($redteam == $warinfo[0][1]) {
  75. $redcid = $warinfo[0][1];
  76. $redname = $warinfo[0][2];
  77. $redinfo = get_players($warinfo[0][1]);
  78. $bluecid = $warinfo[1][1];
  79. $bluename = $warinfo[1][2];
  80. $blueinfo = get_players($warinfo[1][1]);
  81. } else {
  82. $redcid = $warinfo[1][1];
  83. $redname = $warinfo[1][2];
  84. $redinfo = get_players($warinfo[1][1]);
  85. $bluecid = $warinfo[0][1];
  86. $bluename = $warinfo[0][2];
  87. $blueinfo = get_players($warinfo[0][1]);
  88. }
  89. echo'<form action="" method="get">
  90. <input type="hidden" name="p" value="report" size="0">
  91. <input type="hidden" name="rtype" value="clanbase" size="0">
  92. <input type="hidden" name="stage" value="generate" size="0">
  93. <input type="hidden" name="id" value="'.$id.'" size="0">
  94. <input type="hidden" name="wid" value="'.$wid.'" size="0">
  95. <input type="hidden" name="red" value="'.$redteam.'" size="0">
  96. <table class="searchformb">
  97. <tr>
  98. <td width="480" colspan="2" align="center" class="heading">
  99. <b>Clan and Player Info for Clanbase War ID '.$wid.'</b></td>
  100. </tr>
  101. <tr>
  102. <td colspan="2" align="center" class="smheading">
  103. <a href="http://www.clanbase.com/claninfo.php?cid='.$redcid.'" target="_blank">'.$redname.'</a></td>
  104. </tr>';
  105. $redcount = count($redinfo);
  106. $bluecount = count($blueinfo);
  107. $sql_rteam = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 0 ORDER BY pi.name ASC";
  108. $q_rteam = mysql_query($sql_rteam);
  109. while($r_rteam = mysql_fetch_array($q_rteam)) {
  110. echo'<tr>
  111. <td class="grey">'.$r_rteam[name].'</td>
  112. <td class="grey">
  113. <select CLASS="searchform" name="'.$r_rteam[id].'">
  114. <option selected CLASS="searchform" value="">Use Me To Assign a CB Player to Stats</option>';
  115. for ($i = 0; $i < $redcount; $i++) {
  116. echo'<option CLASS="searchform" value="'.$redinfo[$i][0].'">'.$redinfo[$i][1].'</option>';
  117. }
  118. echo'</select></td>
  119. </tr>';
  120. }
  121. echo'<td width="100%" align="center" class="smheading" colspan="2">
  122. <a href="http://www.clanbase.com/claninfo.php?cid='.$bluecid.'" target="_blank">'.$bluename.'</a></td>';
  123. $sql_bteam = "SELECT p.id, pi.name FROM uts_player AS p, uts_pinfo AS pi WHERE p.pid = pi.id AND matchid = $id AND team = 1 ORDER BY pi.name ASC";
  124. $q_bteam = mysql_query($sql_bteam);
  125. while($r_bteam = mysql_fetch_array($q_bteam)) {
  126. echo'<tr>
  127. <td class="grey">'.$r_bteam[name].'</td>
  128. <td class="grey">
  129. <select CLASS="searchform" name="'.$r_bteam[id].'">
  130. <option selected CLASS="searchform" value="">Use Me To Assign a CB Player to Stats</option>';
  131. for ($i = 0; $i < $bluecount; $i++) {
  132. echo'<option CLASS="searchform" value="'.$blueinfo[$i][0].'">'.$blueinfo[$i][1].'</option>';
  133. }
  134. echo'</select></td>
  135. </tr>';
  136. }
  137. echo'<tr>
  138. <td class="grey" colspan="2" align="center">
  139. <input type=submit CLASS="searchformb" value="Generate Report">
  140. </td>
  141. </tr>
  142. </table></form>';
  143. }
  144. ?>