restore composer.json, add mysqli extension

This commit is contained in:
2026-04-15 17:02:52 +05:00
commit 77cf56a348
4317 changed files with 1397107 additions and 0 deletions

View 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>

View 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

View 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>

View 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">&times;</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

View 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

View 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>

View 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>

View 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