<!DOCTYPE html>
<html lang="en">

<head>

  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
  <meta name="description" content="">
  <meta name="author" content="">

  <title>List Of Shipping</title>

  <!-- Bootstrap core CSS -->
  <link href="../vendor/bootstrap/css/bootstrap.min.css" rel="stylesheet">
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.14.0/css/all.min.css" />
  <link href="https://fonts.googleapis.com/css2?family=Kufam:wght@400;500;600;700;800;900&display=swap"
    rel="stylesheet">

  <!-- Custom styles for this template -->
  <link href="../public/css/main.css" rel="stylesheet">

</head>

<body>

  <div class="d-flex" id="wrapper">

    <!-- Sidebar -->
    <?php

          include ('../sidebar_admin.php'); 
      ?>
    <!-- /#sidebar-wrapper -->

    <!-- Page Content -->
    <div id="page-content-wrapper">

        <?php
        include ('../navbar_admin.php');
        ?>

        <div class="container">
        <div class="page_name_candidate">
          <div class="candidate_div">
            <h1>Shipping List</h1>

          </div>
          <div class="select_sort_second">

            <div class="sort_btn">


              <a href="" data-toggle="modal" class="add_shipping_list" data-target="#add_payment_modal"><span class="span_btn"><svg width="12px"
                    height="12px" viewBox="0 0 18 18" version="1.1" xmlns:xlink="http://www.w3.org/1999/xlink"
                    xmlns="http://www.w3.org/2000/svg">
                    <desc>Created with Lunacy</desc>
                    <path
                      d="M10 8L17 8C17.5523 8 18 8.44772 18 9C18 9.55229 17.5523 10 17 10L10 10L10 17C10 17.5523 9.55229 18 9 18C8.44772 18 8 17.5523 8 17L8 10L1 10C0.447715 10 0 9.55229 0 9C0 8.44772 0.447715 8 1 8L8 8L8 1C8 0.447715 8.44772 0 9 0C9.55229 0 10 0.447715 10 1L10 8Z"
                      id="Path" fill="#FFFFFF" stroke="none" />
                  </svg></span>Add</a>

            </div>
          </div>



        </div>

        <div class="cards">
          <div class="row">
            <div class="col-xl-12 mt-3 mb-3">
              <div class="card payment_method_card candidate">
                <div class="card-body ">
                  <div class="pagination_table">
                    <div class="results">


                    </div>
                    <div class="page">
                      <!-- <div class="page_filter">
                        <div class="form-group mr-3">

                          <select class="form-control">
                            <option>City</option>
                            <option>2</option>
                            <option>3</option>
                            <option>4</option>
                            <option>5</option>
                          </select>
                        </div>
                        <div class="form-group mr-3">

                          <select class="form-control">
                            <option>Country</option>
                            <option>2</option>
                            <option>3</option>
                            <option>4</option>
                            <option>5</option>
                          </select>
                        </div>
                        <div class="form-group mr-3">
                          <label for="exampleFormControlSelect1">Show:</label>
                          <select class="form-control" id="exampleFormControlSelect1">
                            <option>20</option>
                            <option>2</option>
                            <option>3</option>
                            <option>4</option>
                            <option>5</option>
                          </select>
                        </div>
                      </div> -->

                      <span class="page_head">Results Per Page</span>
                      <div id="paginate">

                      </div>
                      <!-- <ul class="pagination pagination-sm">
                        <li class="page-item"><a class="page-link page_pre" href="#"><span><i
                                class="fas fa-angle-left"></i></span></a></li>
                        <li class="page-item"><a class="page-link" href="#">1</a></li>
                        <li class="page-item"><a class="page-link" href="#">2</a></li>
                        <li class="page-item"><a class="page-link" href="#">...</a></li>
                        <li class="page-item"><a class="page-link" href="#">19</a></li>
                        <li class="page-item"><a class="page-link page_next" href="#"><span><i
                                class="fas fa-angle-right"></i></span></a></li>
                      </ul> -->

                    </div>
                  </div>
                  <div class="search_product">
                    <form action="#">
                      <div class="input-group ">
                        <div class="input-group-prepend">
                          <span class="input-group-text" id="basic-addon1"><i class="fas fa-search"></i></span>
                        </div>
                        <input type="text" class="form-control" placeholder="Searching for.." aria-label="Username"
                          aria-describedby="basic-addon1">
                      </div>
                    </form>

                  </div>

                  <table class="table table_centerd">
                    <thead>
                      <tr>

                        <th>Logo</th>
                        <th>Name</th>
                        <th>Delivery Days</th>
                         <th>Type</th>
                        <th>Currency Code</th>
                        <th>Currency Symbol</th>
                        <th>Action</th>
                        <th>Enable</th>


                      </tr>
                    </thead>
                    <tbody id="shipping-table-body">
                      <!-- <tr>
                        <td><img src="../public/image/person.jpg" alt=""></td>
                        <td><span>Elston Gullan</span>
                        </td>
                        <td>2 days</td>
                        <td>United States</td>
                        <td>USD</td>
                        <td>$</td>


                        <td>
                          <div class="">
                            <button type="button" data-toggle="modal" data-target="#packages_modal_form_id"
                              class="btn btn-outline-white2 btn-rounded btn-sm">
                              <i class="fas fa-plus fa-plus2"></i>
                            </button>
                            <button data-toggle="modal" data-target="#add_payment_modal_edit" id="editmodal"
                              type="button" class="btn btn-outline-white2 btn-rounded btn-sm">
                              <i class="fas fa-pencil-alt fa-pencil-alt2 mt-0"></i>
                            </button>
                            <button type="button" class="btn btn-outline-white2 btn-rounded btn-sm">
                              <i class="far fa-trash-alt fa-trash-alt2 mt-0"></i>
                            </button>

                          </div>
                        </td>
                        <td>
                          <label class="switch">
                            <input type="checkbox">
                            <span class="slider round"></span>
                          </label>

                        </td>
                        <td>
                          <button type="button"
                            class="btn ml-3 accordion-toggle btn-outline-white2 text-center btn-rounded btn-sm"
                            id="accordion1" data-toggle="collapse" data-parent="#demo1" href="#demo1"
                            aria-expanded="true">
                           
                            <span class="expand-button"></span>
                          
                          </button>
                        </td>


                      </tr>
                      <tr>
                        <td colspan="11" class="hiddenRow">
                          <div class="accordian-body collapse" id="demo1">

                            <div class="row table_image_row">
                              <div class="col-xl-12">
                                <table class="table table-shipping-weight">
                                  <thead>
                                    <tr>

                                      <th scope="col">Name</th>

                                      <th scope="col">Delivery Days</th>

                                      <th scope="col">Action</th>


                                    </tr>
                                  </thead>
                                  <tbody>
                                    <tr>

                                      <td>price</td>

                                      <td>1 grams</td>

                                      <td>
                                        <div class="">
                                          <button type="button" data-toggle="modal"
                                            data-target="#sub_packages_modal_form_id"
                                            class="btn btn-outline-white2 btn-rounded btn-sm">
                                            <i class="fas fa-plus fa-plus2"></i>
                                          </button>
                                          <button data-toggle="modal" data-target="#edit_package_sub_id"
                                            id="payment_editmodal" type="button"
                                            class="btn btn-outline-white2 btn-rounded btn-sm">
                                            <i class="fas fa-pencil-alt fa-pencil-alt2 mt-0"></i>
                                          </button>
                                          <button id="accordion2" data-toggle="collapse" data-parent="#accordion2"
                                            href="#collapsetwo" type="button"
                                            class="btn ml-3 btn-outline-white2 accordion-toggle btn-rounded btn-sm"
                                            aria-expanded="true">
                                            <span class="expand2-button"></span>
                                          </button>

                                        </div>
                                      </td>


                                    </tr>
                                    <tr>
                                      <td colspan="11" class="hiddenRow">
                                        <div class="accordian-body collapse" id="collapsetwo">

                                          <div class="row table_image_row">
                                            <div class="col-xl-12">
                                              <table class="table table-shipping-weight">
                                                <thead>
                                                  <tr>

                                                    <th scope="col">Price</th>

                                                    <th scope="col">From Weight</th>
                                                    <th scope="col">To Weight</th>
                                                    <th scope="col">Action</th>


                                                  </tr>
                                                </thead>
                                                <tbody>
                                                  <tr>

                                                    <td>price</td>

                                                    <td>1 grams</td>
                                                    <td>500 grams</td>
                                                    <td>
                                                      <div class="">

                                                        <button data-toggle="modal"
                                                          data-target="#sub_child_packages_modal_form_id"
                                                          id="payment_editmodal" type="button"
                                                          class="btn btn-outline-white2 btn-rounded btn-sm">
                                                          <i class="fas fa-pencil-alt fa-pencil-alt2 mt-0"></i>
                                                        </button>

                                                      </div>
                                                    </td>

                                                  </tr>
                                                 

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

                                          </div>

                                        </div>
                                      </td>
                                    </tr>
                                  </tbody>
                                </table>
                              </div>

                            </div>

                          </div>
                        </td>
                      </tr> -->

                    </tbody>
                  </table>

                </div>
              </div>

            </div>

          </div>

        </div>
      </div>
      <!-- /#page-content-wrapper -->

    </div>

        <!--  input hidden wrapper-->
      <input type="hidden" id="packages-id">
      <input type="hidden" id="subpackages-id">
      <input type="hidden" id="edit-shipping-data">
      <input type="hidden" id="edit-sub-shipping-data">
      <input type="hidden" id="edit-sub-meta-shipping-data">





      <!--      input hidden wrapper-->

    <!-- /#wrapper -->
    <!-- modals -->
    <!-- add modal -->
    <form class="childcatagories_modal_from" id="modal-form" action="">
      <div class="modal fade" id="add_payment_modal" tabindex="-1" role="dialog"
        aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
          <div class="modal-content">
            <div class="modal-header mh">
              <button type="button" class="close closmodel" data-dismiss="modal" aria-label="Close"
                onclick="colsemodel()">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body mb">
              <div>
                <div class="cat-folder-img">
                  <i class="fa fa-folder" aria-hidden="true"></i>
                </div>
              </div>
              <div class="form-group">
                <label for="cat-name-upload" class="customer-add-input-label txt-regular upload-input-label">
                  Name</label>
                <input type="text" id="addpro_cat" name="addpro_cat" placeholder="Enter Shipping Name" value=""
                  class="customer-add-input shipping_name_input  w-100" />
              </div>
              <div class="form-group">
                <label for="cat-name-upload"
                  class="customer-add-input-label txt-regular upload-input-label">Delivery Days</label>
                <input type="text" id="addpro_cat" name="pri_dis" placeholder="Enter Delivery Days" value=""
                  class="customer-add-input deliery_days_input w-100" />
              </div>
              <div class="form-group">
                <label for="cat-name-upload" class="customer-add-input-label txt-regular upload-input-label">Currency Code</label>
                <input type="text" id="addpro_cat" name="pri_con" placeholder="Enter Currency Code"
                  value="" class="customer-add-input currency_code_input w-100" />
              </div>
                <div class="form-group" style="display:none">
                    <label for="cat-name-upload" class="customer-add-input-label txt-regular upload-input-label">Type</label>
                    <input type="text" id="addpro_cat" name="pri_con" placeholder="Enter  Type"
                           value="customized"  class="customer-add-input type_input w-100" />
                </div>
              <div class="form-group">
                <label for="cat-name-upload" class="customer-add-input-label txt-regular upload-input-label">Currency Symbol</label>
                <input type="text" id="addpro_cat" name="rid_cat" placeholder="Enter Currency Symbol" value="" 
                  class="customer-add-input currecny_symbol_input  w-100" />
              </div>



              <div>
                <div>
                  <div class="upload-text-heading">
                    <h5 class="coupon-code-main-heading txt-regular">
                      Upload Picture
                    </h5>
                  </div>
                  <div>
                    <p class="upload-main-paragraph txt-label2">
                      Drag and drop your files here
                    </p>
                  </div>
                </div>
                <div class="card text-center uload-card">
                  <div class="file-upload4">
                    <div class="image-upload-wrap4">
                      <input class="file-upload-input4" type="file" onchange="readURL4(this);" accept="image/*" />
                      <div class="drag-text4">
                        <div class="card-body upload-card-body4">
                          <div class="upload-img4">
                            <img src="../public/image/upload.png" alt="" />
                          </div>
                          <div class="upload-image-format4">
                            <p>
                              .PDF .JPG .PNG .DOC
                            </p>
                          </div>
                          <div class="upload-detail4">
                            <h4>You can also upload files by</h4>
                            <div class="upload-clicking4">
                              <a href="#" class="">Clicking here</a>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="file-upload-content4">
                      <img class="file-upload-image4" src="#" alt="your image" />
                      <div class="image-title-wrap4">
                        <button type="button" onclick="removeUpload4()" class="btn remove-image4">
                          Remove
                          <span class="image-title4" style="display: none;">Uploaded
                            Image</span>
                        </button>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="modal-footer mf">
              <button type="button"  class="btn btn-primary add_shipping">
                <img src="../public/image/tick (1).png" alt="" />
              </button>
            </div>
          </div>
        </div>
      </div>
    </form>
    <!-- edit modal -->
    <form class="childcatagories_modal_from" id="modal-form" action="">
      <div class="modal fade" id="add_payment_modal_edit" tabindex="-1" role="dialog"
        aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
          <div class="modal-content">
            <div class="modal-header mh">
              <button type="button" class="close closmodel" data-dismiss="modal" aria-label="Close"
                onclick="colsemodel()">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body mb">
              <div>
                <div class="cat-folder-img">
                  <i class="fa fa-folder" aria-hidden="true"></i>
                </div>
              </div>
              <div class="form-group">
                <label for="cat-name-upload" class="customer-add-input-label txt-regular upload-input-label">
                  Name</label>
                <input type="text" id="addpro_cat" name="addpro_cat" placeholder="Enter Shipping Name" value=""
                  class="customer-add-input edit_ship_name  w-100" />
              </div>
              <div class="form-group">
                <label for="cat-name-upload"
                  class="customer-add-input-label txt-regular upload-input-label">Delivery Days</label>
                <input type="text" id="addpro_cat" name="pri_dis" placeholder="Enter Delivery Days" value=""
                  class="customer-add-input edit_delivery_days  w-100" />
              </div>
              <div class="form-group">
                <label for="cat-name-upload" class="customer-add-input-label txt-regular upload-input-label">Currency Code</label>
                <input type="text" id="addpro_cat" name="pri_con" placeholder="Enter Currency Code"
                  value="" class="customer-add-input edit_currency_code  w-100" />
              </div>
              <div class="form-group" style="display:none">
                <label for="cat-name-upload" class="customer-add-input-label txt-regular upload-input-label">Type</label>
                <input type="text" id="addpro_cat" name="rid_cat" placeholder="Enter Type" value="" 
                  class="customer-add-input edit_type  w-100" />
              </div>
              <div class="form-group">
                <label for="cat-name-upload"
                  class="customer-add-input-label txt-regular upload-input-label">Currency Symbol</label>
                <input type="text" id="addpro_cat" name="rid_cat" placeholder="Enter Currency Symbol" value=""
                  class="customer-add-input edit_currency_symbol  w-100" />
              </div>



              <div>
                <div>
                  <div class="upload-text-heading">
                    <h5 class="coupon-code-main-heading txt-regular">
                      Upload Picture
                    </h5>
                  </div>
                  <div>
                    <p class="upload-main-paragraph txt-label2">
                      Drag and drop your files here
                    </p>
                  </div>
                </div>
                <div class="card text-center uload-card">
                  <div class="file-upload4">
                    <div class="image-upload-wrap4">
                      <input class="file-upload-input4" type="file" onchange="readURL4(this);" accept="image/*" />
                      <div class="drag-text4">
                        <div class="card-body upload-card-body4">
                          <div class="upload-img4">
                            <img src="../public/image/upload.png" alt="" />
                          </div>
                          <div class="upload-image-format4">
                            <p>
                              .PDF .JPG .PNG .DOC
                            </p>
                          </div>
                          <div class="upload-detail4">
                            <h4>You can also upload files by</h4>
                            <div class="upload-clicking4">
                              <a href="#" class="">Clicking here</a>
                            </div>
                          </div>
                        </div>
                      </div>
                    </div>
                    <div class="file-upload-content4">
                      <img class="file-upload-image4" src="#" alt="your image" />
                      <div class="image-title-wrap4">
                        <button type="button" onclick="removeUpload4()" class="btn remove-image4">
                          Remove
                          <span class="image-title4" style="display: none;">Uploaded
                            Image</span>
                        </button>
                      </div>
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <div class="modal-footer mf">
              <button type="button" class="btn btn-primary update_all_shipping_data">
                <img src="../public/image/tick (1).png" alt="" />
              </button>
            </div>
          </div>
        </div>
      </div>
    </form>
    <!-- add packages add for modal start -->
    <form class="childcatagories_modal_from" id="modal-form" action="">
      <div class="modal fade" id="packages_modal_form_id" tabindex="-1" role="dialog"
        aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
          <div class="modal-content">
            <div class="modal-header mh">
              <button type="button" class="close closmodel" data-dismiss="modal" aria-label="Close"
                onclick="colsemodel()">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body mb">
              <div>
                <div class="cat-folder-img">
                  <i class="fa fa-folder" aria-hidden="true"></i>
                </div>
              </div>
              <div class="form-group">
                <label for="cat-name-upload" class="customer-add-input-label txt-regular upload-input-label">Packges
                  Name</label>
                <input type="text" id="addpro_cat" name="addpro_cat" placeholder="Enter packges Name" value=""
                  class="customer-add-input package_input_name  w-100" />
              </div>
              <div class="form-group">
                <label for="cat-name-upload" class="customer-add-input-label txt-regular upload-input-label">Delivery
                  Days</label>
                <input type="text" id="addpro_cat" name="pri_dis" placeholder="Enter Delivery Days" value=""
                  class="customer-add-input delivery_days_input w-100" />
              </div>



            </div>
            <div class="modal-footer mf">
              <button type="button"  class="btn btn-primary add_packages">
                <img src="../public/image/tick (1).png" alt="" />
              </button>
            </div>
          </div>
        </div>
      </div>
    </form>
    <!-- add featued add for modal end -->
    <!-- sub add packages  modal start -->
    <form class="childcatagories_modal_from" id="modal-form" action="">
      <div class="modal fade" id="sub_packages_modal_form_id" tabindex="-1" role="dialog"
        aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
          <div class="modal-content">
            <div class="modal-header mh">
              <button type="button" class="close closmodel" data-dismiss="modal" aria-label="Close"
                onclick="colsemodel()">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body mb">
              <div>
                <div class="cat-folder-img">
                  <i class="fa fa-folder" aria-hidden="true"></i>
                </div>
              </div>
              <div class="form-group">
                <label for="cat-name-upload"
                  class="customer-add-input-label txt-regular upload-input-label">Price</label>
                <input type="text" id="addpro_cat" name="addpro_cat" placeholder="Enter Price" value=""
                  class="customer-add-input price_input w-100" />
              </div>
              <div class="form-group">
                <label for="cat-name-upload" class="customer-add-input-label txt-regular upload-input-label">Form
                  Weight</label>
                <input type="text" id="addpro_cat" name="pri_dis" placeholder="Enter Weight" value=""
                  class="customer-add-input from_input w-100" />
              </div>
              <div class="form-group">
                <label for="cat-name-upload" class="customer-add-input-label txt-regular upload-input-label">To
                  Weight</label>
                <input type="text" id="addpro_cat" name="pri_dis" placeholder="Enter Weight" value=""
                  class="customer-add-input to_weight_input  w-100" />
              </div>



            </div>
            <div class="modal-footer mf">
              <button type="button"  class="btn btn-primary addsubpackages">
                <img src="../public/image/tick (1).png" alt="" />
              </button>
            </div>
          </div>
        </div>
      </div>
    </form>
    <!-- sub add packages  modal end -->
    <!-- sub edit modal start -->
    <form class="childcatagories_modal_from" id="modal-form" action="">
      <div class="modal fade" id="edit_package_sub_id" tabindex="-1" role="dialog"
        aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
          <div class="modal-content">
            <div class="modal-header mh">
              <button type="button" class="close closmodel" data-dismiss="modal" aria-label="Close"
                onclick="colsemodel()">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body mb">
              <div>
                <div class="cat-folder-img">
                  <i class="fa fa-folder" aria-hidden="true"></i>
                </div>
              </div>
              <div class="form-group">
                <label for="cat-name-upload" class="customer-add-input-label txt-regular upload-input-label">Packges
                  Name</label>
                <input type="text" id="addpro_cat" name="addpro_cat" placeholder="Enter packges Name" value=""
                  class="customer-add-input edit_packages_name w-100" />
              </div>
              <div class="form-group">
                <label for="cat-name-upload" class="customer-add-input-label txt-regular upload-input-label">Delivery
                  Days</label>
                <input type="text" id="addpro_cat" name="pri_dis" placeholder="Enter Delivery Days" value=""
                  class="customer-add-input edit_packages_delivery_days w-100" />
              </div>



            </div>
            <div class="modal-footer mf">
              <button type="button"  class="btn btn-primary update_packgages_data">
                <img src="../public/image/tick (1).png" alt="" />
              </button>
            </div>
          </div>
        </div>
      </div>
    </form>
    <!-- sub edit modal start -->
    <!-- sub edit packages  modal start -->
    <form class="childcatagories_modal_from" id="modal-form" action="">
      <div class="modal fade" id="sub_child_packages_modal_form_id" tabindex="-1" role="dialog"
        aria-labelledby="exampleModalCenterTitle" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered" role="document">
          <div class="modal-content">
            <div class="modal-header mh">
              <button type="button" class="close closmodel" data-dismiss="modal" aria-label="Close"
                onclick="colsemodel()">
                <span aria-hidden="true">&times;</span>
              </button>
            </div>
            <div class="modal-body mb">
              <div>
                <div class="cat-folder-img">
                  <i class="fa fa-folder" aria-hidden="true"></i>
                </div>
              </div>
              <div class="form-group">
                <label for="cat-name-upload"
                  class="customer-add-input-label txt-regular upload-input-label">Price</label>
                <input type="text" id="addpro_cat" name="addpro_cat" placeholder="Enter Price" value=""
                  class="customer-add-input edit_packges_meta_price w-100" />
              </div>
              <div class="form-group">
                <label for="cat-name-upload" class="customer-add-input-label txt-regular upload-input-label">Form
                  Weight</label>
                <input type="text" id="addpro_cat" name="pri_dis" placeholder="Enter Weight" value=""
                  class="customer-add-input edit_packges_meta_from_weight  w-100" />
              </div>
              <div class="form-group">
                <label for="cat-name-upload" class="customer-add-input-label txt-regular upload-input-label">To
                  Weight</label>
                <input type="text" id="addpro_cat" name="pri_dis" placeholder="Enter Weight" value=""
                  class="customer-add-input edit_packges_meta_to_weight  w-100" />
              </div>



            </div>
            <div class="modal-footer mf">
              <button type="button" onclick="" class="btn btn-primary update_packges_meta">
                <img src="../public/image/tick (1).png" alt="" />
              </button>
            </div>
          </div>
        </div>
      </div>
    </form>
    <!-- sub edit packages  modal end -->

    <!-- Bootstrap core JavaScript -->
    <script src="../vendor/jquery/jquery.min.js"></script>
    <script src="../vendor/bootstrap/js/bootstrap.bundle.min.js"></script>
    <script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
    <script src="../public/js/customjs.js"></script>

    <!-- Menu Toggle Script -->
    <script>
      $("#menu-toggle").click(function (e) {
        e.preventDefault();
        $("#wrapper").toggleClass("toggled");
      });

      $('.list_ship_active').addClass('active');
    </script>


    <script>
      $(document).ready(function () {
        retrieveAllShipping(1);

        function retrieveAllShipping(page) {
          sendRequest("?action_type=retrieve&request_type=shipping&functionality_type=retrieve_all_shipping", {
              page: page

            }, "POST")
            .then((data) => {

              // console.log(data);
              var data = JSON.parse(data);
              // console.log("hello : " + data.code);
              if (data.code == "202") {
                $("#paginate").html(data.htmlData);
                $("#shipping-table-body").empty();
                var list = data.listOfData;

                for (var i = 0; i < list.length; i++) {


                  // console.log("Data  Id = " + list[i].id + " Name = " + list[i].logo + " enable = " + list[i].name);
                  var n = list[i].id;
                  var logo = list[i].logo;
                  var name = list[i].name;
                  var estimate_days = list[i].estimated_delivery_days;
                  var cur_symbol = list[i].currency_symbol;
                  var cur_code = list[i].currency_code;
                  var type = list[i].type;


                    var enable = list[i].enable;
                  var checked = "";
                  if (enable == 0) {

                    checked = "value='0'";
                  } else {

                    checked = "value='1'  checked";
                  }



                  var text = '<tr id="shipping-row-'+n+'">' +
                    '<td><img src="' + logo + '" alt=""></td>' +
                    '<td><span>' + name + '</span>' +
                    '</td>' +
                    '<td>' + estimate_days + '</td>' +
                      '<td>' + type + '</td>' +
                    '<td>' + cur_code + '</td>' +
                    '<td>' + cur_symbol + '</td>' +
                    '<td>' +
                    '<div class="">' +
                    '<button type="button" data-toggle="modal" data-id="' + n +
                    '" data-target=""' +
                    'class="btn btn-outline-white2 btn-rounded btn-sm package_modal_open">' +
                    '<i class="fas fa-plus fa-plus2"></i>' +
                    '</button>' +
                    '<button data-toggle="modal" data-id-edit="' + n +'" data-target="" ' +
                    'type="button" class="btn btn-outline-white2 btn-rounded btn-sm shipping_edit_data">' +
                    '<i class="fas fa-pencil-alt fa-pencil-alt2 mt-0"></i>' +
                    '</button>' +
                    '<button type="button" onclick="deleteshipping(' + n +
                    ')" class="btn btn-outline-white2 btn-rounded btn-sm">' +
                    '<i class="far fa-trash-alt fa-trash-alt2 mt-0"></i>' +
                    '</button>' +

                    '</div>' +
                    '</td>' +
                    '<td>' +
                    '<label class="switch">' +
                    '<input type="checkbox" data-id="'+n+'" id="enable-switch-'+n+'"  class="shipping_switch" '+ checked + '>' +
                    '<span class="slider round"></span>' +
                    '</label>' +

                    '</td>' +
                    '<td>' +
                    '<button type="button"' +
                    'class="btn ml-3 accordion-toggle btn-outline-white2 text-center btn-rounded btn-sm"' +
                    'id="accordion1" onclick="getpackages(' + n +
                    ')" data-toggle="collapse" data-parent="#shipping_colpse_' + n + '" href="#shipping_colpse_' +
                    n + '"' +
                    'aria-expanded="true">' +
                    '<span class="expand-button"></span>' +
                    '</button>' +
                    '</td>' +
                    '</tr>' +
                    '<tr>' +
                    '<td colspan="11" class="hiddenRow">' +
                    '<div class="accordian-body collapse" id="shipping_colpse_' + n + '">' +

                    '<div class="row table_image_row">' +
                    '<div class="col-xl-12">' +
                    '<table class="table table-shipping-weight">' +
                    ' <thead>' +
                    '<tr>' +

                    '<th scope="col">Name</th>' +

                    '<th scope="col">Delivery Days</th>' +

                    '<th scope="col">Action</th>' +


                    '</tr>' +
                    '</thead>' +
                    '<tbody id="shipping-packages-' + n + '">' +
                    '<tr>' +

                    '<td>price</td>' +

                    '<td>1 grams</td>' +

                    '<td>' +
                    '<div class="">' +
                    '<button type="button" data-toggle="modal"' +
                    'data-target=""' +
                    'class="btn btn-outline-white2 btn-rounded btn-sm subpackages_open">' +
                    '<i class="fas fa-plus fa-plus2"></i>' +
                    '</button>' +
                    '<button data-toggle="modal" data-target="#edit_package_sub_id"' +
                    'id="payment_editmodal" type="button"' +
                    'class="btn btn-outline-white2 btn-rounded btn-sm">' +
                    '<i class="fas fa-pencil-alt fa-pencil-alt2 mt-0"></i>' +
                    '</button>' +
                    '<button id="accordion2" data-toggle="collapse" data-parent="#accordion2"' +
                    'href="#collapsetwo" type="button"' +
                    'class="btn ml-3 btn-outline-white2 accordion-toggle btn-rounded btn-sm"' +
                    'aria-expanded="true">' +
                    '<span class="expand2-button"></span>' +
                    '</button>' +

                    '</div>' +
                    '</td>' +


                    '</tr>' +
                    '<tr>' +
                    '<td colspan="11" class="hiddenRow">' +
                    '<div class="accordian-body collapse" id="collapsetwo">' +

                    '<div class="row table_image_row">' +
                    '<div class="col-xl-12">' +
                    '<table class="table table-shipping-weight">' +
                    '<thead>' +
                    '<tr>' +

                    '<th scope="col">Price</th>' +

                    '<th scope="col">From Weight</th>' +
                    '<th scope="col">To Weight</th>' +
                    '<th scope="col">Action</th>' +


                    '</tr>' +
                    '</thead>' +
                    '<tbody>' +
                    '<tr>' +

                    '<td>price</td>' +

                    '<td>1 grams</td>' +
                    '<td>500 grams</td>' +
                    '<td>' +
                    '<div class="">' +

                    '<button data-toggle="modal"' +
                    'data-target=""' +
                    'id="payment_editmodal" type="button"' +
                    'class="btn btn-outline-white2 btn-rounded btn-sm packages_meta_edit">' +
                    '<i class="fas fa-pencil-alt fa-pencil-alt2 mt-0"></i>' +
                    '</button>' +

                    '</div>' +
                    '</td>' +

                    '</tr>' +


                    '</tbody>' +
                    '</table>' +
                    '</div>' +

                    '</div>' +

                    '</div>' +
                    '</td>' +
                    '</tr>' +
                    '</tbody>' +
                    '</table>' +
                    '</div>' +

                    '</div>' +

                    '</div>' +
                    '</td>' +
                    '</tr>';
                  $("#shipping-table-body").append(text);
                  // if (enable == '0') {
                  //   $("#remove-child-card-" + n).attr("class", "cat-card");
                  //   // $("#category-status-" + n).val(0);

                  // } else {
                  //   $("#remove-child-card-" + n).attr("class", "disable_outline");
                  //   // $("#category-status-" + subcategory_id).val(1);
                  // }



                }



              }
              else if (data.code == "206") {
                console.log("Failed to Delete");
              }



            })
            .catch((error) => {
              console.log(error)
            });
        }

        $(document).on('click','.add_shipping_list',function(){
            $(".image-upload-wrap4").show();
            $(".file-upload-content4").hide();

        });

        $(document).on('click', '.page-link', function () {
          var page = $(this).data('page_number');
          var query = $('#featured-search').val();
          $('#page-no').val(page);
          retrieveAllShipping(page);
        });

        $(document).on('click','.add_shipping',function (){
           var name = $(".shipping_name_input").val();
           var days =$(".deliery_days_input").val();
            var code =$(".currency_code_input").val();
            var symbol =$(".currecny_symbol_input").val();
            var img =$(".file-upload-image4").attr('src');
            var type =$(".type_input").val();


            sendRequest("?action_type=create&request_type=shipping&functionality_type=insert_shipping_data", {
                name: name,
                days: days,
                code: code,
                symbol: symbol,
                img :img,
                type:type,

            }, "POST")
                .then((data) => {
                    var data = JSON.parse(data);
                    if(data.code == "202"){
                        $("#add_payment_modal").modal('hide');
                        retrieveAllShipping(1);
                    }


                })
                .catch((error) => {
                    console.log(error)
                })

        });

        $(document).on('click', '.package_modal_open',function (){
            var s =$(this).data('id');
           $("#packages-id").val(s);
            $("#packages_modal_form_id").modal('show');

        });

        $(document).on('click','.add_packages',function (){
            var id=$('#packages-id').val();
              var name = $(".package_input_name").val();
              var days =$(".delivery_days_input").val();



              sendRequest("?action_type=create&request_type=shipping&functionality_type=insert_packages_data", {
                  id: id,
                  name: name,
                  days: days,


              }, "POST")
                  .then((data) => {
                      var data = JSON.parse(data);
                      if(data.code == "202"){
                          $("#packages_modal_form_id").modal('hide');
                          // retrieveAllShipping(1);
                      }


                  })
                  .catch((error) => {
                      console.log(error)
                  })

          });

        $(document).on('click', '.subpackages_open',function (){
              var s =$(this).data('id');
              $("#subpackages-id").val(s);
              $("#sub_packages_modal_form_id").modal('show');

        });

        $(document).on('click','.addsubpackages',function (){
              var id=$('#subpackages-id').val();
              var price = $(".price_input").val();
            var from = $(".from_input").val();
            var to_weight = $(".to_weight_input").val();




              sendRequest("?action_type=create&request_type=shipping&functionality_type=insert_sub_packages_data", {
                  id: id,
                  price: price,
                  from: from,
                  to_weight: to_weight,


              }, "POST")
                  .then((data) => {
                      var data = JSON.parse(data);
                      if(data.code == "202"){
                          $("#sub_packages_modal_form_id").modal('hide');
                          // retrieveAllShipping(1);
                      }


                  })
                  .catch((error) => {
                      console.log(error)
                  })

          });

        $(document).on('change','.shipping_switch',function (){

              var id=$(this).data('id');
            var enable_val;
              var from = $(".from_input").val();
              var to_weight = $(".to_weight_input").val();
            if ($("#enable-switch-"+id).is(':checked')) {
                $("#enable-switch-"+id).val(1);
                enable_val = "1";
            } else {
                $("#enable-switch-"+id).val(0);
                enable_val = "0";
            }




              sendRequest("?action_type=update&request_type=shipping&functionality_type=update_enable_data", {
                  id: id,
                  enable_val: enable_val,
              }, "POST")
                  .then((data) => {
                      var data = JSON.parse(data);
                      if(data.code == "202"){
                          // $("#sub_packages_modal_form_id").modal('hide');
                          // retrieveAllShipping(1);
                      }


                  })
                  .catch((error) => {
                      console.log(error)
                  })

          });

        $(document).on('click', '.shipping_edit_data',function (){
              var s =$(this).data('id-edit');

              $("#edit-shipping-data").val(s);



              sendRequest("?action_type=retrieve&request_type=shipping&functionality_type=retrive_update_shipping_data", {
                id: s
            }, "POST")
                .then((data) => {
                    var data = JSON.parse(data);
                    if(data.code == "202"){
                        var list = data.listOfData;
                        console.log("hello : "+list);
                        for (var i = 0; i < list.length; i++) {
                            var n = list[i].id;
                            var logo = list[i].logo;
                            var name = list[i].name;
                            var estimate_days = list[i].estimated_delivery_days;
                            var cur_symbol = list[i].currency_symbol;
                            var cur_code = list[i].currency_code;
                            var type = list[i].type;
                            $(".edit_ship_name").val(name);
                            $(".edit_currency_symbol").val(cur_symbol);
                            $(".edit_currency_code").val(cur_code);
                            $(".edit_delivery_days").val(estimate_days);
                            $(".edit_type").val(type);
                            $(".image-upload-wrap4").hide();
                            $(".file-upload-content4").show();
                            $(".file-upload-image4").attr('src',logo);


                        }



                        $("#add_payment_modal_edit").modal('show');



                    }


                })
                .catch((error) => {
                    console.log(error)
                })

          });

        $(document).on('click','.update_all_shipping_data',function (){
            var id = $("#edit-shipping-data").val();
              var name = $(".edit_ship_name").val();
              var days =$(".edit_delivery_days").val();
              var code =$(".edit_currency_code").val();
              var symbol =$(".edit_currency_symbol").val();
              var img =$(".file-upload-image4").attr('src');
              var type =$(".edit_type").val();


              sendRequest("?action_type=update&request_type=shipping&functionality_type=update_shipping_data", {
                  id:id,
                  name: name,
                  days: days,
                  code: code,
                  symbol: symbol,
                  img :img,
                  type:type,

              }, "POST")
                  .then((data) => {
                      var data = JSON.parse(data);
                      if(data.code == "202"){
                          $("#add_payment_modal_edit").modal('hide');
                          retrieveAllShipping(1);
                      }


                  })
                  .catch((error) => {
                      console.log(error)
                  })

          });

        $(document).on('click', '#ship-packages',function (){
              var s =$(this).data('id');

              $("#edit-sub-shipping-data").val(s);



              sendRequest("?action_type=retrieve&request_type=shipping&functionality_type=retrive_update_shipping_packages_data", {
                  id: s
              }, "POST")
                  .then((data) => {
                      var data = JSON.parse(data);
                      if(data.code == "202"){
                          var list = data.listOfData;
                          console.log("hello : "+list);
                          for (var i = 0; i < list.length; i++) {
                              var n = list[i].id;
                              var name = list[i].name;
                              var days = list[i].days;

                              $(".edit_packages_name").val(name);
                              $(".edit_packages_delivery_days").val(days);
                          }

                          $("#edit_package_sub_id").modal('show');
                      }

                  })
                  .catch((error) => {
                      console.log(error)
                  })

          });

        $(document).on('click','.update_packgages_data',function (){
           var name= $(".edit_packages_name").val();
            var days= $(".edit_packages_delivery_days").val();
              var id = $("#edit-sub-shipping-data").val();



              sendRequest("?action_type=update&request_type=shipping&functionality_type=update_shipping_packges_data", {
                  id:id,
                  name: name,
                  days: days,


              }, "POST")
                  .then((data) => {
                      var data = JSON.parse(data);
                      if(data.code == "202"){
                          $("#edit_package_sub_id").modal('hide');
                          retrieveAllShipping(1);
                      }


                  })
                  .catch((error) => {
                      console.log(error)
                  })

          });

        $(document).on('click', '.packages_meta_edit',function (){
              var s =$(this).data('id');
              // alert(s);

              $("#edit-sub-meta-shipping-data").val(s);



              sendRequest("?action_type=retrieve&request_type=shipping&functionality_type=retrive_update_shipping_packages_meta_data", {
                  id: s
              }, "POST")
                  .then((data) => {
                      var data = JSON.parse(data);
                      if(data.code == "202"){
                          var list = data.listOfData;
                          console.log("hello : "+list);
                          for (var i = 0; i < list.length; i++) {
                              var n = list[i].id;
                              var price = list[i].price;
                              var from_weight = list[i].from_weight;
                              var to_weight = list[i].to_weight;


                              $(".edit_packges_meta_price").val(price);
                              $(".edit_packges_meta_from_weight").val(from_weight);
                              $(".edit_packges_meta_to_weight").val(to_weight);

                          }

                          $("#sub_child_packages_modal_form_id").modal('show');
                      }

                  })
                  .catch((error) => {
                      console.log(error)
                  })
          });

        $(document).on('click','.update_packges_meta',function (){
            var id =  $("#edit-sub-meta-shipping-data").val();
            var price = $(".edit_packges_meta_price").val();
           var from_weight = $(".edit_packges_meta_from_weight").val();
           var to_weight = $(".edit_packges_meta_to_weight").val();



              sendRequest("?action_type=update&request_type=shipping&functionality_type=update_shipping_packges_meta_data", {
                  id:id,
                  price: price,
                  from_weight: from_weight,
                  to_weight: to_weight,



              }, "POST")
                  .then((data) => {
                      var data = JSON.parse(data);
                      if(data.code == "202"){
                          $("#sub_child_packages_modal_form_id").modal('hide');
                          retrieveAllShipping(1);
                      }


                  })
                  .catch((error) => {
                      console.log(error)
                  })

          });
          // update_packges_meta



      });

      function getpackages(id) {
        var shipping_id = id;

        sendRequest("?action_type=retrieve&request_type=shipping&functionality_type=retrieve_shipping_packages", {
            id: shipping_id

          }, "POST")
          .then((data) => {
            var data = JSON.parse(data);
            // alert(data.code)
            if (data.code == "202") {
              // $("#paginate").html(data.htmlData);
              $("#shipping-packages-" + shipping_id).empty();
              var list = data.listOfData;


              for (var i = 0; i < list.length; i++) {


                // console.log("Data  Id = " + list[i].id + " Name = " + list[i].logo + " enable = " + list[i].name);
                var n = list[i].id;
                var name = list[i].name;
                var d_days = list[i].d_days;




                var text = '<tr id="shipping-packages-id-'+n+'">' +

                  '<td>' + name + '</td>' +

                  '<td>' + d_days + '</td>' +

                  '<td>' +
                  '<div class="">' +
                  '<button type="button" data-id="' + n + '" data-toggle="modal"' +
                  'data-target=""' +
                  'class="btn btn-outline-white2 btn-rounded btn-sm subpackages_open">' +
                  '<i class="fas fa-plus fa-plus2"></i>' +
                  '</button>' +
                  '<button data-toggle="modal" data-id="' + n + '" data-target=""' +
                  'id="ship-packages" type="button"' +
                  'class="btn btn-outline-white2 btn-rounded btn-sm">' +
                  '<i class="fas fa-pencil-alt fa-pencil-alt2 mt-0"></i>' +
                  '</button>' +
                    '<button type="button" onclick="deleteshippingpackages(' + n + ')" class="btn btn-outline-white2 btn-rounded btn-sm"><i class="far fa-trash-alt fa-trash-alt2 mt-0"></i></button>'+
                  '<button id="accordion2" data-toggle="collapse" onclick="getpackgesmeta(' + n +
                  ')" data-parent="#accordion2"' +
                  'href="#packages_collapse_' + n + '" type="button"' +
                  'class="btn ml-3 btn-outline-white2 accordion-toggle btn-rounded btn-sm"' +
                  'aria-expanded="true">' +
                  '<span class="expand2-button"></span>' +
                  '</button>' +

                  '</div>' +
                  '</td>' +


                  '</tr>' +
                  '<tr>' +
                  '<td colspan="11" class="hiddenRow">' +
                  '<div class="accordian-body collapse" id="packages_collapse_' + n + '">' +

                  '<div class="row table_image_row">' +
                  '<div class="col-xl-12">' +
                  '<table class="table table-shipping-weight">' +
                  '<thead>' +
                  '<tr>' +

                  '<th scope="col">Price</th>' +

                  '<th scope="col">From Weight</th>' +
                  '<th scope="col">To Weight</th>' +
                  '<th scope="col">Action</th>' +


                  '</tr>' +
                  '</thead>' +
                  '<tbody id="shipping-packages-meta-'+n+'" >' +
                  '<tr>' +

                  '<td>price</td>' +

                  '<td>1 grams</td>' +
                  '<td>500 grams</td>' +
                  '<td>' +
                  '<div class="">' +

                  '<button data-toggle="modal"' +
                  'data-target=""' +
                  'id="payment_editmodal" type="button"' +
                  'class="btn btn-outline-white2 btn-rounded btn-sm packages_meta_edit">' +
                  '<i class="fas fa-pencil-alt fa-pencil-alt2 mt-0"></i>' +
                  '</button>' +

                  '</div>' +
                  '</td>' +

                  '</tr>' +


                  '</tbody>' +
                  '</table>' +
                  '</div>' +

                  '</div>' +

                  '</div>' +
                  '</td>' +
                  '</tr>';

                $("#shipping-packages-" + shipping_id).append(text);
                // if (enable == '0') {
                //   $("#remove-child-card-" + n).attr("class", "cat-card");
                //   // $("#category-status-" + n).val(0);

                // } else {
                //   $("#remove-child-card-" + n).attr("class", "disable_outline");
                //   // $("#category-status-" + subcategory_id).val(1);
                // }



              }



            } else if (data.code == "206") {
              console.log("Failed to Delete");
            }

          })
          .catch((error) => {
            console.log(error)
          })
      }

      function getpackgesmeta(id) {
        var shipping_id = id;

        sendRequest("?action_type=retrieve&request_type=shipping&functionality_type=retrieve_shipping_packages_meta", {
            id: shipping_id

          }, "POST")
          .then((data) => {
            var data = JSON.parse(data);
            // alert(data.code)
            if (data.code == "202") {
              // $("#paginate").html(data.htmlData);
              $("#shipping-packages-meta-"+shipping_id).empty();
              var list = data.listOfData;


              for (var i = 0; i < list.length; i++) {


                // console.log("Data  Id = " + list[i].id + " Name = " + list[i].logo + " enable = " + list[i].name);
                var n = list[i].id;
                var price = list[i].price;
                var from_weight = list[i].from_weight;
                var to_weight = list[i].to_weight;





                var text = '<tr id="meta-packges-id-'+n+'">' +

                  '<td>'+price+'</td>' +

                  '<td>'+from_weight+'</td>' +
                  '<td>'+to_weight+'</td>' +
                  '<td>' +
                  '<div class="">' +

                  '<button data-toggle="modal"' +
                  'data-target=""' +
                  'id="payment_editmodal" data-id="'+n+'" type="button"' +
                  'class="btn btn-outline-white2 btn-rounded btn-sm packages_meta_edit">' +
                  '<i class="fas fa-pencil-alt fa-pencil-alt2 mt-0"></i>' +
                  '</button>' +
                    '<button type="button" onclick="deleteshippingpackagesmeta('+n+')" class="btn btn-outline-white2 btn-rounded btn-sm"><i class="far fa-trash-alt fa-trash-alt2 mt-0"></i></button>'+

                  '</div>' +
                  '</td>' +

                  '</tr>';


                  

                $("#shipping-packages-meta-"+shipping_id).append(text);
                // if (enable == '0') {
                //   $("#remove-child-card-" + n).attr("class", "cat-card");
                //   // $("#category-status-" + n).val(0);

                // } else {
                //   $("#remove-child-card-" + n).attr("class", "disable_outline");
                //   // $("#category-status-" + subcategory_id).val(1);
                // }



              }



            } else if (data.code == "206") {
              console.log("Failed to Delete");
            }

          })
          .catch((error) => {
            console.log(error)
          })
      }

      function deleteshipping(id){
          var del_id =id;

          sendRequest("?action_type=delete&request_type=shipping&functionality_type=delete_shipping_data", {
              id:del_id,




          }, "POST")
              .then((data) => {
                  var data = JSON.parse(data);
                  if(data.code == "202"){
                      $("#shipping-row-"+del_id).remove();

                      // $("#sub_child_packages_modal_form_id").modal('hide');
                      // retrieveAllShipping(1);
                  }


              })
              .catch((error) => {
                  console.log(error)
              })
      }

      function deleteshippingpackages(id){

          var del_id =id;

          sendRequest("?action_type=delete&request_type=shipping&functionality_type=delete_shipping_packages_data", {
              id:del_id,




          }, "POST")
              .then((data) => {
                  var data = JSON.parse(data);
                  if(data.code == "202"){
                      $("#shipping-packages-id-"+del_id).remove();

                      // $("#sub_child_packages_modal_form_id").modal('hide');
                      // retrieveAllShipping(1);
                  }


              })
              .catch((error) => {
                  console.log(error)
              })

      }
      
      function deleteshippingpackagesmeta(id) {

          var del_id =id;

          sendRequest("?action_type=delete&request_type=shipping&functionality_type=delete_shipping_packages_meta_data", {
              id:del_id,




          }, "POST")
              .then((data) => {
                  var data = JSON.parse(data);
                  if(data.code == "202"){
                      $("#meta-packges-id-"+del_id).remove();

                      // $("#sub_child_packages_modal_form_id").modal('hide');
                      // retrieveAllShipping(1);
                  }


              })
              .catch((error) => {
                  console.log(error)
              })


      }



    </script>

</body>

</html>