| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- <?php
- /**
- * Catalog 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 Monsters_Page $page The page model,.
- * @var Monsters_Page $page The page model,.
- */
- ?>
- <!DOCTYPE html>
- <html lang='en'>
- <head>
- <?=$page->generate_head()?>
- </head>
- <body>
- <header>
- <?php
- include __DIR__ . "/inc/header_app.php";
- ?>
- </header>
- <aside id='filters' class='content filters'>
- <h2 id='filters_title'>
- Catalog
- </h2>
- <p>
- A list with every monster in the game.
- </p>
- <form action='/monsters/' method='get' id='filter_catalog' class='filter'>
- <table>
- <tr>
- <td class='label'>
- Element:
- </td>
- <td>
- <?php
- $selected = Array("", "", "", "", "");
- $selected[$page->get_filter("ELEMENT") - 1] = "selected";
- ?>
- <select name='element'>
- <option value='0'>All</option>
- <option value='<?=ELEMENT_ID::WATER?>' <?=$selected[0]?>>Water</option>
- <option value='<?=ELEMENT_ID::FIRE?>' <?=$selected[1]?>>Fire</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' id='filter_stars'>
- Stars:
- </td>
- <td>
- <input type='number' name='min_stars' id='filter_stars_min' min='1' max='5' value='<?=$page->get_filter("MIN_STARS")?>'/>
- -
- <input type='number' name='max_stars' id='filter_stars_max' min='1' max='5' value='<?=$page->get_filter("MAX_STARS")?>'/>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Name:
- </td>
- <td>
- <input type='text' name='name' id='filter_name' value='<?=$page->get_filter("NAME")?>'/>
- </td>
- </tr>
- </table>
- <input type='submit' value='Apply'/>
- </form>
- </aside> <!-- #filters -->
- <main>
- <section id='list' class='list'>
- <h2>
- Catalog
- </h2>
- <article>
- <?php
- $element = "";
- foreach ($page->get_monsters() as $monster){
- if ($monster->get_element() != $element){
- if ($element != ""){
- ?>
- </article>
- <article>
- <?php
- }
- $element = $monster->get_element();
- }
- ?>
- <div class='monster'>
- <a href='/monsters/<?=$monster->get_id()?>'>
- <div class='monster_panel'>
- <?=HTML::unit_panel($monster)?>
- </div>
- </a>
- </div>
- <?php
- }
- ?>
- </article>
- </section> <!-- #catalog -->
- </main>
- <?php
- include __DIR__ . "/inc/footer.php";
- ?>
- </body>
- </html>
|