<h1>Angebot</h1>
<?php
if ((!isset($_POST['new'])) and (!isset($_POST['edit'])) and (!isset($_POST['del']))) {
    $sql1 = 'SELECT * FROM Angebot';
    $result1 = $db->query($sql1);
    ?>
    <fieldset>
        <form action="index.php?section=angebote" method="post">
            <fieldset>
                <legend>neues Angebot erstellen</legend>
                <input type="submit" name="new" value="Erstellen"/>
                <br/>
            </fieldset>
            <br/>
            <select name="Titel">
                <?php
                while ($nt1 = $result1->fetch_assoc()) {
                    echo '<option value="' . $nt1['ID'] . '">' . $nt1['ID'] . ' ' . $nt1['head1'] . '</option>';
                }
                ?>
            </select>
            <br/>
            <fieldset>
                <legend>Angebot ändern</legend>
                <input type="submit" name="edit" value="Bearbeiten"/>
                <br/>
            </fieldset>
            <br/>
            <fieldset>
                <legend>Angebot löschen</legend>
                <input type="submit" name="del" value="Löschen"/>
                <br/>
            </fieldset>
    </fieldset>

    <?php
} else {
    if (isset($_POST['new'])) {
        include "inhalte/angebote/new.php";
    } elseif (isset($_POST['edit'])) {
        include "inhalte/angebote/edit.php";
    } elseif (isset($_POST['del'])) {
        include "inhalte/angebote/del.php";
    } else {
        echo "Fehler";
    }
}