Viewing file: index.blade.php (4.33 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
@extends('layouts.admin')
@section('title') Transactions @endsection
@section('extra-css') <link rel="stylesheet" href="{{ asset('plugins/datatables-bs4/css/dataTables.bootstrap4.min.css') }}"> <link rel="stylesheet" href="{{ asset('plugins/datatables-responsive/css/responsive.bootstrap4.min.css') }}"> <style> #transaction_filter { display: none !important; } </style> @endsection
@section('content') <!-- Main content --> <section class="content"> <div class="row"> <div class="col-12"> <div class="card"> <div class="card-header"> <h2 class="card-title">@lang('Transaction List')</h2> <div class="float-right"> <div class="form-group"> <select class="form-control select_customer" multiple="multiple" name="customer_select" id="customer_select"> @if (isset($customers) && $customers) @foreach ($customers as $customer) <option value="{{ $customer->id }}">{{ $customer->full_name }}</option> @endforeach @endif </select> </div> </div> </div> <!-- /.card-header --> <div class="card-body table-body"> <table id="transaction" class="table table-striped table-bordered dt-responsive nowrap"> <thead> <tr> <th>@lang('Customer Name')</th> <th>@lang('Plan')</th> <th>@lang('admin.table.price')</th> <th>@lang('admin.table.transaction_id')</th> <th>@lang('Payment Type')</th> <th>@lang('admin.table.status')</th> </tr> </thead>
</table> </div> <!-- /.card-body --> </div> <!-- /.card --> </div> <!-- /.col --> </div> <!-- /.row --> </section> <!-- /.content --> @endsection
@section('extra-scripts') <script src="{{ asset('plugins/datatables/jquery.dataTables.min.js') }}"></script> <script src="{{ asset('plugins/datatables-bs4/js/dataTables.bootstrap4.min.js') }}"></script> <script src="{{ asset('plugins/datatables-responsive/js/dataTables.responsive.min.js') }}"></script> <script src="{{ asset('plugins/datatables-responsive/js/responsive.bootstrap4.min.js') }}"></script> <script> "use strict";
var transactions = $('#transaction').DataTable({ processing: true, serverSide: true, responsive: true, ajax: { url: "{{ route('admin.transaction.get.all') }}", type: 'GET', data: function(d) { let customer_ids = $('#customer_select').val(); d.customer_id = []; $.each(customer_ids, function(index, value) { d.customer_id[index] = value; }); } },
columns: [{ "data": "customer_name" }, { "data": "plan" }, { "data": "price" }, { "data": "transaction_id" }, { "data": "payment_type" }, { "data": "status" }, ] });
$(document).on('change', '#customer_select', function(e) { transactions.ajax.reload(); });
$('.select_customer').select2({ placeholder: "Search Customer", multiple: true, allowClear: false, tags: true, }) </script> @endsection
|