<!DOCTYPE html>
<html lang="en">
  
<head>
    <%- include('./partials/head'); -%>
    
</head>
<body onload="startTime()">
    <%- include('./partials/header_sidebar'); -%>
    
    <!-- tap on top starts-->

        <!-- Page Sidebar Ends-->
        <div class="page-body">
          <div class="container-fluid">
            <div class="page-title">
              <div class="row">
                <div class="col-sm-6">
                  <h3><%=lan.Edit%> <%=lan.Profile%></h3>
                </div>
                <div class="col-sm-6">
                  <ol class="breadcrumb">
                    <li class="breadcrumb-item"><a href="/index"><i data-feather="home"></i></a></li>
                    <li class="breadcrumb-item"><%=lan.Dashboard%></li>
                    <li class="breadcrumb-item active"><%=lan.Edit%> <%=lan.Profile%></li>
                  </ol>
                </div>
              </div>
            </div>
          </div>
          <!-- Container-fluid starts-->
          <div class="container-fluid">
            <div class="row">
              <div class="col-sm-12">
                <div class="card">
                  <div class="card-body">
                    <form  class="needs-validation" id="edit_admin_form" novalidate="" action="/edit_admin/<%=admin.id%>" method="post">
                      <div class="row">

                        <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 form-group">
                          <label class="col-form-label"><%=lan.Name%></label>
                          <input class="form-control cdcheck" type="text" name="name" value="<%=admin.name%>" placeholder="<%=lan.Enter%> <%=lan.Name%>" required>
                        </div>

                        <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 form-group">
                          <label class="col-form-label"><%=lan.Email%></label>
                          <input class="form-control cdcheck" id="admin_email" type="email" name="email" value="<%=admin.email%>" placeholder="<%=lan.Enter%> <%=lan.Email%>" required>
                          <input type="hidden" id="adminemail" value="<%=admin.email%>">
                        </div>

                        <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 form-group">
                            <label class="col-form-label"><%=lan.Country%> <%=lan.Code%></label>
                            <select class="js-example-basic-single cdcheck" id="country_code" name="country_code" required>
                                <option value selected disabled><%=lan.Country%> <%=lan.List%></option>
                                <% CountryCode.forEach((data, x) => { %>
                                    <option value="<%= data %>" <%= admin.country_code == data ? 'selected' : "" %>> <%= nameCode[x] %> <%= data %> </option>
                                <% }) %>
                            </select>
                        </div>

                        <input type="hidden" id="coccode" value="<%=admin.country_code%>">
                        <input type="hidden" id="cophone" value="<%=admin.phone%>">

                        <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 form-group">
                            <label class="col-form-label"><%=lan.Number%></label>
                            <input class="form-control cdcheck" type="number" id="ephone" name="phone" value="<%=admin.phone%>" placeholder="<%=lan.Enter%> <%=lan.Number%>" required>
                        </div>

                        <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 form-group">
                          <label class="col-form-label"><%=lan.Password%></label>
                          <input class="form-control" type="password" name="password" placeholder="**********">
                        </div>
                        
                        <div class="text-center">
                          <p class="text-danger d-none mt-3" id="admin_detail_error"><%=lan.Please_Enter_All_Detail%>.</p>
                          <p class="text-danger d-none mt-3" id="admin_phoneno_error"><%=lan.This_Phone_No_Alread_Registered%>.</p>
                        </div>
                        </div>
                      </form>
                    <div class="text-end mt-5">
                      <button class="btn btn-square btn-primary btn-air-primary add_detail_btn b-r-10" id="edit_admin" type="submit"><%=lan.Submit%></button> 
                    </div>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <!-- Container-fluid Ends-->
        </div>

        <%- include('./partials/footer'); -%>
        <%- include('./partials/script'); -%>
  </body>
</html>