| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321 |
- <?php
- /**
- * Artifacts view.
- *
- * Contains the view layout and ome code to present the data.
- *
- * @category View
- * @var Artifacts_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?>artifacts.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'/>
- </head>
- <body>
- <?php
- include __DIR__ . "/inc/header.php";
- ?>
- <aside class='filters'>
- <h2>
- Artifacts
- </h2>
- <p>
- Manage your enchantments
- </p>
- <form action='/<?=$UID?>/artifacts/' method='get' id='filter_artifacts' class='filter'>
- <table>
- <tr>
- <td class='label'>
- Element:
- </td>
- <td>
- <select multiple name='element[]' id='filter_element'>
- <?php
- $reflect = new ReflectionClass("ELEMENT_ID");
- foreach($reflect->getConstants() as $name => $id){
- if ($id != ELEMENT_ID::PURE){
- $selected = "";
- if (in_array($id, $page->filters["ELEMENT"])){
- $selected = "selected='selected'";
- }
- ?>
- <option value='<?=$id?>' <?=$selected?>><?=$name?></option>
- <?php
- }
- }
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Type:
- </td>
- <td>
- <select multiple name='archetype[]' id='filter_archetype'>
- <?php
- $reflect = new ReflectionClass("ARCHETYPE_ID");
- foreach($reflect->getConstants() as $name => $id){
- if ($id != ARCHETYPE_ID::NONE && $id != ARCHETYPE_ID::MATERIAL){
- $selected = "";
- if (in_array($id, $page->filters["ARCHETYPE"])){
- $selected = "selected='selected'";
- }
- ?>
- <option value='<?=$id?>' <?=$selected?>><?=$name?></option>
- <?php
- }
- }
- ?>
- </select>
- </td>
- </tr>
- <tr>
- <td class='label'>
- Main stat:
- </td>
- <td>
- <select multiple name='main_stat[]' id='filter_main_stat'>
- <?php
- $reflect = new ReflectionClass("ARTIFACT_STAT_ID");
- foreach($reflect->getConstants() as $name => $id){
- $selected = "";
- if (in_array($id, $page->filters["MAIN"])){
- $selected = "selected='selected'";
- }
- ?>
- <option value='<?=$id?>' <?=$selected?>><?=$name?></option>
- <?php
- }
- ?>
- </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'>
- 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'>
- 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>
- </table>
- <div id='filter_apply'>
- <input type='submit' value='Apply'/>
- </div>
- </form>
- </aside> <!-- #filters -->
- <main>
- <section class='content' id='artifacts'>
- <h2>
- Artifacts
- </h2>
- <table>
- <?php
- $prev_group = "";
- $group = "";
- $group_title = "";
- $group_image = "";
- foreach ($page->artifacts as $artifact){
- $group = $artifact->type . "-" . $artifact->element . "-" . $artifact->archetype;
- if ($prev_group != $group){
- switch ($artifact->type){
- case ARTIFACT_TYPE::ELEMENT:
- switch ($artifact->element){
- case ELEMENT_ID::WATER:
- $group_title = "Water";
- $group_image = URL::IMG["ARTIFACT"] . "element_water.png";
- break;
- case ELEMENT_ID::FIRE:
- $group_title = "Fire";
- $group_image = URL::IMG["ARTIFACT"] . "element_fire.png";
- break;
- case ELEMENT_ID::WIND:
- $group_title = "Wind";
- $group_image = URL::IMG["ARTIFACT"] . "element_wind.png";
- break;
- case ELEMENT_ID::LIGHT:
- $group_title = "Light";
- $group_image = URL::IMG["ARTIFACT"] . "element_light.png";
- break;
- case ELEMENT_ID::DARK:
- $group_title = "Dark";
- $group_image = URL::IMG["ARTIFACT"] . "element_dark.png";
- break;
- }
- break;
- case ARTIFACT_TYPE::ARCHETYPE:
- switch ($artifact->archetype){
- case ARCHETYPE_ID::ATTACK:
- $group_title = "Attack";
- $group_image = URL::IMG["ARTIFACT"] . "type_attack.png";
- break;
- case ARCHETYPE_ID::DEFENSE:
- $group_title = "Defense";
- $group_image = URL::IMG["ARTIFACT"] . "type_defense.png";
- break;
- case ARCHETYPE_ID::SUPPORT:
- $group_title = "Support";
- $group_image = URL::IMG["ARTIFACT"] . "type_support.png";
- break;
- case ARCHETYPE_ID::HP:
- $group_title = "HP";
- $group_image = URL::IMG["ARTIFACT"] . "type_hp.png";
- break;
- }
- }
- 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::artifact_table($artifact, $artifact->unit)?>
- <?php
- }
- ?>
- </td> <!-- Close last group -->
- </tr>
- </table>
- </section>
- </main>
- <?php
- include __DIR__ . "/inc/footer.php";
- ?>
- </body>
- </html>
|