home.php 25 KB

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