teams.php 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728
  1. <?php
  2. global $AREA_TYPE;
  3. global $SCENARIO;
  4. global $DUNGEON;
  5. global $LABYRINTH_STAGES;
  6. global $DIFFICULTY;
  7. global $ELEMENTAL_RIFT_DUNGEON;
  8. global $UID;
  9. ?>
  10. <!DOCTYPE html>
  11. <html lang='en'>
  12. <head>
  13. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  14. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  15. <title><?=$page->title?></title>
  16. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  17. <!-- CSS files -->
  18. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>ui.css'/>
  19. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>teams.css'/>
  20. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>filters.css'/>
  21. <!-- Meta tags -->
  22. <link rel='canonical' href='<?=$page->canonical?>'/>
  23. <link rel='author' href='<?=$page->author?>'/>
  24. <link rel='publisher' href='<?=$page->author?>'/>
  25. <meta name='description' content='<?=$page->description?>'/>
  26. <meta property='og:title' content='<?=$page->title?>'/>
  27. <meta property='og:url' content='<?=$page->canonical?>'/>
  28. <meta property='og:description' content='<?=$page->description?>'/>
  29. <meta property='og:image' content='<?=$page->icon?>'/>
  30. <meta property='og:site_name' content='<?=$page->name?>'/>
  31. <meta property='og:type' content='website'/>
  32. <meta property='og:locale' content='en'/>
  33. <meta name='twitter:card' content='summary'/>
  34. <meta name='twitter:title' content='<?=$page->title?>'/>
  35. <meta name='twitter:description' content='<?=$page->description?>'/>
  36. <meta name='twitter:image' content='<?=$page->icon?>'/>
  37. <meta name='twitter:url' content='<?=$page->canonical?>'/>
  38. <meta name='robots' content='index follow'/>
  39. <script>
  40. units = [];
  41. max_units = 0;
  42. selected_units = 0;
  43. selected_ids = [];
  44. <?php
  45. foreach ($page->units as $unit){
  46. ?>
  47. units.push(
  48. {
  49. id: <?=$unit->id?>,
  50. name: "<?=$unit->title?>",
  51. stars: <?=$unit->stars?>,
  52. level: <?=$unit->level?>,
  53. image: '<?=$unit->unit->get_image()?>',
  54. awakens_from: '<?=$unit->unit->awakens_from?>',
  55. awakens_to: '<?=$unit->unit->awakens_to?>',
  56. element: '<?=$unit->unit->element_name?>'
  57. }
  58. );
  59. <?php
  60. }
  61. ?>
  62. /**
  63. * Shows or hiddes the new team panel.
  64. *
  65. * @param show True to show, false to hide.
  66. */
  67. function showNewTeam(show){
  68. if (show === true){
  69. document.getElementById('new_team').style.display = 'block';
  70. }
  71. else{
  72. document.getElementById('new_team').style.display = 'none';
  73. }
  74. }
  75. function saveTeam(){
  76. if (selected_units > max_units){
  77. alert('Too many units selected.');
  78. return;
  79. }
  80. var name = document.getElementById('new_team_name').value;
  81. var description = document.getElementById('new_team_description').value;
  82. var area_type = document.getElementById('new_area_type').options[document.getElementById('new_area_type').selectedIndex].value;
  83. var area = null;
  84. var difficulty = null;
  85. var stage = null;
  86. switch (area_type){
  87. case '<?=$AREA_TYPE["SCENARIO"]?>':
  88. area = document.getElementById('new_area_scenario').options[document.getElementById('new_area_scenario').selectedIndex].value;
  89. difficulty = document.getElementById('new_area_difficulty').options[document.getElementById('new_area_difficulty').selectedIndex].value;
  90. stage = document.getElementById('new_area_stage').options[document.getElementById('new_area_stage').selectedIndex].value;
  91. break;
  92. case '<?=$AREA_TYPE["CAIROS_DUNGEON"]?>':
  93. area = document.getElementById('new_area_cairos_dungeon').options[document.getElementById('new_area_cairos_dungeon').selectedIndex].value;
  94. stage = document.getElementById('new_area_stage').options[document.getElementById('new_area_stage').selectedIndex].value;
  95. break;
  96. case '<?=$AREA_TYPE["RIFT_DUNGEON"]?>':
  97. area = document.getElementById('new_area_rift_dungeon').options[document.getElementById('new_area_rift_dungeon').selectedIndex].value;
  98. break;
  99. case '<?=$AREA_TYPE["RIFT_RAID"]?>':
  100. area = document.getElementById('new_area_rift_raid').options[document.getElementById('new_area_rift_raid').selectedIndex].value;
  101. stage = document.getElementById('new_area_stage').options[document.getElementById('new_area_stage').selectedIndex].value;
  102. break;
  103. case '<?=$AREA_TYPE["ARENA"]?>':
  104. break;
  105. case '<?=$AREA_TYPE["GUILD_WAR"]?>':
  106. break;
  107. case '<?=$AREA_TYPE["GUILD_SIEGE"]?>':
  108. break;
  109. case '<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>':
  110. difficulty = document.getElementById('new_area_difficulty').options[document.getElementById('new_area_difficulty').selectedIndex].value;
  111. stage = document.getElementById('new_area_stage').options[document.getElementById('new_area_stage').selectedIndex].value;
  112. break;
  113. case '<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>':
  114. difficulty = document.getElementById('new_area_difficulty').options[document.getElementById('new_area_difficulty').selectedIndex].value;
  115. break;
  116. case '<?=$AREA_TYPE["DIMENSIONAL_HOLE"]?>':
  117. area = document.getElementById('new_area_dimensional_hole').options[document.getElementById('new_area_dimensional_hole').selectedIndex].value;
  118. stage = document.getElementById('new_area_stage').options[document.getElementById('new_area_stage').selectedIndex].value;
  119. break;
  120. case '<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>':
  121. difficulty = document.getElementById('new_area_difficulty').options[document.getElementById('new_area_difficulty').selectedIndex].value;
  122. break;
  123. default:
  124. alert('Unknown Area');
  125. return;
  126. }
  127. if (!Number.isInteger(parseInt(area))){
  128. area = 0;
  129. }
  130. if (!Number.isInteger(parseInt(stage))){
  131. stage = 0;
  132. }
  133. if (!Number.isInteger(parseInt(difficulty))){
  134. difficulty = 0;
  135. }
  136. var ids = selected_ids.join(',');
  137. var xhttp = new XMLHttpRequest();
  138. xhttp.onreadystatechange = function() {
  139. if (this.readyState == 4 && this.status == 200) {
  140. location.reload();
  141. }
  142. };
  143. xhttp.open("POST", "/action/new_team/", true);
  144. xhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
  145. xhttp.send('uid=<?=$UID?>&ids=' + ids + '&area_type=' + area_type + '&area=' + area + '&difficulty=' + difficulty + '&stage=' + stage + '&name=' + encodeURI(name) + '&description=' + encodeURI(description));
  146. }
  147. /**
  148. * Searches a unit with the pattern entered in the 'new_unit_id'
  149. * field. Shows a clickable list of matching units.
  150. */
  151. function searchUnit(){
  152. key = document.getElementById('new_unit_id').value;
  153. var autocomplete = document.getElementById('new_unit_autocomplete');
  154. while (autocomplete.firstChild) {
  155. autocomplete.removeChild(autocomplete.firstChild);
  156. }
  157. if (key.length == 0){
  158. autocomplete.style.display = 'none';
  159. }
  160. for (var i = 0; i < units.length; i++) {
  161. if (units[i].name.toUpperCase().includes(key.toUpperCase())){
  162. autocomplete.style.display = 'block';
  163. var line = document.createElement('div');
  164. var img = document.createElement('img');
  165. img.setAttribute('src', units[i].image);
  166. var nam = document.createElement('span');
  167. var tex = document.createTextNode(units[i].name + '(' + units[i].stars + '*, Lv. ' + units[i].level + ')');
  168. nam.appendChild(tex);
  169. line.appendChild(img);
  170. line.appendChild(nam);
  171. sid = units[i].id;
  172. line.setAttribute('onclick', 'selectUnit(' + sid + ');');
  173. autocomplete.appendChild(line);
  174. }
  175. }
  176. }
  177. /**
  178. * Selects a unit from the list and adds it to the new team.
  179. * The search list is hidden afterwards.
  180. *
  181. * @param id Unit id.
  182. */
  183. function selectUnit(id){
  184. var name = null;
  185. var stars = null;
  186. var level = null;
  187. var image = null;
  188. var element = null;
  189. for (var i = 0; i < units.length; i ++) {
  190. if (units[i].id == id){
  191. name = units[i].name;
  192. stars = units[i].stars;
  193. level = units[i].level;
  194. image = units[i].image;
  195. element = units[i].element;
  196. break;
  197. }
  198. }
  199. if (name != null){
  200. var monsterPanel = document.createElement('div');
  201. monsterPanel.setAttribute('class', 'monster_panel');
  202. monsterPanel.setAttribute('id', 'monster_panel_' + id);
  203. monsterPanel.setAttribute('onclick', 'deleteUnit(' + id + ')');
  204. var monsterStars = document.createElement('span');
  205. monsterStars.setAttribute('class', 'stars');
  206. for (var i = 0; i < stars; i ++){
  207. var star = document.createElement('img');
  208. // TODO: Handle star color.
  209. star.setAttribute('class', 'star star_purple');
  210. star.setAttribute('src', '<?=$path["img"]["icon"]?>star.png');
  211. monsterStars.appendChild(star);
  212. }
  213. var monsterImage = document.createElement('img');
  214. monsterImage.setAttribute('class', 'monster border_' + element);
  215. monsterImage.setAttribute('src', image);
  216. var monsterLevel = document.createElement('span');
  217. monsterLevel.setAttribute('class', 'level');
  218. monsterLevel.appendChild(document.createTextNode(level));
  219. monsterPanel.appendChild(monsterStars);
  220. monsterPanel.appendChild(monsterImage);
  221. monsterPanel.appendChild(monsterLevel);
  222. var teamPanel = document.getElementById('new_team_units');
  223. teamPanel.appendChild(monsterPanel);
  224. // Hide the selector
  225. var autocomplete = document.getElementById('new_unit_autocomplete');
  226. while (autocomplete.firstChild) {
  227. autocomplete.removeChild(autocomplete.firstChild);
  228. }
  229. autocomplete.style.display = 'none';
  230. document.getElementById('new_unit_id').value = '';
  231. selected_units ++;
  232. if (selected_units >= max_units){
  233. document.getElementById('new_unit').style.display = 'none';
  234. }
  235. else{
  236. document.getElementById('new_unit').style.display = 'block';
  237. }
  238. selected_ids.push(id);
  239. }
  240. }
  241. /**
  242. * Deletes a unit from the new team form.
  243. *
  244. * @param id Unit id.
  245. */
  246. function deleteUnit(id){
  247. var position = -1;
  248. for (var i = 0; i < units.length; i ++) {
  249. if (units[i].id == id){
  250. position = i;
  251. break;
  252. }
  253. }
  254. if (position >= 0 && position < units.length){
  255. units.splice(position, 1);
  256. document.getElementById('new_team_units').removeChild(document.getElementById('monster_panel_' + id));
  257. selected_units --;
  258. if (selected_units >= max_units){
  259. document.getElementById('new_unit').style.display = 'none';
  260. }
  261. else{
  262. document.getElementById('new_unit').style.display = 'block';
  263. }
  264. }
  265. }
  266. /**
  267. * Shows the stage selector in the new team panel.
  268. *
  269. * @param total The number of stages to show.
  270. */
  271. function populateStage(total){
  272. var sel = document.getElementById('new_area_stage');
  273. while (sel.firstChild) {
  274. sel.removeChild(sel.firstChild);
  275. }
  276. var opt;
  277. var att;
  278. // Empty
  279. opt = document.createElement('option');
  280. tex = document.createTextNode('');
  281. opt.appendChild(tex);
  282. sel.appendChild(opt);
  283. for (var i = 1; i <= total; i ++){
  284. opt = document.createElement('option');
  285. tex = document.createTextNode('Stage ' + i);
  286. att = document.createAttribute('value');
  287. att.value = i;
  288. opt.setAttributeNode(att);
  289. opt.appendChild(tex);
  290. sel.appendChild(opt);
  291. }
  292. }
  293. /**
  294. * Shows the difficulty selector in the new team panel.
  295. *
  296. * @param labyrinth Indicates if the area type is the Tartarus
  297. * labyrinth. If so, it includes 'Easy'.
  298. * @param toa Indicates if the area type is the Tower of
  299. * Ascension. If so, it excludes 'Hell'.
  300. */
  301. function populateDifficulty(labyrinth = false, toa = false){
  302. var sel = document.getElementById('new_area_difficulty');
  303. while (sel.firstChild) {
  304. sel.removeChild(sel.firstChild);
  305. }
  306. var opt;
  307. var att;
  308. var tex;
  309. // Empty
  310. opt = document.createElement('option');
  311. tex = document.createTextNode('');
  312. opt.appendChild(tex);
  313. sel.appendChild(opt);
  314. // Easy (Labyrinth only)
  315. if (labyrinth){
  316. opt = document.createElement('option');
  317. tex = document.createTextNode('Easy difficulty');
  318. att = document.createAttribute('value');
  319. att.value = '<?=$DIFFICULTY["EASY"]?>';
  320. opt.setAttributeNode(att);
  321. opt.appendChild(tex);
  322. sel.appendChild(opt);
  323. }
  324. // Normal
  325. opt = document.createElement('option');
  326. tex = document.createTextNode('Normal difficulty');
  327. att = document.createAttribute('value');
  328. att.value = '<?=$DIFFICULTY["NORMAL"]?>';
  329. opt.setAttributeNode(att);
  330. opt.appendChild(tex);
  331. sel.appendChild(opt);
  332. // Hard
  333. opt = document.createElement('option');
  334. tex = document.createTextNode('Hard difficulty');
  335. att = document.createAttribute('value');
  336. att.value = '<?=$DIFFICULTY["HARD"]?>';
  337. opt.setAttributeNode(att);
  338. opt.appendChild(tex);
  339. sel.appendChild(opt);
  340. // Hell
  341. if (!toa){
  342. opt = document.createElement('option');
  343. tex = document.createTextNode('Hell difficulty');
  344. att = document.createAttribute('value');
  345. att.value = '<?=$DIFFICULTY["HELL"]?>';
  346. opt.setAttributeNode(att);
  347. opt.appendChild(tex);
  348. sel.appendChild(opt);
  349. }
  350. }
  351. /**
  352. * Shows the appropiate area selector when the area type is
  353. * selected in the new team panel.
  354. */
  355. function selectNewAreaType(){
  356. var type = document.getElementById('new_area_type').options[document.getElementById('new_area_type').selectedIndex].value;
  357. document.getElementById('new_area_scenario').style.display = 'none';
  358. document.getElementById('new_area_scenario').selectedIndex = 0;
  359. document.getElementById('new_area_cairos_dungeon').style.display = 'none';
  360. document.getElementById('new_area_cairos_dungeon').selectedIndex = 0;
  361. document.getElementById('new_area_rift_dungeon').style.display = 'none';
  362. document.getElementById('new_area_rift_dungeon').selectedIndex = 0;
  363. document.getElementById('new_area_tartarus_labyrinth').style.display = 'none';
  364. document.getElementById('new_area_tartarus_labyrinth').selectedIndex = 0;
  365. document.getElementById('new_area_dimensional_hole').style.display = 'none';
  366. document.getElementById('new_area_dimensional_hole').selectedIndex = 0;
  367. document.getElementById('new_area_difficulty').style.display = 'none';
  368. document.getElementById('new_area_difficulty').selectedIndex = 0;
  369. document.getElementById('new_area_stage').style.display = 'none';
  370. document.getElementById('new_area_stage').selectedIndex = 0;
  371. switch (type){
  372. case '<?=$AREA_TYPE["SCENARIO"]?>':
  373. document.getElementById('new_area_scenario').style.display = 'inline';
  374. max_units = 4;
  375. break;
  376. case '<?=$AREA_TYPE["CAIROS_DUNGEON"]?>':
  377. document.getElementById('new_area_cairos_dungeon').style.display = 'inline';
  378. max_units = 5;
  379. break;
  380. case '<?=$AREA_TYPE["RIFT_DUNGEON"]?>':
  381. document.getElementById('new_area_rift_dungeon').style.display = 'inline';
  382. max_units = 6;
  383. break;
  384. case '<?=$AREA_TYPE["RIFT_RAID"]?>':
  385. document.getElementById('new_area_rift_raid').style.display = 'inline';
  386. max_units = 6
  387. break;
  388. case '<?=$AREA_TYPE["ARENA"]?>':
  389. max_units = 4;
  390. //document.getElementById('new_area_arena').style.display = 'inline';
  391. break;
  392. case '<?=$AREA_TYPE["GUILD_WAR"]?>':
  393. max_units = 3;
  394. document.getElementById('new_area_guild_war').style.display = 'inline';
  395. break;
  396. case '<?=$AREA_TYPE["GUILD_SIEGE"]?>':
  397. max_units = 3;
  398. document.getElementById('new_area_guild_siege').style.display = 'inline';
  399. break;
  400. case '<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>':
  401. max_units = 5;
  402. document.getElementById('new_area_tartarus_labyrinth').style.display = 'inline';
  403. break;
  404. case '<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>':
  405. max_units = 5;
  406. //document.getElementById('new_area_trial_of_ascension').style.display = 'inline';
  407. break;
  408. case '<?=$AREA_TYPE["WORLD_BOSS"]?>':
  409. //max_units = 5;
  410. //document.getElementById('new_area_world_boss').style.display = 'inline';
  411. break;
  412. case '<?=$AREA_TYPE["DIMENSIONAL_HOLE"]?>':
  413. max_units = 4;
  414. document.getElementById('new_area_dimensional_hole').style.display = 'inline';
  415. break;
  416. case '<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>':
  417. max_units = 5;
  418. //document.getElementById('new_area_dimensional_rift').style.display = 'inline';
  419. break;
  420. }
  421. if (selected_units >= max_units || type == ''){
  422. document.getElementById('new_unit').style.display = 'none';
  423. }
  424. else{
  425. document.getElementById('new_unit').style.display = 'block';
  426. }
  427. }
  428. /**
  429. * Populates the difficulty and stage selectors when an area is
  430. * selected in the new team panel.
  431. */
  432. function selectNewArea(){
  433. var type = document.getElementById('new_area_type').options[document.getElementById('new_area_type').selectedIndex].value;
  434. document.getElementById('new_area_stage').selectedIndex = 0;
  435. document.getElementById('new_area_difficulty').selectedIndex = 0;
  436. document.getElementById('new_area_stage').style.display = 'none';
  437. document.getElementById('new_area_difficulty').style.display = 'none';
  438. switch (type){
  439. case '<?=$AREA_TYPE["SCENARIO"]?>':
  440. document.getElementById('new_area_stage').style.display = 'inline';
  441. document.getElementById('new_area_difficulty').style.display = 'inline';
  442. populateStage(7);
  443. populateDifficulty();
  444. break;
  445. case '<?=$AREA_TYPE["CAIROS_DUNGEON"]?>':
  446. document.getElementById('new_area_stage').style.display = 'inline';
  447. populateStage(10);
  448. populateDifficulty();
  449. break;
  450. case '<?=$AREA_TYPE["RIFT_DUNGEON"]?>':
  451. break;
  452. case '<?=$AREA_TYPE["RIFT_RAID"]?>':
  453. document.getElementById('new_area_stage').style.display = 'inline';
  454. populateStage(5);
  455. break;
  456. case '<?=$AREA_TYPE["ARENA"]?>':
  457. break;
  458. case '<?=$AREA_TYPE["GUILD_WAR"]?>':
  459. break;
  460. case '<?=$AREA_TYPE["GUILD_SIEGE"]?>':
  461. break;
  462. case '<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>':
  463. document.getElementById('new_area_difficulty').style.display = 'inline';
  464. populateDifficulty(true, false);
  465. break;
  466. case '<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>':
  467. document.getElementById('new_area_difficulty').style.display = 'inline';
  468. populateDifficulty(false, true);
  469. break;
  470. case '<?=$AREA_TYPE["WORLD_BOSS"]?>':
  471. break;
  472. case '<?=$AREA_TYPE["DIMENSIONAL_HOLE"]?>':
  473. document.getElementById('new_area_stage').style.display = 'inline';
  474. populateStage(5);
  475. break;
  476. case '<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>':
  477. break;
  478. }
  479. }
  480. /**
  481. * Shows or hiddes the filters panel.
  482. */
  483. function toggleFilters(){
  484. var content = document.getElementById('filters_content');
  485. var slid = document.getElementById('filters_slid');
  486. if (content.style.maxHeight != '30em'){
  487. content.style.maxHeight = '30em';
  488. slid.style.transform = 'rotate(90deg)';
  489. }
  490. else{
  491. content.style.maxHeight = '0px';
  492. slid.style.transform = 'rotate(0deg)';
  493. }
  494. };
  495. </script>
  496. </head>
  497. <body>
  498. <?php
  499. include __DIR__ . "/inc/header.php";
  500. ?>
  501. <section class='filters'>
  502. <h2 id='filters_title' onClick='toggleFilters();'>
  503. <img id='filters_slid' id='filters_slid' alt=' ' src='<?=$path["img"]["icon"]?>slid.png'/>
  504. Team filters
  505. </h2>
  506. <article id='filters_content'>
  507. <?php
  508. $filters = $page->filters;
  509. $custom_filters = $page->custom_filters;
  510. include __DIR__ . "/inc/filter_teams.php";
  511. ?>
  512. </article>
  513. </section> <!-- #filters -->
  514. <section class='list'>
  515. <h2>
  516. Teams
  517. </h2>
  518. <article>
  519. <table id='teams'>
  520. <tr>
  521. <th>
  522. Team
  523. </th>
  524. <th>
  525. Description
  526. </th>
  527. <th>
  528. Units
  529. </th>
  530. </tr>
  531. <?php
  532. $odd = "odd";
  533. foreach ($page->teams as $team){
  534. ?>
  535. <tr>
  536. <td class='team <?=$odd?>'>
  537. <h4>
  538. <?=$team->name?>
  539. </h4>
  540. <?php
  541. $area = $team->area->name;
  542. if (intval($team->stage) > 0){
  543. $area = $area . " - " . $team->stage;
  544. }
  545. ?>
  546. <h5>
  547. <?=$area?>
  548. </h5>
  549. </td>
  550. <td class='description <?=$odd?>'>
  551. <?=$team->description?>
  552. </td>
  553. <td class='units <?=$odd?>'>
  554. <?php
  555. foreach ($team->unit as $unit){
  556. ?>
  557. <a href='/<?=$UID?>/monsters/<?=$unit->id?>'>
  558. <div class='monster_panel'>
  559. <?=html_unit_panel($unit)?>
  560. </div>
  561. </a>
  562. <?php
  563. }
  564. ?>
  565. </td>
  566. </tr>
  567. <?php
  568. if ($odd == ""){
  569. $odd = "odd";
  570. }
  571. else{
  572. $odd = "";
  573. }
  574. }
  575. ?>
  576. </table>
  577. <input type='button' onClick='showNewTeam(true);' value='New Team'/>
  578. </article>
  579. </section> <!-- .list -->
  580. <?php
  581. include __DIR__ . "/inc/footer.php";
  582. ?>
  583. <section id='new_team' class='content'>
  584. <h2>
  585. New team
  586. </h2>
  587. <article>
  588. <table>
  589. <tr>
  590. <td class='new_title'>
  591. Area
  592. </td>
  593. <td class='new_values'>
  594. <select id='new_area_type' name='new_area_type' onChange='selectNewAreaType();'>
  595. <option value=''> </option>
  596. <option value='<?=$AREA_TYPE["SCENARIO"]?>'>Scenario</option>
  597. <option value='<?=$AREA_TYPE["CAIROS_DUNGEON"]?>'>Cairos Dungeon</option>
  598. <option value='<?=$AREA_TYPE["RIFT_DUNGEON"]?>'>Rift Dungeon</option>
  599. <option value='<?=$AREA_TYPE["RIFT_RAID"]?>'>Rift Raid</option>
  600. <option value='<?=$AREA_TYPE["DIMENSIONAL_HOLE"]?>'>Dimensional Hole</option>
  601. <option value='<?=$AREA_TYPE["ARENA"]?>'>Arena</option>
  602. <option value='<?=$AREA_TYPE["GUILD_WAR"]?>'>Guild War</option>
  603. <option value='<?=$AREA_TYPE["GUILD_SIEGE"]?>'>Guild Siege</option>
  604. <option value='<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>'>Tartarus Labyrinth</option>
  605. <option value='<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>'>Trial of Ascension</option>
  606. <!--<option value='<?=$AREA_TYPE["WORLD_BOSS"]?>'>World Boss</option>-->
  607. <option value='<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>'>Dimensinal Rift</option>
  608. </select>
  609. <select id='new_area_scenario' class='new_area' onChange='selectNewArea();'>
  610. <option value=''> </option>
  611. <option value='<?=$SCENARIO['GAREN_FOREST']?>'>Garen Forest</option>
  612. <option value='<?=$SCENARIO['MT_SIZ']?>'>Mt. Siz</option>
  613. <option value='<?=$SCENARIO['KABIR_RUINS']?>'>Kabir Ruins</option>
  614. <option value='<?=$SCENARIO['MT_WHITE_RAGON']?>'>Mt. White Ragon</option>
  615. <option value='<?=$SCENARIO['TELAIN_FOREST']?>'>Telain Forest</option>
  616. <option value='<?=$SCENARIO['HYDENI_RUINS']?>'>Hydeni Ruins</option>
  617. <option value='<?=$SCENARIO['TAMOR_DESERT']?>'>Tamor Desert</option>
  618. <option value='<?=$SCENARIO['VROFAGUS_RUINS']?>'>Vrofagus Ruins</option>
  619. <option value='<?=$SCENARIO['FAIMON_VOLCANO']?>'>Faimon Volcano</option>
  620. <option value='<?=$SCENARIO['AIDEN_FOREST']?>'>Aiden Forest</option>
  621. <option value='<?=$SCENARIO['FERUN_CASTLE']?>'>Ferun Castle</option>
  622. <option value='<?=$SCENARIO['MT_RUNAR']?>'>Mt. Runar</option>
  623. <option value='<?=$SCENARIO['CHIRUKA_REMAINS']?>'>Charuca Remains</option>
  624. </select>
  625. <select id='new_area_cairos_dungeon' class='new_area' onChange='selectNewArea();'>
  626. <option value=''> </option>
  627. <option value='<?=$DUNGEON['GIANTS_KEEP']?>'>Giant&#39;s Keep</option>
  628. <option value='<?=$DUNGEON['DRAGONS_LAIR']?>'>Dragon&#39;s Lair</option>
  629. <option value='<?=$DUNGEON['NECROPOLIS']?>'>Necropolis</option>
  630. <option value='<?=$DUNGEON['HALL_OF_MAGIC']?>'>Hall of Magic</option>
  631. <option value='<?=$DUNGEON['HALL_OF_FIRE']?>'>Hall of Fire</option>
  632. <option value='<?=$DUNGEON['HALL_OF_WATER']?>'>Hall of Water</option>
  633. <option value='<?=$DUNGEON['HALL_OF_WIND']?>'>Hall of Wind</option>
  634. <option value='<?=$DUNGEON['HALL_OF_LIGHT']?>'>Hall of Light</option>
  635. <option value='<?=$DUNGEON['HALL_OF_DARK']?>'>Hall of Dark</option>
  636. </select>
  637. <select id='new_area_rift_dungeon' class='new_area' onChange='selectNewArea();'>
  638. <option value=''> </option>
  639. <option value='<?=$ELEMENTAL_RIFT_DUNGEON['FIRE_BEAST']?>'>Fire Beast</option>
  640. <option value='<?=$ELEMENTAL_RIFT_DUNGEON['ICE_BEAST']?>'>Ice Beast</option>
  641. <option value='<?=$ELEMENTAL_RIFT_DUNGEON['WIND_BEAST']?>'>Wind Beast</option>
  642. <option value='<?=$ELEMENTAL_RIFT_DUNGEON['LIGHT_BEAST']?>'>Light Beast</option>
  643. <option value='<?=$ELEMENTAL_RIFT_DUNGEON['DARK_BEAST']?>'>Dark Beast</option>
  644. </select>
  645. <select id='new_area_dimensional_hole' class='new_area' onChange='selectNewArea();'>
  646. <option value=''> </option>
  647. <option value='<?=$DUNGEON['FOREST_OF_ROARING_BEASTS']?>'>Forest or Roaring Beasts</option>
  648. <option value='<?=$DUNGEON['KARZHAN_REMAINS_WARBEAR']?>'>Karzhan Remains (Warbear)</option>
  649. <option value='<?=$DUNGEON['KARZHAN_REMAINS_WARBEAR']?>'>Karzhan Remains (Inugami)</option>
  650. <option value='<?=$DUNGEON['SANCTUARY_OF_DREAMING_FAIRIES']?>'>Sanctuary of Dreaming Fairies</option>
  651. <option value='<?=$DUNGEON['ELLUNIA_REMAINS_FAIRY']?>'>Ellunia Remains (Fairy)</option>
  652. <option value='<?=$DUNGEON['ELLUNIA_REMAINS_PIXIE']?>'>Ellunia Remains (Pixie)</option>
  653. <!-- TODO: Lumel -->
  654. </select>
  655. <select id='new_area_tartarus_labyrinth' class='new_area' onChange='selectNewArea();'>
  656. <option value=''> </option>
  657. <option value='<?=$LABYRINTH_STAGES['TARTARUS']?>'>Tartarus</option>
  658. <option value='<?=$LABYRINTH_STAGES['KOTTOS']?>'>Kottos</option>
  659. <option value='<?=$LABYRINTH_STAGES['LEOS']?>'>Leos</option>
  660. <option value='<?=$LABYRINTH_STAGES['AQUILES']?>'>Aquiles</option>
  661. <option value='<?=$LABYRINTH_STAGES['NORMAL']?>'>Normal Stage</option>
  662. <option value='<?=$LABYRINTH_STAGES['RESCUE']?>'>Rescue Stage</option>
  663. <option value='<?=$LABYRINTH_STAGES['EXPLODE']?>'>Explode Stage</option>
  664. <option value='<?=$LABYRINTH_STAGES['COOL_TIME']?>'>Cool Time Stage</option>
  665. <option value='<?=$LABYRINTH_STAGES['SPEED_LIMIT']?>'>Speed Limit Stage</option>
  666. <option value='<?=$LABYRINTH_STAGES['TIME_LIMIT']?>'>Time Limit Stage</option>
  667. <!-- TODO: Lumel -->
  668. </select>
  669. <select id='new_area_difficulty'>
  670. </select>
  671. <select id='new_area_stage'>
  672. </select>
  673. </td>
  674. </tr>
  675. <tr>
  676. <td class='new_title'>
  677. Name
  678. </td>
  679. <td class='new_values'>
  680. <input type='text' id='new_team_name' name='name'/>
  681. </td>
  682. </tr>
  683. <tr>
  684. <td class='new_title'>
  685. Description
  686. </td>
  687. <td class='new_values'>
  688. <textarea id='new_team_description' name='description'></textarea>
  689. </td>
  690. </tr>
  691. <tr>
  692. <td class='new_title'>
  693. Units:
  694. <div class='new_unit' id='new_unit'>
  695. <input id='new_unit_id' onInput='searchUnit();'/>
  696. <div id='new_unit_autocomplete' class='new_unit_autocomplete'>
  697. </div>
  698. </td>
  699. <td class='new_values'>
  700. <div id='new_team_units'>
  701. </div>
  702. </td>
  703. </tr>
  704. <tr>
  705. <td colspan='2'>
  706. <input type='button' value='Save' onClick='saveTeam();'/>
  707. <input type='button' value='Close' onClick='showNewTeam(false);'/>
  708. </td>
  709. </tr>
  710. </table>
  711. </article>
  712. </section>
  713. </body>
  714. </html>