PageRenderTime 55ms CodeModel.GetById 24ms RepoModel.GetById 1ms app.codeStats 0ms

/Templates/Ranking/ally_top10.tpl

https://bitbucket.org/Dzoki/travianx
Smarty Template | 222 lines | 213 code | 9 blank | 0 comment | 37 complexity | 5a1c43f58676ef28c665d30bb7e54dd0 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."alidata ORDER BY ap DESC Limit 10");
  13. $result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY ap DESC Limit 1");
  14. ?>
  15. <table cellpadding="1" cellspacing="1">
  16. <thead>
  17. <tr>
  18. <th>Top 10 Alliances<div id="submenu"><a title="Top 10" href="statistiken.php?id=43"><img class="active btn_top10" src="img/x.gif" alt="Top 10"></a><a title="defender" href="statistiken.php?id=42"><img class="btn_def" src="img/x.gif" alt="defender"></a><a title="attacker" href="statistiken.php?id=41"><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>Alliance</td>
  32. <td>Points</td>
  33. </tr>
  34. </thead>
  35. <tbody>
  36. <?php
  37. while($row = mysql_fetch_array($result))
  38. {
  39. if($row['id']==$session->alliance) {
  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='allianz.php?aid=".$row['id']."'>".$row['tag']."</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['id'] == $session->alliance) {
  54. echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
  55. echo "<td class=\"ra fc\">?&nbsp;</td>";
  56. if($row['id'] == $session->alliance) {
  57. echo "<td class=\"pla\">".$row['tag']."</td>"; } else { echo "<td class=\"pla\"><a href='allianz.php?aid=".$row['id']."'>".$row['tag']."</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."alidata ORDER BY dp DESC Limit 10");
  69. $result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' 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>Alliance</td>
  81. <td>Points</td>
  82. </tr>
  83. </thead>
  84. <tbody>
  85. <?php
  86. while($row = mysql_fetch_array($result))
  87. {
  88. if($row['id']==$session->alliance) {
  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='allianz.php?aid=".$row['id']."'>".$row['tag']."</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['id'] == $session->alliance) {
  103. echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
  104. echo "<td class=\"ra fc\">?&nbsp;</td>";
  105. if($row['id'] == $session->alliance) {
  106. echo "<td class=\"pla\">".$row['tag']."</td>"; } else { echo "<td class=\"pla\"><a href='allianz.php?aid=".$row['id']."'>".$row['tag']."</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."alidata ORDER BY clp DESC Limit 10");
  118. $result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' 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>Alliance</td>
  131. <td>Ranks</td>
  132. </tr>
  133. </thead>
  134. <tbody>
  135. <?php
  136. while($row = mysql_fetch_array($result))
  137. {
  138. if($row['id']==$session->alliance) {
  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='allianz.php?aid=".$row['id']."'>".$row['tag']."</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['id'] == $session->alliance) {
  153. echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
  154. echo "<td class=\"ra fc\">?&nbsp;</td>";
  155. if($row['id'] == $session->alliance) {
  156. echo "<td class=\"pla\">".$row['tag']."</td>"; } else { echo "<td class=\"pla\"><a href='allianz.php?aid=".$row['id']."'>".$row['tag']."</a></td>"; }
  157. echo "<td class=\"val lc\">".$row['clp']."</td>";
  158. echo "</tr>";
  159. }
  160. ?>
  161. </tbody>
  162. </table>
  163. <?php
  164. for($i=1;$i<=0;$i++) {
  165. echo "Row ".$i;
  166. }
  167. $result = mysql_query("SELECT * FROM ".TB_PREFIX."alidata ORDER BY RR DESC Limit 10");
  168. $result2 = mysql_query("SELECT * FROM ".TB_PREFIX."alidata WHERE id = '".$session->alliance."' ORDER BY RR DESC Limit 1");
  169. ?>
  170. <table cellpadding="1" cellspacing="1" id="top10_raiders" class="top10 row_table_data">
  171. <thead>
  172. <tr>
  173. <th onclick="return Popup(3,5)"><img src="img/x.gif" class="help" alt="Instructions" title="Instructions">
  174. </th>
  175. <th colspan="2">Robbers of the week</th>
  176. </tr>
  177. <tr>
  178. <td>No.</td>
  179. <td>Alliance</td>
  180. <td>Resources</td>
  181. </tr>
  182. </thead>
  183. <tbody>
  184. <?php
  185. while($row = mysql_fetch_array($result))
  186. {
  187. if($row['id']==$session->alliance) {
  188. echo "<tr class=\"own hl\">"; } else { echo "<tr>"; }
  189. echo "<td class=\"ra fc\">".$i++.".&nbsp;</td>";
  190. echo "<td class=\"pla\"><a href='allianz.php?aid=".$row['id']."'>".$row['tag']."</a></td>";
  191. echo "<td class=\"val lc\">".$row['RR']."</td>";
  192. echo "</tr>";
  193. }
  194. ?>
  195. <tr>
  196. <td colspan="3" class="empty"></td>
  197. </tr>
  198. <?php
  199. while($row = mysql_fetch_array($result2))
  200. {
  201. if($row['id'] == $session->alliance) {
  202. echo "<tr class=\"none\">"; } else { echo "<tr class=\"own hl\">"; }
  203. echo "<td class=\"ra fc\">?&nbsp;</td>";
  204. if($row['id'] == $session->alliance) {
  205. echo "<td class=\"pla\">".$row['tag']."</td>"; } else { echo "<td class=\"pla\"><a href='allianz.php?aid=".$row['id']."'>".$row['tag']."</a></td>"; }
  206. echo "<td class=\"val lc\">".$row['RR']."</td>";
  207. echo "</tr>";
  208. }
  209. mysql_close($con);
  210. ?>
  211. </tbody>
  212. </table>
  213. <div>