catalog.php 8.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187
  1. <!DOCTYPE html>
  2. <html lang='en'>
  3. <head>
  4. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  5. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  6. <title><?=$page->title?></title>
  7. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  8. <!-- CSS files -->
  9. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>ui.css'/>
  10. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>catalog.css'/>
  11. <!-- Script files -->
  12. <script src="<?=$path["js"]?>ui.js"></script>
  13. <!-- Meta tags -->
  14. <link rel='canonical' href='<?=$page->canonical?>'/>
  15. <link rel='author' href='<?=$page->author?>'/>
  16. <link rel='publisher' href='<?=$page->author?>'/>
  17. <meta name='description' content='<?=$page->description?>'/>
  18. <meta property='og:title' content='<?=$page->title?>'/>
  19. <meta property='og:url' content='<?=$page->canonical?>'/>
  20. <meta property='og:description' content='<?=$page->description?>'/>
  21. <meta property='og:image' content='<?=$page->icon?>'/>
  22. <meta property='og:site_name' content='<?=$page->name?>'/>
  23. <meta property='og:type' content='website'/>
  24. <meta property='og:locale' content='en'/>
  25. <meta name='twitter:card' content='summary'/>
  26. <meta name='twitter:title' content='<?=$page->title?>'/>
  27. <meta name='twitter:description' content='<?=$page->description?>'/>
  28. <meta name='twitter:image' content='<?=$page->icon?>'/>
  29. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  30. <meta name='robots' content='index follow'/>
  31. </head>
  32. <body>
  33. <?php
  34. include __DIR__ . "/inc/header.php";
  35. ?>
  36. <section class='filters'>
  37. <h2>
  38. Catalog filters
  39. </h2>
  40. <form action='/catalog/' method='get'>
  41. <table>
  42. <tr>
  43. <td class='filter'>
  44. <span>Element:</span>
  45. <?php
  46. $fire_selected = "";
  47. $water_selected = "";
  48. $wind_selected = "";
  49. $light_selected = "";
  50. $dark_selected = "";
  51. switch (strtoupper($page->filters["element"])){
  52. case "FIRE":
  53. $fire_selected = "selected='selected'";
  54. break;
  55. case "WATER":
  56. $water_selected = "selected='selected'";
  57. break;
  58. case "WIND":
  59. $wind_selected = "selected='selected'";
  60. break;
  61. case "LIGHT":
  62. $light_selected = "selected='selected'";
  63. break;
  64. case "DARK":
  65. $dark_selected = "selected='selected'";
  66. break;
  67. }
  68. ?>
  69. <select name='element' id='filter_type'>
  70. <option value=''>All</option>
  71. <option value='Fire' <?=$fire_selected?>>Fire</option>
  72. <option value='Water' <?=$water_selected?>>Water</option>
  73. <option value='Wind' <?=$wind_selected?>>Wind</option>
  74. <option value='Light' <?=$light_selected?>>Light</option>
  75. <option value='Dark' <?=$dark_selected?>>Dark</option>
  76. </select>
  77. </td>
  78. <td class='filter' id='filter_stars'>
  79. <span>Stars:</span>
  80. <input type='number' name='min_stars' id='filter_stars_min' min='1' max='6' value='<?=$page->filters["min_stars"]?>'/>
  81. -
  82. <input type='number' name='max_stars' id='filter_stars_max' min='1' max='6' value='<?=$page->filters["max_stars"]?>'/>
  83. </td>
  84. </tr>
  85. <tr>
  86. <td class='filter' colspan='2'>
  87. <span>Name:</span>
  88. <input type='text' name='name' id='filter_name' value='<?=$page->filters["name"]?>'/>
  89. </td>
  90. </tr>
  91. <tr>
  92. <td class='filter' colspan='2'>
  93. <?php
  94. $checked = "";
  95. if ($page->filters["in_storage"]){
  96. $checked = "checked";
  97. }
  98. ?>
  99. <input type='checkbox' name='in_storage' <?=$checked?>/>
  100. Show monsters in storage
  101. </td>
  102. </tr>
  103. <tr>
  104. <td class='filter' colspan='2'>
  105. <?php
  106. $checked = "";
  107. if ($page->filters["without_runes"]){
  108. $checked = "checked";
  109. }
  110. ?>
  111. <input type='checkbox' name='without_runes' <?=$checked?>/>
  112. Show monsters without runes
  113. </td>
  114. </tr>
  115. </table>
  116. <div id='filter_apply'>
  117. <input type='submit' value='Apply'/>
  118. </div>
  119. </form>
  120. </section> <!-- #filters -->
  121. <section class='list'>
  122. <h2>
  123. Catalog
  124. </h2>
  125. <article>
  126. <?php
  127. $element = "";
  128. foreach ($page->monsters as $mon){
  129. if ($mon->element != $element){
  130. if ($element != ""){
  131. ?>
  132. </article>
  133. <article>
  134. <?php
  135. }
  136. $element = $mon->element;
  137. }
  138. if ($mon->awakens_from == "" && $mon->awakens_to == ""){
  139. // No to, no from, silver monster.
  140. $star_class ="star_silver";
  141. $mon_title = $mon->element . " " . $mon->name;
  142. }
  143. elseif ($mon->awakens_from =! "" && $mon->awakens_to == ""){
  144. // Already awakened
  145. if ($mon->base_stars - $mon->natural_stars == 1){
  146. // Normal awaken.
  147. $star_class ="star_purple";
  148. }
  149. else{
  150. // Second awaken.
  151. $star_class ="star_red";
  152. }
  153. $mon_title = $mon->name;
  154. }
  155. elseif ($mon->awakens_to =! ""){
  156. // Awakeable.
  157. $star_class ="star_gold";
  158. $mon_title = $mon->element . " " . $mon->name;
  159. }
  160. ?>
  161. <div class='monster'>
  162. <a href='/catalog/<?=$mon->id?>'>
  163. <div class='monster_panel'>
  164. <span class='stars'>
  165. <?php
  166. for ($i = 0; $i < $mon->natural_stars; $i ++){
  167. ?>
  168. <img class='star <?=$star_class?>' src='<?=$path["img"]["layout"] . "icon/star.png"?>'/>
  169. <?php
  170. }
  171. ?>
  172. </span>
  173. <img title='<?=$mon_title?>' class='monster border_<?=$mon->element?>' src='<?=$mon->get_image()?>'/>
  174. </div>
  175. </a>
  176. </div>
  177. <?php
  178. }
  179. ?>
  180. </article>
  181. </section> <!-- #catalog -->
  182. <?php
  183. include __DIR__ . "/inc/footer.php";
  184. ?>
  185. </body>
  186. </html>