runs.php 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. <?php
  2. /**
  3. * Runs view.
  4. *
  5. * Contains the view layout and ome code to present the data.
  6. *
  7. * @author Iñigo Valentin <i@inigovalentin.com>
  8. * @license https://www.gnu.org/licenses/gpl-3.0.en.html GNU General Public License V3
  9. * @package SWDB
  10. * @category View
  11. * @property Runs_Page $page The page model.
  12. * @var Runs_Page $page The page model.
  13. */
  14. ?>
  15. <!DOCTYPE html>
  16. <html lang='en'>
  17. <head>
  18. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  19. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  20. <title><?=$page->get_title()?></title>
  21. <link rel='shortcut icon' href='<?=$page->get_favicon()?>'/>
  22. <!-- CSS files -->
  23. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui.css'/>
  24. <?php
  25. if (get_context()->get_game_mode() == GAME_MODE_ID::RTA){
  26. ?>
  27. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>ui-rta.css'/>
  28. <?php
  29. }
  30. ?>
  31. <link rel='stylesheet' type='text/css' href='<?=URL::CSS?>runs.css'/>
  32. <!-- Meta tags -->
  33. <link rel='canonical' href='<?=$page->get_canonical()?>'/>
  34. <link rel='author' href='<?=$page->get_author()?>'/>
  35. <link rel='publisher' href='<?=$page->get_author()?>'/>
  36. <meta name='description' content='<?=$page->get_description()?>'/>
  37. <meta property='og:title' content='<?=$page->get_title()?>'/>
  38. <meta property='og:url' content='<?=$page->get_canonical()?>'/>
  39. <meta property='og:description' content='<?=$page->get_description()?>'/>
  40. <meta property='og:image' content='<?=$page->get_icon()?>'/>
  41. <meta property='og:site_name' content='<?=$page->get_name()?>?>'/>
  42. <meta property='og:type' content='website'/>
  43. <meta property='og:locale' content='en'/>
  44. <meta name='twitter:card' content='summary'/>
  45. <meta name='twitter:title' content='<?=$page->get_title()?>'/>
  46. <meta name='twitter:description' content='<?=$page->get_description()?>'/>
  47. <meta name='twitter:image' content='<?=$page->get_icon()?>'/>
  48. <meta name='twitter:url' content='<?=$page->get_canonical()?>'/>
  49. <meta name='robots' content='index follow'/>
  50. <script>
  51. /**
  52. * Shows or hiddes the save team form.
  53. *
  54. * @param id Run ID.
  55. * @param show TRue to show, false to hide.
  56. */
  57. function saveForm(id, show){
  58. if (show === true){
  59. document.getElementById('save_team').style.display = 'block';
  60. document.getElementById('save_id').value = id;
  61. }
  62. else{
  63. document.getElementById('save_team').style.display = 'none';
  64. }
  65. }
  66. /**
  67. * Makes a request to save the team.
  68. *
  69. * Hides the team save form on success.
  70. */
  71. function saveTeam(){
  72. var id = document.getElementById('save_id').value;
  73. var name = document.getElementById('save_team_name').value;
  74. var description = document.getElementById('save_team_description').value;
  75. if (name == ''){
  76. alert('Name required')
  77. return;
  78. }
  79. var xhttp = new XMLHttpRequest();
  80. xhttp.onreadystatechange = function() {
  81. if (this.readyState == 4 && this.status == 200) {
  82. saveForm(null, false);
  83. }
  84. };
  85. xhttp.open("POST", "/action/save_run_team/", true);
  86. xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  87. xhttp.send('player=<?=get_context()->get_player()->get_id()?>&run=' + id + '&name=' + encodeURI(name) + '&description=' + encodeURI(description));
  88. }
  89. /**
  90. * Shows or hiddes the filters panel.
  91. */
  92. function toggleFilters(){
  93. var content = document.getElementById('filters_content');
  94. var slid = document.getElementById('filters_slid');
  95. if (content.style.maxHeight != '30em'){
  96. content.style.maxHeight = '30em';
  97. slid.style.transform = 'rotate(90deg)';
  98. }
  99. else{
  100. content.style.maxHeight = '0px';
  101. slid.style.transform = 'rotate(0deg)';
  102. }
  103. };
  104. /**
  105. * Shows the appropiate area selector.
  106. */
  107. function selectAreaType(){
  108. var areaType = document.getElementById('filter_area_type').options[document.getElementById('filter_area_type').selectedIndex].value;
  109. // Clear all selectors
  110. var areas = document.getElementsByClassName('filter_area');
  111. for (var i = 0; i < areas.length; i++) {
  112. areas[i].style.display = 'none';
  113. areas[i].removeAttribute('name');
  114. }
  115. // Show selected selector.
  116. switch (areaType){
  117. case '<?=AREA_TYPE_ID::SCENARIO?>':
  118. document.getElementById('filter_area_scenario').style.display = 'inline-block';
  119. document.getElementById('filter_area_scenario').setAttribute('name', 'area');
  120. break;
  121. case '<?=AREA_TYPE_ID::CAIROS_DUNGEON?>':
  122. document.getElementById('filter_area_cairos').style.display = 'inline-block';
  123. document.getElementById('filter_area_cairos').setAttribute('name', 'area');
  124. break;
  125. case '<?=AREA_TYPE_ID::RIFT_DUNGEON?>':
  126. document.getElementById('filter_area_rift_dungeon').style.display = 'inline-block';
  127. document.getElementById('filter_area_rift_dungeon').setAttribute('name', 'area');
  128. break;
  129. // Rift Raid: Don't filter by area.
  130. // Arena: Don't filter by area.
  131. // Guild War: Don't filter by area.
  132. // Guild Siege: Don't filter by area.
  133. // Rift Raid: Don't filter by area.
  134. // Tartarus: Don't filter by area.
  135. // TOA: Don't filter by area.
  136. // Rift Raid: Don't filter by area.
  137. // WB: Don't filter by area.
  138. // Dimensional Rift: Don't filter by area.
  139. // TODO: Filter Dimensional Hole dungeon
  140. }
  141. }
  142. </script>
  143. </head>
  144. <body onload='selectAreaType();'>
  145. <?php
  146. include __DIR__ . "/inc/header.php";
  147. ?>
  148. <aside>
  149. <h2>
  150. Logged runs
  151. </h2>
  152. <p>
  153. View and compare saved runs
  154. </p>
  155. <form action='/<?=get_context()->get_player()->get_id()?>/runs/' method='get' id='filter_runeupgrade' class='filter'>
  156. <table>
  157. <tr>
  158. <td class='label'>
  159. Area
  160. </td>
  161. <td>
  162. <?php
  163. $selected = array_fill(0, 12 + 1, "");
  164. $selected[$page->get_filter("AREA_TYPE")] = "selected";
  165. ?>
  166. <select name='area_type' id='filter_area_type' onchange='selectAreaType();'>
  167. <option value='0'>All</option>
  168. <option value='<?=AREA_TYPE_ID::SCENARIO?>' <?=$selected[AREA_TYPE_ID::SCENARIO]?>>Scenario</option>
  169. <option value='<?=AREA_TYPE_ID::CAIROS_DUNGEON?>' <?=$selected[AREA_TYPE_ID::CAIROS_DUNGEON]?>>Cairos Dungeon</option>
  170. <option value='<?=AREA_TYPE_ID::RIFT_DUNGEON?>' <?=$selected[AREA_TYPE_ID::RIFT_DUNGEON]?>>Rift Beast</option>
  171. <option value='<?=AREA_TYPE_ID::RIFT_RAID?>' <?=$selected[AREA_TYPE_ID::RIFT_RAID]?>>Rift Raid</option>
  172. <option value='<?=AREA_TYPE_ID::DIMENSIONAL_HOLE?>' <?=$selected[AREA_TYPE_ID::DIMENSIONAL_HOLE]?>>Dimensional Hole</option>
  173. <option value='<?=AREA_TYPE_ID::ARENA?>' <?=$selected[AREA_TYPE_ID::ARENA]?>>Arena</option>
  174. <option value='<?=AREA_TYPE_ID::GUILD_WAR?>' <?=$selected[AREA_TYPE_ID::GUILD_WAR]?>>Guild War</option>
  175. <option value='<?=AREA_TYPE_ID::GUILD_SIEGE?>' <?=$selected[AREA_TYPE_ID::GUILD_SIEGE]?>>Guild Siege</option>
  176. <option value='<?=AREA_TYPE_ID::TARTARUS_LABYRINTH?>' <?=$selected[AREA_TYPE_ID::TARTARUS_LABYRINTH]?>>Tartarus Labyrinth</option>
  177. <option value='<?=AREA_TYPE_ID::TRIAL_OF_ASCENSION?>' <?=$selected[AREA_TYPE_ID::TRIAL_OF_ASCENSION]?>>Trial of Ascension</option>
  178. <option value='<?=AREA_TYPE_ID::WORLD_BOSS?>' <?=$selected[AREA_TYPE_ID::WORLD_BOSS]?>>World Boss</option>
  179. <option value='<?=AREA_TYPE_ID::DIMENSIONAL_RIFT?>' <?=$selected[AREA_TYPE_ID::DIMENSIONAL_RIFT]?>>Dimensional Rift</option>
  180. </select>
  181. <?php
  182. $selected = array_fill(0, 9002, "");
  183. $selected[$page->get_filter("AREA")] = "selected";
  184. ?>
  185. <select id='filter_area_scenario' class='filter_area'>
  186. <option value='0'>All</option>
  187. <option value='<?=SCENARIO_ID::GAREN_FOREST?>' <?=$selected[SCENARIO_ID::GAREN_FOREST]?>>Garen Forest</option>
  188. <option value='<?=SCENARIO_ID::MT_SIZ?>' <?=$selected[SCENARIO_ID::MT_SIZ]?>>Mt. Siz</option>
  189. <option value='<?=SCENARIO_ID::KABIR_RUINS?>' <?=$selected[SCENARIO_ID::KABIR_RUINS]?>>Kabir Ruins</option>
  190. <option value='<?=SCENARIO_ID::MT_WHITE_RAGON?>' <?=$selected[SCENARIO_ID::MT_WHITE_RAGON]?>>Mt. White Ragon</option>
  191. <option value='<?=SCENARIO_ID::TELAIN_FOREST?>' <?=$selected[SCENARIO_ID::TELAIN_FOREST]?>>Telain Forest</option>
  192. <option value='<?=SCENARIO_ID::HYDENI_RUINS?>' <?=$selected[SCENARIO_ID::HYDENI_RUINS]?>>Hydeni Ruins</option>
  193. <option value='<?=SCENARIO_ID::TAMOR_DESERT?>' <?=$selected[SCENARIO_ID::TAMOR_DESERT]?>>Tamor Desert</option>
  194. <option value='<?=SCENARIO_ID::VROFAGUS_RUINS?>' <?=$selected[SCENARIO_ID::VROFAGUS_RUINS]?>>Vrofagus Ruins</option>
  195. <option value='<?=SCENARIO_ID::FAIMON_VOLCANO?>' <?=$selected[SCENARIO_ID::FAIMON_VOLCANO]?>>Faimon Volcano</option>
  196. <option value='<?=SCENARIO_ID::AIDEN_FOREST?>' <?=$selected[SCENARIO_ID::AIDEN_FOREST]?>>Aiden Forest</option>
  197. <option value='<?=SCENARIO_ID::FERUN_CASTLE?>' <?=$selected[SCENARIO_ID::FERUN_CASTLE]?>>Ferun Castle</option>
  198. <option value='<?=SCENARIO_ID::MT_RUNAR?>' <?=$selected[SCENARIO_ID::MT_RUNAR]?>>Mt. Runar</option>
  199. <option value='<?=SCENARIO_ID::CHIRUKA_REMAINS?>' <?=$selected[SCENARIO_ID::CHIRUKA_REMAINS]?>>Charuka Remains</option>
  200. </select>
  201. <select id='filter_area_cairos' class='filter_area'>
  202. <option value='0'>All</option>
  203. <option value='<?=DUNGEON_ID::GIANTS_KEEP?>' <?=$selected[DUNGEON_ID::GIANTS_KEEP]?>>Giant&#39;s Keep</option>
  204. <option value='<?=DUNGEON_ID::DRAGONS_LAIR?>' <?=$selected[DUNGEON_ID::DRAGONS_LAIR]?>>Dragon&#39;s Lair</option>
  205. <option value='<?=DUNGEON_ID::NECROPOLIS?>' <?=$selected[DUNGEON_ID::NECROPOLIS]?>>Necropolis</option>
  206. <option value='<?=DUNGEON_ID::HALL_OF_MAGIC?>' <?=$selected[DUNGEON_ID::HALL_OF_MAGIC]?>>Hall of Magic</option>
  207. <option value='<?=DUNGEON_ID::HALL_OF_LIGHT?>' <?=$selected[DUNGEON_ID::HALL_OF_LIGHT]?>>Hall of Light</option>
  208. <option value='<?=DUNGEON_ID::HALL_OF_DARK?>' <?=$selected[DUNGEON_ID::HALL_OF_DARK]?>>Hall of Dark</option>
  209. <option value='<?=DUNGEON_ID::HALL_OF_FIRE?>' <?=$selected[DUNGEON_ID::HALL_OF_FIRE]?>>Hall of Fire</option>
  210. <option value='<?=DUNGEON_ID::HALL_OF_WATER?>' <?=$selected[DUNGEON_ID::HALL_OF_WATER]?>>Hall of Water</option>
  211. <option value='<?=DUNGEON_ID::HALL_OF_WIND?>' <?=$selected[DUNGEON_ID::HALL_OF_WIND]?>>Hall of Wind</option>
  212. </select>
  213. <select id='filter_area_rift_dungeon' class='filter_area'>
  214. <option value='0'>All</option>
  215. <option value='<?=ELEMENTAL_RIFT_DUNGEON_ID::LIGHT_BEAST?>' <?=$selected[ELEMENTAL_RIFT_DUNGEON_ID::LIGHT_BEAST]?>>Light Beast</option>
  216. <option value='<?=ELEMENTAL_RIFT_DUNGEON_ID::DARK_BEAST?>' <?=$selected[ELEMENTAL_RIFT_DUNGEON_ID::DARK_BEAST]?>>Dark Beast</option>
  217. <option value='<?=ELEMENTAL_RIFT_DUNGEON_ID::FIRE_BEAST?>' <?=$selected[ELEMENTAL_RIFT_DUNGEON_ID::FIRE_BEAST]?>>Fire Beast</option>
  218. <option value='<?=ELEMENTAL_RIFT_DUNGEON_ID::ICE_BEAST?>' <?=$selected[ELEMENTAL_RIFT_DUNGEON_ID::ICE_BEAST]?>>Ice Beast</option>
  219. <option value='<?=ELEMENTAL_RIFT_DUNGEON_ID::WIND_BEAST?>' <?=$selected[ELEMENTAL_RIFT_DUNGEON_ID::WIND_BEAST]?>>Wind Beast</option>
  220. </select>
  221. </td>
  222. </tr>
  223. <tr>
  224. <td class='label'>
  225. Date range:
  226. </td>
  227. <td>
  228. <input type='date' name='date_min' id='date_min' value='<?=$page->get_filter("DATE_MIN")?>'/>
  229. -
  230. <input type='date' name='date_max' id='date_max' value='<?=$page->get_filter("DATE_MAX")?>'/>
  231. </td>
  232. </tr>
  233. <tr>
  234. <td colspan='2'>
  235. <?php
  236. $checked = "";
  237. if ($page->get_filter("DEFEAT")){
  238. $checked = "checked";
  239. }
  240. ?>
  241. <input type='checkbox' name='defeat' id='filter_defeat' <?=$checked?>/>
  242. <label for='filter_defeat'>Show defeats</label>
  243. </td>
  244. </tr>
  245. <tr>
  246. <td colspan='2'>
  247. <?php
  248. $checked = "";
  249. if ($page->get_filter("HELPER")){
  250. $checked = "checked";
  251. }
  252. ?>
  253. <input type='checkbox' name='helper' id='filter_helper' <?=$checked?>/>
  254. <label for='filter_helper'>Show runs with friends/mentors</label>
  255. </td>
  256. </tr>
  257. <tr>
  258. <td colspan='2'>
  259. <input type='number' name='number' id='number' min='1' value='<?=$page->get_filter("NUMBER")?>'/> runs per page
  260. </td>
  261. </tr>
  262. </table>
  263. <input type='submit' value='Apply'/>
  264. </form>
  265. </aside>
  266. <main>
  267. <section class='content'>
  268. <h2>
  269. Runs
  270. </h2>
  271. <article>
  272. <table id='runs'>
  273. <tr>
  274. <th>
  275. Area
  276. </th>
  277. <th>
  278. Date
  279. </th>
  280. <th>
  281. Team
  282. </th>
  283. <th>
  284. Time/Rank
  285. </th>
  286. <th>
  287. Reward
  288. </th>
  289. </tr>
  290. <?php
  291. foreach ($page->get_runs() as $run){
  292. $enable_save = true;
  293. ?>
  294. <tr id='run_<?=$run->get_id()?>'>
  295. <td class='area'>
  296. <div class='area'>
  297. <img title='<?=$run->get_area()->get_name()?>' class='area' src='<?=$run->get_area()->get_image($run->get_stage())?>'/>
  298. <?php
  299. if ($run->get_stage() > 0){
  300. ?>
  301. <span class='stage'><?=$run->get_stage()?></span>
  302. <?php
  303. }
  304. if(APPLICATION::valid_id("SCENARIO_ID", $run->get_area()->get_id())){
  305. ?>
  306. <span class='difficulty'>
  307. <?php
  308. if (
  309. $run->get_area()->get_type() == AREA_TYPE_ID::TARTARUS_LABYRINTH ||
  310. $run->get_area()->get_type() == AREA_TYPE_ID::DIMENSIONAL_RIFT
  311. ){
  312. $difficulty = $run->get_difficulty();
  313. }
  314. else{
  315. $difficulty = $run->get_difficulty() - 1;
  316. }
  317. for ($i = 0; $i < $difficulty; $i ++){
  318. ?>
  319. <img class='difficulty' src='<?=URL::IMG["ICON"]?>star.png'/>
  320. <?php
  321. }
  322. ?>
  323. </span>
  324. <?php
  325. }
  326. ?>
  327. </div>
  328. </td>
  329. <td class='date'>
  330. <?=$run->get_start_time("Y/m/d H:i:s")?>
  331. </td>
  332. <td class='team'>
  333. <?php
  334. if ($run->had_help()){
  335. $enable_save = false;
  336. ?>
  337. <div class='monster_panel helper'>
  338. <img class='monster' title='Friend/Mentor' src='<?=URL::IMG["CURRENCY"]?>socialpoint.png'/>
  339. </div>
  340. <?php
  341. }
  342. $prev_front = false;
  343. $front = "undefined";
  344. foreach ($run->get_party() as $party){
  345. $front = in_array($party->get_id(), $run->get_frontline());
  346. if ($front != "undefined" && $prev_front != $front){
  347. ?>
  348. <hr class='frontline'/>
  349. <?php
  350. }
  351. if ($party instanceof Monster){
  352. $enable_save = false;
  353. $disabled = "disabled";
  354. }
  355. else{
  356. $disabled = "";
  357. }
  358. if ($disabled == ""){
  359. ?>
  360. <a target='_blank' href='/<?=get_context()->get_player()->get_id()?>/unit/<?=$party->get_id()?>'>
  361. <?php
  362. }
  363. ?>
  364. <div class='monster_panel <?=$disabled?>'>
  365. <?=HTML::unit_panel($party)?>
  366. <?php
  367. if ($party->get_id() == $run->get_leader()){
  368. ?>
  369. <img alt='Leader' class='leader' src='<?=URL::IMG["ICON"]?>leader.png'/>
  370. <?php
  371. }
  372. ?>
  373. </div>
  374. <?php
  375. if ($disabled == ""){
  376. ?>
  377. </a>
  378. <?php
  379. }
  380. $prev_front = $front;
  381. }
  382. ?>
  383. </td>
  384. <td class='time'>
  385. <?php
  386. if ($run->get_area()->get_type() == AREA_TYPE_ID::RIFT_DUNGEON){
  387. ?>
  388. <span class='rank'>
  389. <?=$run->get_rank()?>
  390. </span>
  391. <span class='score'>
  392. <?=$run->get_score()?>
  393. </span>
  394. <?php
  395. }
  396. else{
  397. if ($run->is_win()){
  398. if ($run->get_time() > 1){
  399. $s = floor($run->get_time() / 1000);
  400. $m = floor($s / 60);
  401. $s = floor($s % 60);
  402. $ms = ($run->get_time() - (1000 * 60 * $m) - (1000 * 60 * $s) / 100);
  403. $s = str_pad($s, 2, '0', STR_PAD_LEFT);
  404. $ms = str_pad($ms, 2, '0', STR_PAD_LEFT);
  405. ?>
  406. <?=$m?>:<?=$s?><span class='ms'>.<?=$ms?></span>
  407. <?php
  408. }
  409. }
  410. else{
  411. ?>
  412. <span class='defeated'>Defeated</span>
  413. <?php
  414. }
  415. }
  416. ?>
  417. </td>
  418. <td class='reward'>
  419. <?php
  420. if ($run->get_rewards()["energy"] > 0){
  421. ?>
  422. <div class='item'>
  423. <img class='item' title='Energy' src='<?=URL::IMG["CURRENCY"]?>energy.png'/>
  424. <span class='item'><?=$run->get_rewards()["energy"]?></span>
  425. </div>
  426. <?php
  427. }
  428. if ($run->get_rewards()["mana"] > 0){
  429. ?>
  430. <div class='item'>
  431. <img class='item' title='Mana' src='<?=URL::IMG["CURRENCY"]?>mana.png'/>
  432. <span class='item'><?=$run->get_rewards()["mana"]?></span>
  433. </div>
  434. <?php
  435. }
  436. if ($run->get_rewards()["crystal"] > 0){
  437. ?>
  438. <div class='item'>
  439. <img class='item' title='Crystal' src='<?=URL::IMG["CURRENCY"]?>crystal.png'/>
  440. <span class='item'><?=$run->get_rewards()["crystal"]?></span>
  441. </div>
  442. <?php
  443. }
  444. if ($run->get_rewards()["honor_points"] > 0){
  445. ?>
  446. <div class='item'>
  447. <img class='item' title='Honor Points' src='<?=URL::IMG["CURRENCY"]?>honor.png'/>
  448. <span class='item'><?=$run->get_rewards()["honor_points"]?></span>
  449. </div>
  450. <?php
  451. }
  452. if ($run->get_rewards()["guild_points"] > 0){
  453. ?>
  454. <div class='item'>
  455. <img class='item' title='Guild Points' src='<?=URL::IMG["CURRENCY"]?>guildpoint.png'/>
  456. <span class='item'><?=$run->get_rewards()["guild_points"]?></span>
  457. </div>
  458. <?php
  459. }
  460. if ($run->get_rewards()["monster"] != null){
  461. ?>
  462. <div class='item'>
  463. <img class='item' title='<?=$run->get_rewards()["monster"]->get_name()?>' src='<?=$run->get_rewards()["monster"]->get_image()?>'/>
  464. </div>
  465. <?php
  466. }
  467. foreach ($run->get_rewards()["item"] as $item){
  468. ?>
  469. <div class='item'>
  470. <img class='item' title='<?=$item["inventory"]->get_name()?>' src='<?=$item["inventory"]->get_image()?>'/>
  471. <span class='item'><?=$item["amount"]?></span>
  472. </div>
  473. <?php
  474. }
  475. if ($run->get_rewards()["sd"] != null){
  476. ?>
  477. <div class='item'>
  478. <img class='item' title='<?=$run->get_rewards()["sd"]->get_name()?>' src='<?=$run->get_rewards()["sd"]->get_image()?>'/>
  479. <img class='item' title=' ' src='<?=URL::IMG["MISC"]?>mask-sd.png'/>
  480. </div>
  481. <?php
  482. }
  483. foreach ($run->get_rewards()["monster_piece"] as $piece){
  484. ?>
  485. <div class='item'>
  486. <img class='item' title='<?=$piece["monster"]->get_name()?>' src='<?=$piece["monster"]->get_image()?>'/>
  487. <img class='item' title=' ' src='<?=URL::IMG["MISC"]?>mask-piece.png'/>
  488. <span class='item'><?=$piece->amount?></span>
  489. </div>
  490. <?php
  491. }
  492. if ($run->get_rewards()["shapeshifting"] > 0){
  493. ?>
  494. <div class='item'>
  495. <img class='item' title='Shapeshifting Stones' src='<?=URL::IMG["CURRENCY"]?>costumestone.png'/>
  496. <span class='item'><?=$run->get_rewards()["shapeshifting"]?></span>
  497. </div>
  498. <?php
  499. }
  500. foreach ($run->get_rewards()["rune"] as $rune){
  501. ?>
  502. <div class='item item_rune'>
  503. <img class='item' title='Rune' src='<?=URL::IMG["RUNE"]?>base.png'/>
  504. <?=HTML::rune_table($rune)?>
  505. </div>
  506. <?php
  507. }
  508. foreach ($run->get_rewards()["artifact"] as $artifact){
  509. ?>
  510. <div class='item item_artifact'>
  511. <img class='item' title='Artifact' src='<?=URL::IMG["ARTIFACT"]?>base.png'/>
  512. <?=HTML::artifact_table($artifact)?>
  513. </div>
  514. <?php
  515. }
  516. // TODO: Artifacts
  517. foreach ($run->get_rewards()["enchantment"] as $enchantment){
  518. ?>
  519. <div class='item item_enchantment'>
  520. <img class='item' title='Enchantment' src='<?=URL::IMG["GRIND"]?>grind.png'/>
  521. <?=HTML::enchantment_panel($enchantment)?>
  522. </div>
  523. <?php
  524. }
  525. ?>
  526. </td>
  527. <td class='action'>
  528. <?php
  529. if ($enable_save){
  530. ?>
  531. <img alt='Save Team' class='save_team' onclick='saveForm(<?=$run->get_id()?>, true);' src='<?=URL::IMG["ICON"]?>save.png'/>
  532. <?php
  533. }
  534. ?>
  535. </td>
  536. </tr>
  537. <?php
  538. }
  539. ?>
  540. </table>
  541. </article>
  542. </section>
  543. </main>
  544. <section id='save_team' class='content'>
  545. <h2>
  546. Save run
  547. </h2>
  548. <article>
  549. <input id='save_id' type='hidden' value=''/>
  550. <table>
  551. <tr>
  552. <td class='save_title'>
  553. Name
  554. </td>
  555. <td class='save_values'>
  556. <input type='text' id='save_team_name' name='name'/>
  557. </td>
  558. </tr>
  559. <tr>
  560. <td class='save_title'>
  561. Description
  562. </td>
  563. <td class='save_values'>
  564. <textarea id='save_team_description' name='description'></textarea>
  565. </td>
  566. </tr>
  567. <tr>
  568. <td colspan='2'>
  569. <input type='button' value='Save' onClick='saveTeam();'/>
  570. <input type='button' value='Close' onClick='saveForm(null, false);'/>
  571. </td>
  572. </tr>
  573. </table>
  574. </article>
  575. </section>
  576. <?php
  577. include __DIR__ . "/inc/footer.php";
  578. ?>
  579. </body>
  580. </html>