IMMREX7
@extends('schools.school_layout')
@section('content')
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>Collection Report</strong></h2>
</div>
<div class="body">
{!! Form::open(['method' => 'GET', 'action' => ['School\Library\ReportController@collectionReport'],'class' => 'form-horizontal']) !!}
<div class="row clearfix">
<div class="col-sm-2 form-control-label required">
<label for="classname">Member Type</label>
</div>
<div class="col-sm-3">
<div class="form-group">
{!! Form::select('type',['student'=>'Student','employee'=>'Staff'],null,['class' => 'form-control show-tick ms','required'=>'required']) !!}
</div>
</div>
<div class="col-sm-2">
{!! Form::submit('SHOW',['class' => 'btn btn-raised btn-primary btn-round waves-effect']) !!}
{!!Form::close()!!}
</div>
</div>
</div>
</div>
</div>
</div>
@if(isset($type) && $type == 'student')
@if(count($data)>=1)
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>Collection Report</strong></h2>
</div>
<div class="body table-responsive">
<table class="table table-bordered table-striped table-hover js-basic-example dataTable">
<thead>
<tr>
<th>Receipt No</th>
<th>Date</th>
<th>Ec.No.</th>
<th>Accession No</th>
<th>Name</th>
<th>Father</th>
<th>Mobile</th>
<th>Class</th>
<th>Section</th>
<th>For</th>
<th>Payment Mode</th>
<th>Remarks</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@foreach($data as $var)
<tr>
<td>{{$var->receiptNo}}</td>
<td>{{$var->paymentDate}}</td>
<td>{{$var->ecNo}}</td>
<td>{{$var->accessionNo}}</td>
<td>{{$var->firstName}} {{$var->middleName}} {{$var->lastName}}</td>
<td>{{$var->father_fname}} {{$var->father_lname}}</td>
<td>{{$var->father_mobile}}</td>
<td>{{$var->className}}</td>
<td>{{$var->sectionName}}</td>
<td>{{$var->bookStatus}}</td>
<td>{{$var->paymentMode}}</td>
<td>{{$var->remarks}}</td>
<td>
<a href="{{url('school/libtrans/'.$var->memberType.'/'.$var->idLibraryTransaction.'/print')}}" target="_blank" class="btn btn-sm btn-success">Print Receipt</a>
<button class="btn btn-raised btn-danger waves-effect btn-round js-sweetalert" data-id="{{$var->idLibraryTransaction}}" data-type="confirm">CANCEL</button>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endif
@endif
@if(isset($type) && $type == 'employee')
@if(count($data)>=1)
<div class="row clearfix">
<div class="col-sm-12">
<div class="card">
<div class="header">
<h2><strong>Collection Report</strong></h2>
</div>
<div class="body table-responsive">
<table class="table table-bordered table-striped table-hover js-basic-example dataTable">
<thead>
<tr>
<th>Receipt No</th>
<th>Date</th>
<th>Ec.No.</th>
<th>Accession No</th>
<th>Name</th>
<th>Father</th>
<th>Mobile</th>
<th>Class</th>
<th>Section</th>
<th>For</th>
<th>Payment Mode</th>
<th>Remarks</th>
<th>Action</th>
</tr>
</thead>
<tbody>
@foreach($data as $var)
<tr>
<td>{{$var->receiptNo}}</td>
<td>{{$var->paymentDate}}</td>
<td>{{$var->ecNo}}</td>
<td>{{$var->accessionNo}}</td>
<td>{{$var->firstName}} {{$var->middleName}} {{$var->lastName}}</td>
<td>{{$var->father_fname}} {{$var->father_lname}}</td>
<td>{{$var->father_mobile}}</td>
<td>{{$var->className}}</td>
<td>{{$var->sectionName}}</td>
<td>{{$var->bookStatus}}</td>
<td>{{$var->paymentMode}}</td>
<td>{{$var->remarks}}</td>
<td>
<a href="{{url('school/libtrans/'.$var->memberType.'/'.$var->idLibraryTransaction.'/print')}}" target="_blank" class="btn btn-sm btn-success">Print Receipt</a>
</td>
</tr>
@endforeach
</tbody>
</table>
</div>
</div>
</div>
</div>
@endif
@endif
@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/libtrans/')}}" +"/"+ id +"/cancelreceipt",
})
.done(function(data) {
swal({
title: "Cancelled",
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 -