<?php
$setup = array();
$setup['title'] = "Tilføj Nyhed";
$setup['headline'] = "Odense Track - Administration";
$setup['keywords'] = "administration,admin";
$setup['description'] = "Odense Track Administration";

Design::header($setup, 100);

if (isset($_POST['title'])) {
    Alter::addNews($_SESSION['user'], $_POST['title'], $_POST['textinput']);
}
?>

<div class="page">
    <h1>Tilføj Nyhed</h1> <div class="pull_right"><a href="?page=newsadmin">Nyheder</a><span class="seperator"></span><a href="?page=eventadmin">Events</a></div>
    <div class="border"></div>
    <br />
    <div class='editorform'>
        <form method="POST" action="">
            <input type="text" class='editformtitle' required placeholder='Nyhedstitel' name="title" />
            <br /><br />
            <textarea name='textinput' class='editor'></textarea>
            <br />
            <input type="submit" class='button btn btn-success pull_right' value="Tilføj" />

        </form>
    </div>
    <div class='clear'></div>
</div>

<?php
Design::footer(true);
