| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290 |
- <?php
- /**
- * Artifacts view.
- *
- * Contains the view layout and ome code to present the data.
- *
- * @category View
- * @property_read Artifacts_Page $page The page model.
- */
- ?>
- <!DOCTYPE html>
- <html lang='en'>
- <head>
- <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
- <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
- <title><?=$page->title?></title>
- <link rel='shortcut icon' href='<?=$page->favicon?>'/>
- <!-- CSS files -->
- <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui.css'/>
- <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>enchantments.css'/>
- <!-- Meta tags -->
- <link rel='canonical' href='<?=$page->canonical?>'/>
- <link rel='author' href='<?=$page->author?>'/>
- <link rel='publisher' href='<?=$page->author?>'/>
- <meta name='description' content='<?=$page->description?>'/>
- <meta property='og:title' content='<?=$page->title?>'/>
- <meta property='og:url' content='<?=$page->canonical?>'/>
- <meta property='og:description' content='<?=$page->description?>'/>
- <meta property='og:image' content='<?=$page->icon?>'/>
- <meta property='og:site_name' content='<?=$page->name?>'/>
- <meta property='og:type' content='website'/>
- <meta property='og:locale' content='en'/>
- <meta name='twitter:card' content='summary'/>
- <meta name='twitter:title' content='<?=$page->title?>'/>
- <meta name='twitter:description' content='<?=$page->description?>'/>
- <meta name='twitter:image' content='<?=$page->icon?>'/>
- <meta name='twitter:url' content='<?=$page->canonical?>'/>
- <meta name='robots' content='index follow'/>
- <script>
- /**
- * Hack to treat all type selects as one.
- *
- * @param clicked Numeric order of the select clicked.
- * @param event onMouseDown event.
- */
- function fixTypeSelect(clicked, event){
- if (!event.ctrlKey){
- // If controll was not being held, clean all other selects
- const selects = document.querySelectorAll('.select_type');
- Array.from(selects).forEach((element, index) => {
- if (element.id != "select_type_" + clicked){
- element.selectedIndex = -1;
- }
- });
- }
- }
- /**
- * Hack to treat all main stat selects as one.
- *
- * @param clicked Numeric order of the select clicked.
- * @param event onMouseDown event.
- */
- function fixMainSelect(clicked, event){
- if (!event.ctrlKey){
- // If controll was not being held, clean all other selects
- const selects = document.querySelectorAll('.select_main');
- Array.from(selects).forEach((element, index) => {
- if (element.id != "select_main_" + clicked){
- element.selectedIndex = -1;
- }
- });
- }
- }
- </script>
- </head>
- <body>
- <?php
- include __DIR__ . "/inc/header.php";
- ?>
- <aside class='filters'>
- <h2>
- Enchantments
- </h2>
- <p>
- Manage your enchantments
- </p>
- <form action='/<?=$UID?>/enchantments/' method='get' id='filter_artifacts' class='filter'>
- <table>
- <tr>
- <td class='label'>
- Type:
- </td>
- <td>
- <select multiple name='type[]' id='filter_type'>
- <?php
- $selected = "";
- if (in_array("GRI", $page->filters["TYPE"])){
- $selected = "selected='selected'";
- }
- ?>
- <option value='GRI' <?=$selected?>>Grindstone</option>
- <?php
- $selected = "";
- if (in_array("GEM", $page->filters["TYPE"])){
- $selected = "selected='selected'";
- }
- ?>
- <option value='GEM' <?=$selected?>>Gem</option>
- </select>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Quality:
- </td>
- <td>
- <?php
- $selected = Array("", "", "", "", "");
- $selected[$page->filters["MIN_QUALITY"] - 1] = "selected";
- ?>
- <select name='min_quality' id='filter_quality_min'>
- <option value='<?=QUALITY_ID::NORMAL?>' <?=$selected[0]?>>Normal</option>
- <option value='<?=QUALITY_ID::MAGIC?>' <?=$selected[1]?>>Magic</option>
- <option value='<?=QUALITY_ID::RARE?>' <?=$selected[2]?>>Rare</option>
- <option value='<?=QUALITY_ID::HERO?>' <?=$selected[3]?>>Hero</option>
- <option value='<?=QUALITY_ID::LEGEND?>' <?=$selected[4]?>>Legend</option>
- </select>
- -
- <?php
- $selected = Array("", "", "", "", "");
- $selected[$page->filters["MAX_QUALITY"] - 1] = "selected";
- ?>
- <select name='max_quality' id='filter_quality_max'>
- <option value='<?=QUALITY_ID::NORMAL?>' <?=$selected[0]?>>Normal</option>
- <option value='<?=QUALITY_ID::MAGIC?>' <?=$selected[1]?>>Magic</option>
- <option value='<?=QUALITY_ID::RARE?>' <?=$selected[2]?>>Rare</option>
- <option value='<?=QUALITY_ID::HERO?>' <?=$selected[3]?>>Hero</option>
- <option value='<?=QUALITY_ID::LEGEND?>' <?=$selected[4]?>>Legend</option>
- </select>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Rune:
- </td>
- <td class='rune'>
- <div>
- <select multiple name='rune[]' id='filter_rune'>
- <?php
- $selected = "";
- if (in_array(0, $page->filters["RUNE"])){
- $selected = "selected='selected'";
- }
- ?>
- <option value='0' <?=$selected?>>Inmemorial</option>
- <?php
- $reflect = new ReflectionClass("RUNE_SET_ID");
- $i = 1;
- $j = 1;
- foreach($reflect->getConstants() as $name => $id){
- $selected = "";
- if (in_array($id, $page->filters["TYPE"])){
- $selected = "selected='selected'";
- }
- $name_format = ucwords(strtolower($name));
- if (strlen($name_format) > 9){
- $name_format = substr($name_format, 0, 9) . ".";
- }
- ?>
- <option value='<?=$id?>' <?=$selected?>><?=$name_format?></option>
- <?php
- if (($i + 1) % 6 == 0 && ($i + 1) < sizeof($reflect->getConstants())){
- ?>
- </select><select multiple name='type[]' class='select_type' id='select_type_<?=$j?>' onMouseDown='fixTypeSelect(<?=$j?>, event);'>
- <?php
- $j ++;
- }
- $i ++;
- }
- ?>
- </select>
- </div>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Stat:
- </td>
- <td class='stats'>
- <div>
- <select multiple name='stat[]' id='filter_stat'>
- <?php
- $reflect = new ReflectionClass("RUNE_STAT_ID");
- $i = 0;
- $j = 1;
- foreach($reflect->getConstants() as $name => $id){
- $selected = "";
- if (in_array($id, $page->filters["SUB"])){
- $selected = "selected='selected'";
- }
- $name_format = ucwords(str_replace("_P", "%", $name));
- ?>
- <option value='<?=$id?>' <?=$selected?>><?=$name_format?></option>
- <?php
- if (($i + 1) % 2 == 0){
- ?>
- </select><select multiple name='main_stat[]' class='select_sub' id='filter_sub_stat_<?=$j?>' onMouseDown='fixSubSelect(<?=$j?>, event);'>
- <?php
- $j ++;
- }
- $i ++;
- }
- ?>
- </select>
- </div>
- </td>
- </tr>
- </table>
- <div id='filter_apply'>
- <input type='submit' value='Apply'/>
- </div>
- </div>
- </form>
- </aside> <!-- #filters -->
- <main>
- <section class='content' id='enchantments'>
- <h2>
- Enchantments
- </h2>
- <table>
- <?php
- $prev_group = "";
- $group = "";
- $group_title = "";
- $group_image = "";
- foreach ($page->grindstones as $grindstone){
- $group = $grindstone->rune->id . "-" . $grindstone->inmemorial;
- if ($prev_group != $group){
- if ($grindstone->inmemorial == 1){
- $group_title = "Inmemorial";
- $group_image = URL::IMG["ICON"] . "star.png";
- }
- else{
- $group_title = $grindstone->rune->name;
- $group_image = URL::IMG["RUNE"] . str_pad($grindstone->rune->id, 2, '0', STR_PAD_LEFT) . ".png";
- }
- if ($prev_group == ""){
- ?>
- <tr>
- <td class='header'>
- <?php
- }
- else{
- ?>
- </td>
- </tr>
- <tr>
- <td class='header'>
- <?php
- }
- $prev_group = $group;
- ?>
- <img class='group_image_<?=$group?>' alt='<?=$group_title?>' src='<?=$group_image?>'>
- <span>
- <?=$group_title?>
- </span>
- </td>
- </tr>
- <tr>
- <td>
- <?php
- }
- ?>
- <?=HTML::enchantment_panel($grindstone)?>
- <?php
- }
- ?>
- </td> <!-- Close last group -->
- </tr>
- </table>
- </section>
- </main>
- <?php
- include __DIR__ . "/inc/footer.php";
- ?>
- </body>
- </html>
|