<% layout('layouts/customer-boilerplate')  -%>


    <div class="row ">
        <div class="col-md-8 offset-md-4 col-xl-6 offset-xl-3">
            <div class="card shadow">
                <!-- <img src="https://images.unsplash.com/photo-1488459716781-31db52582fe9?ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&ixlib=rb-1.2.1&auto=format&fit=crop&w=800&q=80" alt="" class="card-img-top" /> -->
                <div class="card-body">
                    <h5 class="card-title">Edit Profile data</h5>
                    <form action="/user/myaccount/edit" method="POST">
                        <div class="mb-3">
                            <label class="form-label" for="first_name">First Name: </label>
                            <input class="form-control" type="text" value="<%= currentUser.first_name%>" id="first_name" name="first_name">
                        </div>
                        <div class="mb-3">
                            <label class="form-label" for="last_name">Last Name: </label>
                            <input class="form-control" type="text" value="<%= currentUser.last_name%>" id="last_name" name="last_name">
                        </div>
                        <div class="mb-3">
                            <label class="form-label" for="username">Username: </label>
                            <input class="form-control" type="text" value="<%= currentUser.username%>" id="username" name="username" required disabled>
                        </div>
                        <div class="mb-3">
                            <label class="form-label" for="email">Email: </label>
                            <input class="form-control" type="email" value="<%= currentUser.email_address%>" id="email" name="email_address" required disabled>
                        </div>
                        <div class="mb-3">
                            <label class="form-label" for="phone_number">Phone number: </label>
                            <input class="form-control" type="text" value="<%= currentUser.phone_number%>" id="phone_number" name="phone_number">
                        </div>

                        <div class="mb-3">
                            <label for="address" class="form-label">Address: </label>
                            <input type="text" class="form-control" id="address" value="<%= currentUser.address.St_address%>" name="address[St_address]" placeholder="Main St 123">
                        </div>
                        <div class="mb-3">
                            <label for="address2" class="form-label">Address 2: </label>
                            <input type="text" class="form-control" id="address2" value="<%= currentUser.address.St_address2%>" name="address[St_address2]" placeholder="House, Apartment, floor">
                        </div>

                        <div class="mb-3 row g-3">
                            <div class="col-md-8">
                                <label for="city" class="form-label">City: </label>
                                <input type="text" class="form-control" value="<%= currentUser.address.city%>" name="address[city]" id="city">
                            </div>
                            <div class="col-md-4">
                                <label for="postalcode" class="form-label">Postal code: </label>
                                <input type="text" class="form-control" value="<%= currentUser.address.postal_code%>" name="address[postal_code]" id="postalcode">
                            </div>
                        </div>

                        <div class="mb-3">
                            <div>
                                <label for="voivodship" class="form-label">Voivodship: </label>
                                <select id="voivodship" name="address[voivodship]" class="form-select">
                                    <% if( currentUser.address.voivodship) {%>
                                        <option selected disabled><%= currentUser.address.voivodship %> </option>
                                        <% } else {%> 
                                  <option selected disabled>Choose...</option>
                                  <% } %> 
                                  <option>Greater Poland</option>
                                  <option>Kuyavia-Pomerania</option>
                                  <option>Lesser Poland</option>
                                  <option>Łódź</option>
                                  <option>Lower Silesia</option>
                                  <option>Lublin</option>
                                  <option>Lubusz</option>
                                  <option>Masovia</option>
                                  <option>Opole</option>
                                  <option>Podlaskie</option>
                                  <option>Pomerania</option>
                                  <option>Silesia</option>
                                  <option>Subcarpathia</option>
                                  <option>Holy Cross Province</option>
                                  <option>Warmia-Masuria</option>
                                  <option> West Pomerania</option>
                                </select>
                            </div>
                        </div>

                        <div style="padding-top: 20px;">
                            <button class="btn btn-primary btn-block ">Save</button>
                            <a href="/user/myaccount" class="btn btn-info btn-block" role="button">Back</a>
                        </div>

                    </form>
                </div>
            </div>
        </div>
    </div>