| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442 |
- <?php
- /**
- * Runes view.
- *
- * Contains the view layout and ome code to present the data.
- *
- * @category View
- * @var Runes_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?>runes.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;
- }
- });
- }
- }
- /**
- * Hack to treat all sub stat selects as one.
- *
- * @param clicked Numeric order of the select clicked.
- * @param event onMouseDown event.
- */
- function fixSubSelect(clicked, event){
- if (!event.ctrlKey){
- // If controll was not being held, clean all other selects
- const selects = document.querySelectorAll('.select_sub');
- Array.from(selects).forEach((element, index) => {
- if (element.id != "select_sub_" + clicked){
- element.selectedIndex = -1;
- }
- });
- }
- }
- </script>
- </head>
- <body>
- <?php
- include __DIR__ . "/inc/header.php";
- ?>
- <aside class='content filters' id='filters'>
- <h2 id='filters_title'>
- Rune filters
- </h2>
- <p>
- Manage your runes
- </p>
- <form action='/<?=$UID?>/runes/' method='get' id='filter_runes' class='filter'>
- <table>
- <tr>
- <td class='label' >
- Stars:
- </td>
- <td>
- <input type='number' name='min_stars' id='filter_stars_min' min='1' max='6' value='<?=$page->filters["MIN_STARS"]?>'/>
- -
- <input type='number' name='max_stars' id='filter_stars_max' min='1' max='6' value='<?=$page->filters["MAX_STARS"]?>'/>
- </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'>
- O. quality:
- </td>
- <td>
- <?php
- $selected = Array("", "", "", "", "");
- $selected[$page->filters["MIN_ORIGINAL_QUALITY"] - 1] = "selected";
- ?>
- <select name='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["MAX_ORIGINAL_QUALITY"] - 1] = "selected";
- ?>
- <select name='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'>
- Level:
- </td>
- <td>
- <input type='number' name='min_level' id='filter_level_min' min='0' max='15' value='<?=$page->filters["MIN_LEVEL"]?>'/>
- -
- <input type='number' name='max_level' id='filter_level_max' min='0' max='15' value='<?=$page->filters["MAX_LEVEL"]?>'/>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Efficiency:
- </td>
- <td>
- <input type='number' name='min_efficiency' id='filter_efficiency_min' min='0' max='100' value='<?=$page->filters["MIN_EFFICIENCY"]?>'/>%
- -
- <input type='number' name='max_efficiency' id='filter_efficiency_max' min='0' max='100' value='<?=$page->filters["MAX_EFFICIENCY"]?>'/>%
- </td>
- </tr>
- <tr>
- <td class='label'>
- Max. eff.:
- </td>
- <td>
- <input type='number' name='min_max_efficiency' id='filter_max_efficiency_min' min='0' max='100' value='<?=$page->filters["MIN_MAX_EFFICIENCY"]?>'/>%
- -
- <input type='number' name='max_max_efficiency' id='filter_max_efficiency_max' min='0' max='100' value='<?=$page->filters["MAX_MAX_EFFICIENCY"]?>'/>%
- </td>
- </tr>
- <tr>
- <td class='label'>
- Main stat:
- </td>
- <td class='stats'>
- <div>
- <select multiple name='main_stat[]' class='select_main' id='filter_main_stat_0' onMouseDown='fixMainSelect(0, event);'>
- <?php
- $i = 0;
- $j = 1;
- $reflect = new ReflectionClass("RUNE_STAT_ID");
- foreach($reflect->getConstants() as $name => $id){
- $selected = "";
- if (in_array($id, $page->filters["MAIN"])){
- $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_main' id='filter_main_stat_<?=$j?>' onMouseDown='fixMainSelect(<?=$j?>, event);'>
- <?php
- $j ++;
- }
- $i ++;
- }
- ?>
- </select>
- </div>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Sub stats:
- </td>
- <td class='stats'>
- <div>
- <select multiple name='sub_stat[]' class='select_sub' id='filter_sub_stat' onMouseDown='fixSubSelect(0, event);'>
- <?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='sub_stat[]' class='select_sub' id='filter_sub_stat_<?=$j?>' onMouseDown='fixSubSelect(<?=$j?>, event);'>
- <?php
- $j ++;
- }
- $i ++;
- }
- ?>
- </select>
- </div>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Type:
- </td>
- <td class='type'>
- <div>
- <select multiple name='type[]' class='select_type' id='select_type_0' onMouseDown='fixTypeSelect(0, event);'>
- <?php
- $reflect = new ReflectionClass("RUNE_SET_ID");
- $i = 0;
- $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'>
- Slot:
- </td>
- <td class='slot'>
- <select multiple name='slot[]' id='filter_slot'>
- <?php
- for ($i = 1; $i <= 6; $i ++){
- if (in_array($i, $page->filters["SLOT"])){
- $selected = "selected='selected'";
- }
- else{
- $selected = "";
- }
- ?>
- <option value='<?=$i?>' <?=$selected?>><?=$i?></option>
- <?php
- }
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Assigned:
- </td>
- <td>
- <?php
- $selected = Array("", "", "", "", "");
- $selected[$page->filters["ASSIGNED"]] = "selected";
- ?>
- <select name='assigned' id='filter_assigned'>
- <option value='0' <?=$selected[0]?>>All</option>
- <option value='1' <?=$selected[1]?>>Assigned</option>
- <option value='2' <?=$selected[2]?>>Unassigned</option>
- <option value='3' <?=$selected[3]?>>All (no storage)</option>
- <option value='4' <?=$selected[4]?>>Assigned (no storage)</option>
- </select>
- </td>
- </tr>
- <tr>
- <td class='filter'>
- Group by:
- </td>
- <td>
- <?php
- $selected = Array("", "");
- $selected[$page->filters["GROUP"]] = "selected";
- ?>
- <select name='group' id='filter_group'>
- <option value='0' <?=$selected[0]?>>Slot</option>
- <option value='1' <?=$selected[1]?>>Type</option>
- </select>
- </td>
- </tr>
- </table>
- <input type='submit' value='Apply'/>
- </form>
- </aside> <!-- #filters -->
- <main>
- <section class='content' id='runes'>
- <h2>
- Runes
- </h2>
- <table>
- <?php
- $prev_group = "";
- $group = "";
- $group_title = "";
- $group_image = "";
- foreach ($page->runes as $rune){
- switch ($page->filters["GROUP"]){
- case 1: // "TYPE":
- $group = $rune->type->name;
- $group_title = $rune->type->name;
- $group_image = URL::IMG["RUNE"] . str_pad($rune->type->id, 2, '0', STR_PAD_LEFT) . ".png";
- break;
- default:
- $group = $rune->slot;
- $group_title = "Slot " . $rune->slot;
- $group_image = URL::IMG["RUNE"] . "base.png";
- }
- if ($prev_group != $group){
- 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::rune_table($rune, $rune->unit)?>
- <?php
- }
- ?>
- </td> <!-- Close last group -->
- </tr>
- </table>
- </section>
- </main>
- <?php
- include __DIR__ . "/inc/footer.php";
- ?>
- </body>
- </html>
|