guild.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326
  1. <?php
  2. /**
  3. * Guild view.
  4. *
  5. * Contains the view layout and some code to present the data.
  6. *
  7. * @category View
  8. * @var Guild_Page $page The page model.
  9. */
  10. ?>
  11. <!DOCTYPE html>
  12. <html lang='en'>
  13. <head>
  14. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  15. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  16. <title><?=$page->title?></title>
  17. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  18. <!-- CSS files -->
  19. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui.css'/>
  20. <?php
  21. if ($MODE == GAME_MODE_ID::RTA){
  22. ?>
  23. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui-rta.css'/>
  24. <?php
  25. }
  26. ?>
  27. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>guild.css'/>
  28. <!-- Meta tags -->
  29. <link rel='canonical' href='<?=$page->canonical?>'/>
  30. <link rel='author' href='<?=$page->author?>'/>
  31. <link rel='publisher' href='<?=$page->author?>'/>
  32. <meta name='description' content='<?=$page->description?>'/>
  33. <meta property='og:title' content='<?=$page->title?>'/>
  34. <meta property='og:url' content='<?=$page->canonical?>'/>
  35. <meta property='og:description' content='<?=$page->description?>'/>
  36. <meta property='og:image' content='<?=$page->icon?>'/>
  37. <meta property='og:site_name' content='<?=$page->name?>'/>
  38. <meta property='og:type' content='website'/>
  39. <meta property='og:locale' content='en'/>
  40. <meta name='twitter:card' content='summary'/>
  41. <meta name='twitter:title' content='<?=$page->title?>'/>
  42. <meta name='twitter:description' content='<?=$page->description?>'/>
  43. <meta name='twitter:image' content='<?=$page->icon?>'/>
  44. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  45. <meta name='robots' content='index follow'/>
  46. </head>
  47. <body>
  48. <?php
  49. include __DIR__ . "/inc/header.php";
  50. ?>
  51. <aside>
  52. <?php
  53. if (!isset($page->guild)){
  54. ?>
  55. <h2>
  56. Guild
  57. </h2>
  58. <p>
  59. You are not currently in a guild.
  60. </p>
  61. <?php
  62. }
  63. else{
  64. ?>
  65. <h2>
  66. <?=$page->guild->name?>
  67. </h2>
  68. <span id='guild_level'>
  69. Lv. <?=$page->guild->level?>
  70. </span>
  71. <span id='guild_experience'>
  72. (Exp: <?=$page->guild->experience?>)
  73. </span>
  74. <p id='guild_comment'>
  75. <?=$page->guild->comment?>
  76. </p>
  77. <p id='guild_notice'>
  78. <?=$page->guild->notice?>
  79. </p>
  80. <?php
  81. }
  82. ?>
  83. </aside>
  84. <main>
  85. <?php
  86. if (!isset($page->guild)){
  87. ?>
  88. <section id='no_guild'>
  89. <h2>
  90. Guild
  91. </h2>
  92. You are not currently in a guild.
  93. </section>
  94. <?php
  95. }
  96. else{
  97. ?>
  98. <section id='guild_info' class='content'>
  99. <h2>
  100. <?=$page->guild->name?>
  101. </h2>
  102. <div id='guild_details'>
  103. <div id='guild_skills'>
  104. <?php
  105. foreach ($page->skill_groups as $group){
  106. ?>
  107. <div class='skill_group'>
  108. <span class='skill_group_title'>
  109. <?=$group->name?>
  110. </span>
  111. <img class='skill_group_image' alt='<?=$group->name?>' src='<?=$group->get_image()?>'/>
  112. <div class='skill_group_content'>
  113. <span class='description'>
  114. <?=$group->description?>
  115. </span>
  116. <ul>
  117. <?php
  118. foreach ($group->skills as $skill){
  119. if ($skill->level > $page->guild->level){
  120. $unavailable = "unavailable";
  121. }
  122. else{
  123. $unavailable = "";
  124. }
  125. ?>
  126. <li class='<?=$unavailable?>'>
  127. Lv. <?=$skill->level?>: <?=$skill->effect?>
  128. </li>
  129. <?php
  130. }
  131. ?>
  132. </ul>
  133. </div>
  134. </div>
  135. <?php
  136. }
  137. ?>
  138. </div>
  139. </div>
  140. <table id='guild_members'>
  141. <tr>
  142. <th>
  143. &nbsp;
  144. </th>
  145. <th>
  146. Name
  147. </th>
  148. <th>
  149. Lv.
  150. </th>
  151. <th colspan='2'>
  152. Arena
  153. </th>
  154. <th>
  155. War
  156. </th>
  157. <th>
  158. Def
  159. </th>
  160. <th>
  161. Login
  162. </th>
  163. </tr>
  164. <?php
  165. $odd = "";
  166. foreach ($page->guild->members as $member){
  167. ?>
  168. <tr>
  169. <td class='grade <?=$odd?>'>
  170. <?php
  171. if ($member->grade == GUILD_MEMBER_GRADE_ID::LEADER){
  172. ?>
  173. <img alt='yes' src='<?=URL::IMG["ICON"] . "leader.png"?>'/>
  174. <?php
  175. }
  176. elseif ($member->grade == GUILD_MEMBER_GRADE_ID::VICELEADER){
  177. ?>
  178. <img alt='yes' src='<?=URL::IMG["ICON"] . "viceleader.png"?>'/>
  179. <?php
  180. }
  181. ?>
  182. </td>
  183. <td class='name <?=$odd?>'>
  184. <?=$member->name?>
  185. </td>
  186. <td class='level <?=$odd?>'>
  187. <?=$member->level?>
  188. </td>
  189. <td class='score <?=$odd?>'>
  190. <?=$member->arena_score?>
  191. </td>
  192. <td class='score_icon <?=$odd?>'>
  193. <?php
  194. if ($member->arena_score >= ARENA_RANKING_POINTS::BEGINER && (ARENA_RANKING_RANK::BEGINER == null || $member->rating <= ARENA_RANKING_RANK::BEGINER)){
  195. $src = URL::IMG["RANK"] . "0900.png";
  196. $tit = "Beginer";
  197. }
  198. if ($member->arena_score >= ARENA_RANKING_POINTS::CHALLENGER_1 && (ARENA_RANKING_RANK::CHALLENGER_1 == null || $member->rating <= ARENA_RANKING_RANK::CHALLENGER_1)){
  199. $src = URL::IMG["RANK"] . "1001.png";
  200. $tit = "Challenger 1";
  201. }
  202. if ($member->arena_score >= ARENA_RANKING_POINTS::CHALLENGER_2 && (ARENA_RANKING_RANK::CHALLENGER_2 == null || $member->rating <= ARENA_RANKING_RANK::CHALLENGER_2)){
  203. $src = URL::IMG["RANK"] . "1002.png";
  204. $tit = "Challenger 2";
  205. }
  206. if ($member->arena_score >= ARENA_RANKING_POINTS::CHALLENGER_3 && (ARENA_RANKING_RANK::CHALLENGER_3 == null || $member->rating <= ARENA_RANKING_RANK::CHALLENGER_3)){
  207. $src = URL::IMG["RANK"] . "1003.png";
  208. $tit = "Challenger 3";
  209. }
  210. if ($member->arena_score >= ARENA_RANKING_POINTS::FIGHTER_1 && (ARENA_RANKING_RANK::FIGHTER_1 == null || $member->rating <= ARENA_RANKING_RANK::FIGHTER_1)){
  211. $src = URL::IMG["RANK"] . "2001.png";
  212. $tit = "Fighter 1";
  213. }
  214. if ($member->arena_score >= ARENA_RANKING_POINTS::FIGHTER_2 && (ARENA_RANKING_RANK::FIGHTER_2 == null || $member->rating <= ARENA_RANKING_RANK::FIGHTER_2)){
  215. $src = URL::IMG["RANK"] . "2002.png";
  216. $tit = "Fighter 2";
  217. }
  218. if ($member->arena_score >= ARENA_RANKING_POINTS::FIGHTER_3 && (ARENA_RANKING_RANK::FIGHTER_3 == null || $member->rating <= ARENA_RANKING_RANK::FIGHTER_3)){
  219. $src = URL::IMG["RANK"] . "2003.png";
  220. $tit = "Fighter 3";
  221. }
  222. if ($member->arena_score >= ARENA_RANKING_POINTS::CONQUEROR_1 && (ARENA_RANKING_RANK::CONQUEROR_1 == null || $member->rating <= ARENA_RANKING_RANK::CONQUEROR_1)){
  223. $src = URL::IMG["RANK"] . "3001.png";
  224. $tit = "Conqueror 1";
  225. }
  226. if ($member->arena_score >= ARENA_RANKING_POINTS::CONQUEROR_2 && (ARENA_RANKING_RANK::CONQUEROR_2 == null || $member->rating <= ARENA_RANKING_RANK::CONQUEROR_2)){
  227. $src = URL::IMG["RANK"] . "3002.png";
  228. $tit = "Conqueror 2";
  229. }
  230. if ($member->arena_score >= ARENA_RANKING_POINTS::CONQUEROR_3 && (ARENA_RANKING_RANK::CONQUEROR_3 == null || $member->rating <= ARENA_RANKING_RANK::CONQUEROR_3)){
  231. $src = URL::IMG["RANK"] . "3003.png";
  232. $tit = "Conqueror 3";
  233. }
  234. if ($member->arena_score >= ARENA_RANKING_POINTS::GUARDIAN_1 && (ARENA_RANKING_RANK::GUARDIAN_1 == null || $member->rating <= ARENA_RANKING_RANK::GUARDIAN_1)){
  235. $src = URL::IMG["RANK"] . "4001.png";
  236. $tit = "Guardian 1";
  237. }
  238. if ($member->arena_score >= ARENA_RANKING_POINTS::GUARDIAN_2 && (ARENA_RANKING_RANK::GUARDIAN_2 == null || $member->rating <= ARENA_RANKING_RANK::GUARDIAN_2)){
  239. $src = URL::IMG["RANK"] . "4002.png";
  240. $tit = "Guardian 2";
  241. }
  242. if ($member->arena_score >= ARENA_RANKING_POINTS::GUARDIAN_3 && (ARENA_RANKING_RANK::GUARDIAN_3 == null || $member->rating <= ARENA_RANKING_RANK::GUARDIAN_3)){
  243. $src = URL::IMG["RANK"] . "4003.png";
  244. $tit = "Guardian 3";
  245. }
  246. if ($member->arena_score >= ARENA_RANKING_POINTS::LEGEND && (ARENA_RANKING_RANK::LEGEND == null || $member->rating <= ARENA_RANKING_RANK::LEGEND)){
  247. $src = URL::IMG["RANK"] . "5001.png";
  248. $tit = "Legend";
  249. }
  250. ?>
  251. <img alt='<?=$tit?>' src='<?=$src?>'/>
  252. </td>
  253. <td class='war <?=$odd?>'>
  254. <?php
  255. if ($member->in_war){
  256. ?>
  257. <img alt='yes' src='<?=URL::IMG["ICON"] . "ok.png"?>'/>
  258. <?php
  259. }
  260. ?>
  261. </td>
  262. <td class='defense <?=$odd?>'>
  263. <?php
  264. if ($member->has_defense){
  265. ?>
  266. <img alt='yes' src='<?=URL::IMG["ICON"] . "ok.png"?>'/>
  267. <?php
  268. }
  269. ?>
  270. </td>
  271. <?php
  272. $now = time();
  273. $date = (new DateTime("@$member->last_login"))->format('Y-m-d H:i:s');
  274. $days = $now - strtotime($date);
  275. $days = floor($days / (60 * 60 * 24));
  276. if ($days == 0){
  277. $hours = floor($days / (60 * 60));
  278. if ($hours == 0){
  279. $last_login = "Online";
  280. }
  281. else if ($hours == 1){
  282. $last_login = "1 hour";
  283. }
  284. else{
  285. $last_login = floor($days / (60 * 60)) . " hours";
  286. }
  287. $warning = "";
  288. }
  289. else{
  290. $last_login = "$days days";
  291. if ($days < 2){
  292. $last_login = "$days day";
  293. $warning = "";
  294. }
  295. elseif ($days < 5){
  296. $warning = "warning";
  297. }
  298. else{
  299. $warning = "danger";
  300. }
  301. }
  302. ?>
  303. <td class='last_login <?=$odd?> <?=$warning?>'>
  304. <?=$last_login?>
  305. </td>
  306. </tr>
  307. <?php
  308. if ($odd == ""){
  309. $odd = "odd";
  310. }
  311. else{
  312. $odd = "";
  313. }
  314. }
  315. ?>
  316. </table>
  317. </section>
  318. <?php
  319. }
  320. ?>
  321. </main>
  322. <?php
  323. include __DIR__ . "/inc/footer.php";
  324. ?>
  325. </body>
  326. </html>