teams.php 37 KB

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