HEX
Server: LiteSpeed
System: Linux sv4.hami.host 5.14.0-611.54.3.el9_7.x86_64 #1 SMP PREEMPT_DYNAMIC Thu May 7 16:31:24 EDT 2026 x86_64
User: armgroup (1008)
PHP: 8.2.32
Disabled: show_source, system, shell_exec, passthru, exec, popen, proc_open, mail, socket_create, socket_create_listen, socket_create_pair, link, dl, openlog, syslog, stream_socket_server, curl_multi_init
Upload Files
File: //home/armgroup/libs/resources/views/admin/orders/edit.blade.php
@extends('admin.layouts.app')
@section('title', "پنل مدیریت | ویرایش سفارش")
@section('content')
    <div class="content-wrapper">
        <div class="content-header">
            <div class="container-fluid">
                <div class="row mb-2">
                    <div class="col-sm-6">
                        <h1 class="m-0 text-dark">ویرایش سفارش</h1>
                    </div>
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-left">
                            {{ Breadcrumbs::render('orders-edit', $order) }}
                        </ol>
                    </div>
                </div>
            </div>
        </div>
        <section class="content">
            <div class="container-fluid">
                <div class="row">
                    <div class="col-md-12">
                        <div class="card card-primary">
                            <div class="card-body">
                                <div class="mb-3">
                                    @if($order->delivery_code && $order->delivery_date)
                                        <h5 class="text-center">ارسال لینک صفحه تایید تحویل سفارش به پیک (کد
                                            تحویل: {{ to_persian_numbers($order->delivery_code) }})</h5>
                                        <livewire:admin.order.verify-delivery-link :order="$order"/>
                                    @else
                                        <livewire:admin.order.post-tracking-code :order="$order"/>
                                    @endif
                                </div>
                                <div class="table-responsive">
                                    <table
                                        class="table table-hover table-condensed table-bordered table-striped tbl-card">
                                        <thead class="thead">
                                        <tr>
                                            <th scope="col">خریدار</th>
                                            <th scope="col">موبایل</th>
                                            <th scope="col">کد پیگیری</th>
                                            <th scope="col">قیمت (تومان)</th>
                                            <th scope="col">نوع پرداخت</th>
                                            <th scope="col">وضعیت</th>
                                            <th scope="col">تاریخ ثبت سفارش</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr>
                                            <td>{{ $order->user->name }}</td>
                                            <td>{{ to_persian_numbers($order->user->mobile) }}</td>
                                            <td>{{ $order->tracking_code }}</td>
                                            <td>{{ to_persian_numbers(number_format($order->price)) }}</td>
                                            <td>
                                        <span class="badge badge-{{ $order->payment_type->color() }}">
                                            {{ $order->payment_type->description }}
                                        </span>
                                            </td>
                                            <td>
                                                <livewire:admin.order.status :order="$order"/>
                                            </td>
                                            <td>{{ to_persian_numbers(jdate($order->created_at)) }}</td>
                                        </tr>
                                        </tbody>
                                    </table>
                                </div>
                                @if($order->payment_type->is(\App\Enums\OrderPaymentType::ONLINE))
                                    <hr>
                                    <div class="table-responsive">
                                        <table class="table table-hover table-condensed table-bordered table-striped tbl-card">
                                            <thead class="thead">
                                            <tr>
                                                <th scope="col">شناسه تراکنش</th>
                                                <th scope="col">کد ارجاع</th>
                                                <th scope="col">درگاه بانکی</th>
                                                <th scope="col">IP</th>
                                                <th scope="col">وضعیت</th>
                                                <th scope="col">تاریخ</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            @foreach($order->payments as $payment)
                                                <tr>
                                                    <td>{{ $payment->transaction_id }}</td>
                                                    <td>{{ $payment->reference_id }}</td>
                                                    <td>{{ __($payment->driver) }}</td>
                                                    <td>{{ $payment->ip }}</td>
                                                    <td>
                                                <span class="badge badge-{{ $payment->status ? 'success' : 'danger' }}">
                                                    @if($payment->status)
                                                        موفق
                                                    @else
                                                        ناموفق
                                                        @if($payment->error_message)
                                                            ({{ $payment->error_message }})
                                                        @endif
                                                    @endif
                                                </span>
                                                    </td>
                                                    <td>{{ to_persian_numbers(jdate($order->created_at)) }}</td>
                                                </tr>
                                            @endforeach
                                            </tbody>
                                        </table>
                                    </div>
                                @endif
                                <hr>
                                <div class="text-center">
                                    <small class="text-danger">
                                        <u><span class="fa fa-info-circle"></span> برای حذف محصول از سفارش تعداد آن‌را صفر کنید</u>
                                    </small>
                                </div>
                                <div class="table-responsive">
                                    <table
                                        class="table table-hover table-condensed table-bordered table-striped tbl-card">
                                        <thead>
                                        <tr class="text-center">
                                            <th>#</th>
                                            <th>نام</th>
                                            <th>کد</th>
                                            <th>تعداد</th>
                                            <th>قیمت واحد</th>
                                            <th>تخفیف واحد</th>
                                            <th>جمع کل</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        @foreach($orderProducts as $orderProduct)
                                            <tr class="text-center">
                                                <td>{{ $loop->iteration }}</td>
                                                <td>
                                                    @if($orderProduct->product->slug)
                                                        <a href="{{ route('products.show', $orderProduct->product->slug) }}"
                                                           class="text-dark"
                                                           target="_blank">
                                                            {{ $orderProduct->name }}
                                                        </a>
                                                    @else
                                                        {{ $orderProduct->name }}
                                                    @endif
                                                </td>
                                                <td>{{ $orderProduct->product->code }}</td>
                                                <livewire:admin.order.update-quantity
                                                    :wire:key="$loop->index"
                                                    :quantity="$orderProduct->quantity"
                                                    :orderProduct="$orderProduct"
                                                    :order="$order"
                                                    :orderProductsCount="count($orderProducts)"
                                                    :product="$orderProduct->product" />
                                                <td>{{ to_persian_numbers(number_format($orderProduct->price + $orderProduct->discount)) }}</td>
                                                <td>{{ to_persian_numbers(number_format($orderProduct->discount)) }}</td>
                                                <td>{{ to_persian_numbers(number_format($orderProduct->price * $orderProduct->quantity)) }}</td>
                                            </tr>
                                        @endforeach
                                        </tbody>
                                        <tfoot>
                                        @if($order->discount_code_price)
                                            <tr>
                                                <th colspan="6">
                                                    کد تخفیف
                                                    @if($order->discountCode->title)
                                                        <a href="{{ route('admin.discounts.show', $order->discountCode->id) }}"
                                                           target="_blank">
                                                            ({{ $order->discountCode->title }})
                                                        </a>
                                                    @endif
                                                </th>
                                                <td class="text-center">{{ to_persian_numbers(number_format($order->discount_code_price)) }}</td>
                                            </tr>
                                        @endif
                                        @if($order->discount)
                                            <tr>
                                                <th colspan="6">مجموع تخفیف</th>
                                                <td class="text-center">{{ to_persian_numbers(number_format($order->discount + $order->discount_code_price)) }}</td>
                                            </tr>
                                        @endif
                                        <tr>
                                            <th colspan="6">هزینه ارسال
                                                ({{ is_null($order->shipping_type) ? 'رایگان' : \App\Models\Order::SHIPPING_TRANSLATE[$order->shipping_type] }}
                                                )
                                            </th>
                                            <td class="text-center">
{{--                                                @if(is_null($order->shipping_type))--}}
{{--                                                    {{ to_persian_numbers(number_format($order->shipping_price)) }}--}}
{{--                                                @else--}}
                                                    <livewire:admin.order.shipping-price :order="$order" />
{{--                                                @endif--}}
                                            </td>
                                        </tr>
                                        <tr>
                                            <th colspan="6">جمع کل</th>
                                            <td class="text-center">{{ to_persian_numbers(number_format($order->price)) }}</td>
                                        </tr>
                                        </tfoot>
                                    </table>
                                </div>
                                <hr>
                                <div class="table-responsive">
                                    <table
                                        class="table table-hover table-condensed table-bordered table-striped tbl-card">
                                        <thead>
                                        <tr>
                                            <th>نام گیرنده</th>
                                            <th>موبایل</th>
                                            <th>کدملی</th>
                                            <th>استان</th>
                                            <th>شهر</th>
                                            <th>کدپستی</th>
                                            <th>پلاک</th>
                                            <th>واحد</th>
                                        </tr>
                                        </thead>
                                        <tbody>
                                        <tr>
                                            <td>{{ $address->name }}</td>
                                            <td>{{ to_persian_numbers($address->mobile) }}</td>
                                            <td>{{ to_persian_numbers($address->national_code) }}</td>
                                            <td>{{ $address->city->province->name }}</td>
                                            <td>{{ $address->city->name }}</td>
                                            <td>{{ to_persian_numbers($address->postal_code) }}</td>
                                            <td>{{ to_persian_numbers($address->plaque) }}</td>
                                            <td>{{ to_persian_numbers($address->floor) }}</td>
                                        </tr>
                                        </tbody>
                                        <tfoot>
                                        <tr>
                                            <th>آدرس کامل</th>
                                            <td colspan="7">
                                                {{ $address->address }}
                                                @if($address->lat && $address->lng)
                                                    <div id="map"
                                                         style="height: 300px; width: inherit; margin-top: 20px;"></div>
                                                @endif
                                            </td>
                                        </tr>
                                        @if($order->delivery_date && $order->delivery_time)
                                            <tr>
                                                <th colspan="4">تاریخ تحویل</th>
                                                <th colspan="4">زمان تحویل</th>
                                            </tr>
                                            <tr>
                                                <td colspan="4">
                                                    {{ to_persian_numbers(jdate($order->delivery_date)->format('Y/m/d')) }}
                                                </td>
                                                <td colspan="4">
                                                    {{ to_persian_numbers($order->delivery_time) }}
                                                </td>
                                            </tr>
                                        @endif
                                        </tfoot>
                                    </table>
                                </div>
                                @if($order->description)
                                    <hr>
                                    <div class="alert alert-info">
                                        <strong>توضیحات کاربر: </strong>
                                        {{ $order->description }}
                                    </div>
                                @endif
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>
    </div>
@endsection
@if($address->lat && $address->lng)
    @section('header')
        <link rel="stylesheet" href="{{ asset('leaflet/leaflet.css') }}" />
        <link rel="stylesheet" href="{{ asset('Leaflet.EasyButton/src/easy-button.css') }}">
        <style>
            input[type="text"]:-moz-placeholder {
                text-align: right;
            }
            input[type="text"]:-ms-input-placeholder {
                text-align: right;
            }
            input[type="text"]::-webkit-input-placeholder {
                text-align: right;
            }
        </style>
    @endsection
    @section('footer')
        <script src="{{ asset('leaflet/leaflet.js') }}"></script>
        <script src="{{ asset('Leaflet.EasyButton/src/easy-button.js') }}"></script>
        <script>
            var map = L.map('map').setView([{{ $address->lat }}, {{ $address->lng }}], 14);
            map.scrollWheelZoom.disable()
            L.tileLayer('https://tile.openstreetmap.org/{z}/{x}/{y}.png', {
                attribution: '',
                maxZoom: 18,
                tileSize: 512,
                zoomOffset: -1,
            }).addTo(map);

            L.easyButton( 'fa-location-arrow', function(){
                window.open('https://www.google.com/maps/search/?api=1&query={{ $address->lat }},{{ $address->lng }}', '_blank');
            }).addTo(map);

            var marker = L.marker([{{ $address->lat }}, {{ $address->lng }}]).addTo(map);
        </script>
    @endsection
@endif