home.php 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. <?php
  2. /**
  3. * Home view.
  4. *
  5. * Contains the view layout and some code to present the data.
  6. *
  7. * @category View
  8. * @var Home_Page $page The page model.
  9. * @var int $UID User id.
  10. * @var int[] $EFFECT_AREA Required constants.
  11. */
  12. ?>
  13. <!DOCTYPE html>
  14. <html lang='en'>
  15. <head>
  16. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  17. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  18. <title><?=$page->title?></title>
  19. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  20. <!-- CSS files -->
  21. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui.css'/>
  22. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>home.css'/>
  23. <!-- Meta tags -->
  24. <link rel='canonical' href='<?=$page->canonical?>'/>
  25. <link rel='author' href='<?=$page->author?>'/>
  26. <link rel='publisher' href='<?=$page->author?>'/>
  27. <meta name='description' content='<?=$page->description?>'/>
  28. <meta property='og:title' content='<?=$page->title?>'/>
  29. <meta property='og:url' content='<?=$page->canonical?>'/>
  30. <meta property='og:description' content='<?=$page->description?>'/>
  31. <meta property='og:image' content='<?=$page->icon?>'/>
  32. <meta property='og:site_name' content='<?=$page->name?>'/>
  33. <meta property='og:type' content='website'/>
  34. <meta property='og:locale' content='en'/>
  35. <meta name='twitter:card' content='summary'/>
  36. <meta name='twitter:title' content='<?=$page->title?>'/>
  37. <meta name='twitter:description' content='<?=$page->description?>'/>
  38. <meta name='twitter:image' content='<?=$page->icon?>'/>
  39. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  40. <meta name='robots' content='index follow'/>
  41. </head>
  42. <body>
  43. <?php
  44. include __DIR__ . "/inc/header.php";
  45. ?>
  46. <aside>
  47. <h2>
  48. <?=$page->player->name?>
  49. </h2>
  50. <p>
  51. <?=$page->player->name?>'s profile
  52. </p>
  53. <table id='profile'>
  54. <tr>
  55. <td class='label'>
  56. Lv.
  57. </td>
  58. <td class='value'>
  59. <?=$page->player->level?>
  60. </td>
  61. </tr>
  62. <tr>
  63. <td class='label'>
  64. Exp.
  65. </td>
  66. <td class='value'>
  67. <?=$page->player->experience?>
  68. </td>
  69. </tr>
  70. <tr>
  71. <td class='label'>
  72. Country
  73. </td>
  74. <td class='value'>
  75. <?=$page->player->country?>
  76. </td>
  77. </tr>
  78. <tr>
  79. <td class='label'>
  80. Since
  81. </td>
  82. <td class='value'>
  83. <?=date('Y-m-d', $page->player->joined)?>
  84. </td>
  85. </tr>
  86. <tr>
  87. <td class='label'>
  88. Days
  89. </td>
  90. <td class='value'>
  91. <?=round((time() - $page->player->joined) / (60 * 60 * 24))?>
  92. </td>
  93. </tr>
  94. </table>
  95. </aside>
  96. <main>
  97. <section class='content'>
  98. <h2>
  99. <span>
  100. Summoners War DataBase
  101. </span>
  102. </h2>
  103. <article id='profile'>
  104. <div class='panel' id='panel_left'>
  105. <div id='placements' class='profile_section'>
  106. <h4>
  107. Placements
  108. </h4>
  109. <div id='placements_rep'>
  110. <h5>
  111. Rep monster:
  112. </h5>
  113. <div class='monster_panel'>
  114. <?=HTML::unit_panel($page->player->rep)?>
  115. </div> <!-- .monster_panel -->
  116. </div>
  117. <div id='placements_arena'>
  118. <h5>
  119. Arena defense:
  120. </h5>
  121. <?php
  122. $first = true;
  123. foreach ($page->player->defense as $defense){
  124. ?>
  125. <div class='monster_panel'>
  126. <?=HTML::unit_panel($defense)?>
  127. </div>
  128. <?php
  129. if ($first && isset($defense->unit->leader_skill) && ($defense->unit->leader_skill->area == $EFFECT_AREA["GENERAL"] || $defense->unit->leader_skill->area == $EFFECT_AREA["ARENA"])){
  130. ?>
  131. <div class='skill'>
  132. <img class='skill_img' title='<?=$defense->unit->leader_skill->create_description()?>' src='<?=$defense->unit->leader_skill->get_image()?>'/>
  133. </div>
  134. <?php
  135. }
  136. $first = false;
  137. }
  138. ?>
  139. </div>
  140. <div id='placements_gw'>
  141. <h5>
  142. Guild War defense:
  143. </h5>
  144. <?php
  145. $first = true;
  146. foreach ($page->player->gw_defense[0] as $defense){
  147. ?>
  148. <div class='monster_panel'>
  149. <?=HTML::unit_panel($defense)?>
  150. </div>
  151. <?php
  152. if ($first && isset($defense->unit->leader_skill) && ($defense->unit->leader_skill->area == $EFFECT_AREA["GENERAL"] || $defense->unit->leader_skill->area == $EFFECT_AREA["ARENA"])){
  153. ?>
  154. <div class='skill'>
  155. <img class='skill_img' title='<?=$defense->unit->leader_skill->create_description()?>' src='<?=$defense->unit->leader_skill->get_image()?>'/>
  156. </div>
  157. <?php
  158. }
  159. $first = false;
  160. }
  161. ?>
  162. <hr/>
  163. <?php
  164. $first = true;
  165. foreach ($page->player->gw_defense[1] as $defense){
  166. ?>
  167. <div class='monster_panel'>
  168. <?=HTML::unit_panel($defense)?>
  169. </div>
  170. <?php
  171. if ($first && isset($defense->unit->leader_skill) && ($defense->unit->leader_skill->area == $EFFECT_AREA["GENERAL"] || $defense->unit->leader_skill->area == $EFFECT_AREA["ARENA"])){
  172. ?>
  173. <div class='skill'>
  174. <img class='skill_img' title='<?=$defense->unit->leader_skill->create_description()?>' src='<?=$defense->unit->leader_skill->get_image()?>'/>
  175. </div>
  176. <?php
  177. }
  178. $first = false;
  179. }
  180. ?>
  181. </div>
  182. </div>
  183. <div id='building' class='profile_section'>
  184. <h4>
  185. Buildings
  186. </h4>
  187. <?php
  188. // Buildings
  189. $half = sizeof($page->player->building) / 2;
  190. $i = 0;
  191. foreach ($page->player->building as $building){
  192. if ($i == $half){
  193. ?>
  194. <br class='desktop'/>
  195. <?php
  196. }
  197. ?>
  198. <?=HTML::building_panel($building)?>
  199. <?php
  200. $i ++;
  201. }
  202. ?>
  203. <br/>
  204. <?php
  205. // Decorations
  206. $half = sizeof($page->player->decoration) / 2;
  207. $i = 0;
  208. foreach ($page->player->decoration as $decoration){
  209. if ($i == $half){
  210. ?>
  211. <br class='desktop'/>
  212. <?php
  213. }
  214. ?>
  215. <?=HTML::building_panel($decoration)?>
  216. <?php
  217. $i ++;
  218. }
  219. ?>
  220. </div>
  221. <div class='inventory profile_section' id='inventory'>
  222. <h4>
  223. Inventory
  224. </h4>
  225. <ul>
  226. <li>
  227. <img title='Energy' src='<?=URL::IMG["CURRENCY"]?>energy.png'/>
  228. <?=$page->player->currency["energy"]?> / <?=$page->player->currency["energy_max"]?>
  229. </li>
  230. <li>
  231. <img title='Arena Invitations' src='<?=URL::IMG["CURRENCY"]?>arenaenergy.png'/>
  232. <?=$page->player->currency["arena_energy"]?> / <?=$page->player->currency["arena_energy_max"]?>
  233. </li>
  234. <li>
  235. <img title='Dimensional Energy' src='<?=URL::IMG["CURRENCY"]?>dimensionenergy.png'/>
  236. <?=$page->player->currency["dimension_energy"]?> / <?=$page->player->currency["dimension_energy_max"]?>
  237. </li>
  238. <li>
  239. <img title='Dimensional Crystal' src='<?=URL::IMG["CURRENCY"]?>darkportalenergy.png'/>
  240. <?=$page->player->currency["darkportal_energy"]?> / <?=$page->player->currency["darkportal_energy_max"]?>
  241. </li>
  242. <li>
  243. <img title='Mana' src='<?=URL::IMG["CURRENCY"]?>mana.png'/>
  244. <?=$page->player->currency["mana"]?>
  245. </li>
  246. <li>
  247. <img title='Crystal' src='<?=URL::IMG["CURRENCY"]?>crystal.png'/>
  248. <?=$page->player->currency["crystal"]?>
  249. </li>
  250. <li>
  251. <img title='Social Points' src='<?=URL::IMG["CURRENCY"]?>socialpoint.png'/>
  252. <?=$page->player->currency["social_point"]?>
  253. </li>
  254. <li>
  255. <img title='Honor Points' src='<?=URL::IMG["CURRENCY"]?>honor.png'/>
  256. <?=$page->player->currency["honor_point"]?>
  257. </li>
  258. <li>
  259. <img title='Guild Points' src='<?=URL::IMG["CURRENCY"]?>guildpoint.png'/>
  260. <?=$page->player->currency["guild_point"]?>
  261. </li>
  262. <li>
  263. <img title='Honor Medals' src='<?=URL::IMG["CURRENCY"]?>badge.png'/>
  264. <?=$page->player->currency["honor_medal"]?>
  265. </li>
  266. <li>
  267. <img src='<?=URL::IMG["CURRENCY"]?>mark.png'/>
  268. <?=$page->player->currency["honor_mark"]?>
  269. </li>
  270. <li>
  271. <img title='Ancient Coins' src='<?=URL::IMG["CURRENCY"]?>ancientcoin.png'/>
  272. <?=$page->player->currency["event_coin"]?>
  273. </li>
  274. <li>
  275. <img title='Ancient Crystal' src='<?=URL::IMG["CURRENCY"]?>ancientstone.png'/>
  276. <?=$page->player->currency["ancient_stone"]?>
  277. </li>
  278. <li>
  279. <img title='Shapeshifting Stones' src='<?=URL::IMG["CURRENCY"]?>costumestone.png'/>
  280. <?=$page->player->currency["costume_point"]?>
  281. </li>
  282. </ul>
  283. <?php
  284. // Scrolls
  285. $half = sizeof($page->player->building) / 2;
  286. $i = 0;
  287. foreach ($page->player->inventory_scroll as $item){
  288. if ($half > 6 && $i == $half){
  289. ?>
  290. <br class='desktop'/>
  291. <?php
  292. }
  293. ?>
  294. <?=HTML::item_panel($item)?>
  295. <?php
  296. $i ++;
  297. }
  298. ?>
  299. <br/>
  300. <?php
  301. // Rune craft materials
  302. $prev = 0;
  303. foreach ($page->player->inventory_craft_rune as $item){
  304. ?>
  305. <?=HTML::item_panel($item)?>
  306. <?php
  307. $prev = $item->id;
  308. }
  309. ?>
  310. <br/>
  311. <?php
  312. // Other craft materials
  313. $prev = 0;
  314. foreach ($page->player->inventory_craft as $item){
  315. if ($prev != 0 && $prev < 5000 && $item->id > 5000){
  316. ?>
  317. <br class='desktop'/>
  318. <?php
  319. }
  320. ?>
  321. <?=HTML::item_panel($item)?>
  322. <?php
  323. $prev = $item->id;
  324. }
  325. ?>
  326. <br/>
  327. <?php
  328. // Essences
  329. $prev = "";
  330. $i = 0;
  331. foreach ($page->player->inventory_essence as $item){
  332. //if ($prev != "" && $prev != preg_split('/\s+/', $item->name)[2]){
  333. if ($i > 0 && $i % 6 == 0){
  334. ?>
  335. <br class='desktop'/>
  336. <?php
  337. }
  338. ?>
  339. <?=HTML::item_panel($item)?>
  340. <?php
  341. $prev = preg_split('/\s+/', $item->name)[2];
  342. $i ++;
  343. }
  344. ?>
  345. </div>
  346. </div> <!-- #panel_left -->
  347. <div class='panel' id='panel_right'>
  348. <div class='profile_section' id='records'>
  349. <h4>
  350. Records
  351. </h4>
  352. <div class='record'>
  353. <table id='rank_records'>
  354. <tr>
  355. <td class='label'>
  356. Arena
  357. </td>
  358. <td class='value rank'>
  359. <?=HTML::arena_rank_icon($page->player->top_rank_arena)?>
  360. </td>
  361. </tr>
  362. <tr>
  363. <td class='label'>
  364. World Arena
  365. </td>
  366. <td class='value rank'>
  367. <?=HTML::arena_rank_icon($page->player->top_rank_world_arena)?>
  368. </td>
  369. </tr>
  370. <tr>
  371. <td class='label'>
  372. Special League
  373. </td>
  374. <td class='value rank'>
  375. <?=HTML::arena_rank_icon($page->player->top_rank_special_league)?>
  376. </td>
  377. </tr>
  378. <tr>
  379. <td class='label'>
  380. Guild War
  381. </td>
  382. <td class='value rank'>
  383. <?=HTML::arena_rank_icon($page->player->top_rank_gw - 10)?>
  384. </td>
  385. </tr>
  386. <tr>
  387. <td class='label'>
  388. Siege Battle
  389. </td>
  390. <td class='value rank'>
  391. <?=HTML::arena_rank_icon($page->player->top_rank_siege)?>
  392. </td>
  393. </tr>
  394. <tr>
  395. <td class='label'>
  396. World Boss
  397. </td>
  398. <td class='value wboss'>
  399. <?=WORLD_BOSS_RANK_ID::RANK[$page->player->top_rank_wboss]?>
  400. </td>
  401. </tr>
  402. <tr>
  403. <td class='label'>
  404. Trial of Ascension (N)
  405. </td>
  406. <td class='value toa'>
  407. <?=$page->player->top_rank_toan?>F
  408. </td>
  409. </tr>
  410. <tr>
  411. <td class='label'>
  412. Trial of Ascension (N)
  413. </td>
  414. <td class='value toa'>
  415. <?=$page->player->top_rank_toah?>F
  416. </td>
  417. </tr>
  418. </table>
  419. <table id='battle_records'>
  420. <?php
  421. foreach ($page->player->record as $record){
  422. ?>
  423. <tr>
  424. <td class='record_dungeon'>
  425. <img title='<?=$record->area->name?>' class='area' src='<?=$record->area->get_image()?>'/>
  426. </td>
  427. <td class='record_info'>
  428. <span class='title'>
  429. <?php
  430. $title = "";
  431. switch ($record->area->type){
  432. case AREA_TYPE_ID::CAIROS_DUNGEON:
  433. $title = $record->area->name . " " . $record->stage . "F";
  434. break;
  435. case AREA_TYPE_ID::RIFT_DUNGEON:
  436. $title = $record->area->name;
  437. break;
  438. case AREA_TYPE_ID::RIFT_RAID:
  439. $title = $record->area->name;
  440. }
  441. ?>
  442. <?=$title?>
  443. </span>
  444. <?php
  445. if ($record->area->type == AREA_TYPE_ID::RIFT_DUNGEON){
  446. ?>
  447. <span class='score'>
  448. <?=$record->score?>
  449. </span>
  450. <span class='rank'>
  451. <?=$record->rank?>
  452. </span>
  453. <?php
  454. }
  455. else{
  456. $s = floor($record->time / 1000);
  457. $m = floor($s / 60);
  458. $s = floor($s % 60);
  459. $ms = ($record-> time - (1000 * 60 * $m) - (1000 * 60 * $s) / 100);
  460. $s = str_pad($s, 2, '0', STR_PAD_LEFT);
  461. $ms = str_pad($ms, 2, '0', STR_PAD_LEFT);
  462. ?>
  463. <span class='time'>
  464. <?=$m?>:<?=$s?><span class='ms'>.<?=$ms?></span>
  465. </span>
  466. <?php
  467. }
  468. ?>
  469. </td>
  470. <?php
  471. $class_frontline = "";
  472. if ($record->area->type == AREA_TYPE_ID::RIFT_DUNGEON || $record->area->type == AREA_TYPE_ID::RIFT_RAID){
  473. $class_frontline = "frontlines";
  474. }
  475. ?>
  476. <td class='record_party <?=$class_frontline?>'>
  477. <?php
  478. $prev_front = false;
  479. $front = "undefined";
  480. foreach ($record->party as $party){
  481. $front = in_array($party->id, $record->frontline);
  482. if ($front != "undefined" && $prev_front != $front){
  483. ?>
  484. <hr class='frontline'/>
  485. <?php
  486. }
  487. if ($party instanceof K_Unit){
  488. $disabled = "disabled";
  489. }
  490. else{
  491. $disabled = "";
  492. }
  493. if ($disabled == ""){
  494. ?>
  495. <a target='_blank' href='/<?=$UID?>>/monster/<?=$party->id?>'>
  496. <?php
  497. }
  498. ?>
  499. <div class='monster_panel <?=$disabled?>'>
  500. <?=HTML::unit_panel($party)?>
  501. <?php
  502. if ($party->id == $record->leader){
  503. ?>
  504. <img alt='Leader' class='leader' src='<?=URL::IMG["ICON"]?>leader.png'/>
  505. <?php
  506. }
  507. ?>
  508. </div>
  509. <?php
  510. if ($disabled == ""){
  511. ?>
  512. </a>
  513. <?php
  514. }
  515. $prev_front = $front;
  516. }
  517. ?>
  518. </td>
  519. </tr>
  520. <?php
  521. }
  522. ?>
  523. </table>
  524. </div>
  525. </div>
  526. </div> <!-- #panel_right -->
  527. </article>
  528. </section>
  529. </main>
  530. <?php
  531. include __DIR__ . "/inc/footer.php";
  532. ?>
  533. </body>
  534. </html>