<%- include('../partials/header') -%>
<link rel="stylesheet" href="/user/profile.css">
<div class="container register-form" style="background-color: white;padding: 1%;">
    <div class="form">
        <div class="note">
            <p>Updating your informations makes shopping easier for everyone.</p>
        </div>

        <form class="form-content" method="POST" action="/c_user/edit/profile?_method=PUT">
            <div class="row">
                <div class="col-md-6">
                    <div class="form-group row">
                        <div class="col-md-6">
                            First Name: <input type="text" class="form-control" placeholder="First name *" value="<%=currentUser.first_name%>" name="fname" required />
                        </div>
                        <div class="col-md-6">
                            Last Name: <input type="text" class="form-control" placeholder="Last name *" value="<%=currentUser.last_name%>" name="lname" required />
                        </div>
                    </div><br>
                    <div class="form-group">
                        Street adress:
                        <input type="text" class="form-control" placeholder="Adress *" value="<%=currentUser.adress%>" name="adress"
                            required />
                    </div>
                    <br>
                    <div class="form-group row">
                        <div class="col-md-5 mb-3">
                            Country
                            <input type="text" class="form-control" placeholder="Country *" value="<%=currentUser.country%>" name="country" required />
                        </div>
                        <div class="col-md-4 mb-3">
                            City: 
                            <input type="text" class="form-control" placeholder="City *" value="<%=currentUser.city%>" name="city" required />
                        </div>
                        <div class="col-md-3 mb-3">
                            Zip code: 
                            <input type="text" class="form-control" placeholder="Zib code *" value="<%=currentUser.zip%>" name="zip" required />
                        </div>
                    </div>
                </div>
                <div class="col-md-6">
                    <div class="form-group">
                        Email: <input id="email_input" type="email" class="form-control" placeholder="email adress *" value="<%=currentUser.email%>" name="email"
                            required />
                    </div><br>
                    <div class="form-group">
                        Phone: <input type="text" class="form-control" placeholder="Phone number *" name="phone" value="<%=currentUser.phone%>" required />
                    </div>
                </div>
            </div>
            <br>
            <button type="submit" class="btnSubmit">Save</button>
            <% if(locals.fail){ %>
                <div id="failed_msg" class="alert alert-danger" role="alert">
                    <%= desc %>
                  </div>
            <%}%>
        </form>
    </div>
</div>



<%- include('../partials/footer') -%>