restore composer.json, add mysqli extension
This commit is contained in:
356
resources/views/dashboard/orders/archive.blade.php
Executable file
356
resources/views/dashboard/orders/archive.blade.php
Executable file
@@ -0,0 +1,356 @@
|
||||
@extends('dashboard.layouts.app')
|
||||
@section('title', 'В архиве - ')
|
||||
@section('speedbar')
|
||||
<div class="content-header row">
|
||||
<div class="content-header-left col-md-9 col-12 mb-2">
|
||||
<div class="row breadcrumbs-top">
|
||||
<div class="col-12">
|
||||
<h2 class="content-header-title float-left mb-0">В архиве</h2>
|
||||
<div class="breadcrumb-wrapper col-12">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item "><a href="{{ route('dashboard') }}">@lang('admin.home')</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item "><a href="{{ route('dashboard.orders') }}">@lang('admin.orders.title')</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">
|
||||
В архиве
|
||||
</li>
|
||||
{{-- <li class="breadcrumb-item active">Fixed Layout--}}
|
||||
{{-- </li>--}}
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
|
||||
|
||||
<div class="row" id="table-head">
|
||||
<div class="col-12">
|
||||
|
||||
<div class="card">
|
||||
|
||||
<div class="card-content">
|
||||
<form method="post" action="{{ route('dashboard.orders.mass_archived') }}">
|
||||
@csrf
|
||||
<div class="table ">
|
||||
<table class="table mb-0 ">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" width="50" class="text-right">
|
||||
<div class="form-group text-right">
|
||||
<fieldset class="checkbox">
|
||||
<div class="vs-checkbox-con vs-checkbox-primary">
|
||||
<input type="checkbox" name="order_id[]" class="change-check"
|
||||
id="select-all">
|
||||
<span class="vs-checkbox">
|
||||
<span class="vs-checkbox--check">
|
||||
<i class="vs-icon feather icon-check"></i>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</th>
|
||||
|
||||
<th scope="col" width="50">ID</th>
|
||||
<th scope="col">@lang('admin.orders.user')</th>
|
||||
<th scope="col">@lang('admin.orders.delivery_type')</th>
|
||||
<th scope="col">@lang('admin.orders.payment_system')</th>
|
||||
<th scope="col">@lang('admin.orders.status')</th>
|
||||
<th scope="col">@lang('admin.orders.date')</th>
|
||||
<th scope="col" class="text-right">@lang('admin.actions')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if(count($orders) == 0)
|
||||
<tr>
|
||||
<td class="text-center" colspan="7">
|
||||
@lang('admin.no_data')
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@foreach($orders as $order)
|
||||
<tr>
|
||||
<td class="text-right">
|
||||
<div class="form-group">
|
||||
<fieldset class="checkbox">
|
||||
<div class="vs-checkbox-con vs-checkbox-primary">
|
||||
<input type="checkbox" value="{{ $order->id }}" name="order_id[]" class="change-check"
|
||||
id="checkbox-{{ $loop->iteration }}">
|
||||
<span class="vs-checkbox">
|
||||
<span class="vs-checkbox--check">
|
||||
<i class="vs-icon feather icon-check"></i>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ $order->id }}
|
||||
</td>
|
||||
<td>
|
||||
+{{ $order->user->getPhone() }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if($order->type_delivery == 'delivery')
|
||||
Стандартная доставка
|
||||
@else
|
||||
Самовывоз из пункта выдачи
|
||||
@endif
|
||||
|
||||
@if($order->type == 'one_click')
|
||||
<br><span class="text-danger">(Купить в 1 клик)</span>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@switch($order->payment_status)
|
||||
@case('cancelled')
|
||||
Отменено
|
||||
@break
|
||||
@case('payed')
|
||||
Оплачено
|
||||
@break
|
||||
@case('waiting')
|
||||
Не оплачено
|
||||
@break
|
||||
@case('review')
|
||||
На рассмотрение
|
||||
@break;
|
||||
@endswitch
|
||||
|
||||
(
|
||||
@if($order->payment_type == 'cash')
|
||||
Наличный расчет
|
||||
@elseif($order->payment_type == 'credit')
|
||||
Кредит
|
||||
@else
|
||||
{{ $order->payment_type }}
|
||||
@endif
|
||||
)
|
||||
</td>
|
||||
|
||||
<td>
|
||||
|
||||
<div class="btn-group dropleft mr-1 mb-1">
|
||||
<button type="button" class="btn @if($order->status == 'delivered') btn-success @elseif($order->status == 'cancelled') btn-danger @elseif($order->status == 'processing') btn-primary @elseif($order->status == 'waiting') btn-warning @endif dropdown-toggle waves-effect waves-light" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
@switch($order->status)
|
||||
@case('processing')
|
||||
В обработке
|
||||
@break
|
||||
@case('collected')
|
||||
Собран
|
||||
@break
|
||||
@case('waiting_buyer')
|
||||
Ожидает покупателя
|
||||
@break
|
||||
@case('in_way')
|
||||
В пути
|
||||
@break
|
||||
@case('closed')
|
||||
Закрыт
|
||||
@break
|
||||
@case('cancelled')
|
||||
Отменен
|
||||
@break
|
||||
@case('replacement')
|
||||
Замена
|
||||
@break
|
||||
@endswitch
|
||||
</button>
|
||||
<div class="dropdown-menu" x-placement="left-start" style="position: absolute; transform: translate3d(-147px, 0px, 0px); top: 0px; left: 0px; will-change: transform;">
|
||||
|
||||
@if(!empty(auth()->user()->role->permissions['order_status']['processing'])|| !empty(auth()->user()->role->permissions['order_status']['cancelled']))
|
||||
<a class="dropdown-item @if($order->status == 'processing') disabled @endif" onclick="return confirm('Вы действительно хотите изменить статус')" href="{{ route('dashboard.orders.status', [$order->id, 'processing']) }}">
|
||||
В обработке
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if(!empty(auth()->user()->role->permissions['order_status']['processing']) || !empty(auth()->user()->role->permissions['order_status']['collected']))
|
||||
<a class="dropdown-item @if($order->status == 'collected') disabled @endif" onclick="return confirm('Вы действительно хотите изменить статус')" href="{{ route('dashboard.orders.status', [$order->id, 'collected']) }}">
|
||||
Собран
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if($order->type_delivery == 'pickup' && !empty(auth()->user()->role->permissions['order_status']['waiting_buyer']) || $order->type_delivery == 'pickup' && !empty(auth()->user()->role->permissions['order_status']['closed']) || $order->type_delivery == 'pickup' && !empty(auth()->user()->role->permissions['order_status']['collected']))
|
||||
<a class="dropdown-item @if($order->status == 'waiting_buyer') disabled @endif" onclick="return confirm('Вы действительно хотите изменить статус')" href="{{ route('dashboard.orders.status', [$order->id, 'waiting_buyer']) }}">
|
||||
Ожидает покупателя
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if($order->type_delivery == 'delivery' && !empty(auth()->user()->role->permissions['order_status']['in_way']) || $order->type_delivery == 'delivery' && !empty(auth()->user()->role->permissions['order_status']['closed']))
|
||||
<a class="dropdown-item @if($order->status == 'in_way') disabled @endif" onclick="return confirm('Вы действительно хотите изменить статус')" href="{{ route('dashboard.orders.status', [$order->id, 'in_way']) }}">
|
||||
В пути
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if(!empty(auth()->user()->role->permissions['order_status']['closed']))
|
||||
<a class="modal-comment dropdown-item @if($order->status == 'closed') disabled @endif" data-toggle="modal" data-target="#staticBackdrop" data-id="{{ $order->id }}" data-type="closed"> {{-- href="{{ route('dashboard.orders.status', [$order->id, 'cancelled']) }}"--}}
|
||||
Закрыт
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if(!empty(auth()->user()->role->permissions['order_status']['cancelled']))
|
||||
<a class="modal-comment dropdown-item @if($order->status == 'cancelled') disabled @endif" data-toggle="modal" data-target="#staticBackdrop" data-id="{{ $order->id }}" data-type="cancelled"> {{-- href="{{ route('dashboard.orders.status', [$order->id, 'cancelled']) }}"--}}
|
||||
Отменен
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if(!empty(auth()->user()->role->permissions['order_status']['replacement']) || !empty(auth()->user()->role->permissions['order_status']['closed']))
|
||||
<a class="modal-comment dropdown-item @if($order->status == 'replacement') disabled @endif" data-toggle="modal" data-target="#staticBackdrop" data-id="{{ $order->id }}" data-type="replacement"> {{--href="{{ route('dashboard.orders.status', [$order->id, 'replacement']) }}--}}
|
||||
Замена
|
||||
</a>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ date('H:i - d.m.Y', strtotime($order->created_at)) }}
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
{{-- @can('update', 'orders')--}}
|
||||
{{-- <a href="{{ route('dashboard.orders.edit', $order->id) }}" class="btn btn-info btn-icon btn-sm">--}}
|
||||
{{-- <i class="fa fa-edit"></i>--}}
|
||||
{{-- </a>--}}
|
||||
{{-- @endcan--}}
|
||||
@if(!empty(auth()->user()->role->permissions['orders']['print']))
|
||||
<a href="{{ route('dashboard.invoice_print', $order->id) }}" target="_blank" class="btn btn-success btn-icon btn-sm">
|
||||
<i class="fa fa-print"></i>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@can('view', 'orders')
|
||||
<a href="{{ route('dashboard.orders.view', $order->id) }}" class="btn btn-primary btn-icon btn-sm">
|
||||
<i class="fa fa-eye"></i>
|
||||
</a>
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card-footer" id="show-action">
|
||||
<button type="submit" name="action" value="unarchive" class="btn btn-secondary">
|
||||
<i class="feather icon-box"></i> Вывод
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ $orders->links('pagination::bootstrap-4') }}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('css')
|
||||
<link rel="stylesheet" type="text/css" href="/vendor/picker/daterangepicker.css" />
|
||||
|
||||
@endpush
|
||||
|
||||
@push('js')
|
||||
|
||||
<div class="modal fade" id="staticBackdrop" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="{{ route('dashboard.orders.comments_status') }}" method="post">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="staticBackdropLabel">Написать комментарий</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@csrf
|
||||
<input type="hidden" name="order_id" value="" id="id_order">
|
||||
<input type="hidden" name="type" value="" id="type_order">
|
||||
<textarea cols="3" class="form-control" name="comment"></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-success" data-dismiss="modal">Отменить</button>
|
||||
<button type="submit" class="btn btn-secondary">Изменить статус</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript" src="/vendor/picker/moment.min.js"></script>
|
||||
<script type="text/javascript" src="/vendor/picker/daterangepicker.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
$('input[name="datefilter"]').daterangepicker({
|
||||
autoUpdateInput: false,
|
||||
locale: {
|
||||
cancelLabel: 'Clear'
|
||||
}
|
||||
});
|
||||
|
||||
$('input[name="datefilter"]').on('apply.daterangepicker', function(ev, picker) {
|
||||
$('#from').val(picker.startDate.format('YYYY-MM-DD'));
|
||||
$('#to').val(picker.endDate.format('YYYY-MM-DD'));
|
||||
$(this).val(picker.startDate.format('MM/DD/YYYY') + ' - ' + picker.endDate.format('MM/DD/YYYY'));
|
||||
});
|
||||
|
||||
$('input[name="datefilter"]').on('cancel.daterangepicker', function(ev, picker) {
|
||||
$(this).val('');
|
||||
});
|
||||
|
||||
|
||||
$('.modal-comment').on('click', function (e) {
|
||||
var id = $(this).data('id');
|
||||
var type = $(this).data('type');
|
||||
|
||||
$('#type_order').val(type);
|
||||
$('#id_order').val(id);
|
||||
})
|
||||
|
||||
});
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// Listen for click on toggle checkbox
|
||||
$('#select-all').click(function(event) {
|
||||
if(this.checked) {
|
||||
// Iterate each checkbox
|
||||
$(':checkbox').each(function() {
|
||||
this.checked = true;
|
||||
});
|
||||
} else {
|
||||
$(':checkbox').each(function() {
|
||||
this.checked = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$("#show-action").hide();
|
||||
|
||||
$(".change-check").change(function () {
|
||||
$("#show-action").show();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
3
resources/views/dashboard/orders/components/index/css.blade.php
Executable file
3
resources/views/dashboard/orders/components/index/css.blade.php
Executable file
@@ -0,0 +1,3 @@
|
||||
@push('css')
|
||||
<link rel="stylesheet" type="text/css" href="/vendor/picker/daterangepicker.css" />
|
||||
@endpush
|
||||
189
resources/views/dashboard/orders/components/index/filter.blade.php
Executable file
189
resources/views/dashboard/orders/components/index/filter.blade.php
Executable file
@@ -0,0 +1,189 @@
|
||||
@if (!empty(auth()->user()->role->permissions['orders']['filter']))
|
||||
<div class="col-md-12">
|
||||
<div class="accordion" id="accordionExample">
|
||||
<div class="collapse-margin">
|
||||
<div class="card-header" id="headingOne" data-toggle="collapse" role="button" data-target="#collapseOne"
|
||||
aria-expanded="false" aria-controls="collapseOne">
|
||||
<span class="lead collapse-title">
|
||||
<i class="fa fa-filter"></i> @lang('admin.orders.Filter')
|
||||
</span>
|
||||
</div>
|
||||
|
||||
{{-- id, client_phone, status, payment_status, payment_type, client_type, delivery_type
|
||||
with_didox, with_installation --}}
|
||||
|
||||
<div id="collapseOne" class="collapse" aria-labelledby="headingOne" data-parent="#accordionExample">
|
||||
<div class="card-body">
|
||||
<form method="get" action="{{ route('dashboard.orders.filter') }}">
|
||||
<div class="form-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-12">
|
||||
<div class="form-group">
|
||||
<label for="id">@lang('admin.orders.Order ID')</label>
|
||||
<input type="number" id="id" class="form-control"
|
||||
value="{{ request()->get('id') }}" placeholder="@lang('admin.orders.Order ID')"
|
||||
name="id">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-12">
|
||||
<div class="form-group">
|
||||
<label for="client_phone">@lang('admin.orders.client_phone')</label>
|
||||
<input type="text" id="client_phone" class="form-control"
|
||||
value="{{ request()->get('client_phone') }}"
|
||||
placeholder="@lang('admin.orders.client_phone')" name="client_phone">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-12">
|
||||
<div class="form-group">
|
||||
<label for="order_status">@lang('admin.orders.Order status')</label>
|
||||
<select class="form-control" id="status" name="order_status">
|
||||
<option value="0" selected>@lang('admin.categories.Not selected')</option>
|
||||
@foreach (App\Models\Order::statuses() as $status)
|
||||
<option value="{{ $status }}"
|
||||
@if (request('order_status') == $status) selected @endif>
|
||||
@lang('admin.orders.statuses.' . $status)
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-12">
|
||||
<div class="form-group">
|
||||
<label for="payment_status">@lang('admin.orders.payment_status')</label>
|
||||
<select class="form-control" id="payment_status" name="payment_status">
|
||||
<option value="0" selected>@lang('admin.categories.Not selected')</option>
|
||||
@foreach (App\Models\Order::paymentStatuses() as $paymentStatus)
|
||||
<option value="{{ $paymentStatus }}"
|
||||
@if (request('payment_status') == $paymentStatus) selected @endif>
|
||||
@lang('admin.orders.statuses.' . $paymentStatus)
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-12">
|
||||
<div class="form-group">
|
||||
<label for="payment_type">@lang('admin.orders.Payment type')</label>
|
||||
<select class="form-control" id="payment_type" name="payment_type">
|
||||
<option value="0" selected>@lang('admin.categories.Not selected')</option>
|
||||
@foreach (App\Models\Order::paymentTypes() as $paymentType)
|
||||
<option value="{{ $paymentType }}"
|
||||
@if (request('payment_type') == $paymentType) selected @endif>
|
||||
@lang('admin.orders.payment_type.' . $paymentType)
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-12">
|
||||
<div class="form-group">
|
||||
<label for="client_type">@lang('admin.client.client_type')</label>
|
||||
<select class="form-control" id="client_type" name="client_type">
|
||||
<option value="0" selected>@lang('admin.categories.Not selected')</option>
|
||||
@foreach (App\Models\Order::clientTypes() as $clientType)
|
||||
<option value="{{ $clientType }}"
|
||||
@if (request('client_type') == $clientType) selected @endif>
|
||||
@lang('admin.client.types.' . $clientType)
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-12">
|
||||
<div class="form-group">
|
||||
<label for="delivery_type">@lang('admin.orders.delivery_type')</label>
|
||||
<select class="form-control" id="delivery_type" name="delivery_type">
|
||||
<option value="0" selected>@lang('admin.categories.Not selected')</option>
|
||||
@foreach (App\Models\Order::deliveryTypes() as $deliveryType)
|
||||
<option value="{{ $deliveryType }}"
|
||||
@if (request('delivery_type') == $deliveryType) selected @endif>
|
||||
@lang('admin.orders.type_delivery.' . $deliveryType)
|
||||
</option>
|
||||
@endforeach
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-12">
|
||||
<div class="form-group">
|
||||
<label for="delivery_type">@lang('admin.orders.date')</label>
|
||||
<input type="text" class="form-control" name="datefilter"
|
||||
value="{{ request('datefilter') }}" />
|
||||
<input type="hidden" name="from" id="from"
|
||||
value="{{ request('from') }}">
|
||||
<input type="hidden" name="to" id="to"
|
||||
value="{{ request('to') }}">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-12">
|
||||
<div class="form-group">
|
||||
<label for="delivery_type">@lang('admin.orders.with_didox')</label>
|
||||
<div class="demo-inline-spacing">
|
||||
<div class="form-check form-check-inline">
|
||||
<input name="with_didox[]" class="form-check-input"
|
||||
type="checkbox" id="with_didox1" value="checked"
|
||||
@if (request('with_didox') && in_array('checked', request('with_didox'))) checked @endif
|
||||
@if (!request('with_didox')) checked @endif />
|
||||
<label class="form-check-label"
|
||||
for="with_didox1">@lang('admin.orders.with_installations.1')</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input name="with_didox[]" class="form-check-input"
|
||||
type="checkbox" id="with_didox0" value="unchecked"
|
||||
@if (request('with_didox') && in_array('unchecked', request('with_didox'))) checked @endif
|
||||
@if (!request('with_didox')) checked @endif />
|
||||
<label class="form-check-label"
|
||||
for="with_didox0">@lang('admin.orders.with_installations.0')</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 col-12">
|
||||
<div class="form-group">
|
||||
<label for="delivery_type">@lang('admin.orders.with_installation')</label>
|
||||
<div class="demo-inline-spacing">
|
||||
<div class="form-check form-check-inline">
|
||||
<input name="with_installation[]" class="form-check-input"
|
||||
type="checkbox" id="with_installation1" value="checked"
|
||||
@if (request('with_installation') && in_array('checked', request('with_installation'))) checked @endif
|
||||
@if (!request('with_installation')) checked @endif />
|
||||
<label class="form-check-label"
|
||||
for="with_installation1">@lang('admin.orders.with_installations.1')</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input name="with_installation[]" class="form-check-input"
|
||||
type="checkbox" id="with_installation0" value="unchecked"
|
||||
@if (request('with_installation') && in_array('unchecked', request('with_installation'))) checked @endif
|
||||
@if (!request('with_installation')) checked @endif />
|
||||
<label class="form-check-label"
|
||||
for="with_installation0">@lang('admin.orders.with_installations.0')</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-12">
|
||||
<button type="submit"
|
||||
class="btn btn-primary mr-1 mb-1 waves-effect waves-light"><i
|
||||
class="fa fa-filter"></i> @lang('admin.products.Apply')</button>
|
||||
<a href="{{ route('dashboard.orders') }}"
|
||||
class="btn btn-outline-warning mr-1 mb-1 waves-effect waves-light">@lang('admin.products.Reset')</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
@endif
|
||||
89
resources/views/dashboard/orders/components/index/js.blade.php
Executable file
89
resources/views/dashboard/orders/components/index/js.blade.php
Executable file
@@ -0,0 +1,89 @@
|
||||
@push('js')
|
||||
<div class="modal fade" id="staticBackdrop" data-backdrop="static" data-keyboard="false" tabindex="-1"
|
||||
aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="{{ route('dashboard.orders.comments_status') }}" method="post">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="staticBackdropLabel">Написать комментарий</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@csrf
|
||||
<input type="hidden" name="order_id" value="" id="id_order">
|
||||
<input type="hidden" name="type" value="" id="type_order">
|
||||
<textarea cols="3" class="form-control" name="comment"></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-success" data-dismiss="modal">Отменить</button>
|
||||
<button type="submit" class="btn btn-secondary">Изменить статус</button>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript" src="/vendor/picker/moment.min.js"></script>
|
||||
<script type="text/javascript" src="/vendor/picker/daterangepicker.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
|
||||
$('input[name="datefilter"]').daterangepicker({
|
||||
autoUpdateInput: false,
|
||||
locale: {
|
||||
cancelLabel: 'Clear'
|
||||
}
|
||||
});
|
||||
|
||||
$('input[name="datefilter"]').on('apply.daterangepicker', function(ev, picker) {
|
||||
$('#from').val(picker.startDate.format('YYYY-MM-DD'));
|
||||
$('#to').val(picker.endDate.format('YYYY-MM-DD'));
|
||||
$(this).val(picker.startDate.format('MM/DD/YYYY') + ' - ' + picker.endDate.format(
|
||||
'MM/DD/YYYY'));
|
||||
});
|
||||
|
||||
$('input[name="datefilter"]').on('cancel.daterangepicker', function(ev, picker) {
|
||||
$(this).val('');
|
||||
});
|
||||
|
||||
$('.modal-comment').on('click', function(e) {
|
||||
var id = $(this).data('id');
|
||||
var type = $(this).data('type');
|
||||
|
||||
$('#type_order').val(type);
|
||||
$('#id_order').val(id);
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
// Listen for click on toggle checkbox
|
||||
$('#select-all').click(function(event) {
|
||||
if (this.checked) {
|
||||
// Iterate each checkbox
|
||||
$(':checkbox').each(function() {
|
||||
this.checked = true;
|
||||
});
|
||||
} else {
|
||||
$(':checkbox').each(function() {
|
||||
this.checked = false;
|
||||
});
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$("#show-action").hide();
|
||||
|
||||
$(".change-check").change(function() {
|
||||
$("#show-action").show();
|
||||
});
|
||||
});
|
||||
</script>
|
||||
@endpush
|
||||
20
resources/views/dashboard/orders/components/index/speedbar.blade.php
Executable file
20
resources/views/dashboard/orders/components/index/speedbar.blade.php
Executable file
@@ -0,0 +1,20 @@
|
||||
@section('speedbar')
|
||||
<div class="content-header row">
|
||||
<div class="content-header-left col-md-9 col-12 mb-2">
|
||||
<div class="row breadcrumbs-top">
|
||||
<div class="col-12">
|
||||
<h2 class="content-header-title float-left mb-0">@lang('admin.orders.title')</h2>
|
||||
<div class="breadcrumb-wrapper col-12">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item "><a href="{{ route('dashboard') }}">@lang('admin.home')</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">
|
||||
@lang('admin.orders.title')
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
48
resources/views/dashboard/orders/components/view/client-info.blade.php
Executable file
48
resources/views/dashboard/orders/components/view/client-info.blade.php
Executable file
@@ -0,0 +1,48 @@
|
||||
<div class="col-6 float-left text-left">
|
||||
<h5>@lang('admin.orders.client')</h5>
|
||||
<div class="recipient-info my-2">
|
||||
<p>
|
||||
<b>@lang('admin.client.type'):</b> @lang('admin.client.types.' . $order->client_type)
|
||||
</p>
|
||||
@if ($order->client_type == 'legal')
|
||||
@php
|
||||
$legalInfo = $order->user->legalInfo;
|
||||
@endphp
|
||||
<p><b>@lang('admin.client.company_name'):</b> {{ $legalInfo->company_name }}</p>
|
||||
<p><b>@lang('admin.client.inn'):</b> {{ $legalInfo->inn }}</p>
|
||||
<p><b>@lang('admin.client.director_full_name'):</b> {{ $legalInfo->director_full_name }}</p>
|
||||
<p><b>@lang('admin.client.bank_name'):</b> {{ $legalInfo->bank_name }}</p>
|
||||
<p><b>@lang('admin.client.mfo'):</b> {{ $legalInfo->mfo }}</p>
|
||||
<p><b>@lang('admin.client.payment_account'):</b> {{ $legalInfo->payment_account }}</p>
|
||||
<p><b>@lang('admin.client.oked'):</b> {{ $legalInfo->oked }}</p>
|
||||
<p><b>@lang('admin.client.legal_address'):</b> {{ $legalInfo->legal_address }}</p>
|
||||
<p><b>@lang('admin.client.email'):</b> {{ $order->user->email }}</p>
|
||||
<p><b>@lang('admin.client.phone'):</b> <a href="tel:+{{ $order->phone }}">+{{ $order->phone }}</a></p>
|
||||
@else
|
||||
<p><b>@lang('admin.client.full_name'):</b> {{ $order->full_name }}</p>
|
||||
<p><b>@lang('admin.client.phone'):</b> <a href="tel:+{{ $order->phone }}">+{{ $order->phone }}</a></p>
|
||||
<p><b>@lang('admin.jshir'):</b> {{ $order->jshir }}</p>
|
||||
<p><b>@lang('admin.series'):</b> {{ $order->series }}</p>
|
||||
@endif
|
||||
|
||||
@if ($order->delivery_type == 'delivery' && !empty($order->address))
|
||||
<p>
|
||||
<b>@lang('admin.orders.city'):</b>
|
||||
{{ $order->address->city->region->getName() . ', ' . $order->address->city->getName() }}
|
||||
</p>
|
||||
<p>
|
||||
<b>@lang('admin.orders.address'):</b> {{ $order->address->getAddress() }}
|
||||
</p>
|
||||
<p>
|
||||
<b>@lang('admin.orders.home'):</b> {{ $order->address->getHome() }}
|
||||
</p>
|
||||
<p>
|
||||
<b>@lang('admin.orders.landmark'):</b> {{ $order->address->getLandmark() }}
|
||||
</p>
|
||||
@else
|
||||
<p>
|
||||
<b>@lang('admin.orders.branch'):</b> {{ !empty($order->branch) ? $order->branch->getName() : '' }}
|
||||
</p>
|
||||
@endif
|
||||
</div>
|
||||
</div>
|
||||
60
resources/views/dashboard/orders/components/view/comment.blade.php
Executable file
60
resources/views/dashboard/orders/components/view/comment.blade.php
Executable file
@@ -0,0 +1,60 @@
|
||||
@if (count($order->comments) > 0)
|
||||
@php
|
||||
$commentTypes = [
|
||||
'cancelled' => ['bg-danger', 'feather icon-archive', 'Отменен'],
|
||||
'replacement' => ['bg-warning', 'feather icon-refresh-ccw', 'Замена'],
|
||||
'closed' => ['bg-success', 'feather icon-archive', 'Закрыто'],
|
||||
'default' => ['bg-primary', 'fa fa-comment', 'comment'],
|
||||
];
|
||||
@endphp
|
||||
|
||||
<button type="button" class="btn btn-success mb-1" data-toggle="collapse" href="#collapseExample" role="button"
|
||||
aria-expanded="false" aria-controls="collapseExample">
|
||||
<i class="fa fa-plus-circle"></i> @lang('admin.orders.add_a_comment')
|
||||
</button>
|
||||
|
||||
<div class="collapse" id="collapseExample">
|
||||
<div class="card ">
|
||||
<div class="card-content">
|
||||
<form action="{{ route('dashboard.orders.comments_status') }}" method="post">
|
||||
<div class="card-body">
|
||||
<div class="row">
|
||||
@csrf
|
||||
<input type="hidden" name="order_id" value="{{ $order->id }}">
|
||||
<input type="hidden" name="type" value="default">
|
||||
<label>@lang('admin.orders.comment')</label>
|
||||
<textarea name="comment" id="" class="form-control" cols="3" rows="3"></textarea>
|
||||
|
||||
<button class="btn btn-primary mt-2">
|
||||
<i class="fa fa-save"></i> @lang('admin.save')
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h2>@lang('admin.orders.comments')</h2>
|
||||
<ul class="activity-timeline timeline-left list-unstyled mt-2">
|
||||
@foreach ($order->comments as $comment)
|
||||
@php
|
||||
$type = $commentTypes[$comment->type] ?? $commentTypes['default'];
|
||||
@endphp
|
||||
<li>
|
||||
<div class="timeline-icon {{ $type[0] }}">
|
||||
<i class="{{ $type[1] }} font-medium-2 align-middle"></i>
|
||||
</div>
|
||||
<div class="timeline-info">
|
||||
<p class="font-weight-bold mb-0">@lang('admin.orders.' . $type[2])</p>
|
||||
<span class="font-small-3">{{ $comment->comment }}</span>
|
||||
</div>
|
||||
<small class="text-muted">
|
||||
{{ date('H:i, d.m.Y', strtotime($comment->created_at)) }} |
|
||||
@lang('admin.orders.user') <b>{{ $comment->user->username }}</b>
|
||||
</small>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
39
resources/views/dashboard/orders/components/view/header.blade.php
Executable file
39
resources/views/dashboard/orders/components/view/header.blade.php
Executable file
@@ -0,0 +1,39 @@
|
||||
<div class="row">
|
||||
<div class="col-md-6 text-left pt-1 mb-3">
|
||||
<div class="col-12">
|
||||
<div class="media pt-1">
|
||||
<img src="/images/logo.png" alt="company logo" width="100" class="" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6 text-right pt-1 mb-3">
|
||||
@if (
|
||||
(!empty(auth()->user()->role->permissions['order_status']['replacement']) && $order->status == 'replacement') ||
|
||||
(!empty(auth()->user()->role->permissions['order_status']['closed']) && $order->status == 'replacement'))
|
||||
<a href="{{ route('dashboard.orders.edit', $order->id) }}" class="btn btn-primary">
|
||||
<i class="fa fa-edit"></i> Редактировать
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@if (!empty(auth()->user()->role->permissions['orders']['print']))
|
||||
<a href="{{ route('dashboard.invoice_print', $order->id) }}" target="_blank" class="btn btn-success">
|
||||
<i class="fa fa-print"></i> Печатать
|
||||
</a>
|
||||
@endif
|
||||
|
||||
<a href="{{ route('dashboard.orders.archive', $order->id) }}" class="btn btn-secondary">
|
||||
<i class="feather icon-box"></i>
|
||||
@if ($order->archived == 1)
|
||||
@lang('admin.orders.unarchive')
|
||||
@else
|
||||
@lang('admin.orders.archive')
|
||||
@endif
|
||||
</a>
|
||||
|
||||
<a href="{{ $order->contracts()->latest()->first()?->getPath() }}" class="btn btn-primary">
|
||||
<i class="feather icon-download"></i>
|
||||
@lang('admin.Download contract')
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
39
resources/views/dashboard/orders/components/view/js.blade.php
Executable file
39
resources/views/dashboard/orders/components/view/js.blade.php
Executable file
@@ -0,0 +1,39 @@
|
||||
@push('js')
|
||||
<div class="modal fade" id="staticBackdrop" data-backdrop="static" data-keyboard="false" tabindex="-1"
|
||||
aria-labelledby="staticBackdropLabel" aria-hidden="true">
|
||||
<div class="modal-dialog">
|
||||
<div class="modal-content">
|
||||
<form action="{{ route('dashboard.orders.comments_status') }}" method="post">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="staticBackdropLabel">Написать комментарий</h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
|
||||
<span aria-hidden="true">×</span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
@csrf
|
||||
<input type="hidden" name="order_id" value="" id="id_order">
|
||||
<input type="hidden" name="type" value="" id="type_order">
|
||||
<textarea cols="3" class="form-control" name="comment"></textarea>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-success" data-dismiss="modal">Отменить</button>
|
||||
<button type="submit" class="btn btn-secondary">Изменить статус</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(function() {
|
||||
$('.modal-comment').on('click', function(e) {
|
||||
var id = $(this).data('id');
|
||||
var type = $(this).data('type');
|
||||
|
||||
$('#type_order').val(type);
|
||||
$('#id_order').val(id);
|
||||
})
|
||||
})
|
||||
</script>
|
||||
@endpush
|
||||
97
resources/views/dashboard/orders/components/view/log.blade.php
Executable file
97
resources/views/dashboard/orders/components/view/log.blade.php
Executable file
@@ -0,0 +1,97 @@
|
||||
@if (count($logs) > 0)
|
||||
@php
|
||||
// Mapping log descriptions and status values to icons and labels
|
||||
$descriptionIcons = [
|
||||
'created' => ['bg-success', 'feather icon-plus-circle', 'Создан'],
|
||||
'updated' => ['bg-primary', 'feather icon-refresh-ccw', 'Изменено'],
|
||||
];
|
||||
|
||||
$statusLabels = [
|
||||
'processing' => 'В обработке',
|
||||
'collected' => 'Собран',
|
||||
'waiting_buyer' => 'Ожидает покупателя',
|
||||
'in_way' => 'В пути',
|
||||
'closed' => 'Закрыт',
|
||||
'cancelled' => 'Отменен',
|
||||
'replacement' => 'Замена',
|
||||
];
|
||||
|
||||
$paymentStatuses = [
|
||||
'waiting' => 'Ожидается оплата',
|
||||
'cancelled' => 'Отказано оплата',
|
||||
'payed' => $order->payment_type == 'credit' ? 'Кредит одобрен' : 'Оплачено',
|
||||
'cash' => 'Наличный расчет',
|
||||
'review' => 'Кредит на рассмотрение',
|
||||
];
|
||||
@endphp
|
||||
|
||||
<h2>@lang('admin.logs.title')</h2>
|
||||
<ul class="activity-timeline timeline-left list-unstyled mt-2">
|
||||
@foreach ($logs->reverse() as $log)
|
||||
<li>
|
||||
@if (!empty($log->properties['old']['payment_status']))
|
||||
<div class="timeline-icon bg-success">
|
||||
<i class="feather icon-credit-card font-medium-2 align-middle"></i>
|
||||
</div>
|
||||
@else
|
||||
@php
|
||||
$iconData = $descriptionIcons[$log->description] ?? ['bg-secondary', 'feather icon-info'];
|
||||
@endphp
|
||||
<div class="timeline-icon {{ $iconData[0] }}">
|
||||
<i class="{{ $iconData[1] }} font-medium-2 align-middle"></i>
|
||||
</div>
|
||||
@endif
|
||||
|
||||
<div class="timeline-info">
|
||||
<p class="font-weight-bold mb-0">
|
||||
@if (!empty($log->properties['old']['payment_status']))
|
||||
Статус оплаты
|
||||
@else
|
||||
{{ $iconData[2] ?? '' }}
|
||||
@endif
|
||||
</p>
|
||||
<span class="font-small-3">
|
||||
@if ($log->description == 'updated')
|
||||
@if (!empty($log->properties['old']['status']))
|
||||
@lang('admin.orders.status'):
|
||||
<span
|
||||
class="text-danger">{{ $statusLabels[$log->properties['old']['status']] ?? '' }}</span>
|
||||
изменено на
|
||||
<span
|
||||
class="text-success">{{ $statusLabels[$log->properties['attributes']['status']] ?? '' }}</span>
|
||||
@endif
|
||||
|
||||
@if (!empty($log->properties['old']['payment_status']))
|
||||
@lang('admin.orders.status'):
|
||||
<span
|
||||
class="text-danger">{{ $paymentStatuses[$log->properties['old']['payment_status']] ?? '' }}</span>
|
||||
изменено на
|
||||
<span
|
||||
class="text-success">{{ $paymentStatuses[$log->properties['attributes']['payment_status']] ?? '' }}</span>
|
||||
@endif
|
||||
|
||||
@if (!empty($log->properties['old']['archived']) || !empty($log->properties['attributes']['archived']))
|
||||
@if ($log->properties['old']['archived'])
|
||||
@lang('admin.unarchived')
|
||||
@else
|
||||
@lang('admin.archived')
|
||||
@endif
|
||||
@endif
|
||||
@endif
|
||||
</span>
|
||||
</div>
|
||||
<small class="text-muted">
|
||||
{{ date('H:i, d.m.Y', strtotime($log->created_at)) }} |
|
||||
@lang('admin.orders.user'):
|
||||
<b>
|
||||
@if ($log->description == 'created')
|
||||
{{ $log->causer->phone ?? 'без авторизации' }}
|
||||
@else
|
||||
{{ $log->causer->username ?? '' }}
|
||||
@endif
|
||||
</b>
|
||||
</small>
|
||||
</li>
|
||||
@endforeach
|
||||
</ul>
|
||||
@endif
|
||||
82
resources/views/dashboard/orders/components/view/order-info.blade.php
Executable file
82
resources/views/dashboard/orders/components/view/order-info.blade.php
Executable file
@@ -0,0 +1,82 @@
|
||||
<div class="col-6 float-left text-right">
|
||||
<h1>
|
||||
@lang('admin.orders.order')
|
||||
@lang('admin.orders.statuses.' . $order->payment_status)
|
||||
</h1>
|
||||
<div class="invoice-details mt-2">
|
||||
<h6>@lang('admin.orders.order_number', ['number' => $order->id])</h6>
|
||||
|
||||
<h6 class="mt-2">@lang('admin.orders.date')</h6>
|
||||
<p>{{ date('H:i - d.m.Y', strtotime($order->created_at)) }}</p>
|
||||
|
||||
<h6 class="mt-2">@lang('admin.orders.payment_system')</h6>
|
||||
<p>@lang('admin.orders.payment_type.' . $order->payment_type)</p>
|
||||
|
||||
<h6 class="mt-2">@lang('admin.orders.delivery_type')</h6>
|
||||
<p>@lang('admin.orders.type_delivery.' . $order->delivery_type)</p>
|
||||
|
||||
<h6 class="mt-2">@lang('admin.orders.with_installation')</h6>
|
||||
<p>@lang('admin.orders.with_installations.' . $order->with_installation)</p>
|
||||
|
||||
<h6 class="mt-2">@lang('admin.orders.with_didox')</h6>
|
||||
<p>@lang('admin.orders.with_installations.' . $order->with_didox)</p>
|
||||
|
||||
<h6 class="mt-2">@lang('admin.orders.payment_status')</h6>
|
||||
<div class="btn-group dropleft mb-1">
|
||||
@php
|
||||
// Mapping order statuses to button classes
|
||||
$statusClasses = [
|
||||
'payed' => 'btn-success',
|
||||
'cancelled' => 'btn-danger',
|
||||
'waiting' => 'btn-warning',
|
||||
'review' => 'btn-warning',
|
||||
];
|
||||
|
||||
// Get the class for the current status or set a default class
|
||||
$buttonClass = $statusClasses[$order->payment_status] ?? 'btn-secondary';
|
||||
@endphp
|
||||
<button type="button" class="btn {{ $buttonClass }} dropdown-toggle waves-effect waves-light"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
@lang('admin.orders.statuses.' . $order->payment_status)
|
||||
</button>
|
||||
<div class="dropdown-menu" x-placement="left-start"
|
||||
style="position: absolute; transform: translate3d(-147px, 0px, 0px); top: 0px; left: 0px; will-change: transform;">
|
||||
@foreach (App\Models\Order::paymentStatuses() as $status)
|
||||
<a class="dropdown-item" onclick="return confirm('Вы действительно хотите изменить статус')"
|
||||
href="{{ route('dashboard.orders.change-payment-status', ['order' => $order, 'status' => $status]) }}">
|
||||
@lang('admin.statuses.' . $status)
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<h6 class="mt-2">@lang('admin.orders.status')</h6>
|
||||
<div class="btn-group dropleft mb-1">
|
||||
@php
|
||||
// Mapping order statuses to button classes
|
||||
$statusClasses = [
|
||||
'delivered' => 'btn-success',
|
||||
'cancelled' => 'btn-danger',
|
||||
'processing' => 'btn-primary',
|
||||
'waiting' => 'btn-warning',
|
||||
];
|
||||
|
||||
// Get the class for the current status or set a default class
|
||||
$buttonClass = $statusClasses[$order->status] ?? 'btn-secondary';
|
||||
@endphp
|
||||
<button type="button" class="btn {{ $buttonClass }} dropdown-toggle waves-effect waves-light"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
@lang('admin.orders.statuses.' . $order->status)
|
||||
</button>
|
||||
<div class="dropdown-menu" x-placement="left-start"
|
||||
style="position: absolute; transform: translate3d(-147px, 0px, 0px); top: 0px; left: 0px; will-change: transform;">
|
||||
@foreach (App\Models\Order::statuses() as $status)
|
||||
<a class="dropdown-item" onclick="return confirm('Вы действительно хотите изменить статус')"
|
||||
href="{{ route('dashboard.orders.change-status', ['order' => $order, 'status' => $status]) }}">
|
||||
@lang('admin.statuses.' . $status)
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
103
resources/views/dashboard/orders/components/view/products.blade.php
Executable file
103
resources/views/dashboard/orders/components/view/products.blade.php
Executable file
@@ -0,0 +1,103 @@
|
||||
<div id="invoice-items-details" class="pt-1 col-12 float-left invoice-items-table">
|
||||
<div class="row">
|
||||
<div class="table-responsive col-sm-12 ">
|
||||
<table class="table table-borderless">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>ID</th>
|
||||
<th>@lang('admin.products.image')</th>
|
||||
<th width="300">@lang('admin.products.name')</th>
|
||||
<th>@lang('admin.orders.price')</th>
|
||||
<th>@lang('admin.slider.discount')</th>
|
||||
<th>@lang('admin.orders.count')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@php
|
||||
$currency = $order->getCurrency?->dollar;
|
||||
@endphp
|
||||
<tbody>
|
||||
@foreach ($products as $product)
|
||||
<tr>
|
||||
<td>
|
||||
{{ $product->product->id }}
|
||||
</td>
|
||||
<td>
|
||||
<img src="{{ $product->product->getPoster() }}" width="100" alt="">
|
||||
</td>
|
||||
<td>
|
||||
{{ $product->product->getName() }}
|
||||
</td>
|
||||
@php
|
||||
if ($product->discount) {
|
||||
$dis_persent = 100 - round(($product->discount / $product->price) * 100, 1);
|
||||
} else {
|
||||
$dis_persent = 0;
|
||||
}
|
||||
@endphp
|
||||
<td>
|
||||
@if ($product->discount)
|
||||
<strike>
|
||||
{{ number_format($product->price * $currency, 0, '.', ' ') }}
|
||||
@lang('admin.ye')
|
||||
</strike><br>
|
||||
{{ number_format($product->discount * $currency, 0, '.', ' ') }}
|
||||
@else
|
||||
{{ number_format($product->price * $currency, 0, '.', ' ') }}
|
||||
@endif
|
||||
@lang('admin.ye')
|
||||
</td>
|
||||
<td>
|
||||
{{ $dis_persent }}%
|
||||
</td>
|
||||
<td>{{ $product->getCount() }}</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div id="invoice-total-details" class="invoice-total-table">
|
||||
<div class="row">
|
||||
<div class="col-7 offset-5">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-borderless">
|
||||
<tbody>
|
||||
<tr class="text-right">
|
||||
<th>@lang('admin.orders.product')</th>
|
||||
<td width="150">
|
||||
{{ number_format($order->price_products, 0, '', ' ') }}
|
||||
@lang('admin.ye')
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="text-right">
|
||||
<th>@lang('admin.orders.delivery')</th>
|
||||
<td width="150">
|
||||
{{ number_format($order->price_delivery, 0, '', ' ') }}
|
||||
@lang('admin.ye')
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="text-right">
|
||||
<th>@lang('admin.orders.price_master')</th>
|
||||
<td width="150">
|
||||
{{ number_format($order->price_master, 0, '', ' ') }}
|
||||
@lang('admin.ye')
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr class="text-right">
|
||||
<th>@lang('admin.orders.total')</th>
|
||||
<td width="150">
|
||||
{{ number_format($order->price_total, 0, '', ' ') }}
|
||||
@lang('admin.ye')
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
20
resources/views/dashboard/orders/components/view/speedbar.blade.php
Executable file
20
resources/views/dashboard/orders/components/view/speedbar.blade.php
Executable file
@@ -0,0 +1,20 @@
|
||||
@section('speedbar')
|
||||
<div class="content-header row">
|
||||
<div class="content-header-left col-md-9 col-12 mb-2">
|
||||
<div class="row breadcrumbs-top">
|
||||
<div class="col-12">
|
||||
<h2 class="content-header-title float-left mb-0">@lang('admin.orders.title')</h2>
|
||||
<div class="breadcrumb-wrapper col-12">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item "><a href="{{ route('dashboard') }}">@lang('admin.home')</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">
|
||||
@lang('admin.orders.title')
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
119
resources/views/dashboard/orders/export.blade.php
Executable file
119
resources/views/dashboard/orders/export.blade.php
Executable file
@@ -0,0 +1,119 @@
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">ID</th>
|
||||
<th scope="col" width="18">@lang('admin.orders.user')</th>
|
||||
<th scope="col" width="30">@lang('admin.orders.delivery_type')</th>
|
||||
<th scope="col" width="16">@lang('admin.orders.payment_system')</th>
|
||||
<th scope="col" width="15">Статус оплаты</th>
|
||||
<th scope="col" width="15">@lang('admin.orders.status')</th>
|
||||
<th scope="col" width="20">
|
||||
Комментария
|
||||
</th>
|
||||
<th scope="col" width="30">
|
||||
Комментарии от Банка
|
||||
</th>
|
||||
<th scope="col" width="20">@lang('admin.orders.date')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@foreach($orders as $order)
|
||||
<tr>
|
||||
<td>
|
||||
{{ $order->id }}
|
||||
</td>
|
||||
<td>
|
||||
+{{ sprintf("%s(%s)%s-%s-%s",
|
||||
substr($order->user->getPhone(), 0, 3),
|
||||
substr($order->user->getPhone(), 3, 2),
|
||||
substr($order->user->getPhone(), 5, 3),
|
||||
substr($order->user->getPhone(), 8, 2),
|
||||
substr($order->user->getPhone(), 10, 2)) }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if($order->type_delivery == 'delivery')
|
||||
Стандартная доставка
|
||||
@else
|
||||
Самовывоз из пункта выдачи
|
||||
@endif
|
||||
|
||||
@if($order->type == 'one_click')
|
||||
<br><span class="text-danger">(Купить в 1 клик)</span>
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if($order->payment_type == 'cash')
|
||||
Наличный расчет
|
||||
@elseif($order->payment_type == 'credit')
|
||||
Кредит
|
||||
@else
|
||||
{{ $order->payment_type }}
|
||||
@endif
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@switch($order->payment_status)
|
||||
@case('cancelled')
|
||||
Отменено
|
||||
@break
|
||||
@case('payed')
|
||||
Оплачено
|
||||
@break
|
||||
@case('waiting')
|
||||
Не оплачено
|
||||
@break
|
||||
@case('review')
|
||||
На рассмотрение
|
||||
@break;
|
||||
@endswitch
|
||||
</td>
|
||||
<td>
|
||||
@switch($order->status)
|
||||
@case('processing')
|
||||
В обработке
|
||||
@break
|
||||
@case('collected')
|
||||
Собран
|
||||
@break
|
||||
@case('waiting_buyer')
|
||||
Ожидает покупателя
|
||||
@break
|
||||
@case('in_way')
|
||||
В пути
|
||||
@break
|
||||
@case('closed')
|
||||
Закрыт
|
||||
@break
|
||||
@case('cancelled')
|
||||
Отменен
|
||||
@break
|
||||
@case('replacement')
|
||||
Замена
|
||||
@break
|
||||
@endswitch
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ $order->comment }}
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@if($order->payment_type == 'credit')
|
||||
Клиент перешел на сайт банка,
|
||||
@endif
|
||||
|
||||
@foreach($order->comments_bank as $comment)
|
||||
{{ $comment->comment }},
|
||||
@endforeach
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ date('H:i - d.m.Y', strtotime($order->created_at)) }}
|
||||
</td>
|
||||
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
199
resources/views/dashboard/orders/index.blade.php
Executable file
199
resources/views/dashboard/orders/index.blade.php
Executable file
@@ -0,0 +1,199 @@
|
||||
@extends('dashboard.layouts.app')
|
||||
@section('title', trans('admin.orders.title') . ' - ')
|
||||
|
||||
@include('dashboard.orders.components.index.speedbar')
|
||||
|
||||
@section('content')
|
||||
<div class="row" id="table-head">
|
||||
<div class="col-md-12 mb-1">
|
||||
{{-- <a href="{{ route('dashboard.orders.archive') }}" class="btn btn-icon btn-secondary float-right mr-1">
|
||||
<i class="feather icon-box"></i> @lang('admin.orders.Order archive')
|
||||
</a> --}}
|
||||
|
||||
{{-- <a href="{{ route('dashboard.orders.export') }}" class="btn btn-icon btn-success float-right mr-1">
|
||||
<i class="feather icon-box"></i> @lang('admin.orders.Export')
|
||||
</a> --}}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row" id="table-head">
|
||||
|
||||
{{-- <div class="col-md-4 mb-1 ">
|
||||
<form action="{{ route('dashboard.orders.search') }}" method="get">
|
||||
<div class="input-group ">
|
||||
<input type="text" class="form-control" name="id" placeholder="ID заказа"
|
||||
aria-describedby="button-addon2">
|
||||
<div class="input-group-append" id="button-addon2">
|
||||
<button class="btn btn-primary waves-effect waves-light" type="button">@lang('admin.orders.Search')</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div> --}}
|
||||
|
||||
@include('dashboard.orders.components.index.filter')
|
||||
|
||||
<div class="col-12">
|
||||
|
||||
<div class="card">
|
||||
|
||||
<div class="card-content">
|
||||
<form method="post" action="{{ route('dashboard.orders.mass_archived') }}">
|
||||
@csrf
|
||||
<div class="table">
|
||||
<table class="table mb-0">
|
||||
<thead class="thead-dark">
|
||||
<tr>
|
||||
<th scope="col" width="50" class="text-right">
|
||||
<div class="form-group text-right">
|
||||
<fieldset class="checkbox">
|
||||
<div class="vs-checkbox-con vs-checkbox-primary">
|
||||
<input type="checkbox" name="order_id[]" class="change-check"
|
||||
id="select-all">
|
||||
<span class="vs-checkbox">
|
||||
<span class="vs-checkbox--check">
|
||||
<i class="vs-icon feather icon-check"></i>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</th>
|
||||
|
||||
<th scope="col" width="50">ID</th>
|
||||
<th scope="col">@lang('admin.orders.user')</th>
|
||||
<th scope="col">@lang('admin.orders.delivery_type')</th>
|
||||
<th scope="col">@lang('admin.orders.payment_system')</th>
|
||||
<th scope="col">@lang('admin.orders.status')</th>
|
||||
<th scope="col">@lang('admin.orders.date')</th>
|
||||
<th scope="col" class="text-right">@lang('admin.actions')</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@if (count($orders) == 0)
|
||||
<tr>
|
||||
<td class="text-center" colspan="7">
|
||||
@lang('admin.no_data')
|
||||
</td>
|
||||
</tr>
|
||||
@endif
|
||||
|
||||
@foreach ($orders as $order)
|
||||
<tr>
|
||||
<td class="text-right">
|
||||
<div class="form-group">
|
||||
<fieldset class="checkbox">
|
||||
<div class="vs-checkbox-con vs-checkbox-primary">
|
||||
<input type="checkbox" value="{{ $order->id }}"
|
||||
name="order_id[]" class="change-check"
|
||||
id="checkbox-{{ $loop->iteration }}">
|
||||
<span class="vs-checkbox">
|
||||
<span class="vs-checkbox--check">
|
||||
<i class="vs-icon feather icon-check"></i>
|
||||
</span>
|
||||
</span>
|
||||
</div>
|
||||
</fieldset>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td>{{ $order->id }}</td>
|
||||
<td>+{{ $order->user?->getPhone() }}</td>
|
||||
|
||||
<td>
|
||||
@lang('admin.orders.type_delivery.' . $order->delivery_type)
|
||||
</td>
|
||||
|
||||
<td>
|
||||
@php
|
||||
$payment_statuses = [
|
||||
'waiting' => 'warning',
|
||||
'cancelled' => 'danger',
|
||||
'payed' => 'success',
|
||||
'cash' => 'primary',
|
||||
'review' => 'secondary',
|
||||
];
|
||||
$class = $payment_statuses[$order->payment_status] ?? 'secondary';
|
||||
@endphp
|
||||
|
||||
<span class="badge rounded-pill bg-{{ $class }}">
|
||||
@lang('admin.orders.statuses.' . $order->payment_status)
|
||||
</span>:
|
||||
@lang('admin.orders.payment_type.' . $order->payment_type)
|
||||
</td>
|
||||
|
||||
<td>
|
||||
<div class="btn-group dropleft mr-1 mb-1">
|
||||
@php
|
||||
$statusClasses = [
|
||||
'completed' => 'btn-success',
|
||||
'cancelled' => 'btn-danger',
|
||||
'processing' => 'btn-primary',
|
||||
'waiting_buyer' => 'btn-warning',
|
||||
];
|
||||
|
||||
$buttonClass =
|
||||
$statusClasses[$order->status] ?? 'btn-secondary';
|
||||
@endphp
|
||||
|
||||
<button type="button"
|
||||
class="btn {{ $buttonClass }} dropdown-toggle waves-effect waves-light"
|
||||
data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
|
||||
@lang('admin.orders.statuses.' . $order->status)
|
||||
</button>
|
||||
|
||||
<div class="dropdown-menu" x-placement="left-start"
|
||||
style="position: absolute; transform: translate3d(-147px, 0px, 0px); top: 0px; left: 0px; will-change: transform;">
|
||||
@foreach (App\Models\Order::statuses() as $status)
|
||||
<a class="dropdown-item"
|
||||
onclick="return confirm('Вы действительно хотите изменить статус')"
|
||||
href="{{ route('dashboard.orders.change-status', ['order' => $order, 'status' => $status]) }}">
|
||||
@lang('admin.statuses.' . $status)
|
||||
</a>
|
||||
@endforeach
|
||||
</div>
|
||||
</div>
|
||||
</td>
|
||||
|
||||
<td>
|
||||
{{ date('H:i - d.m.Y', strtotime($order->created_at)) }}
|
||||
</td>
|
||||
|
||||
<td class="text-right">
|
||||
@if (!empty(auth()->user()->role->permissions['orders']['print']))
|
||||
<a href="{{ route('dashboard.invoice_print', $order->id) }}"
|
||||
target="_blank" class="btn btn-success btn-icon btn-sm">
|
||||
<i class="fa fa-print"></i>
|
||||
</a>
|
||||
@endif
|
||||
|
||||
@can('view', 'orders')
|
||||
<a href="{{ route('dashboard.orders.view', $order->id) }}"
|
||||
class="btn btn-primary btn-icon btn-sm">
|
||||
<i class="fa fa-eye"></i>
|
||||
</a>
|
||||
@endcan
|
||||
</td>
|
||||
</tr>
|
||||
@endforeach
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="card-footer" id="show-action">
|
||||
<button type="submit" name="action" value="archived" class="btn btn-secondary">
|
||||
<i class="feather icon-box"></i> @lang('admin.orders.archive')
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{{ $orders->links('pagination::bootstrap-4') }}
|
||||
|
||||
{{-- {{ $orders->appends(request()->input())->links() }} --}}
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@include('dashboard.orders.components.index.css')
|
||||
|
||||
@include('dashboard.orders.components.index.js')
|
||||
39
resources/views/dashboard/orders/update.blade.php
Executable file
39
resources/views/dashboard/orders/update.blade.php
Executable file
@@ -0,0 +1,39 @@
|
||||
@extends('dashboard.layouts.app')
|
||||
@section('title', trans('admin.edit') . ' - ')
|
||||
@section('speedbar')
|
||||
<div class="content-header row">
|
||||
<div class="content-header-left col-md-9 col-12 mb-2">
|
||||
<div class="row breadcrumbs-top">
|
||||
<div class="col-12">
|
||||
<h2 class="content-header-title float-left mb-0">@lang('admin.edit')</h2>
|
||||
<div class="breadcrumb-wrapper col-12">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item ">
|
||||
<a href="{{ route('dashboard') }}">@lang('admin.home')</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item ">
|
||||
<a href="{{ route('dashboard.products') }}">@lang('admin.products.title')</a>
|
||||
</li>
|
||||
<li class="breadcrumb-item active">
|
||||
@lang('admin.edit')
|
||||
</li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@section('content')
|
||||
<div id="app">
|
||||
<order-edit :order="{{ json_encode($order) }}" :branches="{{ json_encode($branches) }}"></order-edit>
|
||||
</div>
|
||||
@endsection
|
||||
|
||||
@push('css')
|
||||
@endpush
|
||||
|
||||
@push('js')
|
||||
@vite('resources/js/app.js')</script>
|
||||
@endpush
|
||||
22
resources/views/dashboard/orders/view.blade.php
Executable file
22
resources/views/dashboard/orders/view.blade.php
Executable file
@@ -0,0 +1,22 @@
|
||||
@extends('dashboard.layouts.app')
|
||||
@section('title', trans('admin.orders.title') . ' - ')
|
||||
@include('dashboard.orders.components.view.speedbar')
|
||||
@section('content')
|
||||
<section class="card invoice-page">
|
||||
<div id="invoice-template" class="card-body">
|
||||
@include('dashboard.orders.components.view.header')
|
||||
|
||||
<div class="row">
|
||||
@include('dashboard.orders.components.view.client-info')
|
||||
@include('dashboard.orders.components.view.order-info')
|
||||
</div>
|
||||
|
||||
@include('dashboard.orders.components.view.products')
|
||||
|
||||
@include('dashboard.orders.components.view.comment')
|
||||
|
||||
@include('dashboard.orders.components.view.log')
|
||||
</div>
|
||||
</section>
|
||||
@endsection
|
||||
@include('dashboard.orders.components.view.js')
|
||||
Reference in New Issue
Block a user