<!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.Outstation%> <%=lan.Setting%></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.Outstation%> <%=lan.Setting%></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" novalidate="" action="/outstation/edit_outstation_setting" method="post" enctype="multipart/form-data">
                      <div class="row">

                        <div class="col-12">
                            <div class="text-center form-group">
                                <% if(msetting[0].image == null) { %>
                                    <img id="file-preview" width="150" height="150" src="../images/dashboard/default/profile.png" alt="image">
                                <% } else { %>
                                    <img id="file-preview" width="150" height="150" src="../../<%=msetting[0].image%>" alt="image">
                                <% }; %>
                            </div>
                        </div>

                        <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 form-group">
                            <label class="col-form-label"><%=lan.image%></label>
                            <input class="form-control" style="height: 47px;" type="file" name="image" onchange="showPreview(event)">
                        </div>

                        <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 form-group">
                          <label class="col-form-label"><%=lan.Title%></label>
                          <input class="form-control" type="text" name="name" value="<%=msetting[0].name%>" placeholder="<%=lan.Enter%> <%=lan.Title%>" required>
                        </div>

                        <div class="col-12 form-group">
                          <label class="col-form-label"><%=lan.Description%></label>
                          <textarea class="form-control" name="description" id="" cols="30" rows="8"><%=msetting[0].description%></textarea>
                        </div>

                        </div>
                        <% let permiss = per != "1" ? per.out_setting[1] : "1" %>
                        <% if(permiss == "1"){ %>
                        <div class="text-end mt-5">
                          <button class="btn btn-square btn-primary btn-air-primary add_detail_btn b-r-10" type="submit"><%=lan.Submit%></button> 
                        </div>
                        <% } %>
                    </form>
                  </div>
                </div>
              </div>
            </div>
          </div>
          <!-- Container-fluid Ends-->
        </div>

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