osb/resources/views/theme/backend/adminlte/r/service/widgets/movement.blade.php

83 lines
2.2 KiB
PHP

<!-- Show client movements -->
<div class="card card-dark">
<div class="card-header">
<h3 class="card-title">Service Movements</h3>
</div>
<div class="card-body">
@if (($x=$user->client_service_movements())->count())
<table class="table table-striped table-hover" id="service_movements">
<thead>
<tr>
<th>ID</th>
<th>Account</th>
<th>Name</th>
<th>Status</th>
<th>Product</th>
</tr>
</thead>
<tbody>
@foreach ($x as $o)
<tr>
<td><a href="{{ url('u/service',$o->id) }}">{{ $o->sid }}</a></td>
<td>{{ $o->account->name }}</td>
<td>{{ $o->name_short }}</td>
<td>
{{ $o->status }}
@switch($o->status)
@case ('ORDER-SENT')
<br>(#{{ $o->order_info_reference }})
@break;
@case ('PROVISION-PLANNED')
<br>({{ ($xx=$o->date_start) ? $xx->format('Y-m-d') : 'No Date' }})
@break;
@case ('CANCEL-PENDING')
<br>({{ ($xx=$o->date_end) ? $xx->format('Y-m-d') : 'No Date' }})
@break;
@endswitch
</td>
<td>{{ $o->product->name }}</td>
</tr>
@endforeach
</tbody>
<tfoot>
<tr>
<th>Count {{ $x->count() }}</th>
<th colspan="4">&nbsp;</th>
</tr>
</tfoot>
</table>
@else
<p>No Service Movements</p>
@endif
</div>
</div>
@section('page-scripts')
@css('//cdn.datatables.net/1.10.25/css/dataTables.bootstrap5.min.css','jq-dt-css','jquery')
@js('//cdn.datatables.net/1.10.25/js/jquery.dataTables.min.js','jq-dt-js','jquery')
@js('//cdn.datatables.net/1.10.25/js/dataTables.bootstrap5.min.js','jq-dt-bs5-js','jq-dt-js')
@js('//cdn.datatables.net/rowgroup/1.1.3/js/dataTables.rowGroup.min.js','jq-dt-rowgroup-js','jq-dt-js')
@css('//cdn.datatables.net/rowgroup/1.1.3/css/rowGroup.bootstrap5.min.css','jq-dt-rowgroup-css','jq-dt-jss')
<script type="text/javascript">
$(document).ready(function() {
$('#service_movements').DataTable( {
order: [3, 'asc'],
rowGroup: {
dataSrc: 1,
startRender: function ( rows, group ) {
return group+': '+rows.count()+' Services';
},
},
orderFixed: [1, 'asc']
});
$('#service_movements tbody').on('click','tr', function () {
$(this).toggleClass('selected');
});
});
</script>
@append