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/group-print.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">
                        <button class="btn btn-primary" type="button" id="print">
                            <span class="fa fa-print"></span> چاپ کن
                        </button>
                    </div>
                    <div class="col-sm-6">
                        <ol class="breadcrumb float-sm-left">
                            {{ Breadcrumbs::render('orders-group-print') }}
                        </ol>
                    </div>
                </div>
            </div>
        </div>
        <section class="content" id="printable">
            <div class="container-fluid">
                @foreach($orders as $order)
                    @php $address = $order->addresses->first(); @endphp
                    @unless($loop->first) <hr> @endunless
                    <div class="row">
                        <div class="col-md-12">
                            <div class="card card-primary">
                                <div class="card-body">
                                    <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>{{ $order->payment_type->description }}</td>
                                                <td>{{ $order->status->description }}</td>
                                                <td>{{ to_persian_numbers(jdate($order->created_at)) }}</td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </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->where('order_id', $order->id) 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>
                                                    <td>{{ to_persian_numbers($orderProduct->quantity) }}</td>
                                                    <td>{{ to_persian_numbers(number_format($orderProduct->price)) }}</td>
                                                    <td>{{ to_persian_numbers(number_format($orderProduct->discount * $orderProduct->quantity)) }}</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">
                                                    {{ to_persian_numbers(number_format($order->shipping_price)) }}
                                                </td>
                                            </tr>
                                            <tr>
                                                <th colspan="6">جمع کل</th>
                                                <td class="text-center">{{ to_persian_numbers(number_format($order->price)) }}</td>
                                            </tr>
                                            </tfoot>
                                        </table>
                                    </div>
                                    <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 }}</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)
                                        <div>
                                            <strong>توضیحات کاربر: </strong>
                                            {{ $order->description }}
                                        </div>
                                    @endif
                                </div>
                            </div>
                        </div>
                    </div>
                @endforeach
            </div>
        </section>
    </div>
@endsection
@section('footer')
    <script>
        $(document).on('click', '#print', function () {
            $('#printable').printThis({header: "", footer: ""});
        });
    </script>
@endsection