| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513 |
- <?php
- /**
- * Rune Enchantment report view.
- *
- * Contains the view layout and ome code to present the data.
- *
- * @category View
- * @var Report_Rune_Enchantment_Page $page The page model.
- * @var int $UID User id.
- */
- ?>
- <!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'/>
- <?php
- if ($MODE == GAME_MODE_ID::RTA){
- ?>
- <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui-rta.css'/>
- <?php
- }
- ?>
- <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>report_rune_enchantment.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 grindstone stat selects as one.
- *
- * @param clicked Numeric order of the select clicked.
- * @param event onMouseDown event.
- */
- function fixGrindStatSelect(clicked, event){
- if (!event.ctrlKey){
- console.log("NO CTRL: " + clicked);
- // If controll was not being held, clean all other selects
- if (clicked == 0){
- document.getElementById("filter_grind_stat_1").selectedIndex = -1;
- }
- else if (clicked == 1){
- document.getElementById("filter_grind_stat_0").selectedIndex = -1;
- }
- }
- }
- /**
- * Hack to treat all enchant stat from selects as one.
- *
- * @param clicked Numeric order of the select clicked.
- * @param event onMouseDown event.
- */
- function fixEnchantStatFromSelect(clicked, event){
- if (!event.ctrlKey){
- // If controll was not being held, clean all other selects
- if (clicked == 0){
- document.getElementById("filter_gem_stat_from_1").selectedIndex = -1;
- }
- else if (clicked == 1){
- document.getElementById("filter_gem_stat_from_0").selectedIndex = -1;
- }
- }
- }
- /**
- * Hack to treat all enchant stat to selects as one.
- *
- * @param clicked Numeric order of the select clicked.
- * @param event onMouseDown event.
- */
- function fixEnchantStatToSelect(clicked, event){
- if (!event.ctrlKey){
- // If controll was not being held, clean all other selects
- if (clicked == 0){
- document.getElementById("filter_gem_stat_to_1").selectedIndex = -1;
- }
- else if (clicked == 1){
- document.getElementById("filter_gem_stat_to_0").selectedIndex = -1;
- }
- }
- }
- </script>
- </head>
- <body>
- <?php
- include __DIR__ . "/inc/header.php";
- ?>
- <aside>
- <h2>
- Report filters
- </h2>
- <form action='/<?=$UID?>/report/rune_enchantment/' method='get' id='filter_runeenchantment' class='filter'>
- <table>
- <tr>
- <td colspan='2' class='header'>
- Monster
- </td>
- </tr>
- <tr>
- <td class='label'>
- Name:
- <div class='help_tooltip'>
- <p>
- Units whose name contains this (case insensitive).
- </p>
- </div>
- </td>
- <td>
- <input type='text' name='monster_name' id='filter_name' value='<?=$page->filters["MONSTER_NAME"]?>'/>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Stars:
- </td>
- <td>
- <input type='number' name='monster_min_stars' id='filter_stars_min' min='1' max='6' value='<?=$page->filters["MONSTER_MIN_STARS"]?>'/>
- -
- <input type='number' name='monster_max_stars' id='filter_stars_max' min='1' max='6' value='<?=$page->filters["MONSTER_MAX_STARS"]?>'/>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Show units:
- </td>
- <td>
- <?php
- $selected = Array("", "", "", "", "");
- $selected[$page->filters["TEAM"]] = "selected";
- ?>
- <select name='unit'>
- <option value='0' <?=$selected[0]?>>All</option>
- <option value='1' <?=$selected[1]?>>In teams</option>
- <option value='2' <?=$selected[2]?>>In teams (score > 0)</option>
- </select>
- </td>
- </tr>
- <tr>
- <td class='label' colspan='2'>
- <?php
- $checked = "";
- if ($page->filters["MONSTER_IN_STORAGE"]){
- $checked = "checked";
- }
- ?>
- <input type='checkbox' name='monster_in_storage' id='filter_monster_in_storage' <?=$checked?>/>
- <label for='filter_monster_in_storage'>Show monsters in storage</label>
- </td>
- </tr>
- <tr>
- <td colspan='2' class='header'>
- Runes
- </td>
- </tr>
- <tr>
- <td class='label'>
- Stars:
- </td>
- <td>
- <input type='number' name='rune_min_stars' id='filter_stars_min' min='1' max='6' value='<?=$page->filters["RUNE_MIN_STARS"]?>'/>
- -
- <input type='number' name='rune_max_stars' id='filter_stars_max' min='1' max='6' value='<?=$page->filters["RUNE_MAX_STARS"]?>'/>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Level:
- </td>
- <td>
- <input type='number' name='rune_min_level' id='filter_level_min' min='0' max='15' value='<?=$page->filters["RUNE_MIN_LEVEL"]?>'/>
- -
- <input type='number' name='rune_max_level' id='filter_level_max' min='0' max='15' value='<?=$page->filters["RUNE_MAX_LEVEL"]?>'/>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Quality:
- </td>
- <td>
- <?php
- $selected = Array("", "", "", "", "");
- $selected[$page->filters["RUNE_MIN_QUALITY"] - 1] = "selected";
- ?>
- <select name='rune_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["RUNE_MAX_QUALITY"] - 1] = "selected";
- ?>
- <select name='rune_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'>
- O. quality:
- </td>
- <td>
- <?php
- $selected = Array("", "", "", "", "");
- $selected[$page->filters["RUNE_MIN_ORIGINAL_QUALITY"] - 1] = "selected";
- ?>
- <select name='rune_min_original_quality' id='filter_original_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["RUNE_MAX_ORIGINAL_QUALITY"] - 1] = "selected";
- ?>
- <select name='rune_max_original_quality' id='filter_original_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'>
- Efficiency:
- </td>
- <td>
- <input type='number' name='rune_min_efficiency' id='filter_efficiency_min' min='0' max='100' value='<?=$page->filters["RUNE_MIN_EFFICIENCY"]?>'/>%
- -
- <input type='number' name='rune_max_efficiency' id='filter_efficiency_max' min='0' max='100' value='<?=$page->filters["RUNE_MAX_EFFICIENCY"]?>'/>%
- </td>
- </tr>
- <tr>
- <td class='label'>
- Max. eff.:
- </td>
- <td>
- <input type='number' name='rune_min_max_efficiency' id='filter_max_efficiency_min' min='0' max='100' value='<?=$page->filters["RUNE_MIN_MAX_EFFICIENCY"]?>'/>%
- -
- <input type='number' name='rune_max_max_efficiency' id='filter_max_efficiency_max' min='0' max='100' value='<?=$page->filters["RUNE_MAX_MAX_EFFICIENCY"]?>'/>%
- </td>
- </tr>
- <tr>
- <td class='slot label'>
- Slot:
- </td>
- <td class='slot'>
- <select multiple name='rune_slot[]' id='filter_slot'>
- <?php
- for ($i = 1; $i <= 6; $i ++){
- if (in_array($i, $page->filters["RUNE_SLOT"])){
- $selected = "selected='selected'";
- }
- else{
- $selected = "";
- }
- ?>
- <option value='<?=$i?>' <?=$selected?>><?=$i?></option>
- <?php
- }
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <td colspan='2' class='header'>
- <?php
- $checked = "";
- if ($page->filters["GRIND"]){
- $checked = "checked";
- }
- ?>
- <input type='checkbox' name='grind' id='filter_grind' <?=$checked?>/>
- <label for='filter_grind'>Grindstones</label>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Min. quality:
- </td>
- <td>
- <?php
- $selected = Array("", "", "", "", "");
- $selected[$page->filters["GRIND_MIN_QUALITY"] - 1] = "selected";
- ?>
- <select name='grind_min_quality'>
- <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='stats label'>
- Stats:
- </td>
- <td class='stats'>
- <div>
- <select multiple name='grind_stat[]' id='filter_grind_stat_0' onMouseDown='fixGrindStatSelect(0, event);'>
- <?php
- $reflect = new ReflectionClass("RUNE_STAT_ID");
- $count = 1;
- $i = 0;
- foreach($reflect->getConstants() as $name => $id){
- $selected = "";
- if (in_array($id, $page->filters["GRIND_STAT"])){
- $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='grind_stat[]' id='filter_grind_stat_<?=$count?>' onMouseDown='fixGrindStatSelect(<?=$count?>, event);'>
- <?php
- $count ++;
- }
- $i ++;
- }
- ?>
- </select>
- </div>
- </td>
- </tr>
- <tr>
- <td colspan='2' class='header'>
- <?php
- $checked = "";
- if ($page->filters["GEM"]){
- $checked = "checked";
- }
- ?>
- <input type='checkbox' name='gem' id='filter_gem' <?=$checked?>/>
- <label for='filter_gem'>Gems</label>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Min. quality:
- </td>
- <td>
- <?php
- $selected = Array("", "", "", "", "");
- $selected[$page->filters["GEM_MIN_QUALITY"] - 1] = "selected";
- ?>
- <select name='gem_min_quality'>
- <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='stats label'>
- Replace...
- </td>
- <td class='stats'>
- <div>
- <select multiple name='gem_stat_from[]' id='filter_gem_stat_from_0' onMouseDown='fixEnchantStatFromSelect(0, event);'>
- <?php
- $reflect = new ReflectionClass("RUNE_STAT_ID");
- $count = 1;
- $i = 0;
- foreach($reflect->getConstants() as $name => $id){
- $selected = "";
- if (in_array($id, $page->filters["GEM_STAT_FROM"])){
- $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='gem_stat_from[]' id='filter_gem_stat_from_<?=$count?>' onMouseDown='fixEnchantStatFromSelect(<?=$count?>, event);'>
- <?php
- $count ++;
- }
- $i ++;
- }
- ?>
- </select>
- </div>
- </td>
- </tr>
- <tr>
- <td class='stats label'>
- ...with:
- </td>
- <td class='stats'>
- <div>
- <select multiple name='gem_stat_from[]' id='filter_gem_stat_to_0' onMouseDown='fixEnchantStatToSelect(0, event);'>
- <?php
- $reflect = new ReflectionClass("RUNE_STAT_ID");
- $count = 1;
- $i = 0;
- foreach($reflect->getConstants() as $name => $id){
- $selected = "";
- if (in_array($id, $page->filters["GEM_STAT_TO"])){
- $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='gem_stat_to[]' id='filter_gem_stat_to_<?=$count?>' onMouseDown='fixEnchantStatToSelect(<?=$count?>, event);'>
- <?php
- $count ++;
- }
- $i ++;
- }
- ?>
- </select>
- </div>
- </td>
- </tr>
- </table>
- <input type='submit' value='Apply'/>
- </form>
- </aside>
- <main>
- <section id='results' class='content'>
- <h2>
- <span>
- Available enchantments
- </span>
- </h2>
- <table id='results'>
- <?php
- foreach ($page->upgrades as $upgrade){
- ?>
- <tr>
- <td class='header' colspan='2'>
- <a href='/<?=$UID?>/monsters/<?=$upgrade["unit"]->id?>/' target='_blank'>
- <div class='monster_panel'>
- <?=HTML::unit_panel($upgrade["unit"])?>
- </div>
- </a>
- <h4>
- <?=$upgrade["unit"]->title?>
- </h4>
- </td>
- </tr>
- <?php
- foreach ($upgrade["upgrade"] as $rupgrade){
- ?>
- <tr>
- <td class='rune'>
- <?=HTML::rune_table($rupgrade["rune"])?>
- </td>
- <td class='upgrades'>
- <?php
- foreach ($rupgrade["enchantment"] as $enchantment){
- ?>
- <?=HTML::enchantment_panel($enchantment)?>
- <?php
- }
- ?>
- </td>
- </tr>
- <?php
- }
- }
- ?>
- </table>
- </section>
- </main>
- <?php
- include __DIR__ . "/inc/footer.php";
- ?>
- </body>
- </html>
|