HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers10/helder.komma.pro/resources/views/kms/shop/orders/index.blade.php
@extends('kms.layouts.kms')

@php /** @var \App\Komma\Globalization\RegionInfo $shopRegionInfo */@endphp
@section('content')
    <h1>{{ ucfirst(__('shop/orders.orders')) }}</h1>

    @if ($errors->any())
        <div class="alert alert-danger">
            <h2>Er kon niet gezocht worden. Foutmeldingen:</h2>
            <ul>
                @foreach ($errors->all() as $error)
                    <li>{{ $error }}</li>
                @endforeach
            </ul>
        </div>
    @endif
    <h2>@lang('shop/orders.search')</h2>
    <form action="{{ route('orders.search') }}" method="GET">
{{--        <label for="order_nr">{{ ucfirst(__('shop/orders.order_number')) }}:</label> <input dusk="order_number" type="text" id="order_nr" name="order_number"><br>--}} <!--TODO we don't have an order number yet-->
        <label for="first_name">{{ ucfirst(__('kms/global.first_name')) }}:</label> <input dusk="first_name" type="text" id="first_name" name="first_name" value="{{ old('first_name') }}"><br>
        <label for="last_name">{{ ucfirst(__('kms/global.last_name')) }}:</label> <input dusk="last_name" type="text" id="last_name" name="last_name" value="{{ old('last_name') }}"><br>
        <label for="email">{{ ucfirst(__('kms/global.email')) }}:</label> <input dusk="email" type="text" id="email" name="email" value="{{ old('email') }}"><br>
        <label for="company">{{ ucfirst(__('company.company')) }}:</label> <input dusk="company" type="text" id="company" name="company" value="{{ old('company') }}"><br>
        <label for="street">{{ ucfirst(__('company.street')) }}:</label> <input dusk="street" type="text" id="street" name="street" value="{{ old('street') }}"><br>
        <label for="house_number">{{ ucfirst(__('company.house_number')) }}:</label> <input dusk="house_number" type="text" id="house_number" name="house_number" value="{{ old('house_number') }}"><br>
        <label for="postal_code">{{ ucfirst(__('company.postal_code')) }}:</label> <input dusk="postal_code" type="text" id="postal_code" name="postal_code" value="{{ old('postal_code') }}"><br>
        <label for="status">{{ ucfirst(__('shop/orders.status_name')) }}:</label>
        <select name="status" id="status">
            <option value="each">@lang('shop/orders.all_statusses')</option>
            @foreach(__('shop/orders.status') as $orderStatusKey => $translation)
                <option @if(old('status') === $orderStatusKey) selected @endif value="{{ $orderStatusKey }}">{{ $translation }}</option>
            @endforeach
        </select><br>

        <label for="perPage">{{ ucfirst(__('shop/orders.results_per_page')) }}:</label>
        <select name="perPage" id="perPage">
            <option {{ (isset($perPage) && $perPage == 5) ? 'selected' : '' }} value="5">5</option>
            <option {{ (isset($perPage) && $perPage == 10) ? 'selected' : '' }} value="10">10</option>
            <option {{ (isset($perPage) && $perPage == 20) ? 'selected' : '' }} value="20">20</option>
            <option {{ (isset($perPage) && $perPage == 50) ? 'selected' : '' }} value="50">50</option>
            <option {{ (isset($perPage) && $perPage == 100) ? 'selected' : '' }} value="100">100</option>
        </select>

        <input type="submit" dusk="search_orders_button" value="{{ ucfirst(__('shop/orders.search')) }}">
    </form>

    @if(isset($orders)) <!--Only is set when a search was done or latest orders where included.-->
        <h2>{{ $resultsTypeTranslation }}</h2>
        @if(count($orders) > 0)
            <table class="order-table">
                <thead>
                    <tr>
                        <th>Id</th>
                        <th>{{ ucfirst(__('shop/orders.status_name')) }}</th>
                        <th>{{ ucfirst(__('kms/global.total')) }}</th>
                        <th>{{ ucfirst(__('shop/products.discount')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.invoice_first_name')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.invoice_last_name')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.invoice_email')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.invoice_company')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.invoice_culture')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.invoice_postal_code')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.invoice_city')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.invoice_street')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.invoice_house_number')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.invoice_telephone')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.shipping_culture')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.shipping_postal_code')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.shipping_city')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.shipping_street')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.shipping_house_number')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.shipping_telephone')) }}</th>
                        <th>{{ ucfirst(__('shop/orders.created_at')) }}</th>
                    </tr>
                </thead>
                <tbody>
                    @foreach($orders as $order)
                        @php /** @var \App\Komma\Shop\Orders\Models\Order $order */@endphp
                        <tr>
                            <td><a href="{{ route('orders.show', ['order' => $order]) }}">{{ $order->id }}</a></td>
                            <td><a href="{{ route('orders.show', ['order' => $order]) }}">{{ __('shop/orders.status.'.$order->status) }}</a></td>
                            <td><a href="{{ route('orders.show', ['order' => $order]) }}">{{ $shopRegionInfo->getCurrencySymbol().$shopRegionInfo->getNumberFormat()->centsToCurrency($order->total_price) }}</a></td>
                            <td><a href="{{ route('orders.show', ['order' => $order]) }}">{{ $order->discount }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->customer->first_name }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->customer->last_name }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->customer->email }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->customer->company }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ (new \App\Komma\Globalization\CultureInfo($order->customer->culture))->getNativeName() }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->invoice_postal_code }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->invoice_city }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->invoice_street }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->invoice_house_number }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->invoice_telephone }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ (new \App\Komma\Globalization\CultureInfo($order->customer->culture))->getNativeName() }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->shipping_postal_code }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->shipping_city }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->shipping_street }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->shipping_house_number }}</a></td>
                            <td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->shipping_telephone }}</a></td>
                            <td><a href="{{ route('orders.show', ['user' => $order]) }}">{{ $order->created_at }}</a></td>
                        </tr>
                    @endforeach
                </tbody>
            </table>

            @if(method_exists($orders, 'links')) {{ $orders->links() }} @endif
        @else
            <p>@lang('shop/orders.no_results')</p>
        @endif
    @endif
@stop