File: D:/HostingSpaces/SBogers95/rentman.io/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"><br>
<label for="last_name">{{ ucfirst(__('kms/global.last_name')) }}:</label> <input dusk="last_name" type="text" id="last_name" name="last_name"><br>
<label for="email">{{ ucfirst(__('kms/global.email')) }}:</label> <input dusk="email" type="text" id="email" name="email"><br>
<label for="company">{{ ucfirst(__('company.company')) }}:</label> <input dusk="company" type="text" id="company" name="company"><br>
<label for="street">{{ ucfirst(__('company.street')) }}:</label> <input dusk="street" type="text" id="street" name="street"><br>
<label for="house_number">{{ ucfirst(__('company.house_number')) }}:</label> <input dusk="house_number" type="text" id="house_number" name="house_number"><br>
<label for="postal_code">{{ ucfirst(__('company.postal_code')) }}:</label> <input dusk="postal_code" type="text" id="postal_code" name="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 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_first_name')) }}</th>
<th>{{ ucfirst(__('shop/orders.shipping_last_name')) }}</th>
<th>{{ ucfirst(__('shop/orders.shipping_email')) }}</th>
<th>{{ ucfirst(__('shop/orders.shipping_company')) }}</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>
</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->invoice_first_name }}</a></td>
<td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->invoice_last_name }}</a></td>
<td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->invoice_email }}</a></td>
<td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->invoice_company }}</a></td>
<td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ (new \App\Komma\Globalization\CultureInfo($order->invoice_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]) }}">{{ $order->shipping_first_name }}</a></td>
<td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->shipping_last_name }}</a></td>
<td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->shipping_email }}</a></td>
<td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ $order->shipping_company }}</a></td>
<td><a href="{{ route('users.show', ['user' => $order->user_id]) }}">{{ (new \App\Komma\Globalization\CultureInfo($order->invoice_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>
</tr>
@endforeach
</tbody>
</table>
@if(method_exists($orders, 'links')) {{ $orders->links() }} @endif
@else
<p>@lang('shop/orders.no_results')</p>
@endif
@endif
@stop