report_skillup.php 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329
  1. <?php
  2. /**
  3. * Skillup report view.
  4. *
  5. * Contains the view layout and ome code to present the data.
  6. *
  7. * @category View
  8. * @var Report_Skillup_Page $page The page model.
  9. * @var int $UID User id.
  10. */
  11. ?>
  12. <!DOCTYPE html>
  13. <html lang='en'>
  14. <head>
  15. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  16. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  17. <title><?=$page->title?></title>
  18. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  19. <!-- CSS files -->
  20. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui.css'/>
  21. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>report_skillup.css'/>
  22. <!-- Meta tags -->
  23. <link rel='canonical' href='<?=$page->canonical?>'/>
  24. <link rel='author' href='<?=$page->author?>'/>
  25. <link rel='publisher' href='<?=$page->author?>'/>
  26. <meta name='description' content='<?=$page->description?>'/>
  27. <meta property='og:title' content='<?=$page->title?>'/>
  28. <meta property='og:url' content='<?=$page->canonical?>'/>
  29. <meta property='og:description' content='<?=$page->description?>'/>
  30. <meta property='og:image' content='<?=$page->icon?>'/>
  31. <meta property='og:site_name' content='<?=$page->name?>'/>
  32. <meta property='og:type' content='website'/>
  33. <meta property='og:locale' content='en'/>
  34. <meta name='twitter:card' content='summary'/>
  35. <meta name='twitter:title' content='<?=$page->title?>'/>
  36. <meta name='twitter:description' content='<?=$page->description?>'/>
  37. <meta name='twitter:image' content='<?=$page->icon?>'/>
  38. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  39. <meta name='robots' content='index follow'/>
  40. </head>
  41. <body id='body_report_skillup'>
  42. <?php
  43. include __DIR__ . "/inc/header.php";
  44. ?>
  45. <aside class='content filters' id='filters'>
  46. <h2 id='filters_title'>
  47. Report filters
  48. </h2>
  49. <article id='filters_content'>
  50. <form action='/<?=$UID?>/report/skillup/' method='get' id='filter_skillup' class='filter'>
  51. <table>
  52. <tr>
  53. <td class='filter' id='filter_stars'>
  54. Stars:
  55. </td>
  56. <td>
  57. <input type='number' name='min_stars' min='1' max='6' value='<?=$page->filters["MIN_STARS"]?>'/>
  58. -
  59. <input type='number' name='max_stars' min='1' max='6' value='<?=$page->filters["MAX_STARS"]?>'/>
  60. </td>
  61. </tr>
  62. <tr>
  63. <td class='filter' id='filter_stars'>
  64. Natural stars:
  65. </td>
  66. <td>
  67. <input type='number' name='min_natural_stars' min='1' max='5' value='<?=$page->filters["MIN_NATURAL_STARS"]?>'/>
  68. -
  69. <input type='number' name='max_natural_stars' min='1' max='5' value='<?=$page->filters["MAX_NATURAL_STARS"]?>'/>
  70. </td>
  71. </tr>
  72. <tr>
  73. <td class='filter'>
  74. Show units:
  75. </td>
  76. <td>
  77. <?php
  78. $selected = Array("", "", "", "", "");
  79. $selected[$page->filters["UNIT"]] = "selected";
  80. ?>
  81. <select name='unit'>
  82. <option value='0' <?=$selected[0]?>>All</option>
  83. <option value='1' <?=$selected[1]?>>In teams</option>
  84. <option value='2' <?=$selected[2]?>>In teams (score > 0)</option>
  85. </select>
  86. </td>
  87. </tr>
  88. <tr>
  89. <td rowspan='2' class='filter'>
  90. Ponderation:
  91. <div class='help_tooltip'>
  92. <p>
  93. Skill weight in the calculation based on it's position.
  94. </p>
  95. </div>
  96. </td>
  97. <td class='filter'>
  98. &nbsp;S1:<input type='number' step='0.1' min='0' max='4' name='pond_1' id='pond_1' value='<?=$page->filters["PONDERATION"][0]?>'/>
  99. &nbsp;S2:<input type='number' step='0.1' min='0' max='4' name='pond_2' id='pond_2' value='<?=$page->filters["PONDERATION"][1]?>'/>
  100. </td>
  101. </tr>
  102. <tr>
  103. <td class='filter'>
  104. &nbsp;S3:<input type='number' step='0.1' min='0' max='4' name='pond_3' id='pond_3' value='<?=$page->filters["PONDERATION"][2]?>'/>
  105. &nbsp;S4:<input type='number' step='0.1' min='0' max='4' name='pond_4' id='pond_4' value='<?=$page->filters["PONDERATION"][3]?>'/>
  106. </td>
  107. </tr>
  108. <tr>
  109. <td class='filter' colspan='2'>
  110. <?php
  111. $checked = "";
  112. if ($page->filters["FAMILY"]){
  113. $checked = "checked";
  114. }
  115. ?>
  116. <input type='checkbox' name='family' id='filter_family' <?=$checked?>/>
  117. <label for='filter_family'>Mons. with lower grade siblings.</label>
  118. <div class='help_tooltip'>
  119. <p>
  120. Include monsters that have family members with less stars than seleced in the stars filters.
  121. </p>
  122. </div>
  123. </td>
  124. </tr>
  125. <tr>
  126. <td class='filter' colspan='2'>
  127. <?php
  128. $checked = "";
  129. if ($page->filters["2A"]){
  130. $checked = "checked";
  131. }
  132. ?>
  133. <input type='checkbox' name='2a' id='filter_2a'<?=$checked?>/>
  134. <label for='filter_2a'>Include second-awakened monsters.</label>
  135. </td>
  136. </tr>
  137. <tr>
  138. <td class='filter' colspan='2'>
  139. <?php
  140. $checked = "";
  141. if ($page->filters["HOMUNCULUS"]){
  142. $checked = "checked";
  143. }
  144. ?>
  145. <input type='checkbox' name='homunculus' id='filter_homunculus' <?=$checked?>/>
  146. <label for='filter_homunculus'>Include Homunculus.</label>
  147. </td>
  148. </tr>
  149. <tr>
  150. <td class='filter' colspan='2'>
  151. <?php
  152. $checked = "";
  153. if ($page->filters["IN_STORAGE"]){
  154. $checked = "checked";
  155. }
  156. ?>
  157. <input type='checkbox' name='in_storage' id='filter_in_storage' <?=$checked?>/>
  158. <label for='filter_in_storage'>Show monsters in storage.</label>
  159. </td>
  160. </tr>
  161. <tr>
  162. <td class='filter' colspan='2'>
  163. <?php
  164. $checked = "";
  165. if ($page->filters["WITHOUT_RUNES"]){
  166. $checked = "checked";
  167. }
  168. ?>
  169. <input type='checkbox' name='without_runes' id='filter_without_runes' <?=$checked?>/>
  170. <label for='filter_without_runes'>Show monsters without runes.</label>
  171. </td>
  172. </tr>
  173. <tr>
  174. <td class='filter' colspan='2'>
  175. <?php
  176. $checked = "";
  177. if ($page->filters["MAXED"]){
  178. $checked = "checked";
  179. }
  180. ?>
  181. <input type='checkbox' name='maxed' id='filter_maxed' <?=$checked?>/>
  182. <label for='filter_maxed'>Show fully skilled-up monster</label>
  183. </td>
  184. </tr>
  185. </table>
  186. <input type='submit' value='Apply'/>
  187. </form>
  188. </article>
  189. </aside> <!-- #filters -->
  190. <main>
  191. <section class='content' id='results'>
  192. <h2>
  193. <span>
  194. Results
  195. </span>
  196. </h2>
  197. <table id='results'>
  198. <?php
  199. $index = 1;
  200. foreach ($page->units as $unit){
  201. switch ($index % 10){
  202. case 1:
  203. $index_title = $index . "<span class='superindex'>st</span> - " . $unit->title;
  204. break;
  205. case 2:
  206. $index_title = $index . "<span class='superindex'>nd</span> - " . $unit->title;
  207. break;
  208. case 3:
  209. $index_title = $index . "<span class='superindex'>rd</span> - " . $unit->title;
  210. break;
  211. default:
  212. $index_title = $index . "<span class='superindex'>th</span> - " . $unit->title;
  213. break;
  214. }
  215. switch ($index % 100){
  216. case 11:
  217. case 12:
  218. case 13:
  219. $index_title = $index . "<span class='superindex'>th</span> - " . $unit->title;
  220. break;
  221. }
  222. ?>
  223. <tr>
  224. <td colspan='7' class='header'>
  225. <?=$index_title?>
  226. </td>
  227. </tr>
  228. <tr>
  229. <td rowspan='3' class='img'>
  230. <a href='/<?=$UID?>/monsters/<?=$unit->id?>/' target='_blank'>
  231. <div class='monster_panel'>
  232. <?=HTML::unit_panel($unit)?>
  233. </div>
  234. </a>
  235. </td>
  236. <?php
  237. $skill_num = 1;
  238. $absolute_level = 0;
  239. $absolute_max_level = 0;
  240. $ponderated_level = 0.0;
  241. $ponderated_max_level = 0.0;
  242. foreach ($unit->unit->skill as $skill){
  243. if ($skill->max_level > 1){
  244. $absolute_max_level += $skill->max_level;
  245. }
  246. $cur_lvl = $unit->skill_levels[$skill_num - 1];
  247. if ($skill->max_level > 1){
  248. $absolute_level += $cur_lvl;
  249. $ponderated_level += $cur_lvl * (($skill_num + 1) / 2.0);
  250. $ponderated_max_level += $skill->max_level * (($skill_num + 1) / 2.0);
  251. }
  252. $max_lvl = $skill->max_level;
  253. if ($max_lvl == $cur_lvl){
  254. $maxed = "maxed";
  255. }
  256. else{
  257. $maxed = "";
  258. }
  259. ?>
  260. <td rowspan='3' class='skill'>
  261. <img title='<?=$skill->description?>' src='<?=$skill->get_image()?>'/>
  262. <span class='skill_level <?=$maxed?>'>
  263. <?=$cur_lvl?>/<?=$max_lvl?>
  264. </span>
  265. <span class='skill_name'>
  266. <?=$skill->name?>
  267. </span>
  268. </td>
  269. <?php
  270. $skill_num ++;
  271. }
  272. while ($skill_num < 5){
  273. ?>
  274. <td rowspan='3' class='skill empty'>
  275. </td>
  276. <?php
  277. $skill_num ++;
  278. }
  279. ?>
  280. <td class='label'>
  281. <span class='desktop'>
  282. Absolute skill-ups:
  283. </span>
  284. <span class='mobile'>
  285. Abs:
  286. </span>
  287. </td>
  288. <td class='value'>
  289. <?=number_format($absolute_level * 100 / $absolute_max_level, 2)?>%
  290. </td>
  291. </tr>
  292. <tr>
  293. <td class='label'>
  294. <span class='desktop'>
  295. Ponderated skill-ups:
  296. </span>
  297. <span class='mobile'>
  298. Pond:
  299. </span>
  300. </td>
  301. <td class='value'>
  302. <?=number_format($ponderated_level * 100 / $ponderated_max_level, 2)?>%
  303. </td>
  304. </tr>
  305. <tr>
  306. <td class='label'>
  307. <span class='desktop'>
  308. Remaining skill-ups:
  309. </span>
  310. <span class='mobile'>
  311. Left:
  312. </span>
  313. </td>
  314. <td class='value'>
  315. <?=$absolute_max_level - $absolute_level?>&nbsp;
  316. </td>
  317. </tr>
  318. <?php
  319. $index ++;
  320. }
  321. ?>
  322. </table>
  323. </section>
  324. </main>
  325. <?php
  326. include __DIR__ . "/inc/footer.php";
  327. ?>
  328. </body>
  329. </html>