PageRenderTime 47ms CodeModel.GetById 19ms RepoModel.GetById 0ms app.codeStats 0ms

/Templates/Ranking/player_top10.tpl

https://bitbucket.org/Dzoki/travianx
Smarty Template | 221 lines | 212 code | 9 blank | 0 comment | 37 complexity | 86ea0707be346430f9ef5d44a1c0b8c3 MD5 | raw file
  1. <?php
  2. $db_host=SQL_SERVER; $db_user=SQL_USER; $db_pass=SQL_PASS; $db_name=SQL_DB;
  3. $con = mysql_connect($db_host, $db_user, $db_pass);
  4. if (!$con)
  5. {
  6. die('Could not connect: ' . mysql_error());
  7. }
  8. for($i=1;$i<=0;$i++) {
  9. echo "Row ".$i;
  10. }
  11. mysql_select_db($db_name, $con);
  12. $result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 3 AND tribe<=3 ORDER BY ap DESC Limit 10");
  13. $result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE username = '".$session->username."' ORDER BY ap DESC Limit 1");
  14. ?>
  15. <table cellpadding="1" cellspacing="1">
  16. <thead>
  17. <tr>
  18. <th>Top 10 players<div id="submenu"><a title="Top 10" href="statistiken.php?id=1"><img class="active btn_top10" src="img/x.gif" alt="Top 10"></a><a title="defender" href="statistiken.php?id=32"><img class="btn_def" src="img/x.gif" alt="defender"></a><a title="attacker" href="statistiken.php?id=31"><img class="btn_off" src="img/x.gif" alt="attacker"></a></div><div id="submenu2"><a title="Romans" href="statistiken.php?id=11"><img class="btn_v1" src="img/x.gif" alt="attacker"></a><a title="Teutons" href="statistiken.php?id=12"><img class="btn_v2" src="img/x.gif" alt="attacker"></a><a title="Gauls" href="statistiken.php?id=13"><img class="btn_v3" src="img/x.gif" alt="attacker"></a></div></th>
  19. </tr>
  20. </thead>
  21. </table>
  22. <table cellpadding="1" cellspacing="1" id="top10_offs" class="top10 row_table_data">
  23. <thead>
  24. <tr>
  25. <th onclick="return Popup(3,5)"><img src="img/x.gif" class="help" alt="Instructions" title="Instructions">
  26. </th>
  27. <th colspan="2">Attackers of the week</th>
  28. </tr>
  29. <tr>
  30. <td>No.</td>
  31. <td>Player</td>
  32. <td>Points</td>
  33. </tr>
  34. </thead>
  35. <tbody>
  36. <?php
  37. while($row = mysql_fetch_array($result))
  38. {
  39. if($row['username']==$session->username) {
  40. echo "<tr class=\"own hl\">"; } else { echo "<tr>"; }
  41. echo "<td class=\"ra fc\">".$i++.".&nbsp;</td>";
  42. echo "<td class=\"pla\"><a href='spieler.php?uid=".$row['id']."'>".$row['username']."</a></td>";
  43. echo "<td class=\"val lc\">".$row['ap']."</td>";
  44. echo "</tr>";
  45. }
  46. ?>
  47. <tr>
  48. <td colspan="3" class="empty"></td>
  49. </tr>
  50. <?php
  51. while($row = mysql_fetch_array($result2))
  52. {
  53. if($row['username'] == $session->username) {
  54. echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
  55. echo "<td class=\"ra fc\">?&nbsp;</td>";
  56. if($row['username'] == $session->username) {
  57. echo "<td class=\"pla\">".$row['username']."</td>"; } else { echo "<td class=\"pla\"><a href='spieler.php?uid=".$row['id']."'>".$row['username']."</a></td>"; }
  58. echo "<td class=\"val lc\">".$row['ap']."</td>";
  59. echo "</tr>";
  60. }
  61. ?>
  62. </tbody>
  63. </table>
  64. <?php
  65. for($i=1;$i<=0;$i++) {
  66. echo "Row ".$i;
  67. }
  68. $result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 3 AND tribe<=3 ORDER BY dp DESC Limit 10");
  69. $result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE username = '".$session->username."' ORDER BY dp DESC Limit 1");
  70. ?>
  71. <table cellpadding="1" cellspacing="1" id="top10_defs" class="top10 row_table_data">
  72. <thead>
  73. <tr>
  74. <th onclick="return Popup(3,5)"><img src="img/x.gif" class="help" alt="Instructions" title="Instructions">
  75. </th>
  76. <th colspan="2">Defenders of the week</th>
  77. </tr>
  78. <tr>
  79. <td>No.</td>
  80. <td>Player</td>
  81. <td>Points</td>
  82. </tr>
  83. </thead>
  84. <tbody>
  85. <?php
  86. while($row = mysql_fetch_array($result))
  87. {
  88. if($row['username']==$session->username) {
  89. echo "<tr class=\"own hl\">"; } else { echo "<tr>"; }
  90. echo "<td class=\"ra fc\">".$i++.".&nbsp;</td>";
  91. echo "<td class=\"pla\"><a href='spieler.php?uid=".$row['id']."'>".$row['username']."</a></td>";
  92. echo "<td class=\"val lc\">".$row['dp']."</td>";
  93. echo "</tr>";
  94. }
  95. ?>
  96. <tr>
  97. <td colspan="3" class="empty"></td>
  98. </tr>
  99. <?php
  100. while($row = mysql_fetch_array($result2))
  101. {
  102. if($row['username'] == $session->username) {
  103. echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
  104. echo "<td class=\"ra fc\">?&nbsp;</td>";
  105. if($row['username'] == $session->username) {
  106. echo "<td class=\"pla\">".$row['username']."</td>"; } else { echo "<td class=\"pla\"><a href='spieler.php?uid=".$row['id']."'>".$row['username']."</a></td>"; }
  107. echo "<td class=\"val lc\">".$row['dp']."</td>";
  108. echo "</tr>";
  109. }
  110. ?>
  111. </tbody>
  112. </table>
  113. <?php
  114. for($i=1;$i<=0;$i++) {
  115. echo "Row ".$i;
  116. }
  117. $result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 3 AND tribe<=3 ORDER BY clp DESC Limit 10");
  118. $result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE username = '".$session->username."' ORDER BY clp DESC Limit 1");
  119. ?>
  120. <div class="clear"></div>
  121. <table cellpadding="1" cellspacing="1" id="top10_climbers" class="top10 row_table_data">
  122. <thead>
  123. <tr>
  124. <th onclick="return Popup(3,5)"><img src="img/x.gif" class="help" alt="Instructions" title="Instructions">
  125. </th>
  126. <th colspan="2">Climbers of the week</th>
  127. </tr>
  128. <tr>
  129. <td>No.</td>
  130. <td>Player</td>
  131. <td>Ranks</td>
  132. </tr>
  133. </thead>
  134. <tbody>
  135. <?php
  136. while($row = mysql_fetch_array($result))
  137. {
  138. if($row['username']==$session->username) {
  139. echo "<tr class=\"own hl\">"; } else { echo "<tr>"; }
  140. echo "<td class=\"ra fc\">".$i++.".&nbsp;</td>";
  141. echo "<td class=\"pla\"><a href='spieler.php?uid=".$row['id']."'>".$row['username']."</a></td>";
  142. echo "<td class=\"val lc\">".$row['clp']."</td>";
  143. echo "</tr>";
  144. }
  145. ?>
  146. <tr>
  147. <td colspan="3" class="empty"></td>
  148. </tr>
  149. <?php
  150. while($row = mysql_fetch_array($result2))
  151. {
  152. if($row['username'] == $session->username) {
  153. echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
  154. echo "<td class=\"ra fc\">?&nbsp;</td>";
  155. if($row['username'] == $session->username) {
  156. echo "<td class=\"pla\">".$row['username']."</td>"; } else { echo "<td class=\"pla\"><a href='spieler.php?uid=".$row['id']."'>".$row['username']."</a></td>"; } echo "<td class=\"val lc\">".$row['clp']."</td>";
  157. echo "</tr>";
  158. }
  159. ?>
  160. </tbody>
  161. </table>
  162. <?php
  163. for($i=1;$i<=0;$i++) {
  164. echo "Row ".$i;
  165. }
  166. $result = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE access<".(INCLUDE_ADMIN?"10":"8")." AND id > 3 AND tribe<=3 ORDER BY RR DESC Limit 10");
  167. $result2 = mysql_query("SELECT * FROM ".TB_PREFIX."users WHERE username = '".$session->username."' ORDER BY RR DESC Limit 1");
  168. ?>
  169. <table cellpadding="1" cellspacing="1" id="top10_raiders" class="top10 row_table_data">
  170. <thead>
  171. <tr>
  172. <th onclick="return Popup(3,5)"><img src="img/x.gif" class="help" alt="Instructions" title="Instructions">
  173. </th>
  174. <th colspan="2">Robbers of the week</th>
  175. </tr>
  176. <tr>
  177. <td>No.</td>
  178. <td>Player</td>
  179. <td>Resources</td>
  180. </tr>
  181. </thead>
  182. <tbody>
  183. <?php
  184. while($row = mysql_fetch_array($result))
  185. {
  186. if($row['username']==$session->username) {
  187. echo "<tr class=\"own hl\">"; } else { echo "<tr>"; }
  188. echo "<td>".$i++.".&nbsp;</td>";
  189. echo "<td><a href='spieler.php?uid=".$row['id']."'>".$row['username']."</a></td>";
  190. echo "<td>".$row['RR']."</td>";
  191. echo "</tr>";
  192. }
  193. ?>
  194. <tr>
  195. <td colspan="3" class="empty"></td>
  196. </tr>
  197. <?php
  198. while($row = mysql_fetch_array($result2))
  199. {
  200. if($row['username'] == $session->username) {
  201. echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
  202. echo "<td class=\"ra fc\">?&nbsp;</td>";
  203. if($row['username'] == $session->username) {
  204. echo "<td class=\"pla\">".$row['username']."</td>"; } else { echo "<td class=\"pla\"><a href='spieler.php?uid=".$row['id']."'>".$row['username']."</a></td>"; }
  205. echo "<td class=\"val lc\">".$row['RR']."</td>";
  206. echo "</tr>";
  207. }
  208. mysql_close($con);
  209. ?>
  210. </tbody>
  211. </table>
  212. <div>