runs.php 29 KB

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