guild.php 15 KB

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