<?php
    session_start();
    
    include("../scripts/connection.php");
    include("../scripts/functions.php");
    $user_data = check_admin($con);
    
    include("header_footer/header.php"); 
?>

<body>
    <div class="center">
        <div class="headline">
            <h2>Mannschaftsverwaltung</h2>
        </div>
        <div class="input-table">
            <div class="input">
                <div class="btn-div">
                    <form action="delete_team.php" method="post">
                        <span class="gg-trash icon edit disabled" id="icon-delete"></span>
                        <input id="delete_team" type="button" value="" class="edit" disabled="true"/>
                        <input type="hidden" name="m_id" id="m_id_delete"/>
                    </form>
                </div>
                <div class="btn-div">
                    <form action="edit_team.php" method="get">
                        <span class="gg-pen icon edit disabled" id="icon-edit"></span>
                        <input id="edit_team" type="button" value="" class="edit" disabled="true"/>
                        <input type="hidden" id="m_id" name="m_id">
                    </form>
                </div>
                <div class="btn-div">
                    <form action="add_team.php" method="get">
                        <span class="gg-add-r icon" id="icon-add"></span>
                        <input id="button" type="submit" value=""/>
                    </form>
                </div>
            </div>
            <div class="table-div">
                <table id="table">
                    <thead>
                        <tr>
                            <th scope="col">Name</th>
                            <th scope="col">Feuerwehr</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php load_teams_table($con); ?>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</body>

<?php 
echo file_get_contents("header_footer/footer.html");
$con = null;
?>