report_skillup.php 16 KB

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