<?php
include($_SERVER['DOCUMENT_ROOT'] . HOME_DIR . TEMPLATE_DIR . '/header.php');
include($_SERVER['DOCUMENT_ROOT'] . HOME_DIR . '/Auth/nav.php');
?>
<form name="edit" action="<?php echo$_SERVER['PHP_SELF']; ?>" method="post">
<div class="container">
  <input type="hidden" name="id" value="<?php echo $_GET['id']; ?>">
  <input type="hidden" name="site" value="<?php echo $site; ?>">

  <div class="card border-warning mb-3">
    <div class="card-header">
      <div class="row">
        <div class="form-group col-sm-1">
        </div>
        <div class="form-group col-sm-7">
          <?php echo $headline; ?>
        </div>
        <div class="form-group col-sm-4">
          <?php echo $linkNew; ?>
        </div>
      </div>
    </div>
    <div class="card-body">
      <div class="row">
        <div class="form-group col-sm-2">
          <label for="username">Benutzername </label>
        </div>
        <div class="form-group col-sm-4">
          <input type="text" name="username" class="form-control" id="username" value="<?php echo showHtmlEntities($row['username']); ?>" required>
        </div>
        <div class="form-group col-sm-6">
        </div>
      </div>

      <div class="row">
        <div class="form-group col-sm-2">
          <label for="first_name">Vorname </label>
        </div>
        <div class="form-group col-sm-4">
          <input type="text" name="first_name" class="form-control" id="first_name" value="<?php echo showHtmlEntities($row['first_name']); ?>" required>
        </div>
        <div class="form-group col-sm-6">
        </div>
      </div>

      <div class="row">
        <div class="form-group col-sm-2">
          <label for="last_name">Nachname </label>
        </div>
        <div class="form-group col-sm-4">
          <input type="text" name="last_name" class="form-control" id="last_name" value="<?php echo showHtmlEntities($row['last_name']); ?>" required>
        </div>
        <div class="form-group col-sm-6">
        </div>
      </div>
      
      <div class="row">
        <div class="form-group col-sm-2">
          <label for="address">Adresse </label>
        </div>
        <div class="form-group col-sm-4">
          <input type="text" name="address" class="form-control" id="address" value="<?php echo showHtmlEntities($row['address']); ?>" required>
        </div>
        <div class="form-group col-sm-6">
        </div>
      </div>
      
      <div class="row">
        <div class="form-group col-sm-2">
          <label for="tel">Telefon </label>
        </div>
        <div class="form-group col-sm-4">
          <input type="text" name="tel" class="form-control" id="tel" value="<?php echo showHtmlEntities($row['tel']); ?>" required>
        </div>
        <div class="form-group col-sm-6">
        </div>
      </div>
      
      <div class="row">
        <div class="form-group col-sm-2">
          <label for="email">E-Mail </label>
        </div>
        <div class="form-group col-sm-4">
          <input type="text" name="email" class="form-control" id="email" value="<?php echo showHtmlEntities($row['email']); ?>" required>
        </div>
        <div class="form-group col-sm-6">
        </div>
      </div>
      
      <div class="row">
        <div class="form-group col-sm-2">
          <label for="role">Rolle</label>
        </div>
        <div class="form-group col-sm-4">
          <select name="role" class="form-control" id="role" required>
            <option value="">Rolle auswählen</option>
            <?php
            foreach ($dropdownUserRoles as $key => $value) {
              echo '<option value="' . $value . '"';
              if ($row['role']         == $value) {
                echo ' selected';
              }
              echo '>' . $key . '</option>';
            } 
            ?>
          </select>
        </div>
        <div class="form-group col-sm-6">
          Admins - alle Rechte, <br>Main_Users - kann TOM / VVT-Texte erstellen, ändern, löschen
        </div>
      </div>
    
    </div>
  </div>
  
  
  
  
  <?php 
    include ($_SERVER['DOCUMENT_ROOT'] . HOME_DIR . TEMPLATE_DIR . '/forms/footer.edit.php');
  ?>
  
</div>
</form>
<p>&nbsp;</p>
<p>&nbsp;</p>
<?php
include($_SERVER['DOCUMENT_ROOT'] . HOME_DIR . TEMPLATE_DIR . '/footer.php');
?>


</body>
</html>

