index.php 2.29 KB
Newer Older
Felix Anders's avatar
Init  
Felix Anders committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
<?php
    require_once("./php/db_connection.php");
?>
<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8"/>
        <meta name="Content-type" content="text/html"/>
        <meta name="viewport" content="width=device-width, initial-scale=1"/>
        <link rel="shortcut icon" type="image/png" href="./img/favicon.png"/>
        <link rel="stylesheet" type="text/css" href="./css/intro.css"/>
        <title>U_CODE Editor</title>
    </head>
    <body>
        <form name="login" method="POST" action="./php/start.php">
            <img src="./img/U_CODE-grey_web.svg"/>
            <h1>City Development</h1>
            <input type="radio" name="groups" value="existingGroup" id="existingGroup" checked="checked"/>
            <label for="existingGroup" class="sectionHeader">Use an existing group</label>
            <section id="existingGroupSection">
                <select name="group" placeholder="Select a group">
                <?php
                $result = $db_link->query("SELECT name, id FROM groups WHERE 1;");
                while($data = $result->fetch_assoc())
                {
                ?>
                    <option value="group_<?=$data['id'];?>"><?=$data['name'];?></option>
                <?php
                }
                ?>
                </select>
            </section>
            <input type="radio" name="groups" value="newGroup" id="newGroup"/>
            <label for="newGroup" class="sectionHeader">Create a new group</label>
            <section id="newGroupSection">
                <input type="text" name="newGroupName" id="newGroupName" placeholder="New Group Name"/>
                <label>Choose a city</label>
                <select name="city">
                <?php
                $result = $db_link->query("SELECT name, id FROM cities WHERE 1;");
                while($data = $result->fetch_assoc())
                {
                ?>
                    <option value="city_<?=$data['id'];?>"><?=$data['name'];?></option>
                <?php
                }
                ?>
                </select>
                <a href="./upload/">Upload new cities and objects</a>
            </section>
            <input type="submit" id="buttonGo" name="submit" value="Start"/>
        </form>
    </body>
</html>