| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510 |
- <?php
- /**
- * Home view.
- *
- * Contains the view layout and some code to present the data.
- *
- * @author Iñigo Valentin <i@inigovalentin.com>
- * @license https://www.gnu.org/licenses/gpl-3.0.en.html GNU General Public License V3
- * @package SWDB
- * @category View
- * @property Home_Page $page The page model.
- * @var Player_Page $page The page model.
- */
- ?>
- <!DOCTYPE html>
- <html lang='en'>
- <head>
- <?=$page->generate_head()?>
- </head>
- <body>
- <header>
- <?php
- include __DIR__ . "/inc/header.php";
- ?>
- </header>
- <aside>
- <h2>
- <?=get_context()->get_player()->get_name()?>'s profile
- </h2>
- <table id='profile'>
- <tr>
- <td class='label'>
- Lv.
- </td>
- <td class='value'>
- <?=get_context()->get_player()->get_level()?>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Exp.
- </td>
- <td class='value'>
- <?=get_context()->get_player()->get_experience()?>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Country
- </td>
- <td class='value'>
- <?=get_context()->get_player()->get_country()?>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Since
- </td>
- <td class='value'>
- <?=get_context()->get_player()->get_joined('Y-m-d')?>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Days
- </td>
- <td class='value'>
- <?=round((time() - get_context()->get_player()->get_joined('U')) / (60 * 60 * 24))?>
- </td>
- </tr>
- </table>
- </aside>
- <main>
- <section class='content'>
- <h2>
- <span>
- Summoners War DataBase
- </span>
- </h2>
- <article id='profile'>
- <div class='panel' id='panel_left'>
- <div id='placements' class='profile_section'>
- <h4>
- Placements
- </h4>
- <table>
- <tr>
- <th>
- Rep.
- </th>
- <td>
- <?=HTML::unit_panel(get_context()->get_player()->get_rep(), $simple=true, $href="/player/" . get_context()->get_player()->get_id() . "/units/" . get_context()->get_player()->get_rep()->get_id())?>
- </td>
- </tr>
- <tr>
- <th>
- Arena
- </th>
- <td>
- <?php
- foreach (get_context()->get_player()->get_arena_defense() as $defense){
- ?>
- <?=HTML::unit_panel($defense, $simple=true, $href="/player/" . get_context()->get_player()->get_id() . "/units/" . $defense->get_id())?>
- <?php
- }
- ?>
- </td>
- </tr>
- <tr>
- <th>
- G. War
- </th>
- <td>
- <div class='team'>
- <?php
- foreach (get_context()->get_player()->get_gw_defense()[0] as $defense){
- ?>
- <?=HTML::unit_panel($defense, $simple=true, $href="/player/" . get_context()->get_player()->get_id() . "/units/" . $defense->get_id())?>
- <?php
- }
- ?>
- </div>
- <div class='team'>
- <?php
- foreach (get_context()->get_player()->get_gw_defense()[1] as $defense){
- ?>
- <?=HTML::unit_panel($defense, $simple=true, $href="/player/" . get_context()->get_player()->get_id() . "/units/" . $defense->get_id())?>
- <?php
- }
- ?>
- </div>
- </td>
- </tr>
- <tr>
- <th colspan='2'>
- Siege defences
- </th>
- </tr>
- <tr>
- <td id='siege_def' colspan='2'>
- <?php
- foreach (get_context()->get_player()->get_siege_defense() as $formation){
- ?>
- <div class='team'>
- <?php
- foreach($formation as $defense){
- ?>
- <?=HTML::unit_panel($defense, $simple=true, $href="/player/" . get_context()->get_player()->get_id() . "/units/" . $defense->get_id())?>
- <?php
- }
- ?>
- </div>
- <?php
- }
- ?>
- </td>
- </tr>
- </table>
- </div>
- <div id='building' class='profile_section'>
- <h4>
- Buildings
- </h4>
- <?php
- // Buildings
- $half = sizeof(get_context()->get_player()->get_buildings()) / 2;
- $i = 0;
- foreach (get_context()->get_player()->get_buildings() as $building){
- if ($i == $half){
- ?>
- <br class='desktop'/>
- <?php
- }
- ?>
- <?=HTML::building_panel($building)?>
- <?php
- $i ++;
- }
- ?>
- <br/>
- <?php
- // Decorations
- $half = sizeof(get_context()->get_player()->get_decorations()) / 2;
- $i = 0;
- foreach (get_context()->get_player()->get_decorations() as $decoration){
- if ($i == $half){
- ?>
- <br class='desktop'/>
- <?php
- }
- ?>
- <?=HTML::building_panel($decoration)?>
- <?php
- $i ++;
- }
- ?>
- </div>
- <div class='inventory profile_section' id='inventory'>
- <h4>
- Inventory
- </h4>
- <ul>
- <li>
- <img title='Energy' src='<?=URL::IMG["CURRENCY"]?>energy.png'/>
- <?=get_context()->get_player()->get_currencies()["energy"]?> / <?=get_context()->get_player()->get_currencies()["energy_max"]?>
- </li>
- <li>
- <img title='Arena Invitations' src='<?=URL::IMG["CURRENCY"]?>arenaenergy.png'/>
- <?=get_context()->get_player()->get_currencies()["arena_energy"]?> / 10
- </li>
- <li>
- <img title='Dimensional Energy' src='<?=URL::IMG["CURRENCY"]?>dimensionenergy.png'/>
- <?=get_context()->get_player()->get_currencies()["dimension_energy"]?> / 100
- </li>
- <li>
- <img title='Dimensional Crystal' src='<?=URL::IMG["CURRENCY"]?>darkportalenergy.png'/>
- <?=get_context()->get_player()->get_currencies()["darkportal_energy"]?> / 10
- </li>
- <li>
- <img title='Mana' src='<?=URL::IMG["CURRENCY"]?>mana.png'/>
- <?=get_context()->get_player()->get_currencies()["mana"]?>
- </li>
- <li>
- <img title='Crystal' src='<?=URL::IMG["CURRENCY"]?>crystal.png'/>
- <?=get_context()->get_player()->get_currencies()["crystal"]?>
- </li>
- <li>
- <img title='Social Points' src='<?=URL::IMG["CURRENCY"]?>socialpoint.png'/>
- <?=get_context()->get_player()->get_currencies()["social_point"]?>
- </li>
- <li>
- <img title='Honor Points' src='<?=URL::IMG["CURRENCY"]?>honor.png'/>
- <?=get_context()->get_player()->get_currencies()["honor_point"]?>
- </li>
- <li>
- <img title='Guild Points' src='<?=URL::IMG["CURRENCY"]?>guildpoint.png'/>
- <?=get_context()->get_player()->get_currencies()["guild_point"]?>
- </li>
- <li>
- <img title='Honor Medals' src='<?=URL::IMG["CURRENCY"]?>badge.png'/>
- <?=get_context()->get_player()->get_currencies()["honor_medal"]?>
- </li>
- <li>
- <img src='<?=URL::IMG["CURRENCY"]?>mark.png'/>
- <?=get_context()->get_player()->get_currencies()["honor_mark"]?>
- </li>
- <li>
- <img title='Ancient Coins' src='<?=URL::IMG["CURRENCY"]?>ancientcoin.png'/>
- <?=get_context()->get_player()->get_currencies()["event_coin"]?>
- </li>
- <li>
- <img title='Ancient Crystal' src='<?=URL::IMG["CURRENCY"]?>ancientstone.png'/>
- <?=get_context()->get_player()->get_currencies()["ancient_stone"]?>
- </li>
- <li>
- <img title='Shapeshifting Stones' src='<?=URL::IMG["CURRENCY"]?>costumestone.png'/>
- <?=get_context()->get_player()->get_currencies()["costume_point"]?>
- </li>
- </ul>
- <?php
- // Scrolls
- $half = sizeof(get_context()->get_player()->get_scrolls()) / 2;
- $i = 0;
- foreach (get_context()->get_player()->get_scrolls() as $item){
- if ($half > 6 && $i == $half){
- ?>
- <br class='desktop'/>
- <?php
- }
- ?>
- <?=HTML::item_panel($item)?>
- <?php
- $i ++;
- }
- ?>
- <br/>
- <?php
- // Rune craft materials
- $prev = 0;
- foreach (get_context()->get_player()->get_rune_craft_materials() as $item){
- ?>
- <?=HTML::item_panel($item)?>
- <?php
- $prev = $item->get_id();
- }
- ?>
- <br/>
- <?php
- // Other craft materials
- $prev = 0;
- foreach (get_context()->get_player()->get_craft_materials() as $item){
- if ($prev != 0 && $prev < 5000 && $item->get_id() > 5000){
- ?>
- <br class='desktop'/>
- <?php
- }
- ?>
- <?=HTML::item_panel($item)?>
- <?php
- $prev = $item->get_id();
- }
- ?>
- <br/>
- <?php
- // Essences
- $prev = "";
- $i = 0;
- foreach (get_context()->get_player()->get_essences() as $item){
- //if ($prev != "" && $prev != preg_split('/\s+/', $item->name)[2]){
- if ($i > 0 && $i % 6 == 0){
- ?>
- <br class='desktop'/>
- <?php
- }
- ?>
- <?=HTML::item_panel($item)?>
- <?php
- $prev = preg_split('/\s+/', $item->get_name())[2];
- $i ++;
- }
- ?>
- </div>
- </div> <!-- #panel_left -->
- <div class='panel' id='panel_right'>
- <div class='profile_section' id='records'>
- <h4>
- Records
- </h4>
- <div class='record'>
- <table id='rank_records'>
- <tr>
- <td class='label'>
- Arena
- </td>
- <td class='value rank'>
- <?=HTML::arena_rank_icon(get_context()->get_player()->get_top_rank_arena())?>
- </td>
- </tr>
- <tr>
- <td class='label'>
- World Arena
- </td>
- <td class='value rank'>
- <?=HTML::arena_rank_icon(get_context()->get_player()->get_top_rank_world_arena())?>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Special League
- </td>
- <td class='value rank'>
- <?=HTML::arena_rank_icon(get_context()->get_player()->get_top_rank_special_league())?>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Guild War
- </td>
- <td class='value rank'>
- <?=HTML::arena_rank_icon(get_context()->get_player()->get_top_rank_gw() - 10)?>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Siege Battle
- </td>
- <td class='value rank'>
- <?=HTML::arena_rank_icon(get_context()->get_player()->get_top_rank_siege())?>
- </td>
- </tr>
- <tr>
- <td class='label'>
- World Boss
- </td>
- <td class='value wboss'>
- <!-- TODO Rank 12?? -->
- <?=WORLD_BOSS_RANK_ID::RANK[get_context()->get_player()->get_top_rank_wboss()]?>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Trial of Ascension (Normal)
- </td>
- <td class='value toa'>
- <?=get_context()->get_player()->get_top_rank_toan()?>F
- </td>
- </tr>
- <tr>
- <td class='label'>
- Trial of Ascension (Hard)
- </td>
- <td class='value toa'>
- <?=get_context()->get_player()->get_top_rank_toah()?>F
- </td>
- </tr>
- <tr>
- <td class='label'>
- Trial of Ascension (Hell)
- </td>
- <td class='value toa'>
- <?=get_context()->get_player()->get_top_rank_toal()?>
- <img id='toal_star' src='<?=URL::IMG["ICON"]?>star.png'/>
- </td>
- </tr>
- </table>
- <table id='battle_records'>
- <?php
- foreach (get_context()->get_player()->get_records() as $record){
- ?>
- <tr>
- <td class='record_dungeon'>
- <img title='<?=$record->get_area()->get_name()?>' class='area' src='<?=$record->get_area()->get_image()?>'/>
- </td>
- <td class='record_info'>
- <span class='title'>
- <?php
- $title = "";
- switch ($record->get_area()->get_type()){
- case AREA_TYPE_ID::CAIROS_DUNGEON:
- case AREA_TYPE_ID::DIMENSIONAL_HOLE:
- $title = $record->get_area()->get_name() . " " . $record->get_stage() . "F";
- break;
- case AREA_TYPE_ID::RIFT_DUNGEON:
- $title = $record->get_area()->get_name();
- break;
- case AREA_TYPE_ID::RIFT_RAID:
- $title = $record->get_area()->get_name() . " " . $record->get_stage();
- break;
- }
- ?>
- <?=$title?>
- </span>
- <?php
- if ($record->get_area()->get_type() == AREA_TYPE_ID::RIFT_DUNGEON){
- ?>
- <span class='score'>
- <?=$record->get_score()?>
- </span>
- <span class='rank'>
- <?=$record->get_rank()?>
- </span>
- <?php
- }
- else{
- $s = floor($record->get_time() / 1000);
- $m = floor($s / 60);
- $s = floor($s % 60);
- $ms = ($record->get_time() - (1000 * 60 * $m) - (1000 * 60 * $s) / 100);
- $s = str_pad($s, 2, '0', STR_PAD_LEFT);
- $ms = str_pad($ms, 2, '0', STR_PAD_LEFT);
- ?>
- <span class='time'>
- <?=$m?>:<?=$s?><span class='ms'>.<?=$ms?></span>
- </span>
- <?php
- }
- ?>
- </td>
- <?php
- $class_frontline = "";
- if ($record->get_area()->get_type() == AREA_TYPE_ID::RIFT_DUNGEON || $record->get_area()->get_type() == AREA_TYPE_ID::RIFT_RAID){
- $class_frontline = "frontlines";
- }
- ?>
- <td class='record_party <?=$class_frontline?>'>
- <?php
- $prev_front = false;
- $front = "undefined";
- foreach ($record->get_party() as $party){
- $front = in_array($party->get_id(), $record->get_frontline());
- if ($front != "undefined" && $prev_front != $front){
- ?>
- <hr class='frontline'/>
- <?php
- }
- if ($party instanceof Monster){
- $disabled = "disabled";
- $href = null;
- }
- else{
- $disabled = "";
- $href="/player/" . get_context()->get_player()->get_id() . "/units/" . $party->get_id();
- }
- ?>
- <?=HTML::unit_panel($party, $simple=true, $href="/player/" . get_context()->get_player()->get_id() . "/units/" . $defense->get_id())?>
- <?php
- $prev_front = $front;
- }
- ?>
- </td>
- </tr>
- <?php
- }
- ?>
- </table>
- </div>
- </div>
- </div> <!-- #panel_right -->
- </article>
- </section>
- </main>
- <?php
- include __DIR__ . "/inc/footer.php";
- ?>
- </body>
- </html>
|