runs.php 29 KB

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