Update source into github
This commit is contained in:
@@ -0,0 +1,230 @@
|
||||
@extends("admin.main")
|
||||
@section("content")
|
||||
@if(auth()->guard('admins')->user()->can("add order"))
|
||||
<div class="card card-outline card-primary">
|
||||
<form action="{{ route('admin.order.store') }}" method="post">
|
||||
@csrf
|
||||
<div class="card-header p-0 border-bottom-0">
|
||||
<ul class="nav nav-tabs" id="custom-tabs-four-tab" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="pill"
|
||||
href="#detail" role="tab"
|
||||
aria-controls="detail" aria-selected="true">Customer Information</a>
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="pill"
|
||||
href="#product" role="tab"
|
||||
aria-controls="product" aria-selected="false">Product Service</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="tab-content" id="custom-tabs-four-tabContent">
|
||||
<div class="tab-pane fade active show"
|
||||
id="detail" role="tabpanel"
|
||||
aria-labelledby="detail">
|
||||
<div class="card-body">
|
||||
{{--Client User--}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="customer_id">Client User</label>
|
||||
<div class="col-md-8">
|
||||
<select class="form-control select2" name="customer_id" id="customer_id"
|
||||
style="width: 100%">
|
||||
@if($customer->count())
|
||||
@foreach($customer->all() as $item)
|
||||
<option value="{{ $item->id }}">
|
||||
{{ $item->firstname . ' ' . $item->lastname }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{--Payment Method--}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="payment_id">Payment Method</label>
|
||||
<div class="col-md-8">
|
||||
<select class="form-control" name="payment_id" id="payment_id">
|
||||
@if($payment->count())
|
||||
@foreach($payment->all() as $item)
|
||||
<option value="{{ $item->id }}">
|
||||
{{ $item->name }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{--Promotion Code--}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="discount_id">Promotion Code</label>
|
||||
<div class="col-md-8">
|
||||
<select class="form-control" name="discount_id" id="discount_id">
|
||||
<option value="">--------</option>
|
||||
@if($discount->count())
|
||||
@foreach($discount->all() as $item)
|
||||
<option value="{{ $item->id }}">
|
||||
{{ $item->code }}
|
||||
</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{--Orders Status--}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="status">Orders Status</label>
|
||||
<div class="col-md-8">
|
||||
<select class="form-control" name="status" id="status">
|
||||
<option value="0">Pending</option>
|
||||
<option value="1">Active</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{--Orders Action--}}
|
||||
<div class="form-group row">
|
||||
<label class="col-md-4" for="status">Orders Status</label>
|
||||
<div class="col-md-8 form-group row">
|
||||
<div class="col align-items-center d-flex">
|
||||
<label class="mr-2" for="Invoice">Create Invoice</label>
|
||||
<input type="checkbox" name="create_invoice" checked id="Invoice">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="tab-pane fade"
|
||||
id="product"
|
||||
role="tabpanel"
|
||||
aria-labelledby="product">
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="card-body append-new__product">
|
||||
<div class="box clients-summary__box p-4">
|
||||
{{--Product Type--}}
|
||||
<div class="row form-group">
|
||||
<label for="order_product_type" class="col-md-4">Product Type
|
||||
(*)</label>
|
||||
<div class="col-md-8">
|
||||
<select class="form-control order_product_type"
|
||||
data-append="product[0][product_id]"
|
||||
name="product[0][type]">
|
||||
<option value="0">-----------</option>
|
||||
@if($type->count())
|
||||
@foreach($type->all() as $item)
|
||||
<option value="{{ $item->id }}">{{ $item->name }}</option>
|
||||
@endforeach
|
||||
@endif
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{--Product--}}
|
||||
<div class="row form-group">
|
||||
<label for="product_id" class="col-md-4">Product (*)</label>
|
||||
<div class="col-md-8">
|
||||
<select class="form-control product_id"
|
||||
name="product[0][product_id]">
|
||||
<option value="0">-----------</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{--Domain--}}
|
||||
<div class="row form-group">
|
||||
<label for="Domain" class="col-md-4">Domain</label>
|
||||
<div class="col-md-8">
|
||||
<input type="text" class="form-control Domain"
|
||||
name="product[0][domain]"
|
||||
value="">
|
||||
</div>
|
||||
</div>
|
||||
{{--Billing Cycle--}}
|
||||
<div class="row form-group">
|
||||
<label for="billing" class="col-md-4">Billing Cycle (*)</label>
|
||||
<div class="col-md-8">
|
||||
<select class="form-control billing" name="product[0][billing]">
|
||||
<option value="0">Free</option>
|
||||
<option value="1">One Time</option>
|
||||
<option value="2" selected>Monthly</option>
|
||||
<option value="3">Quarterly</option>
|
||||
<option value="4">Semi-Annually</option>
|
||||
<option value="5">Annually</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
{{--Product Quantity--}}
|
||||
<div class="row form-group">
|
||||
<label for="quantity" class="col-md-4">Quantity (*)</label>
|
||||
<div class="col-md-8">
|
||||
<input type="number" class="form-control quantity"
|
||||
name="product[0][quantity]"
|
||||
value="1" min="1">
|
||||
</div>
|
||||
</div>
|
||||
{{--Product Price--}}
|
||||
<div class="row form-group">
|
||||
<label for="price_custom" class="col-md-4">Price Override</label>
|
||||
<div class="col-md-8">
|
||||
<input type="number" class="form-control price_custom"
|
||||
name="product[0][price_custom]" value="" min="1">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
<a href="javascript:void(0)"
|
||||
class="btn btn-outline-primary btn-add__newProduct">Add
|
||||
new Product</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="clients-summary__box">
|
||||
<h4 class="title">Order Summary</h4>
|
||||
<!--Box info-->
|
||||
<div class="summary__box">
|
||||
<table class="table table-borderless">
|
||||
<tbody class="append-element__js">
|
||||
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="tax">
|
||||
<td class="fs-20">VAT @ 10.00%</td>
|
||||
<td></td>
|
||||
<td class="text-right fs-20" id="tax_append">0đ</td>
|
||||
</tr>
|
||||
<tr class="total">
|
||||
<td class="fs-20">Total</td>
|
||||
<td></td>
|
||||
<td class="text-right fs-20" id="total_append">0đ</td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-footer text-right">
|
||||
<a href="{{ route('admin.order.index') }}" class="btn bg-gradient-secondary">Cancel</a>
|
||||
<button type="submit" class="btn bg-gradient-primary">Confirm Order</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-danger alert-dismissible">
|
||||
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Order
|
||||
management department</h5>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
@push('scripts')
|
||||
<script type="text/javascript">
|
||||
const apiGetProduct = '{{ route('api.getProduct') }}';
|
||||
const apiGetProductType = '{{route('api.getProductType')}}';
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,181 @@
|
||||
@php use Carbon\Carbon; @endphp
|
||||
@extends("admin.main")
|
||||
@section("content")
|
||||
@if(auth()->guard('admins')->user()->can("edit order"))
|
||||
<div class="card card-outline card-primary">
|
||||
<div class="card-body">
|
||||
<div class="row form-group">
|
||||
<table class="form" width="100%" border="0" cellspacing="2" cellpadding="3">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td class="fieldlabel">Date</td>
|
||||
<td class="fieldarea">{{ Carbon::parse($order->date)->format("d/m/Y H:i:s") }}</td>
|
||||
<td width="15%" class="fieldlabel">Payment Method</td>
|
||||
<td class="fieldarea">{{ $order->payment->name ?? 'VN Pay' }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td width="15%" class="fieldlabel">Order #</td>
|
||||
<td class="fieldarea">{{ $order->order_num }} (ID: {{$order->id}})</td>
|
||||
<td class="fieldlabel">Amount</td>
|
||||
<td class="fieldarea">@money($order->amount) đ</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">Client</td>
|
||||
<td class="fieldarea">
|
||||
<a href="{{ route('customer.info',['userid' => $order->customer->id]) }}">{{ $order->customer->firstname . ' ' . $order->customer->lastname }}</a>
|
||||
<br>
|
||||
{{ $order->customer->address }}
|
||||
</td>
|
||||
<td class="fieldlabel">Invoice #</td>
|
||||
<td class="fieldarea">{{ $order->invoice_id !== 0 ? $order->invoice_id : "No Invoice" }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="fieldlabel">Status</td>
|
||||
<td class="fieldarea">{!! App\Http\Helpers\Helper::OrderStatus($order->status) !!}</td>
|
||||
<td class="fieldlabel">IP Address</td>
|
||||
<td class="fieldarea">
|
||||
{{ $order->client_ip }}
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td class="fieldlabel">Order Placed By</td>
|
||||
<td class="fieldarea">
|
||||
@if($order->user)
|
||||
{{ $order->user->username }} (#ID: {{ $order->user->id }})
|
||||
<em>{{ $order->user->email }}</em>
|
||||
@endif
|
||||
</td>
|
||||
<td class="fieldlabel">Promotion Code</td>
|
||||
<td class="fieldarea">
|
||||
@if($order->discount)
|
||||
{{ $order->discount->code }}
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="row form-group">
|
||||
<div class="col-md-12">
|
||||
<h3 class="mb-3">Order Item</h3>
|
||||
<table class="table table-invoice table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Item</th>
|
||||
<th>Description</th>
|
||||
<th>Billing Cycle</th>
|
||||
<th>Amount</th>
|
||||
<th style="width: 40px">Status</th>
|
||||
<th>Payment Status</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($order->orderItem->isNotEmpty())
|
||||
@foreach($order->orderItem->all() as $item)
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
@if($item->type && in_array($item->Type->id,[3,4]))
|
||||
<a href="{{ route('customer.product',['userid' => $item->customer_id,'product' =>$item->relid,'type' => $item->type_id ]) }}">
|
||||
{{ $item->type->name }}
|
||||
</a>
|
||||
@else
|
||||
{{ $item->type->name }}
|
||||
@endif
|
||||
</td>
|
||||
<td>
|
||||
{{ $item->description }}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{ Helper::billing_cycle($item->billing) }}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@money($item->amount) đ
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if($item->status)
|
||||
{!! $item->status->getStatus() !!}
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
@if($order->invoice_id !== 0)
|
||||
{!! $order->invoice->getStatus() !!}
|
||||
@else
|
||||
No Invoice Due
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
@if( $order->status !== 1)
|
||||
<div class="row mt-2 form-group">
|
||||
<div class="col-md-12">
|
||||
<label class="box-input__checker">
|
||||
<span>Auto Create Product (Hosting/VPS)</span>
|
||||
<input type="checkbox" name="module_checker" checked="checked">
|
||||
<span class="checkmark"></span>
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
@endif
|
||||
</div>
|
||||
<div class="card-footer text-center">
|
||||
<form
|
||||
onclick=" {{ $order->status === 1 ? "return false;" : "" }}"
|
||||
class="d-lg-inline"
|
||||
action="{{ route('admin.order.update',['id' => $order->id,'action' => 'accept']) }}"
|
||||
method="post">
|
||||
@method('put')
|
||||
@csrf
|
||||
<input type="hidden" name="module" value="1">
|
||||
<button type="submit"
|
||||
class="btn {{ $order->status === 1 ? "disabled" : "" }} bg-gradient-success">
|
||||
<i class="far fa-check-circle"></i>
|
||||
Accept Order
|
||||
</button>
|
||||
</form>
|
||||
<form class="d-lg-inline"
|
||||
action="{{ route('admin.order.update',['id' => $order->id,'action' => 'cancel']) }}"
|
||||
method="post">
|
||||
@method('put')
|
||||
@csrf
|
||||
<button type="submit"
|
||||
class="btn bg-gradient-secondary">Cancel Order
|
||||
</button>
|
||||
</form>
|
||||
<form class="d-lg-inline" action="{{ route('admin.order.destroy',['id' => $order->id]) }}"
|
||||
method="post">
|
||||
@method('delete')
|
||||
@csrf
|
||||
<button type="submit"
|
||||
class="btn bg-gradient-danger">Delete Order
|
||||
</button>
|
||||
</form>
|
||||
<a href="{{ route('admin.order.index') }}" class="btn bg-gradient-secondary">
|
||||
Back
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-danger alert-dismissible">
|
||||
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Order
|
||||
management department</h5>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
@endsection
|
||||
@push("scripts")
|
||||
<script type="text/javascript">
|
||||
$('.box-input__checker span').click(function () {
|
||||
let inputModule = $('input[name="module"][type="hidden"]');
|
||||
$('input[name="module_checker"]').prop('checked') ?
|
||||
inputModule.val(0) :
|
||||
inputModule.val(1)
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
@@ -0,0 +1,200 @@
|
||||
@php use App\Http\Helpers\Helper; @endphp
|
||||
@extends("admin.main")
|
||||
@section("content")
|
||||
@if(auth()->guard('admins')->user()->can("manager order"))
|
||||
<div class="card card-primary card-outline">
|
||||
<div class="card-header">
|
||||
<form action="{{ route('admin.order.index') }}" method="get">
|
||||
<div class="row form-group mb-0">
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="inputName">
|
||||
Order ID </label>
|
||||
<input type="number" name="order_id" id="inputName" class="form-control"
|
||||
value="{{ request()->order_id ?? "" }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="order_num">
|
||||
Order Num</label>
|
||||
<input type="number" name="order_num" id="order_num" class="form-control"
|
||||
value="{{ request()->order_num ?? "" }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="order_amount">
|
||||
Amount</label>
|
||||
<input type="number" name="order_amount" id="order_amount" class="form-control"
|
||||
value="{{ request()->order_amount ?? "" }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="reservation">Date range:</label>
|
||||
<div class="input-group">
|
||||
<div class="input-group-prepend">
|
||||
<span class="input-group-text">
|
||||
<i class="far fa-calendar-alt"></i>
|
||||
</span>
|
||||
</div>
|
||||
<input type="text" class="form-control reservation float-right"
|
||||
name="order_date"
|
||||
value="{{ request()->order_date ?? "" }}"
|
||||
id="reservation">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="paymentStatus">
|
||||
Payment Status</label>
|
||||
<select name="payment_status" class="form-control" id="paymentStatus">
|
||||
<option value="full"
|
||||
@selected(request()->payment_status === "full")>
|
||||
Any
|
||||
</option>
|
||||
<option value="active"
|
||||
@selected(request()->payment_status === "active")>
|
||||
Paid
|
||||
</option>
|
||||
<option value="unpaid"
|
||||
@selected(request()->payment_status === "unpaid")>
|
||||
Unpaid
|
||||
</option>
|
||||
<option value="cancel"
|
||||
@selected(request()->payment_status === "cancel")>
|
||||
Cancel
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<x-form.customer :model="request()->get('client') ?? null"/>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="form-group">
|
||||
<label for="inputStatus">
|
||||
Status</label>
|
||||
<select name="status" class="form-control" id="inputStatus">
|
||||
<option value="full"
|
||||
@selected(request()->status === "full")>
|
||||
Any
|
||||
</option>
|
||||
<option value="active"
|
||||
@selected(request()->status === "active")>
|
||||
Active
|
||||
</option>
|
||||
<option value="pending"
|
||||
@selected(request()->status === "pending")>
|
||||
Pending
|
||||
</option>
|
||||
<option value="processing"
|
||||
@selected(request()->status === "processing")>
|
||||
Processing
|
||||
</option>
|
||||
<option value="cancel"
|
||||
@selected(request()->status === "cancel")>
|
||||
Cancel
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<label class="clear-search hidden">
|
||||
|
||||
</label>
|
||||
<button type="submit" class="form-control btn btn-block bg-gradient-primary">
|
||||
<i class="fas fa-search"></i> Search
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<span>{{ $orders->count() }} Records Found</span>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<table class="table table-invoice table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10px">
|
||||
<label for=""></label><input type="checkbox" name="check" class="check-all" id="">
|
||||
</th>
|
||||
<th>Order #</th>
|
||||
<th>Date</th>
|
||||
<th>Client Name</th>
|
||||
<th>Payment Method</th>
|
||||
<th>Total</th>
|
||||
<th>Payment Status</th>
|
||||
<th>Status</th>
|
||||
<th style="width: 40px"></th>
|
||||
<th style="width: 40px"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if($orders->count())
|
||||
@foreach($orders->all() as $item)
|
||||
<tr>
|
||||
<td class="text-center">
|
||||
<input type="checkbox" name="id[]" id="" value="{{ $item->id }}">
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a href="{{ route("admin.order.edit",['id' => $item->id]) }}"
|
||||
title="View Order"> {{ $item->order_num }}</a>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@time($item->date)
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{ $item->customer->firstname . ' ' . $item->customer->lastname }}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{ $item->Payment->name ?? 'VN Pay' }}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{{ number_format($item->amount,0,',','.') }}đ
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if ($item->invoice_id !== 0)
|
||||
{!! $item->invoice->getStatus() !!}
|
||||
@endif
|
||||
</td>
|
||||
<td class="text-center">
|
||||
{!! Helper::OrderStatus($item->status) !!}
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<a class="btn btn-warning btn-sm"
|
||||
href="{{ route('admin.order.edit',['id' => $item->id ]) }}">
|
||||
<i class="fas fa-search"></i>
|
||||
</a>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
@if(auth()->guard('admins')->user()->can("delete order"))
|
||||
<form method="post" class="d-inline"
|
||||
action="{{ route('admin.order.destroy',['order' => $item->id]) }}">
|
||||
@csrf
|
||||
@method('delete')
|
||||
<button type="submit" data-toggle="tooltip" data-placement="top" title=""
|
||||
class="btn btn-sm btn-danger" data-original-title="Xoá">
|
||||
<i class="fas fa-trash"></i>
|
||||
</button>
|
||||
</form>
|
||||
@endif
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
@endif
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="card-footer">
|
||||
{{ $orders->withQueryString()->links() }}
|
||||
</div>
|
||||
</div>
|
||||
@else
|
||||
<div class="alert alert-danger alert-dismissible">
|
||||
<h5 class="mb-0"><i class="icon fas fa-ban"></i> Access Denied - You are not assigned to any Order
|
||||
management department</h5>
|
||||
</div>
|
||||
@endif
|
||||
@endsection
|
||||
Reference in New Issue
Block a user