<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
  <title>Perfil</title>
  <link rel="stylesheet" href="/css/managePerfil.css">
</head>

<body>
  <%- include('../navbar', LoginData) %>
  <div class="img_sh_title">
    <hr class="hr_left">
    <label>Perfil de Usuario <%= LoginData.accountname %> </label>
    <hr class="hr_right">
  </div>

  <div class="container my-4">
    <div class="row">
      <div class="col text-center" style="margin-top:90px">
        <form action="">
          <img class="profile_img" src="/images/<%= LoginData.profile_pic_dir.slice(1, LoginData.profile_pic_dir.length) %>">
          <div class="mb-3">
            <label for="" class="form-label">Foto de perfil</label>
            <input class="form-control" type="file">
          </div>  
          <button class="submit_button">Actualizar</button>
        </form>
      </div>
      <div class="col">
        <h3 class="mt-5">Información</h3>
        <form action="">
          <div class="mb-3">
            <label for="" class="form-label">Nombre de Usuario</label>
            <input type="text" name="nickname" value="<%= LoginData.nickname %>" class="form-control">
          </div>
          <div class="mb-3">
            <label for="" class="form-label">Biografia</label>
            <textarea name="info" id="" class="form-control"></textarea>
          </div>
          <div class="mb-3 gender-div">
            <label for="" class="form-label">Genero</label>
            <div class="form-check">
              <input class="form-check-input" type="radio" name="flexRadioDefault" id="flexRadioDefault1">
              <label class="form-check-label" for="flexRadioDefault1">
                Hombre
              </label>
            </div>
            <div class="form-check">
              <input class="form-check-input" type="radio" name="flexRadioDefault" id="flexRadioDefault2" checked>
              <label class="form-check-label" for="flexRadioDefault2">
                Mujer
              </label>
            </div>
            <div class="form-check">
              <input class="form-check-input" type="radio" name="flexRadioDefault" id="flexRadioDefault2" checked>
              <label class="form-check-label" for="flexRadioDefault2">
                No especificado
              </label>
            </div>
          </div>
          <div class="mb-3">
            <label for="" class="form-label">Pais</label>
            <br>
            <select name="countries" id="cbx-countries" class="select-countries">
              <option value="" selected disabled>Selecciona Pais</option>
              <% for( let i = 0; i < countries.length; i++ ) { %>
              <option value="<%= countries[i] %>" <% if( countries[i] === LoginData.country ) { %> selected <% } %>><%= countries[i] %></option>
              <% } %>
            </select>
          </div>
          <div class="row text-center mt-2"><button class="submit_button mb-5">Actualizar</button></div>

        </form>
      </div>
    </div>
  </div>
  <div class="container my-4">
    <div class="row align-items-center">
      <div class="col" style="border-right: 1px solid white;">
        <h1 class="mt-2">Editar información de sesión</h1>
        <form action="">
          <div class="mb-3">
            <label for="" class="form-label">Correo</label>
            <input type="text" name="email" class="form-control" value="<%= LoginData.email %> " readonly>

          </div>
          <div class="mb-3">
            <label for="" class="form-label">Contraseña</label>
            <input type="text" name="password" class="form-control" placeholder="Contraseña anterior">
            <input type="text" name="password" class="form-control mt-3" placeholder="Contraseña nueva">
          </div>

          <div class="row text-center mt-2"><button class="submit_button mb-5">Actualizar</button></div>
        </form>
      </div>
      <div class="col">
        <h3 class="mt-5">Facturacion</h3>
        <form action="">
          <div class="mb-3">
            <label class="form-label" for="">Dirección de Facturación</label>
            <input class="form-control" type="text" name="fact_dir">
          </div>
          <div class="mb-3">
            <label class="form-label" for="">Codigo Postal</label>
            <input class="form-control" type="text" name="fact_postal">
          </div>
          <div class="mb-3">
            <label class="form-label" for="">País</label>
            <input class="form-control" type="text" name="fact_country">
          </div>
          <div class="mb-3">
            <label class="form-label" for="">Numero de tarjeta</label>
            <input class="form-control" type="text" name="fact_card">
          </div>
          <div class="mb-3">
            <label class="form-label" for="">Fecha de tarjeta</label>
            <input class="form-control" type="text" name="fact_date">
          </div>
          <div class="row text-center mt-2">
            <button class="submit_button mb-5">Actualizar</button>
          </div>
        </form>
      </div>
    </div>
  </div>

  <script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.9.2/dist/umd/popper.min.js" integrity="sha384-IQsoLXl5PILFhosVNubq5LC7Qb9DXgDA9i+tQ8Zj3iwWAwPtgFTxbJ8NT4GN1R8p" crossorigin="anonymous"></script>
  <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.0.2/dist/js/bootstrap.min.js" integrity="sha384-cVKIPhGWiC2Al4u+LWgxfKTRIcfu0JTxR+EQDz/bgldoEyl4H0zUF0QKbrJ0EcQF" crossorigin="anonymous"></script>

</body>

</html>