teams.php 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426
  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. ?>
  9. <!DOCTYPE html>
  10. <html lang='en'>
  11. <head>
  12. <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
  13. <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
  14. <title><?=$page->title?></title>
  15. <link rel='shortcut icon' href='<?=$page->favicon?>'/>
  16. <!-- CSS files -->
  17. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>ui.css'/>
  18. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>teams.css'/>
  19. <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>filters.css'/>
  20. <!-- Script files -->
  21. <script src="<?=$path["js"]?>ui.js"></script>
  22. <script src="<?=$path["js"]?>teams.js"></script>
  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. function populateUnits(total){
  43. for (var i = 0; i < 6; i ++){
  44. if (i < total){
  45. document.getElementById('new_unit_' + i).style.display = 'inline-block';
  46. }
  47. else{
  48. document.getElementById('new_unit_' + i).style.display = 'none';
  49. }
  50. }
  51. }
  52. function populateStage(total){
  53. var sel = document.getElementById('new_area_stage');
  54. while (sel.firstChild) {
  55. sel.removeChild(sel.firstChild);
  56. }
  57. var opt;
  58. var att;
  59. for (var i = 1; i <= total; i ++){
  60. opt = document.createElement('option');
  61. tex = document.createTextNode(i);
  62. att = document.createAttribute('value');
  63. att.value = i;
  64. opt.setAttributeNode(att);
  65. opt.appendChild(tex);
  66. sel.appendChild(opt);
  67. }
  68. }
  69. function populateDifficulty(labyrinth = false, toa = false){
  70. var sel = document.getElementById('new_area_difficulty');
  71. while (sel.firstChild) {
  72. sel.removeChild(sel.firstChild);
  73. }
  74. var opt;
  75. var att;
  76. var tex;
  77. // Empty
  78. opt = document.createElement('option');
  79. tex = document.createTextNode('');
  80. opt.appendChild(tex);
  81. sel.appendChild(opt);
  82. // Easy (Labyrinth only)
  83. if (labyrinth){
  84. opt = document.createElement('option');
  85. tex = document.createTextNode('Normal');
  86. att = document.createAttribute('value');
  87. att.value = '<?=$DIFFICULTY["EASY"]?>';
  88. opt.setAttributeNode(att);
  89. opt.appendChild(tex);
  90. sel.appendChild(opt);
  91. }
  92. // Normal
  93. opt = document.createElement('option');
  94. tex = document.createTextNode('Normal');
  95. att = document.createAttribute('value');
  96. att.value = '<?=$DIFFICULTY["NORMAL"]?>';
  97. opt.setAttributeNode(att);
  98. opt.appendChild(tex);
  99. sel.appendChild(opt);
  100. // Hard
  101. opt = document.createElement('option');
  102. tex = document.createTextNode('Hard');
  103. att = document.createAttribute('value');
  104. att.value = '<?=$DIFFICULTY["HARD"]?>';
  105. opt.setAttributeNode(att);
  106. opt.appendChild(tex);
  107. sel.appendChild(opt);
  108. // Hell
  109. if (!toa){
  110. opt = document.createElement('option');
  111. tex = document.createTextNode('Hell');
  112. att = document.createAttribute('value');
  113. att.value = '<?=$DIFFICULTY["HELL"]?>';
  114. opt.setAttributeNode(att);
  115. opt.appendChild(tex);
  116. sel.appendChild(opt);
  117. }
  118. }
  119. function selectNewAreaType(){
  120. var type = document.getElementById('new_area_type').options[document.getElementById('new_area_type').selectedIndex].value;
  121. document.getElementById('new_area_scenario').style.display = 'none';
  122. document.getElementById('new_area_scenario').selectedIndex = 0;
  123. document.getElementById('new_area_cairos_dungeon').style.display = 'none';
  124. document.getElementById('new_area_cairos_dungeon').selectedIndex = 0;
  125. document.getElementById('new_area_rift_dungeon').style.display = 'none';
  126. document.getElementById('new_area_rift_dungeon').selectedIndex = 0;
  127. //document.getElementById('new_area_arena').style.display = 'none';
  128. document.getElementById('new_area_tartarus_labyrinth').style.display = 'none';
  129. document.getElementById('new_area_tartarus_labyrinth').selectedIndex = 0;
  130. //document.getElementById('new_area_trial_of_ascension').style.display = 'none';
  131. //document.getElementById('new_area_world_boss').style.display = 'none';
  132. document.getElementById('new_area_dimensional_hole').style.display = 'none';
  133. document.getElementById('new_area_dimensional_hole').selectedIndex = 0;
  134. //document.getElementById('new_area_dimensional_rift').style.display = 'none';
  135. document.getElementById('new_area_difficulty').style.display = 'none';
  136. document.getElementById('new_area_difficulty').selectedIndex = 0;
  137. document.getElementById('new_area_stage').style.display = 'none';
  138. document.getElementById('new_area_stage').selectedIndex = 0;
  139. switch (type){
  140. case '<?=$AREA_TYPE["SCENARIO"]?>':
  141. document.getElementById('new_area_scenario').style.display = 'inline';
  142. break;
  143. case '<?=$AREA_TYPE["CAIROS_DUNGEON"]?>':
  144. document.getElementById('new_area_cairos_dungeon').style.display = 'inline';
  145. break;
  146. case '<?=$AREA_TYPE["RIFT_DUNGEON"]?>':
  147. document.getElementById('new_area_rift_dungeon').style.display = 'inline';
  148. break;
  149. case '<?=$AREA_TYPE["RIFT_RAID"]?>':
  150. document.getElementById('new_area_rift_raid').style.display = 'inline';
  151. break;
  152. case '<?=$AREA_TYPE["ARENA"]?>':
  153. //document.getElementById('new_area_arena').style.display = 'inline';
  154. break;
  155. case '<?=$AREA_TYPE["GUILD_WAR"]?>':
  156. document.getElementById('new_area_guild_war').style.display = 'inline';
  157. break;
  158. case '<?=$AREA_TYPE["GUILD_SIEGE"]?>':
  159. document.getElementById('new_area_guild_siege').style.display = 'inline';
  160. break;
  161. case '<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>':
  162. document.getElementById('new_area_tartarus_labyrinth').style.display = 'inline';
  163. break;
  164. case '<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>':
  165. //document.getElementById('new_area_trial_of_ascension').style.display = 'inline';
  166. break;
  167. case '<?=$AREA_TYPE["WORLD_BOSS"]?>':
  168. //document.getElementById('new_area_world_boss').style.display = 'inline';
  169. break;
  170. case '<?=$AREA_TYPE["DIMENSIONAL_HOLE"]?>':
  171. document.getElementById('new_area_dimensional_hole').style.display = 'inline';
  172. break;
  173. case '<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>':
  174. //document.getElementById('new_area_dimensional_rift').style.display = 'inline';
  175. break;
  176. }
  177. }
  178. function selectNewArea(){
  179. var type = document.getElementById('new_area_type').options[document.getElementById('new_area_type').selectedIndex].value;
  180. document.getElementById('new_area_stage').selectedIndex = 0;
  181. document.getElementById('new_area_difficulty').selectedIndex = 0;
  182. switch (type){
  183. case '<?=$AREA_TYPE["SCENARIO"]?>':
  184. document.getElementById('new_area_stage').style.display = 'inline';
  185. document.getElementById('new_area_difficulty').style.display = 'inline';
  186. populateStage(7);
  187. pupulateDifficulty();
  188. break;
  189. case '<?=$AREA_TYPE["CAIROS_DUNGEON"]?>':
  190. document.getElementById('new_area_stage').style.display = 'inline';
  191. document.getElementById('new_area_difficulty').style.display = 'inline';
  192. populateStage(10);
  193. pupulateDifficulty();
  194. break;
  195. case '<?=$AREA_TYPE["RIFT_DUNGEON"]?>':
  196. break;
  197. case '<?=$AREA_TYPE["RIFT_RAID"]?>':
  198. document.getElementById('new_area_stage').style.display = 'inline';
  199. populateStage(5);
  200. break;
  201. case '<?=$AREA_TYPE["ARENA"]?>':
  202. break;
  203. case '<?=$AREA_TYPE["GUILD_WAR"]?>':
  204. break;
  205. case '<?=$AREA_TYPE["GUILD_SIEGE"]?>':
  206. break;
  207. case '<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>':
  208. document.getElementById('new_area_difficulty').style.display = 'inline';
  209. pupulateDifficulty(true, false);
  210. break;
  211. case '<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>':
  212. document.getElementById('new_area_difficulty').style.display = 'inline';
  213. pupulateDifficulty(false, true);
  214. break;
  215. case '<?=$AREA_TYPE["WORLD_BOSS"]?>':
  216. break;
  217. case '<?=$AREA_TYPE["DIMENSIONAL_HOLE"]?>':
  218. document.getElementById('new_area_stage').style.display = 'inline';
  219. populateStage(5);
  220. break;
  221. case '<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>':
  222. break;
  223. }
  224. }
  225. </script>
  226. </head>
  227. <body>
  228. <?php
  229. include __DIR__ . "/inc/header.php";
  230. ?>
  231. <section class='filters'>
  232. <h2>
  233. Team filters
  234. </h2>
  235. <?php
  236. $filters = $page->filters;
  237. include __DIR__ . "/inc/filter_team.php";
  238. ?>
  239. </section> <!-- #filters -->
  240. <section class='list'>
  241. <h2>
  242. Teams
  243. </h2>
  244. <article>
  245. <table>
  246. <?php
  247. foreach ($page->teams as $team){
  248. ?>
  249. <tr>
  250. <td>
  251. <h4>
  252. <?=$team->name?>
  253. </h4>
  254. <?php
  255. $area = $team->area->name;
  256. if (intval($team->stage) > 0){
  257. $area = $area . " - " . $team->stage;
  258. }
  259. ?>
  260. <h5>
  261. <?=$area?>
  262. </h5>
  263. </td>
  264. <td>
  265. <?=$team->description?>
  266. </td>
  267. <td>
  268. <?php
  269. foreach ($team->units as $unit){
  270. ?>
  271. <a href='/<?=$UID?>/monsters/<?=$unit->id?>'>
  272. <div class='monster_panel'>
  273. <?=html_unit_panel($unit)?>
  274. </div>
  275. </a>
  276. <?php
  277. }
  278. ?>
  279. </td>
  280. </tr>
  281. <?php
  282. }
  283. ?>
  284. </table>
  285. </article>
  286. </section> <!-- .list -->
  287. <?php
  288. include __DIR__ . "/inc/footer.php";
  289. ?>
  290. <section id='new_team' class='content'>
  291. <h2>
  292. New team
  293. </h2>
  294. <article>
  295. <table>
  296. <tr>
  297. <td>
  298. Area
  299. </td>
  300. <td>
  301. <select id='new_area_type' name='new_area_type' onChange='selectNewAreaType();'>
  302. <option value=''> </option>
  303. <option value='<?=$AREA_TYPE["SCENARIO"]?>'>Scenario</option>
  304. <option value='<?=$AREA_TYPE["CAIROS_DUNGEON"]?>'>Cairos Dungeon</option>
  305. <option value='<?=$AREA_TYPE["RIFT_DUNGEON"]?>'>Rift Dungeon</option>
  306. <option value='<?=$AREA_TYPE["RIFT_RAID"]?>'>Rift Raid</option>
  307. <option value='<?=$AREA_TYPE["DIMENSIONAL_HOLE"]?>'>Dimensional Hole</option>
  308. <option value='<?=$AREA_TYPE["ARENA"]?>'>Arena</option>
  309. <option value='<?=$AREA_TYPE["GUILD_WAR"]?>'>Guild War</option>
  310. <option value='<?=$AREA_TYPE["GUILD_SIEGE"]?>'>Guild Siege</option>
  311. <option value='<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>'>Tartarus Labyrinth</option>
  312. <option value='<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>'>Trial of Ascension</option>
  313. <option value='<?=$AREA_TYPE["WORLD_BOSS"]?>'>World Boss</option>
  314. <option value='<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>'>Dimensinal Rift</option>
  315. </select>
  316. <select id='new_area_scenario' class='new_area' onChange='selectNewArea();'>
  317. <option value=''> </option>
  318. <option value='<?=$SCENARIO['GAREN_FOREST']?>'>Garen Forest</option>
  319. <option value='<?=$SCENARIO['MT_SIZ']?>'>Mt. Siz</option>
  320. <option value='<?=$SCENARIO['KABIR_RUINS']?>'>Kabir Ruins</option>
  321. <option value='<?=$SCENARIO['MT_WHITE_RAGON']?>'>Mt. White Ragon</option>
  322. <option value='<?=$SCENARIO['TELAIN_FOREST']?>'>Telain Forest</option>
  323. <option value='<?=$SCENARIO['HYDENI_RUINS']?>'>Hydeni Ruins</option>
  324. <option value='<?=$SCENARIO['TAMOR_DESERT']?>'>Tamor Desert</option>
  325. <option value='<?=$SCENARIO['VROFAGUS_RUINS']?>'>Vrofagus Ruins</option>
  326. <option value='<?=$SCENARIO['FAIMON_VOLCANO']?>'>Faimon Volcano</option>
  327. <option value='<?=$SCENARIO['AIDEN_FOREST']?>'>Aiden Forest</option>
  328. <option value='<?=$SCENARIO['FERUN_CASTLE']?>'>Ferun Castle</option>
  329. <option value='<?=$SCENARIO['MT_RUNAR']?>'>Mt. Runar</option>
  330. <option value='<?=$SCENARIO['CHIRUKA_REMAINS']?>'>Charuca Remains</option>
  331. </select>
  332. <select id='new_area_cairos_dungeon' class='new_area' onChange='selectNewArea();'>
  333. <option value=''> </option>
  334. <option value='<?=$DUNGEON['GIANTS_KEEP']?>'>Giant&#39;s Keep</option>
  335. <option value='<?=$DUNGEON['DRAGONS_LAIR']?>'>Dragon&#39;s Lair</option>
  336. <option value='<?=$DUNGEON['NECROPOLIS']?>'>Necropolis</option>
  337. <option value='<?=$DUNGEON['HALL_OF_MAGIC']?>'>Hall of Magic</option>
  338. <option value='<?=$DUNGEON['HALL_OF_FIRE']?>'>Hall of Fire</option>
  339. <option value='<?=$DUNGEON['HALL_OF_WATER']?>'>Hall of Water</option>
  340. <option value='<?=$DUNGEON['HALL_OF_WIND']?>'>Hall of Wind</option>
  341. <option value='<?=$DUNGEON['HALL_OF_LIGHT']?>'>Hall of Light</option>
  342. <option value='<?=$DUNGEON['HALL_OF_DARK']?>'>Hall of Dark</option>
  343. </select>
  344. <select id='new_area_rift_dungeon' class='new_area' onChange='selectNewArea();'>
  345. <option value=''> </option>
  346. <option value='<?=$ELEMENTAL_RIFT_DUNGEON['FIRE_BEAST']?>'>Fire Beast</option>
  347. <option value='<?=$ELEMENTAL_RIFT_DUNGEON['ICE_BEAST']?>'>Ice Beast</option>
  348. <option value='<?=$ELEMENTAL_RIFT_DUNGEON['WIND_BEAST']?>'>Wind Beast</option>
  349. <option value='<?=$ELEMENTAL_RIFT_DUNGEON['LIGHT_BEAST']?>'>Light Beast</option>
  350. <option value='<?=$ELEMENTAL_RIFT_DUNGEON['DARK_BEAST']?>'>Dark Beast</option>
  351. </select>
  352. <select id='new_area_dimensional_hole' class='new_area' onChange='selectNewArea();'>
  353. <option value=''> </option>
  354. <option value='<?=$DUNGEON['FOREST_OF_ROARING_BEASTS']?>'>Forest or Roaring Beasts</option>
  355. <option value='<?=$DUNGEON['KARZHAN_REMAINS_WARBEAR']?>'>Karzhan Remains (Warbear)</option>
  356. <option value='<?=$DUNGEON['KARZHAN_REMAINS_WARBEAR']?>'>Karzhan Remains (Inugami)</option>
  357. <option value='<?=$DUNGEON['SANCTUARY_OF_DREAMING_FAIRIES']?>'>Sanctuary of Dreaming Fairies</option>
  358. <option value='<?=$DUNGEON['ELLUNIA_REMAINS_FAIRY']?>'>Ellunia Remains (Fairy)</option>
  359. <option value='<?=$DUNGEON['ELLUNIA_REMAINS_PIXIE']?>'>Ellunia Remains (Pixie)</option>
  360. <!-- TODO: Lumel -->
  361. </select>
  362. <select id='new_area_tartarus_labyrinth' class='new_area' onChange='selectNewArea();'>
  363. <option value=''> </option>
  364. <option value='<?=$LABYRINTH_STAGES['TARTARUS']?>'>Tartarus</option>
  365. <option value='<?=$LABYRINTH_STAGES['KOTTOS']?>'>Kottos</option>
  366. <option value='<?=$LABYRINTH_STAGES['LEOS']?>'>Leos</option>
  367. <option value='<?=$LABYRINTH_STAGES['AQUILES']?>'>Aquiles</option>
  368. <option value='<?=$LABYRINTH_STAGES['NORMAL']?>'>Normal Stage</option>
  369. <option value='<?=$LABYRINTH_STAGES['RESCUE']?>'>Rescue Stage</option>
  370. <option value='<?=$LABYRINTH_STAGES['EXPLODE']?>'>Explode Stage</option>
  371. <option value='<?=$LABYRINTH_STAGES['COOL_TIME']?>'>Cool Time Stage</option>
  372. <option value='<?=$LABYRINTH_STAGES['SPEED_LIMIT']?>'>Speed Limit Stage</option>
  373. <option value='<?=$LABYRINTH_STAGES['TIME_LIMIT']?>'>Time Limit Stage</option>
  374. <!-- TODO: Lumel -->
  375. </select>
  376. <select id='new_area_difficulty'>
  377. </select>
  378. <select id='new_area_stage'>
  379. </select>
  380. </td>
  381. </tr>
  382. <tr>
  383. <td>
  384. Name
  385. </td>
  386. <td>
  387. <input type='text' id='name' name='name'/>
  388. </td>
  389. </tr>
  390. <tr>
  391. <td>
  392. Description
  393. </td>
  394. <td>
  395. <textarea name='description'></textarea>
  396. </td>
  397. </tr>
  398. <tr>
  399. <td colspan='2'>
  400. <?php
  401. for ($i = 0; $i < 6; $i ++){
  402. ?>
  403. <div class='new_unit' id='new_unit_<?=$i?>'>
  404. <div>
  405. </div>
  406. <input id='new_unit_<?=$i?>_id' list='new_unit_<?=$i?>_list'/>
  407. <datalist id='new_unit_<?=$i?>_list'>
  408. <?php
  409. foreach ($page->units as $unit){
  410. ?>
  411. <?php
  412. }
  413. ?>
  414. </datalist>
  415. </div>
  416. <?php
  417. }
  418. ?>
  419. </td>
  420. </tr>
  421. </article>
  422. </section>
  423. </body>
  424. </html>