<%- include('includes/header', {username: admin[0].name,email: admin[0].email } ) %>

    <div class="body-wrapper">
        <div class="container-fluid">
            <div class="card bg-info-subtle shadow-none position-relative overflow-hidden mb-4">
                <div class="card-body px-4 py-3">
                    <div class="row align-items-center">
                        <div class="col-md-8 col-sm-7">
                            <h4 class="fw-semibold mb-1">Subscription Plans</h4>

                        </div>
<div class="col-md-4 col-sm-5 text-md-end text-sm-start mt-3 mt-md-0">
    <a id="addPlanBtn" href='/addsubscriptionplan'
       class="btn btn-primary">
   <i class="bi bi-plus-lg me-1"></i> Add Plan
    </a>
</div>
                    </div>

                </div>
            </div>

    <div class="card shadow-sm">
        <div class="card-body">

          <h4 class="mb-4">Update Subscription Section</h4>

          <form id="sectionForm">

            <!-- TYPE (HIDDEN) -->
            <input type="hidden" name="type" value="<%= section ? section.type : 'subscriptions' %>">

            <!-- LABEL + TITLE (ONE LINE) -->
            <div class="row mb-3">
              <div class="col-md-6">
                <label class="form-label fw-semibold">Section</label>
                <input type="text" class="form-control" name="badge" value="<%= section ? section.badge : '' %>"
                  placeholder="Subscription Section Label">
              </div>
              <div class="col-md-6">
                <label class="form-label fw-semibold">Title</label>
                <input type="text" class="form-control" name="title" value="<%= section ? section.title : '' %>"
                  placeholder="Subscription Title">
                    <small class="text-muted">
                                    Highlight any word using <code>&lt;span&gt;word&lt;/span&gt;</code>
                                </small>
              </div>
            </div>

            <!-- SHORT DESCRIPTION -->
            <div class="mb-4">
              <label class="form-label fw-semibold">Short Description</label>
              <textarea class="form-control" name="shortDescription" rows="3"
                placeholder="Write short description here..."
                ><%= section ? section.shortDescription : '' %></textarea>
            </div>

            <!-- BUTTON -->
            <button type="submit" class="btn btn-primary px-4">
              Update Section
            </button>

          </form>

        </div>
      </div>
            <div class="datatables">


                <div class="card">
                    <div class="card-body">
                        <div class="table-responsive">
                            <table id="zero_config" class="table table-striped table-bordered text-nowrap align-middle">
                                <thead>
                                    <tr>
                                        <th>Name</th>
                                        <th>Monthly Price</th>
                                        <th>Yearly Price</th>
                                        <th>Limit</th>
                                        <th>Status</th>
                                        <th class="action-col">Action</th>
                                    </tr>
                                </thead>
                                <tbody>

                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>



            </div>



        </div>
    </div>
    </div>

    <%- include('includes/allscripts') %>
        <script src="https://cdn.quilljs.com/1.3.6/quill.min.js"></script>
        <script src="/js/view/subscriptionplan.js"></script>
            <script src="/js/view/pagesection.js"></script>