@extends(Auth::check() && Auth::user()->role->layout == 1 ? 'layouts.admin' : 'layouts.employee')

@section('content')
<div class="content-wrapper">
	<section class="content-header">
		<h1>
		Cliente
		</h1>
	</section>

	<section class="content">
		<a class="btn btn-app btn-flat bg-green" href="{{ asset('/customers/'.$customer->id.'/edit') }}"><i class="fa fa-edit"></i> {{trans('general.edit')}}</a>
		<div class="row">
			<div class="col-md-9">
				<div class="row">
					<div class="col-md-12">
						<div class="box box-success">
							<div class="box-header">
								<h3 class="box-title">Cliente {{trans('general.detalle')}} </h3>
							</div>
							<div class="box-body no-padding">
								<table class="table">
									<tbody>
									<tr>
										<td style="width: 10px" class="text-center"><i class="fa fa-user"></i></td>
										<td><strong>Nombre</strong></td>
										<td>{{ $customer->fiscal_reason }}</td>
									</tr>
									<tr>
										<td style="width: 10px" class="text-center"><i class=""></i></td>
										<td><strong>Cif</strong></td>
										<td>{{ $customer->cif }}</td>
									</tr>
									<tr>
										<td style="width: 10px" class="text-center"><i class=""></i></td>
										<td><strong>Dirección</strong></td>
										<td>{{ $customer->fiscal_address }}</td>
									</tr>

									<tr>
										<td style="width: 10px" class="text-center"><i class="fa fa-pencil"></i></td>
										<td><strong>Comentarios</strong></td>
										<td>{{ $customer->comment }}</td>
									</tr>

									</tbody>
								</table>
							</div>
						</div>
					</div>
				</div>
				<div class="row">

					<div class="col-sm-6">
								<div class="description-block">
									<h5 class="description-header">{{ $user->boats ? $user->boats->count() : '0' }}</h5>
									<span class="description-text small">{{trans('general.boats')}}</span>
								</div>
					</div>
					<div class="col-md-6">
						<div class="box box-success">
							<div class="box-header">
								<h3 class="box-title">{{trans('general.boats')}} {{trans('general.detalle')}}</h3>
							</div>
							<div class="box-body no-padding">
								<table class="table">
									<tbody>
									<tr>
										<td style="width: 10px" class="text-center"><i class="fa fa-key"></i></td>
										<td><strong>{{trans('general.usuario')}} ID</strong></td>
										<td>{{ $user->id }}</td>
									</tr>
									<tr>
										<td class="text-center"><i class="fa fa-briefcase"></i></td>
										<td><strong>{{trans('general.nombre')}}</strong></td>
										@if($user->boats ? $user->boats : '')
										<td>
										@foreach ($user->boats as $boat)
										{{ $boat->name }} -
										@endforeach
										</td>
										@endif
									</tr>
									<tr>
										<td class="text-center"><i class="fa fa-calendar-check-o"></i></td>
										<td><strong>{{trans('general.launch')}}</strong></td>
										@if($user->boats ? $user->boats : '')
										<td>
										@foreach ($user->boats as $boat)
										{{ $boat->launch }} -
										@endforeach
										</td>
										@endif
										
									</tr>
									<tr>
										<td class="text-center"><i class="fa fa-briefcase"></i></td>
										<td><strong>{{trans('general.maker')}}</strong></td>
										@if($user->boats ? $user->boats : '')
										<td>
										@foreach ($user->boats as $boat)
										{{ $boat->maker }} -
										@endforeach
										</td>
										@endif
										
									</tr>
									<tr>
										<td class="text-center"><i class="fa fa-credit-card"></i></td>
										<td><strong>{{trans('general.boatnumber')}}</strong></td>
										@if($user->boats ? $user->boats : '')
										<td>
										@foreach ($user->boats as $boat)
										{{ $boat->number }} -
										@endforeach
										</td>
										@endif
										
									</tr>
									<tr>
										<td class="text-center"><i class="fa fa-credit-card"></i></td>
										<td><strong>{{trans('general.model')}}</strong></td>
										@if($user->boats ? $user->boats : '')
										<td>
										@foreach ($user->boats as $boat)
										{{ $boat->model }} - 
										@endforeach
										</td>
										@endif
										
									</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>

					<div class="col-md-6">
						<div class="box box-success">
							<div class="box-header">
								<h3 class="box-title">{{trans('general.bank')}} {{trans('general.detalle')}}</h3>
							</div>
							<div class="box-body no-padding">
								<table class="table">
									<tbody>
									<tr>
										<td style="width: 10px" class="text-center"><i class="fa fa-credit-card-alt"></i></td>
										<td><strong>{{trans('general.accountname')}}</strong></td>
										<td>{{ $user->bank_account ? $user->bank_account->account_name : '' }}</td>
									</tr>
									<tr>
										<td style="width: 10px" class="text-center"><i class="fa fa-hashtag"></i></td>
										<td><strong>{{trans('general.accountnumber')}} </strong></td>
										<td>{{ $user->bank_account ? $user->bank_account->account_number : '' }}</td>
									</tr>
									<tr>
										<td style="width: 10px" class="text-center"><i class="fa fa-bank"></i></td>
										<td><strong>{{trans('general.bankname')}}</strong></td>
										<td>{{ $user->bank_account ? $user->bank_account->bank_name : '' }}</td>
									</tr>
									</tbody>
								</table>
							</div>
						</div>
					</div>

				</div>
			</div>
		</div>
	</section>
</div>
@endsection
