|
| 1 | +@extends('admin.layouts.app') |
| 2 | +@section('title', 'Category List') |
| 3 | +@section('content') |
| 4 | + <!-- Page header --> |
| 5 | + <div class="page-header d-print-none"> |
| 6 | + <div class="container-xl"> |
| 7 | + <div class="row g-2 align-items-center"> |
| 8 | + <div class="col"> |
| 9 | + <!-- Page pre-title --> |
| 10 | + {{-- <div class="page-pretitle"> |
| 11 | + Overview |
| 12 | + </div> --}} |
| 13 | + <h2 class="page-title"> |
| 14 | + Orders |
| 15 | + </h2> |
| 16 | + </div> |
| 17 | + <!-- Page title actions --> |
| 18 | + <div class="col-auto ms-auto d-print-none"> |
| 19 | + <div class="btn-list"> |
| 20 | + <a href="{{ route('admin.products.categories.create') }}" class="btn btn-primary"> |
| 21 | + <svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" |
| 22 | + viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" |
| 23 | + stroke-linecap="round" stroke-linejoin="round"> |
| 24 | + <path stroke="none" d="M0 0h24v24H0z" fill="none" /> |
| 25 | + <path d="M12 5l0 14" /> |
| 26 | + <path d="M5 12l14 0" /> |
| 27 | + </svg> |
| 28 | + Create new order |
| 29 | + </a> |
| 30 | + {{-- <button data-route="{{ route('admin.categories.bulk_delete') }}" type="button" id="bulk-delete-btn" class="btn btn-danger" disabled>Delete Selected</button> --}} |
| 31 | + </div> |
| 32 | + </div> |
| 33 | + </div> |
| 34 | + </div> |
| 35 | + </div> |
| 36 | + <div class="page-body"> |
| 37 | + <div class="container-xl"> |
| 38 | + <div class="row row-deck row-cards"> |
| 39 | + <div class="col-12"> |
| 40 | + <div class="card"> |
| 41 | + <div class="card-body border-bottom py-3"> |
| 42 | + |
| 43 | + <div class="d-flex"> |
| 44 | + <div class="text-secondary"> |
| 45 | + Show |
| 46 | + <div class="mx-2 d-inline-block"> |
| 47 | + <select name="limit" onchange="updateData(this)" data-route="{{ route('admin.orders.index') }}"> |
| 48 | + <option value="5" @selected((request()->limit ?? 10) == 5)>5</option> |
| 49 | + <option value="10" @selected((request()->limit ?? 10) == 10)>10</option> |
| 50 | + <option value="20" @selected((request()->limit ?? 10) == 20)>20</option> |
| 51 | + </select> |
| 52 | + </div> |
| 53 | + items |
| 54 | + </div> |
| 55 | + <div class="ms-auto text-secondary"> |
| 56 | + Search: |
| 57 | + <div class="ms-2 d-inline-block"> |
| 58 | + <form action=""> |
| 59 | + <input type="text" class="form-control form-control-sm" aria-label="Search Categories" name="q" value="{{ request()->q }}" placeholder="ID, Order No., Gateway...."> |
| 60 | + <input type="hidden" name="limit" id="limitInput" value="{{ request()->limit }}"> |
| 61 | + </form> |
| 62 | + </div> |
| 63 | + </div> |
| 64 | + </div> |
| 65 | + |
| 66 | + </div> |
| 67 | + <div class="table-responsive"> |
| 68 | + <table class="table card-table table-vcenter text-nowrap datatable"> |
| 69 | + <thead> |
| 70 | + <tr> |
| 71 | + <th class="w-1"><input class="form-check-input m-0 align-middle" id="select-all-items" type="checkbox" aria-label="Select all invoices"></th> |
| 72 | + <th class="w-1">ID |
| 73 | + <svg xmlns="http://www.w3.org/2000/svg" class="icon icon-sm icon-thick" width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M6 15l6 -6l6 6" /></svg> |
| 74 | + </th> |
| 75 | + <th>Order No.</th> |
| 76 | + {{-- <th>Trx ID</th> --}} |
| 77 | + <th>Currency</th> |
| 78 | + <th>Gateway</th> |
| 79 | + <th>Items</th> |
| 80 | + <th>Total</th> |
| 81 | + <th>Created at</th> |
| 82 | + <th></th> |
| 83 | + </tr> |
| 84 | + </thead> |
| 85 | + <tbody> |
| 86 | + @foreach ($orders as $order) |
| 87 | + <tr> |
| 88 | + <td><input class="form-check-input m-0 align-middle selected-item" type="checkbox" value="{{ $order->id }}" aria-label="Select invoice"></td> |
| 89 | + <td><span class="text-secondary">{{ $order->id }}</span></td> |
| 90 | + <td><a href="{{ route('admin.orders.show', $order->id) }}" class="text-reset" tabindex="-1">{{ $order->order_number }}</a></td> |
| 91 | + {{-- <td>{{ $order->transaction->transaction_id }}</td> --}} |
| 92 | + <td>{{ $order->currency }}</td> |
| 93 | + <td>{{ $order->payment_gateway }}</td> |
| 94 | + <td> |
| 95 | + <table class="table border"> |
| 96 | + <tbody> |
| 97 | + @foreach ($order->items as $item) |
| 98 | + <tr> |
| 99 | + <td class="border">{{ $item->quantity ?? 1 }} x {{ $item->product->title }}</td> |
| 100 | + <td class="border">{{ number_format($item->price ?? 0, 2) }}</td> |
| 101 | + </tr> |
| 102 | + @endforeach |
| 103 | + </tbody> |
| 104 | + </table> |
| 105 | + </td> |
| 106 | + <td>{{ $order->total }}</td> |
| 107 | + <td>{{ $order->created_at->diffForHumans() }}</td> |
| 108 | + <td class="text-end"> |
| 109 | + <span class="dropdown"> |
| 110 | + <button class="btn dropdown-toggle align-text-top" data-bs-boundary="viewport" data-bs-toggle="dropdown">Actions</button> |
| 111 | + <div class="dropdown-menu dropdown-menu-end"> |
| 112 | + <a class="dropdown-item" href="{{ route('admin.orders.edit', $order->id) }}"> |
| 113 | + Edit |
| 114 | + </a> |
| 115 | + <form onsubmit="return confirmDelete(event, this)" |
| 116 | + action="{{ route('admin.orders.destroy', $order->id) }}" |
| 117 | + method="post"> |
| 118 | + @csrf |
| 119 | + @method('delete') |
| 120 | + <button type="submit" class="text-danger dropdown-item delete-btn">Delete</button> |
| 121 | + </form> |
| 122 | + </div> |
| 123 | + </span> |
| 124 | + </td> |
| 125 | + </tr> |
| 126 | + @endforeach |
| 127 | + </tbody> |
| 128 | + </table> |
| 129 | + </div> |
| 130 | + <div class="card-footer"> |
| 131 | + {{ $orders->links('pagination::bootstrap-5') }} |
| 132 | + </div> |
| 133 | + </div> |
| 134 | + </div> |
| 135 | + </div> |
| 136 | + </div> |
| 137 | + </div> |
| 138 | +@endsection |
| 139 | + |
| 140 | + |
0 commit comments