<!DOCTYPE html>
<html lang="en">
  
<head>
    <%- include('./partials/head'); -%>
</head>
<body onload="startTime()">
    <%- include('./partials/header_sidebar'); -%>
    
    <!-- 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.payment %></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.payment %></li>
                <li class="breadcrumb-item active"><%= lan.edit %> <%= lan.payment %></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="/settings/edit_payment_data/<%=payment_list[0].id%>" method="post" enctype="multipart/form-data">
                    <div class="row">
                        <div class="col-sm-12 col-md-12 col-lg-12 col-xl-12 text-center form-group">
                            <% if(payment_list[0].image == null){ %>
                                <img id="file-preview" width="150" height="150" src="../images/dashboard/default/profile.png" alt="<%= lan.image %>">
                            <% } else { %>
                                <img id="file-preview" width="150" height="150" src="../../<%=payment_list[0].image%>" alt="<%= lan.image %>">
                            <% }; %>
                        </div>
                        <div class="row mt-3">
                            <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 form-group">
                                <label class="col-form-label"><%= lan.upload %> <%= lan.img %></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.payment %> <%= lan.gateway %> <%= lan.name %></label>
                                <input class="form-control" type="text" name="name" value="<%=payment_list[0].name%>" placeholder="<%= lan.enter %> <%= lan.name %>" required>
                            </div>
                            <div class="col-sm-12 col-md-12 col-lg-12 col-xl-12 form-group">
                                <label class="col-form-label"><%= lan.payment %> <%= lan.gateway %> <%= lan.sub_title %></label>
                                <input class="form-control" type="text" name="sub_title" value="<%=payment_list[0].sub_title%>" placeholder="<%= lan.enter %> <%= lan.sub_title %>" required>
                            </div>

                            <% if (payment_list[0].id == "10") { %>
                              <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 form-group">
                                <label class="col-form-label"><%= lan.upload %> <%= lan.qr_code %></label>
                                <input class="form-control" style="height: 47px;" type="file" name="qrcode" onchange="secondshowPreview(event)" >
                              </div>

                              <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 form-group">
                                <% if(attribute[0] == null){ %>
                                    <img id="second-file-preview" width="150" height="150" src="../images/dashboard/default/profile.png" alt="<%= lan.image %>">
                                <% } else { %>
                                    <img id="second-file-preview" width="150" height="150" src="../../<%=attribute[0]%>" alt="<%= lan.image %>">
                                <% }; %>
                              </div>

                            <% } else if (payment_list[0].id == "11") { %>

                              <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 form-group">
                                <label class="col-form-label"><%= lan.bank %> <%= lan.name %></label>
                                <input class="form-control" type="text" name="bankname" value="<%=attribute[0]%>" placeholder="<%= lan.enter %> <%= lan.bank %> <%= 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.bank %> <%= lan.holder_name %></label>
                                <input class="form-control" type="text" name="bholder" value="<%=attribute[1]%>" placeholder="<%= lan.enter %> <%= lan.bank %> <%= lan.holder_name %>" required>
                              </div>

                              <div class="col-sm-12 col-md-6 col-lg-4 col-xl-4 form-group">
                                <label class="col-form-label"><%= lan.account_no %></label>
                                <input class="form-control" type="text" name="accno" value="<%=attribute[2]%>" placeholder="<%= lan.enter %> <%= lan.account_no %>" required>
                              </div>

                              <div class="col-sm-12 col-md-6 col-lg-4 col-xl-4 form-group">
                                <label class="col-form-label"><%= lan.ifsc_code %></label>
                                <input class="form-control" type="text" name="ifccode" value="<%=attribute[3]%>" placeholder="<%= lan.enter %> <%= lan.ifsc_code %>" required>
                              </div>

                              <div class="col-sm-12 col-md-6 col-lg-4 col-xl-4 form-group">
                                <label class="col-form-label"><%= lan.swift_code %></label>
                                <input class="form-control" type="text" name="swiftcode" value="<%=attribute[4]%>" placeholder="<%= lan.enter %> <%= lan.swift_code %>" required>
                              </div>

                            <% } else { %>

                              <div class="col-sm-12 col-md-12 col-lg-12 col-xl-12 form-group">
                                  <label class="col-form-label"><%= lan.payment %> <%= lan.gateway %> <%= lan.attributes %></label>
                                  <select class="custome_select_create form-control" multiple="multiple" name="attribute" required>
                                      <% attribute.forEach(function(data){ %>
                                        <option value="<%=data%>" selected><%=data%></option>
                                      <% }); %>
                                  </select>
                              </div>

                            <% }; %>

                            <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 form-group">
                                <label class="col-form-label"><%= lan.payment %> <%= lan.gateway %> <%= lan.status %></label>
                                <select class="js-example-basic-single" name="status" required>
                                  <option value="1" <%= payment_list[0].status == "1" ? 'selected' : '' %>><%= lan.publish %></option>
                                  <option value="0" <%= payment_list[0].status == "0" ? 'selected' : '' %>><%= lan.unpublish %></option>
                                </select>
                            </div>
                            <div class="col-sm-12 col-md-6 col-lg-6 col-xl-6 form-group">
                                <div class="d-flex mb-2" style="margin-top: 40px;">
                                    <div class="icon-state switch-outline">
                                      <label class="switch">
                                        <input type="checkbox" name="wallet_status" <%= payment_list[0].wallet_status == "1" ? 'checked' : '' %>><span class="switch-state bg-success"></span>
                                      </label>
                                    </div>
                                    <label class="col-form-label m-l-10"><%= lan.show_on_wallet %>?</label>
                                </div>
                            </div>
                            <input type="hidden" name="old_image" value="<%=payment_list[0].image%>">
                        </div>
                    </div>
                    <div class="text-end mt-3">
                      <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>
