    <!-- Main Content -->
    <div class="hk-pg-wrapper">
			<!-- Container -->
            <div class="container-fluid mt-xl-50 mt-sm-30 mt-15">

            <div class="hk-pg-header mb-10">
                    <div>
						<h4 class="hk-pg-title"><span class="pg-title-icon"><span class="feather-icon"><svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-activity"><polyline points="22 12 18 12 15 21 9 3 6 12 2 12"></polyline></svg></span></span>Manage Invoices></h4>
                    </div>
					<div class="d-flex dropdown">
                    </div>
                </div>


				<div class="row">
          <div class="col-xl-12">
            <section class="hk-sec-wrapper">
              <h5 class="hk-sec-title">Data Table</h5>
              <p class="mb-40"></p>
                <div class="table-wrap">
                        <br/></br>
                  <div class="table-responsive">
                        <table id="orders-table" class="table dataTable no-footer">
                                        <thead>
                                            <tr>
                                                <th>Date Time</th>
                                                <th>No Invoice</th>
                                                <th>Customer Name</th>
                                                <th>Net Amount</th>
                                                <th>Paid Status</th>
                                                <th>Action</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                        </tbody>
                        </table>
                  </div>
                </div>

                    
                    <!--- Card Body END -->
          </section>
          </div>
        </div>
		


    </div>


    <script src="https://texapp.is3.cloudhost.id/api/v2/assets/vendors/sweetalert2/sweetalert2.min.js"></script>
  <script src="https://texapp.is3.cloudhost.id/api/v2/assets/vendors/promise-polyfill/polyfill.min.js"></script> 
<script type="text/javascript">


        $(document).ready(function () {

            
            var dataTable = $('#orders-table').DataTable({
                "processing": true,
                "serverSide": true,
                
                "ajax": {
                    "url": "<?php echo base_url('invoice/getData'); ?>",
                    "type": "POST",
                    "data": function(d){
                        d.length = $('#orders-table').DataTable().page.len();
                    }
                }
            });

            $('#apply_filter').click(function(){
                var customerName = $('#customer_name').val();
                var startDate = $('#start_date').val();
                var endDate = $('#end_date').val();

                dataTable.clear().draw();
                dataTable.ajax.url("<?php echo base_url('invoice/getData'); ?>").load({
                    customer_name: customerName,
                    startDate: startDate,
                    endDate: endDate
                });
            });

            $('#clear_filter').click(function(){
                $('#customer_name').val('');
                $('#start_date').val('');
                $('#end_date').val('');

                dataTable.clear().draw();
                dataTable.ajax.url("<?php echo base_url('invoice/getData'); ?>").load();
            });
            $('deleteBtn').on('click', function(e){
            e.preventDefault();
            var url = $(this).data('url');
            showSwal = function(type) {
                'use strict';
                    swal.fire({
                        text: 'Any fool can use a computer',
                        confirmButtonText: 'Close',
                        confirmButtonClass: 'btn btn-danger',
                    })


        }});
                
        });

        function contoh(e) {

var url = "<?php echo base_url('invoice/deleteOrder'); ?>?kode=" + e;
console.log(e);
const swalWithBootstrapButtons = Swal.mixin({
    customClass: {
      confirmButton: 'btn btn-success',
      cancelButton: 'btn btn-danger mr-2'
    },
    buttonsStyling: false,
  })
  
  swalWithBootstrapButtons.fire({
    title: 'Are you sure?',
    text: "You won't be able to revert this!",
    icon: 'warning',
    showCancelButton: true,
    confirmButtonClass: 'mr-2',
    confirmButtonText: 'Yes, delete it!',
    cancelButtonText: 'No, cancel!',
    reverseButtons: true
  }).then((result) => {
    if (result.value) {
        $.getJSON(url, function(data) {
           console.log(data);

           
         }),
      swalWithBootstrapButtons.fire(
        'Deleted!',
        'Your file has been deleted.',
        'success'
      )

      setTimeout(function() {
            location.reload();
        }, 2000);

    } else if (
      // Read more about handling dismissals
      result.dismiss === Swal.DismissReason.cancel
    ) {
      swalWithBootstrapButtons.fire(
        'Cancelled',
        'Your imaginary file is safe :)',
        'error'
      )
    }
  })
  

}

    </script>

            <!-- /Container -->



