Viewing file: index.blade.php (16.02 KB) -rw-r--r-- Select action/file-type: (+) | (+) | (+) | Code (+) | Session (+) | (+) | SDB (+) | (+) | (+) | (+) | (+) | (+) |
@extends('admin.layouts.app')
@section('title') {{ __('orders') }} @endsection
@section('content') @php $user = auth()->user(); @endphp <div class=""> <div class="row"> <div class="col-md-12"> <div class="card"> <div class="card-header"> <div class="d-flex justify-content-between"> <h3 class="card-title line-height-36"> {{ __('orders') }} </h3> <div class="d-flex align-items-center gap-20px"> @if ($user->can('order.create')) <div> <a href="{{ route('order.create') }}" class="btn bg-primary"> <i class="fas fa-plus"></i> <span class="ml-2"> {{ __('Add New Order') }} </span> </a> </div> @endif @if (request('company') || request('provider') || request('plan') || request('sort_by')) <div> <a href="{{ route('order.index') }}" class="btn bg-danger"> <i class="fas fa-times"></i> {{ __('clear') }} </a> </div> @endif </div> </div> </div> <form id="filterForm" action="{{ route('order.index') }}" method="GET"> <div class="card-body border-bottom row"> <div class="col-xl-3 col-md-6 col-12"> <label>{{ __('customer') }}</label> <select name="customer" class="form-control select2bs4"> <option {{ request('customer') ? '' : 'selected' }} value="" selected> {{ __('all') }} </option> @foreach ($customers as $customer) <option {{ request('customer') == $customer->id ? 'selected' : '' }} value="{{ $customer->id }}"> {{ $customer->name }} </option> @endforeach </select> </div> <div class="col-xl-3 col-md-6 col-12"> <label>{{ __('payment_provider') }}</label> <select name="provider" id="filter" class="form-control select2bs4"> <option {{ request('provider') ? '' : 'selected' }} value="" selected> {{ __('all') }} </option> <option {{ request('provider') == 'paypal' ? 'selected' : '' }} value="paypal"> {{ __('paypal') }} </option> <option {{ request('provider') == 'stripe' ? 'selected' : '' }} value="stripe"> {{ __('stripe') }} </option> <option {{ request('provider') == 'razorpay' ? 'selected' : '' }} value="razorpay"> {{ __('razorpay') }} </option> <option {{ request('provider') == 'paystack' ? 'selected' : '' }} value="paystack"> {{ __('paystack') }} </option> <option {{ request('provider') == 'sslcommerz' ? 'selected' : '' }} value="sslcommerz"> {{ __('sslcommerz') }} </option> <option {{ request('provider') == 'instamojo' ? 'selected' : '' }} value="instamojo"> {{ __('instamojo') }} </option> <option {{ request('provider') == 'flutterwave' ? 'selected' : '' }} value="flutterwave"> {{ __('flutterwave') }} </option> <option {{ request('provider') == 'mollie' ? 'selected' : '' }} value="mollie"> {{ __('mollie') }} </option> <option {{ request('provider') == 'midtrans' ? 'selected' : '' }} value="midtrans"> {{ __('midtrans') }} </option> <option {{ request('provider') == 'offline' ? 'selected' : '' }} value="offline"> {{ __('offline') }} </option> </select> </div> <div class="col-xl-3 col-md-6 col-12"> <label>{{ __('plan') }}</label> <select name="plan" class="form-control select2bs4"> <option {{ request('plan') ? '' : 'selected' }} value="" selected> {{ __('all') }} </option> @foreach ($plans as $plan) <option {{ request('plan') == $plan->id ? 'selected' : '' }} value="{{ $plan->id }}"> {{ $plan->label }} </option> @endforeach </select> </div> <div class="col-xl-3 col-md-6 col-12"> <label>{{ __('sort_by') }}</label> <select name="sort_by" class="form-control select2bs4"> <option {{ !request('sort_by') || request('sort_by') == 'latest' ? 'selected' : '' }} value="latest" selected> {{ __('latest') }} </option> <option {{ request('sort_by') == 'oldest' ? 'selected' : '' }} value="oldest"> {{ __('oldest') }} </option> </select> </div> </div> </form> <div class="card-body text-center table-responsive p-0"> <table class="ll-table table table-hover text-nowrap"> <thead> <tr> <th>{{ __('order_no') }}</th> <th>{{ __('transaction_no') }}</th> <th>{{ __('plan_name') }}</th> <th>{{ __('payment_provider') }}</th> <th>{{ __('customer') }}</th> <th>{{ __('amount') }}($)</th> <th>{{ __('created_time') }}</th> <th>{{ __('payment_status') }}</th> <th width="10%">{{ __('action') }}</th> </tr> </thead> <tbody> @forelse ($transactions as $order) <tr> <td> #{{ $order->order_id }} </td> <td> {{ $order->transaction_id }} </td> <td> @if ($order->payment_type == 'per_job_based') <span class="badge badge-secondary"> {{ ucfirst(Str::replace('_', ' ', $order->payment_type)) }} </span> @else <span class="badge badge-primary">{{ $order->plan->label }}</span> @endif </td> <td> @if ($order->payment_provider == 'offline') Offline @if (isset($order->manualPayment) && isset($order->manualPayment->name)) (<b>{{ $order->manualPayment->name }}</b>) @endif @else {{ ucfirst($order->payment_provider) }} @endif </td> <td class="text-capitalize""> <a href=""> {{ $order->customer ? $order->customer->name : '-' }} </a> </td> <td> {{ $order->currency_symbol }}{{ $order->amount }} (${{ $order->usd_amount }}) </td> <td class="text-muted"> {{ formatTime($order->created_at, 'M d, Y') }} </td> <td class="text-capitalize"> @if ($order->payment_status == 'paid') <span class="badge badge-pill bg-success">{{ __('paid') }}</span> @else <span class="badge badge-pill bg-warning">{{ __('unpaid') }}</span> <br> <a onclick="return confirm('{{ __('are_you_sure') }} ?')" href="{{ route('manual.payment.mark.paid', $order->id) }}">{{ __('mark_as_paid') }}</a> @endif </td> <td> <div class="d-flex"> <form action="{{ route('admin.transaction.invoice.download', $order->id) }}" method="POST" id="invoice_download_form"> @csrf <button type="submit" class="mr-1 btn btn-sm btn-info"> <i class="fas fa-download"></i> </button> </form> <a href="{{ route('order.show', $order->id) }}" class="mr-1 btn btn-sm bg-primary mr-1"> <i class="fas fa-eye"></i> </a> @if ($user->can('order.edit')) <a href="{{ route('order.edit', $order->id) }}" class="mr-1 btn btn-sm bg-secondary"> <i class="fas fa-pen"></i> </a> @endif @if ($user->can('order.delete')) <form action="{{ route('order.destroy', $order->id) }}" method="POST"> @csrf @method('DELETE') <button onclick="return confirm('{{ __('are_you_sure_want_to_delete_this_item') }}?');" type="submit" class="mr-1 btn btn-sm btn-danger"> <i class="fas fa-trash"></i> </button> </form> @endif </div> </td> </tr> @empty <tr> <td colspan="9"> <div class="empty py-5"> <x-not-found route="" message="{{ __('no_data_found') }}" /> </div> </td> </tr> @endforelse </tbody> </table> </div> @if ($transactions->total() > $transactions->count()) <div class="mt-3 d-flex justify-content-center">{{ $transactions->links() }}</div> @endif </div> </div> </div> </div> @endsection
@section('script') <script src="{{ asset('backend') }}/plugins/select2/js/select2.full.min.js"></script> <script> $('#filterForm').on('change', function() { $(this).submit(); })
$('.select2bs4').select2({ theme: 'bootstrap4' }) </script> @endsection
@section('style') <link rel="stylesheet" href="{{ asset('backend') }}/plugins/select2/css/select2.min.css"> <link rel="stylesheet" href="{{ asset('backend') }}/plugins/select2-bootstrap4-theme/select2-bootstrap4.min.css"> <style> .select2-container { width: 100% !important; } .select2-results__option[aria-selected=true] { display: none; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice { color: #fff; border: 1px solid #fff; background: #007bff; border-radius: 30px; }
.select2-container--bootstrap4 .select2-selection--multiple .select2-selection__choice__remove { color: #fff; } </style> @endsection
|