Browse Source

Added teams page

Iñigo Valentin 6 years ago
parent
commit
0e798bbd8c

+ 17 - 3
application/Constant.php

@@ -1,6 +1,7 @@
 <?php
 
     $DIFFICULTY = [
+        "EASY" => 0,
         "NORMAL" => 1,
         "HARD" => 2,
         "HELL" => 3,
@@ -78,9 +79,9 @@
 
     $SCENARIO = [
         'GAREN_FOREST' => 1,
-        'MT._SIZ' => 2,
+        'MT_SIZ' => 2,
         'KABIR_RUINS' => 3,
-        'MT._WHITE_RAGON' => 4,
+        'MT_WHITE_RAGON' => 4,
         'TELAIN_FOREST' => 5,
         'HYDENI_RUINS' => 6,
         'TAMOR_DESERT' => 7,
@@ -108,7 +109,7 @@
         'HALL_OF_LIGHT' => 7001,
         'GIANTS_KEEP' => 8001,
         'DRAGONS_LAIR' => 9001,
-
+        // TODO: Lumel
     ];
 
     $ELEMENTAL_RIFT_DUNGEON = [
@@ -127,6 +128,19 @@
         'LEVEL_5' => 5,
     ];
 
+    $LABYRINTH_STAGES = [
+        'TARTARUS' => 1,
+        'KOTTOS' => 2,
+        'LEOS' => 3,
+        'AQUILES' => 4,
+        'NORMAL' => 5,
+        'RESCUE' => 6,
+        'EXPLODE' => 7,
+        'COOL_TIME' => 8,
+        'SPEED_LIMIT' => 9,
+        'TIME_LIMIT' => 10
+    ];
+
     $BUILDING = [
         'SUMMONERS_TOWER' => 1,
         'SUMMONHENGE' => 2,

+ 4 - 4
application/Controller.php

@@ -61,7 +61,6 @@
             // TODO: Validate private/public user with cookie and redirect
             $UID = $uid;
             if (preg_match("/\d{7}/", $UID)){
-error_log('1');
                 $q = $db->query("SELECT count(uid) AS c FROM player WHERE uid = $UID;");
                 $r = $q->fetchArray(SQLITE3_ASSOC);
                 if ($r["c"] == 0){
@@ -72,15 +71,12 @@ error_log('1');
                 }
             }
             else{
-error_log('2');
                 if ($_SESSION['session'] == true && isset($_SESSION['uid'])){
-error_log('2.1');
                     $UID = $_SESSION['uid'];
                     header("Location: /$UID" . parse_url($_SERVER["REQUEST_URI"], PHP_URL_PATH));
                     return;
                 }
                 else{
-error_log('2.2');
                     require_once($path["page"] . "Landing_Page.php");
                     $page = new Landing_Page($db);
                     require_once($page->view);
@@ -110,6 +106,10 @@ error_log('2.2');
                     require_once($path["page"] . "Runs_Page.php");
                     $page = new Runs_Page($db);
                 }
+                elseif (strtoupper($pars[0]) == "TEAMS"){
+                    require_once($path["page"] . "Teams_Page.php");
+                    $page = new Teams_Page($db);
+                }
                 elseif (strtoupper($pars[0]) == "MONSTERS"){
                     if (count($pars) == 1){
                         require_once($path["page"] . "Monsters_Page.php");

+ 6 - 1
application/Filter.php

@@ -2,7 +2,7 @@
 
     global $QUALITY;
     global $RUNE_STAT;
-    
+
     $a = "VARIALEA";
 
     $FILTER_CATALOG = [
@@ -143,4 +143,9 @@
         "helper" => false,
         "number" => 20,
     ];
+    
+    $FILTER_TEAM = [
+        "name" => "",
+        "area" => null
+    ];
 ?>

+ 95 - 0
application/entity/Team.php

@@ -0,0 +1,95 @@
+<?php
+
+    require_once($path["entity"] . "K_Area.php");
+    require_once($path["entity"] . "Unit.php");
+
+
+    /**
+     * A Team.
+     *
+     * Represents an object from the table 'unit'.
+     */
+    class Team extends Entity{
+
+        /**
+         * Owner identifier.
+         */
+        public $uid;
+
+        /**
+         * Team identifier.
+         */
+        public $id;
+
+        /**
+         * Team name.
+         */
+        public $name;
+
+        /**
+         * Team description.
+         */
+        public $description;
+
+        /**
+         * List of {@see Unit}s in the team.
+         */
+        public $unit = [];
+
+        /**
+         * Area the team is designed for.
+         */
+        public $area;
+
+        /**
+         * Stage the team is designed for. It can be null.
+         */
+        public $stage;
+
+        /**
+         * Constructor.
+         *
+         * Searches the database and retrieves the information about the
+         * monster, populating it and it's items.
+         *
+         * @param SQLite3 $db Connection to the database.
+         * @param int $id Monster identifier.
+         * @param complete If false, query only monster and k_monster.
+         */
+        public function __construct($db, $id, $complete = true){
+            global $path;
+            parent::__construct($db);
+            $s = "
+              SELECT
+                uid,
+                id,
+                name,
+                description,
+                area,
+                stage
+              FROM team
+              WHERE id = '$id';
+            ";
+            $q = $this->db->query($s);
+            $r = $q->fetchArray(SQLITE3_ASSOC);
+            $this->uid = $r["uid"];
+            $this->id = $r["id"];
+            $this->name = $r["name"];
+            $this->description = $r["description"];
+            $this->area = new K_Area($this->db, $r["area"]);
+            $this->stage = $r["stage"];
+            if ($complete){
+                $s = "
+                  SELECT unit
+                  FROM team_unit
+                  WHERE team = '$id';
+                ";
+                $q = $this->db->query($s);
+                while ($r = $q->fetchArray(SQLITE3_ASSOC)){
+                    array_push($this->skill_levels, $r["level"]);
+                }
+            }
+        }
+
+    }
+?>

+ 11 - 1
application/page/Report_Runeupgrade_Page.php

@@ -3,6 +3,16 @@
     require_once($path["page"] . "Page.php");
     require_once($path["entity"] . "Unit.php");
     require_once($path["entity"] . "Rune.php");
+    
+    class Upgrade{
+        private $db;
+        public $unit = null;
+        public $rune = [];
+        
+        public function __construct($db){
+            $this->db = $db;
+        }
+    }
 
     /**
      * Upgradeable runes report page.
@@ -296,7 +306,7 @@
                     break;
             }
             if (strlen($this->filters["monster_name"]) > 0){
-                $s = $s . " AND k_unit.name LIKE = '%" . $this->filters["monster_name"] . "%' ";
+                $s = $s . " AND upper(k_unit.name) LIKE = upper('%" . $this->filters["monster_name"] . "%') ";
             }
             if (!$this->filters["monster_in_storage"]){
                 //$s = $s . " AND unit.in_storage = 0 ";

+ 86 - 0
application/page/Teams_Page.php

@@ -0,0 +1,86 @@
+ <?php
+
+    require_once($path["page"] . "Page.php");
+    require_once($path["entity"] . "Team.php");
+
+    /**
+     * Monster list page.
+     */
+    class Teams_Page extends Page{
+
+        /**
+         * Array of @{see Team}s.
+         */
+        public $teams = [];
+
+        /**
+         * The filters the page can handle.
+         */
+        public $filters;
+
+
+        /**
+         * Constructor.
+         *
+         * Retrieves the data and initializes the variables.
+         *
+         * @param SQLite3 $db Connection to the database.
+         */
+        public function __construct($db){
+            global $path;
+            global $root;
+            parent::__construct($db);
+            $this->view = $path["view"] . "teams.php";
+            $this->parse_filters();
+            $s = $this->build_query();
+            $q = $this->db->query($s);
+            while ($r = $q->fetchArray(SQLITE3_ASSOC)){
+                array_push($this->teams, new Team($db, $r["id"]));
+            }
+            $this->title = "Teams - SWDB";
+            $this->description = "Teams";
+            $this->canonical = $root . "teams/";
+        }
+
+        /**
+         * Parses the request looking for the selected filters, validates them
+         * and adds them to the $filters array.
+         */
+        private function parse_filters(){
+            global $FILTER_TEAM;
+            global $AREA_TYPE;
+            $this->filters = $FILTER_TEAM;
+            if (isset($_GET["area"]) && in_array($_GET["area"], $AREA_TYPE)){
+                $this->filters["area"] = $_GET["area"];
+            }
+            if (isset($_GET["name"]) && strlen($_GET["name"]) > 0){
+                $this->filters["name"] = SQLite3::escapeString($_GET["name"]);
+            }
+            return;
+        }
+
+        /**
+         * Builds the query to the rune table using the selected or default
+         * filters.
+         *
+         * @return The query to be executed.
+         */
+        private function build_query(){
+            global $ELEMENT;
+            global $UID;
+            $s = "
+              SELECT id
+              FROM team
+              WHERE uid = '$UID'
+            ";
+            if (in_array($this->filters["area"], $ELEMENT)){
+                $s = $s . " AND area  = '" . strtoupper($this->filters["area"]) . "') ";
+            }
+            if ($this->filters["name"] != ""){
+                $s = $s . " AND upper(name) LIKE '%" . strtoupper($this->filters["name"]) . "%' ";
+            }
+            return $s;
+        }
+
+    }
+?>

+ 34 - 0
application/view/inc/filter_teams.php

@@ -0,0 +1,34 @@
+<?php
+    global $AREA_TYPE;
+?>
+<form action='/<?=$UID?>/teams/' method='get'  id='filter_monsters' class='filter'>
+    <table>
+        <tr>
+            <td class='filter' colspan='2'>
+                <span>Name:</span>
+                <input type='text' name='name' id='filter_name' value='<?=$page->filters["name"]?>'/>
+            </td>
+            <td>
+                <span>Area:</span>
+                <select name='area'>
+                    <option value=''> <option>
+                    <option value='<?=$AREA_TYPE["SCENARIO"]?>'>Scenario</option>
+                    <option value='<?=$AREA_TYPE["CAIROS_DUNGEON"]?>'>Cairos Dungeon</option>
+                    <option value='<?=$AREA_TYPE["RIFT_DUNGEON"]?>'>Rift Dungeon</option>
+                    <option value='<?=$AREA_TYPE["RIFT_RAID"]?>'>Rift Raid</option>
+                    <option value='<?=$AREA_TYPE["DIMENSIONAL_HOLE"]?>'>Dimensional Hole></option>
+                    <option value='<?=$AREA_TYPE["AREAN"]?>'>Arena</option>
+                    <option value='<?=$AREA_TYPE["GUILD_WAR"]?>'>Guild War</option>
+                    <option value='<?=$AREA_TYPE["GUILD_SIEGE"]?>'>Guild Siege</option>
+                    <option value='<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>'>Tartarus Labyrinth</option>
+                    <option value='<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>'>Trial of Ascension</option>
+                    <option value='<?=$AREA_TYPE["WORLD_BOSS"]?>'>World Boss</option>
+                    <option value='<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>'>Dimensinal Rift</option>
+                </select>
+            </td>
+        </tr>
+    </table>
+    <div id='filter_apply'>
+        <input type='submit' value='Apply'/>
+    </div>
+</form>

+ 3 - 0
application/view/inc/header.php

@@ -33,6 +33,9 @@
             <a href='/<?=$UID?>/runs/'>
                 Runs
             </a>
+            <a href='/<?=$UID?>/teams/'>
+                Teams
+            </a>
             <a href='/<?=$UID?>/report/'>
                 Reports
             </a>

+ 426 - 0
application/view/teams.php

@@ -0,0 +1,426 @@
+<?php
+    global $AREA_TYPE;
+    global $SCENARIO;
+    global $DUNGEON;
+    global $LABYRINTH_STAGES;
+    global $DIFFICULTY;
+    global $ELEMENTAL_RIFT_DUNGEON;
+?>
+<!DOCTYPE html>
+<html lang='en'>
+    <head>
+        <meta content='text/html; charset=utf-8' http-equiv='content-type'/>
+        <meta name='viewport' content='width=device-width, initial-scale=1, maximum-scale=1, minimum-scale=1'/>
+        <title><?=$page->title?></title>
+        <link rel='shortcut icon' href='<?=$page->favicon?>'/>
+        <!-- CSS files -->
+        <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>ui.css'/>
+        <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>teams.css'/>
+        <link rel='stylesheet' type='text/css' href='<?=$path["css"]?>filters.css'/>
+        <!-- Script files -->
+        <script src="<?=$path["js"]?>ui.js"></script>
+        <script src="<?=$path["js"]?>teams.js"></script>
+        <!-- Meta tags -->
+        <link rel='canonical' href='<?=$page->canonical?>'/>
+        <link rel='author' href='<?=$page->author?>'/>
+        <link rel='publisher' href='<?=$page->author?>'/>
+        <meta name='description' content='<?=$page->description?>'/>
+        <meta property='og:title' content='<?=$page->title?>'/>
+        <meta property='og:url' content='<?=$page->canonical?>'/>
+        <meta property='og:description' content='<?=$page->description?>'/>
+        <meta property='og:image' content='<?=$page->icon?>'/>
+        <meta property='og:site_name' content='<?=$page->name?>'/>
+        <meta property='og:type' content='website'/>
+        <meta property='og:locale' content='en'/>
+        <meta name='twitter:card' content='summary'/>
+        <meta name='twitter:title' content='<?=$page->title?>'/>
+        <meta name='twitter:description' content='<?=$page->description?>'/>
+        <meta name='twitter:image' content='<?=$page->icon?>'/>
+        <meta name='twitter:url' content='<?=$page->canonical?>'/>
+        <meta name='robots' content='index follow'/>
+        <script>
+            function populateUnits(total){
+                for (var i = 0; i < 6; i ++){
+                    if (i < total){
+                        document.getElementById('new_unit_' + i).style.display = 'inline-block';
+                    }
+                    else{
+                        document.getElementById('new_unit_' + i).style.display = 'none';
+                    }
+                }
+            }
+            function populateStage(total){
+                var sel = document.getElementById('new_area_stage');
+                while (sel.firstChild) {
+                    sel.removeChild(sel.firstChild);
+                }
+                var opt;
+                var att;
+                for (var i = 1; i <= total; i ++){
+                    opt = document.createElement('option');
+                    tex = document.createTextNode(i);
+                    att = document.createAttribute('value');
+                    att.value = i;
+                    opt.setAttributeNode(att);
+                    opt.appendChild(tex);
+                    sel.appendChild(opt);
+                }
+            }
+            function populateDifficulty(labyrinth = false, toa = false){
+                var sel = document.getElementById('new_area_difficulty');
+                while (sel.firstChild) {
+                    sel.removeChild(sel.firstChild);
+                }
+                var opt;
+                var att;
+                var tex;
+                // Empty
+                opt = document.createElement('option');
+                tex = document.createTextNode('');
+                opt.appendChild(tex);
+                sel.appendChild(opt);
+                // Easy (Labyrinth only)
+                if (labyrinth){
+                    opt = document.createElement('option');
+                    tex = document.createTextNode('Normal');
+                    att = document.createAttribute('value');
+                    att.value = '<?=$DIFFICULTY["EASY"]?>';
+                    opt.setAttributeNode(att);
+                    opt.appendChild(tex);
+                    sel.appendChild(opt);
+                }
+                // Normal
+                opt = document.createElement('option');
+                tex = document.createTextNode('Normal');
+                att = document.createAttribute('value');
+                att.value = '<?=$DIFFICULTY["NORMAL"]?>';
+                opt.setAttributeNode(att);
+                opt.appendChild(tex);
+                sel.appendChild(opt);
+                // Hard
+                opt = document.createElement('option');
+                tex = document.createTextNode('Hard');
+                att = document.createAttribute('value');
+                att.value = '<?=$DIFFICULTY["HARD"]?>';
+                opt.setAttributeNode(att);
+                opt.appendChild(tex);
+                sel.appendChild(opt);
+                // Hell
+                if (!toa){
+                    opt = document.createElement('option');
+                    tex = document.createTextNode('Hell');
+                    att = document.createAttribute('value');
+                    att.value = '<?=$DIFFICULTY["HELL"]?>';
+                    opt.setAttributeNode(att);
+                    opt.appendChild(tex);
+                    sel.appendChild(opt);
+                }
+            }
+            function selectNewAreaType(){
+                var type = document.getElementById('new_area_type').options[document.getElementById('new_area_type').selectedIndex].value;
+                document.getElementById('new_area_scenario').style.display = 'none';
+                document.getElementById('new_area_scenario').selectedIndex = 0;
+                document.getElementById('new_area_cairos_dungeon').style.display = 'none';
+                document.getElementById('new_area_cairos_dungeon').selectedIndex = 0;
+                document.getElementById('new_area_rift_dungeon').style.display = 'none';
+                document.getElementById('new_area_rift_dungeon').selectedIndex = 0;
+                //document.getElementById('new_area_arena').style.display = 'none';
+                document.getElementById('new_area_tartarus_labyrinth').style.display = 'none';
+                document.getElementById('new_area_tartarus_labyrinth').selectedIndex = 0;
+                //document.getElementById('new_area_trial_of_ascension').style.display = 'none';
+                //document.getElementById('new_area_world_boss').style.display = 'none';
+                document.getElementById('new_area_dimensional_hole').style.display = 'none';
+                document.getElementById('new_area_dimensional_hole').selectedIndex = 0;
+                //document.getElementById('new_area_dimensional_rift').style.display = 'none';
+                document.getElementById('new_area_difficulty').style.display = 'none';
+                document.getElementById('new_area_difficulty').selectedIndex = 0;
+                document.getElementById('new_area_stage').style.display = 'none';
+                document.getElementById('new_area_stage').selectedIndex = 0;
+                switch (type){
+                    case '<?=$AREA_TYPE["SCENARIO"]?>':
+                        document.getElementById('new_area_scenario').style.display = 'inline';
+                        break;
+                    case '<?=$AREA_TYPE["CAIROS_DUNGEON"]?>':
+                        document.getElementById('new_area_cairos_dungeon').style.display = 'inline';
+                        break;
+                    case '<?=$AREA_TYPE["RIFT_DUNGEON"]?>':
+                        document.getElementById('new_area_rift_dungeon').style.display = 'inline';
+                        break;
+                    case '<?=$AREA_TYPE["RIFT_RAID"]?>':
+                        document.getElementById('new_area_rift_raid').style.display = 'inline';
+                        break;
+                    case '<?=$AREA_TYPE["ARENA"]?>':
+                        //document.getElementById('new_area_arena').style.display = 'inline';
+                        break;
+                    case '<?=$AREA_TYPE["GUILD_WAR"]?>':
+                        document.getElementById('new_area_guild_war').style.display = 'inline';
+                        break;
+                    case '<?=$AREA_TYPE["GUILD_SIEGE"]?>':
+                        document.getElementById('new_area_guild_siege').style.display = 'inline';
+                        break;
+                    case '<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>':
+                        document.getElementById('new_area_tartarus_labyrinth').style.display = 'inline';
+                        break;
+                    case '<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>':
+                        //document.getElementById('new_area_trial_of_ascension').style.display = 'inline';
+                        break;
+                    case '<?=$AREA_TYPE["WORLD_BOSS"]?>':
+                        //document.getElementById('new_area_world_boss').style.display = 'inline';
+                        break;
+                    case '<?=$AREA_TYPE["DIMENSIONAL_HOLE"]?>':
+                        document.getElementById('new_area_dimensional_hole').style.display = 'inline';
+                        break;
+                    case '<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>':
+                        //document.getElementById('new_area_dimensional_rift').style.display = 'inline';
+                        break;
+                }
+            }
+            function selectNewArea(){
+                var type = document.getElementById('new_area_type').options[document.getElementById('new_area_type').selectedIndex].value;
+                document.getElementById('new_area_stage').selectedIndex = 0;
+                document.getElementById('new_area_difficulty').selectedIndex = 0;
+                switch (type){
+                    case '<?=$AREA_TYPE["SCENARIO"]?>':
+                        document.getElementById('new_area_stage').style.display = 'inline';
+                        document.getElementById('new_area_difficulty').style.display = 'inline';
+                        populateStage(7);
+                        pupulateDifficulty();
+                        break;
+                    case '<?=$AREA_TYPE["CAIROS_DUNGEON"]?>':
+                        document.getElementById('new_area_stage').style.display = 'inline';
+                        document.getElementById('new_area_difficulty').style.display = 'inline';
+                        populateStage(10);
+                        pupulateDifficulty();
+                        break;
+                    case '<?=$AREA_TYPE["RIFT_DUNGEON"]?>':
+                        break;
+                    case '<?=$AREA_TYPE["RIFT_RAID"]?>':
+                        document.getElementById('new_area_stage').style.display = 'inline';
+                        populateStage(5);
+                        break;
+                    case '<?=$AREA_TYPE["ARENA"]?>':
+                        break;
+                    case '<?=$AREA_TYPE["GUILD_WAR"]?>':
+                        break;
+                    case '<?=$AREA_TYPE["GUILD_SIEGE"]?>':
+                        break;
+                    case '<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>':
+                        document.getElementById('new_area_difficulty').style.display = 'inline';
+                        pupulateDifficulty(true, false);
+                        break;
+                    case '<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>':
+                        document.getElementById('new_area_difficulty').style.display = 'inline';
+                        pupulateDifficulty(false, true);
+                        break;
+                    case '<?=$AREA_TYPE["WORLD_BOSS"]?>':
+                        break;
+                    case '<?=$AREA_TYPE["DIMENSIONAL_HOLE"]?>':
+                        document.getElementById('new_area_stage').style.display = 'inline';
+                        populateStage(5);
+                        break;
+                    case '<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>':
+                        break;
+                }
+            }
+        </script>
+    </head>
+    <body>
+<?php
+        include __DIR__ . "/inc/header.php";
+?>
+            <section class='filters'>
+                <h2>
+                    Team filters
+                </h2>
+<?php
+                $filters = $page->filters;
+                include __DIR__ . "/inc/filter_team.php";
+?>
+            </section> <!-- #filters -->
+            <section class='list'>
+                <h2>
+                    Teams
+                </h2>
+                <article>
+                    <table>
+<?php
+                        foreach ($page->teams as $team){
+?>
+                            <tr>
+                                <td>
+                                    <h4>
+                                        <?=$team->name?>
+                                    </h4>
+<?php
+                                    $area = $team->area->name;
+                                    if (intval($team->stage) > 0){
+                                        $area = $area . " - " . $team->stage;
+                                    }
+?>
+                                    <h5>
+                                        <?=$area?>
+                                    </h5>
+                                </td>
+                                <td>
+                                    <?=$team->description?>
+                                </td>
+                                <td>
+<?php
+                                    foreach ($team->units as $unit){
+?>
+                                        <a href='/<?=$UID?>/monsters/<?=$unit->id?>'>
+                                            <div class='monster_panel'>
+                                                <?=html_unit_panel($unit)?>
+                                            </div>
+                                        </a>
+<?php
+                                    }
+?>
+                                </td>
+                            </tr>
+<?php
+                        }
+?>
+                    </table>
+                </article>
+            </section> <!-- .list -->
+
+<?php
+        include __DIR__ . "/inc/footer.php";
+?>
+        <section id='new_team' class='content'>
+            <h2>
+                New team
+            </h2>
+            <article>
+                <table>
+                    <tr>
+                        <td>
+                            Area
+                        </td>
+                        <td>
+                            <select id='new_area_type' name='new_area_type' onChange='selectNewAreaType();'>
+                                <option value=''> </option>
+                                <option value='<?=$AREA_TYPE["SCENARIO"]?>'>Scenario</option>
+                                <option value='<?=$AREA_TYPE["CAIROS_DUNGEON"]?>'>Cairos Dungeon</option>
+                                <option value='<?=$AREA_TYPE["RIFT_DUNGEON"]?>'>Rift Dungeon</option>
+                                <option value='<?=$AREA_TYPE["RIFT_RAID"]?>'>Rift Raid</option>
+                                <option value='<?=$AREA_TYPE["DIMENSIONAL_HOLE"]?>'>Dimensional Hole</option>
+                                <option value='<?=$AREA_TYPE["ARENA"]?>'>Arena</option>
+                                <option value='<?=$AREA_TYPE["GUILD_WAR"]?>'>Guild War</option>
+                                <option value='<?=$AREA_TYPE["GUILD_SIEGE"]?>'>Guild Siege</option>
+                                <option value='<?=$AREA_TYPE["TARTARUS_LABYRINTH"]?>'>Tartarus Labyrinth</option>
+                                <option value='<?=$AREA_TYPE["TRIAL_OF_ASCENSION"]?>'>Trial of Ascension</option>
+                                <option value='<?=$AREA_TYPE["WORLD_BOSS"]?>'>World Boss</option>
+                                <option value='<?=$AREA_TYPE["DIMENSIONAL_RIFT"]?>'>Dimensinal Rift</option>
+                            </select>
+                            <select id='new_area_scenario' class='new_area' onChange='selectNewArea();'>
+                                <option value=''> </option>
+                                <option value='<?=$SCENARIO['GAREN_FOREST']?>'>Garen Forest</option>
+                                <option value='<?=$SCENARIO['MT_SIZ']?>'>Mt. Siz</option>
+                                <option value='<?=$SCENARIO['KABIR_RUINS']?>'>Kabir Ruins</option>
+                                <option value='<?=$SCENARIO['MT_WHITE_RAGON']?>'>Mt. White Ragon</option>
+                                <option value='<?=$SCENARIO['TELAIN_FOREST']?>'>Telain Forest</option>
+                                <option value='<?=$SCENARIO['HYDENI_RUINS']?>'>Hydeni Ruins</option>
+                                <option value='<?=$SCENARIO['TAMOR_DESERT']?>'>Tamor Desert</option>
+                                <option value='<?=$SCENARIO['VROFAGUS_RUINS']?>'>Vrofagus Ruins</option>
+                                <option value='<?=$SCENARIO['FAIMON_VOLCANO']?>'>Faimon Volcano</option>
+                                <option value='<?=$SCENARIO['AIDEN_FOREST']?>'>Aiden Forest</option>
+                                <option value='<?=$SCENARIO['FERUN_CASTLE']?>'>Ferun Castle</option>
+                                <option value='<?=$SCENARIO['MT_RUNAR']?>'>Mt. Runar</option>
+                                <option value='<?=$SCENARIO['CHIRUKA_REMAINS']?>'>Charuca Remains</option>
+                            </select>
+                            <select id='new_area_cairos_dungeon' class='new_area' onChange='selectNewArea();'>
+                                <option value=''> </option>
+                                <option value='<?=$DUNGEON['GIANTS_KEEP']?>'>Giant&#39;s Keep</option>
+                                <option value='<?=$DUNGEON['DRAGONS_LAIR']?>'>Dragon&#39;s Lair</option>
+                                <option value='<?=$DUNGEON['NECROPOLIS']?>'>Necropolis</option>
+                                <option value='<?=$DUNGEON['HALL_OF_MAGIC']?>'>Hall of Magic</option>
+                                <option value='<?=$DUNGEON['HALL_OF_FIRE']?>'>Hall of Fire</option>
+                                <option value='<?=$DUNGEON['HALL_OF_WATER']?>'>Hall of Water</option>
+                                <option value='<?=$DUNGEON['HALL_OF_WIND']?>'>Hall of Wind</option>
+                                <option value='<?=$DUNGEON['HALL_OF_LIGHT']?>'>Hall of Light</option>
+                                <option value='<?=$DUNGEON['HALL_OF_DARK']?>'>Hall of Dark</option>
+                            </select>
+                            <select id='new_area_rift_dungeon' class='new_area' onChange='selectNewArea();'>
+                                <option value=''> </option>
+                                <option value='<?=$ELEMENTAL_RIFT_DUNGEON['FIRE_BEAST']?>'>Fire Beast</option>
+                                <option value='<?=$ELEMENTAL_RIFT_DUNGEON['ICE_BEAST']?>'>Ice Beast</option>
+                                <option value='<?=$ELEMENTAL_RIFT_DUNGEON['WIND_BEAST']?>'>Wind Beast</option>
+                                <option value='<?=$ELEMENTAL_RIFT_DUNGEON['LIGHT_BEAST']?>'>Light Beast</option>
+                                <option value='<?=$ELEMENTAL_RIFT_DUNGEON['DARK_BEAST']?>'>Dark Beast</option>
+                            </select>
+                            <select id='new_area_dimensional_hole' class='new_area' onChange='selectNewArea();'>
+                                <option value=''> </option>
+                                <option value='<?=$DUNGEON['FOREST_OF_ROARING_BEASTS']?>'>Forest or Roaring Beasts</option>
+                                <option value='<?=$DUNGEON['KARZHAN_REMAINS_WARBEAR']?>'>Karzhan Remains (Warbear)</option>
+                                <option value='<?=$DUNGEON['KARZHAN_REMAINS_WARBEAR']?>'>Karzhan Remains (Inugami)</option>
+                                <option value='<?=$DUNGEON['SANCTUARY_OF_DREAMING_FAIRIES']?>'>Sanctuary of Dreaming Fairies</option>
+                                <option value='<?=$DUNGEON['ELLUNIA_REMAINS_FAIRY']?>'>Ellunia Remains (Fairy)</option>
+                                <option value='<?=$DUNGEON['ELLUNIA_REMAINS_PIXIE']?>'>Ellunia Remains (Pixie)</option>
+                                <!-- TODO: Lumel -->
+                            </select>
+                            <select id='new_area_tartarus_labyrinth' class='new_area' onChange='selectNewArea();'>
+                                <option value=''> </option>
+                                <option value='<?=$LABYRINTH_STAGES['TARTARUS']?>'>Tartarus</option>
+                                <option value='<?=$LABYRINTH_STAGES['KOTTOS']?>'>Kottos</option>
+                                <option value='<?=$LABYRINTH_STAGES['LEOS']?>'>Leos</option>
+                                <option value='<?=$LABYRINTH_STAGES['AQUILES']?>'>Aquiles</option>
+                                <option value='<?=$LABYRINTH_STAGES['NORMAL']?>'>Normal Stage</option>
+                                <option value='<?=$LABYRINTH_STAGES['RESCUE']?>'>Rescue Stage</option>
+                                <option value='<?=$LABYRINTH_STAGES['EXPLODE']?>'>Explode Stage</option>
+                                <option value='<?=$LABYRINTH_STAGES['COOL_TIME']?>'>Cool Time Stage</option>
+                                <option value='<?=$LABYRINTH_STAGES['SPEED_LIMIT']?>'>Speed Limit Stage</option>
+                                <option value='<?=$LABYRINTH_STAGES['TIME_LIMIT']?>'>Time Limit Stage</option>
+                                <!-- TODO: Lumel -->
+                            </select>
+                            <select id='new_area_difficulty'>
+                            </select>
+                            <select id='new_area_stage'>
+                            </select>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            Name
+                        </td>
+                        <td>
+                            <input type='text' id='name' name='name'/>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td>
+                            Description
+                        </td>
+                        <td>
+                            <textarea name='description'></textarea>
+                        </td>
+                    </tr>
+                    <tr>
+                        <td colspan='2'>
+<?php
+                            for ($i = 0; $i < 6; $i ++){
+?>
+                                <div class='new_unit' id='new_unit_<?=$i?>'>
+                                    <div>
+                                    </div>
+                                    <input id='new_unit_<?=$i?>_id' list='new_unit_<?=$i?>_list'/>
+                                    <datalist id='new_unit_<?=$i?>_list'>
+<?php
+                                        foreach ($page->units as $unit){
+?>
+                                            
+<?php
+                                        }
+?>
+                                    </datalist>
+                                </div>
+<?php
+                            }
+?>
+                        </td>
+                    </tr>
+            </article>
+        </section>
+    </body>
+</html>

+ 3 - 0
public/css/teams.css

@@ -0,0 +1,3 @@
+select.new_area{
+    display: none;
+}