home.php 24 KB

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