| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180 |
- <?php
- /**
- * Monsters view.
- *
- * Contains the view layout and ome code to present the data.
- *
- * @category View
- * @var Monsters_Page $page The page model.
- * @var Player get_context()->get_player() Currently selected player.
- * @var int get_context()->get_game_mode() Game mode.
- */
- ?>
- <!DOCTYPE html>
- <html lang='en'>
- <head>
- <?=$page->generate_head()?>
- </head>
- <body>
- <header>
- <?php
- include __DIR__ . "/inc/header.php";
- ?>
- </header>
- <aside id='filters' class='content filters'>
- <h2 id='filters_title'>
- Monsters
- </h2>
- <p>
- Filters
- </p>
- <form action='/player/<?=get_context()->get_player()->get_id()?>/units/' method='get' id='filter_monsters' class='filter'>
- <table>
- <tr>
- <td class='label'>
- Element:
- </td>
- <td class='value'>
- <?php
- $selected = Array("", "", "", "", "");
- $selected[$page->get_filter("ELEMENT") - 1] = "selected";
- ?>
- <select multiple name='element'>
- <option> </option>
- <option value='<?=ELEMENT_ID::FIRE?>' <?=$selected[1]?>>Fire</option>
- <option value='<?=ELEMENT_ID::WATER?>' <?=$selected[0]?>>Water</option>
- <option value='<?=ELEMENT_ID::WIND?>' <?=$selected[2]?>>Wind</option>
- <option value='<?=ELEMENT_ID::LIGHT?>' <?=$selected[3]?>>Light</option>
- <option value='<?=ELEMENT_ID::DARK?>' <?=$selected[4]?>>Dark</option>
- </select>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Stars:
- </td>
- <td class='value'>
- <input type='number' name='min_stars' id='filter_stars_min' min='1' max='6' value='<?=$page->get_filter("MIN_STARS")?>'/>
- -
- <input type='number' name='max_stars' id='filter_stars_max' min='1' max='6' value='<?=$page->get_filter("MAX_STARS")?>'/>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Name:
- </td>
- <td class='value'>
- <input type='text' name='name' id='filter_name' value='<?=$page->get_filter("NAME")?>'/>
- </td>
- </tr>
- <tr>
- <td class='filter' colspan='2'>
- <?php
- $checkedStorage = "";
- $checkedShrine = "";
- $checkedMaterial = "";
- if ($page->get_filter("IN_STORAGE")){
- $checkedStorage = "checked";
- }
- if ($page->get_filter("IN_SHRINE")){
- $checkedShrine = "checked";
- }
- if ($page->get_filter("IN_MATERIAL")){
- $checkedMaterial = "checked";
- }
- ?>
- <input type='checkbox' name='in_storage' id='filter_in_storage' <?=$checkedStorage?>/>
- <label for='filter_in_storage'>Monsters in storage</label>
- <input type='checkbox' name='in_shrine' id='filter_in_shrine' <?=$checkedShrine?>/>
- <label for='filter_in_storage'>Monsters in the Sealed Shrine</label>
- <input type='checkbox' name='in_material' id='filter_in_material' <?=$checkedMaterial?>/>
- <label for='filter_in_storage'>Monsters in Enhancing Storage</label>
- </td>
- </tr>
- <tr>
- <td class='filter' colspan='2'>
- <?php
- $checked = "";
- if ($page->get_filter("WITHOUT_RUNES")){
- $checked = "checked";
- }
- ?>
- <input type='checkbox' name='without_runes' id='filter_without_runes' <?=$checked?>/>
- <label for='filter_without_runes'>Monsters without runes</label>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Effects:
- <div class='help_tooltip'>
- <p>
- Effect the monster can induce. Choose 'All' to search for all of the selected, or 'Any' to search for any of the selected effects.
- </p>
- </div>
- <br/>
- <select name='effect_option' id='filter_effect_option'>
- <option value='or' <?=($page->get_filter("EFFECT_OPTION") == "or") ? ("selected='selected'") : ("");?>>Any</option>
- <option value='and' <?=($page->get_filter("EFFECT_OPTION") == "and") ? ("selected='selected'") : ("");?>>All</option>
- </select>
- </td>
- <td class='value'>
- <select multiple name='effect[]' id='filter_effect'>
- <?php
- foreach ($page->get_effects() as $effect){
- if (in_array($effect->get_id(), $page->get_filter("EFFECT"))){
- $selected = "selected='selected'";
- }
- else{
- $selected = "";
- }
- $name = $effect->get_name();
- $name = strtoupper($name);
- $name = str_replace("INCREASE", "INC.", $name);
- $name = str_replace("DECREASE", "DEC.", $name);
- $name = str_replace("CRITICAL", "CRIT.", $name);
- $name = str_replace("CONTINUOUS", "CONT.", $name);
- $name = str_replace("DAMAGE", "DMG.", $name);
- $name = str_replace("BENEFICIAL", "BENEF.", $name);
- $name = str_replace("BENEFICIAL", "BENEF.", $name);
- $name = str_replace("EFFECTS", "EFF.", $name);
- $name = str_replace("EFFECT", "EFF.", $name);
- ?>
- <option value='<?=$effect->get_id()?>' <?=$selected?>><?=$name?></option>
- <?php
- }
- ?>
- </select>
- </td>
- </tr>
- </table>
- <input type='submit' value='Apply'/>
- </form>
- </aside> <!-- #filters -->
- <main>
- <section id='list' class='list'>
- <h2>
- Monsters
- </h2>
- <article>
- <?php
- foreach ($page->get_units() as $unit){
- ?>
- <div class='monster'>
- <a href='/player/<?=get_context()->get_player()->get_id()?>/units/<?=$unit->get_id()?>'>
- <div class='monster_panel'>
- <?=HTML::unit_panel($unit)?>
- </div>
- </a>
- </div>
- <?php
- }
- ?>
- </article>
- </section> <!-- #catalog -->
- </main>
- <?php
- include __DIR__ . "/inc/footer.php";
- ?>
- </body>
- </html>
|