<%- include('../includes/header') %>

    <!-- Appointment -->
    <section class="section-area account-wraper1">
        <div class="container-fluid">
            <div class="appointment-inner section-sp2 pt-3">
                <div class="container">
                    <%- include('../includes/tabs') %>
                </div>
                    <!-- Profile Tab -->
                    <div id="profile" class="tabcontent">
                        <div class="container mt-5">
                            <div class="row align-items-center">
                                <div class="col-lg-12">
                                    <div class="appointment-form form-wraper">
                                        <h1 class="mb-4">Profile</h1>
                                        <div class="row">
                                            <form id="profileForm">
                                                <div class="form-group">
                                                    <label for="fullname">Fullname</label>
                                                    <input id="fullname" name="name" type="text" class="form-control"
                                                        value="<%= user.fullname && user.fullname %>"
                                                        placeholder="Enter Fullname">
                                                </div>
                                                <div class="form-group">
                                                    <label for="email">Email</label>
                                                    <input id="email" name="email" type="email" class="form-control"
                                                        value="<%= user.email && user.email %>"
                                                        placeholder=" Enter Email">
                                                </div>
                                                <div class="form-group">
                                                    <label for="dob">Date of birth</label>
                                                    <input id="dob" name="dob" type="date" class="form-control"
                                                        placeholder=" Enter Dob">
                                                </div>
                                                <div class="form-group">
                                                    <label for="gender">Gender</label>
                                                    <select id="gender" name="gender" class="form-control">
                                                        <option value="" >Select Gender</option>
                                                        <option <%=user.gender && user.gender==1 ? 'selected' : '' %>
                                                            value="1">Male</option>
                                                        <option <%=user.gender && user.gender==2 ? 'selected' : '' %>
                                                            value="2">Female</option>
                                                        <option <%=user.gender && user.gender==0 ? 'selected' : '' %>
                                                            value="0">Other</option>
                                                    </select>
                                                </div>
                                           
                                                <button type="submit" class="btn btn-outline-primary btn-sm mt-3">Update <i class="btn-icon-bx fas fa-chevron-right"></i></button>
                                            </form>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
            </div>
        </div>
    </section>

    </div>
    <button onclick='window.scrollTo({top: 0, behavior: "smooth"});' class="back-to-top fa fa-chevron-up"></button>
    </div>
    <%- include('../includes/footer') %>
        <script>
            const datePicker = document.getElementById('dob')
            datePicker.max = new Date().toISOString().split("T")[0];
            var dob = "<%= user.dob %>"
            if (dob != "") {
                var date = new Date(dob);
                var currentDate = date.toISOString().substring(0, 10);
                datePicker.value = currentDate;
            }
        </script>