IMMREX7

aku nok ndi : /home/spdtg/www/schoolmis/resources/views/schools/stock/
File Up :
aku nok ndi : /home/spdtg/www/schoolmis/resources/views/schools/stock/invoice_receipts.blade.php

@extends('schools.school_layout')
@section('content')
<div class="row clearfix">
    <div class="col-sm-12">
        <div class="card">
            <div class="header">
                <h2><strong>Select Which receipt you want to cancel</strong></h2>
            </div>
            <div class="body table-responsive">
                <table class="table table-bordered table-striped table-hover dataTable js-basic-example">
                    <thead>
                        <tr>
                            <th>S. No.</th>
                            <th>Payment Date</th>
                            <th>Invoice No.</th>
                            <th>Receipt No</th>
                            <th>Payment Mode</th>
                            <th>Paid Amount</th>
                            <th>Action</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $i = 1; ?>
                        @foreach($receipts as $var)
                        <tr>
                            <th scope="row">{{$i}}</th>
                            <td>{{$var->paymentDate}}</td>
                            <td>{{$var->invoiceNo}}</td>
                            <td>{{$var->receiptNo}}</td>
                            <td>{{$var->paymentMode}}</td>
                            <td>{{$var->paidAmount}}</td>
                            <td><button class="btn btn-raised btn-danger waves-effect btn-round js-sweetalert" data-id="{{$var->idInvoicePayment}}" data-type="confirm">CANCEL</button></td>
                        </tr>
                        <?php $i++; ?>
                        @endforeach
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
@stop
@section('script')
<script>
$(document).on('click', '.js-sweetalert', function (e) {
    $.ajaxSetup({
        headers: {
          'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });
    e.preventDefault();
    var id = $(this).data('id');
    swal({
            title: "Are you sure?",
            text: "Are You sure you want to delete this  Receipt!",
            type: "warning",
            showCancelButton: true,
            confirmButtonColor: "#DD6B55",
            confirmButtonText: "Yes, Cancel it!",
            closeOnConfirm: true
        },
        function() {
         //   console.log('here');
            $.ajax({
                type: "GET",
                url: "{{url('/school/invoices-payment/')}}" +"/"+id,
                data: {id:id}
                       
            })
            .done(function(data) {
                swal({
                    title: "Deleted", 
                    text: "Receipt has been successfully cancelled", 
                    type: "success"
                },function() {
                    location.reload();
                });
            })
            .error(function(data) {
              swal("Oops", "We couldn't connect to the server!", "error");
            });
            return false;
    });
});
</script>
@stop

Copyright © 2021 - 2025 IMMREX7