home.php 25 KB

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