ultimatepos/resources/views/holding/partials/table_relations.blade.php

51 lines
2.7 KiB
PHP

<div class="table-responsive">
<table class="table table-bordered table-striped" id="holding_relations_table" style="width:100%">
<thead>
<tr>
<th>@lang('lang_v1.holding_owner')</th>
<th>@lang('lang_v1.holding_related')</th>
<th>@lang('lang_v1.type')</th>
<th>@lang('lang_v1.holding_contract_ref')</th>
<th>@lang('lang_v1.holding_contract_dates')</th>
<th>@lang('lang_v1.holding_status')</th>
<th>@lang('messages.action')</th>
</tr>
</thead>
<tbody>
@forelse($relations as $relation)
<tr>
<td>{{ optional($relation->ownerEntity)->name }}</td>
<td>{{ optional($relation->relatedEntity)->name }}</td>
<td>{{ $relationTypes[$relation->relation_type] ?? $relation->relation_type }}</td>
<td>{{ $relation->contract_ref ?: '—' }}</td>
<td>
@if($relation->contract_start_date || $relation->contract_end_date)
{{ $relation->contract_start_date ? format_date($relation->contract_start_date) : '—' }}
{{ $relation->contract_end_date ? format_date($relation->contract_end_date) : '—' }}
@else @endif
</td>
<td>
@if($relation->is_active)
<span class="label label-success">@lang('lang_v1.holding_status_active')</span>
@else
<span class="label label-warning">@lang('lang_v1.holding_status_inactive')</span>
@endif
</td>
<td>
<div class="btn-group">
@can('holding.update')
<button type="button" class="btn btn-xs btn-primary btn-modal" data-href="{{ route('holding.relations.edit', $relation->id) }}" data-container=".holding_relation_modal"><i class="glyphicon glyphicon-edit"></i></button>
@endcan
@can('holding.delete')
<button type="button" class="btn btn-xs btn-danger holding-delete" data-href="{{ route('holding.relations.destroy', $relation->id) }}" data-tab="relations_tab"><i class="glyphicon glyphicon-trash"></i></button>
@endcan
</div>
</td>
</tr>
@empty
<tr class="holding-table-empty"><td></td><td></td><td></td><td></td><td></td><td></td><td></td></tr>
@endforelse
</tbody>
</table>
</div>