osb/resources/views/theme/backend/adminlte/service/widget/admin/movement.blade.php

81 lines
1.9 KiB
PHP
Raw Normal View History

@use(App\Models\Service)
2020-04-14 07:40:47 +00:00
<!-- Show client movements -->
<div class="card card-dark">
<div class="card-header p-2">
2021-06-29 06:36:34 +00:00
<h3 class="card-title">Service Movements</h3>
2018-08-11 05:09:41 +00:00
</div>
<div class="card-body p-2">
@if(($x=Service::movements($user))->count())
<table class="table table-sm table-striped table-hover" id="service_movements">
2018-08-11 05:09:41 +00:00
<thead>
<tr>
<th>ID</th>
<th>Account</th>
<th>Name</th>
<th>Status</th>
<th>Product</th>
</tr>
</thead>
2021-06-29 06:36:34 +00:00
2020-04-14 07:40:47 +00:00
<tbody>
@foreach ($x as $o)
<tr>
2021-06-29 06:36:34 +00:00
<td><a href="{{ url('u/service',$o->id) }}">{{ $o->sid }}</a></td>
2020-04-14 07:40:47 +00:00
<td>{{ $o->account->name }}</td>
2020-04-18 22:33:41 +00:00
<td>{{ $o->name_short }}</td>
<td>
{{ $o->status }}
@switch($o->status)
@case ('ORDER-SENT')
<br>(#{{ $o->order_info_reference }})
@break;
@case ('PROVISION-PLANNED')
2022-04-19 07:07:39 +00:00
<br>({{ ($xx=$o->start_at) ? $xx->format('Y-m-d') : 'No Date' }})
@break;
@case ('CANCEL-PENDING')
2022-04-19 07:07:39 +00:00
<br>({{ ($xx=$o->stop_at) ? $xx->format('Y-m-d') : 'No Date' }})
@break;
@endswitch
</td>
2020-04-14 07:40:47 +00:00
<td>{{ $o->product->name }}</td>
</tr>
@endforeach
</tbody>
2021-06-29 06:36:34 +00:00
2018-08-11 05:09:41 +00:00
<tfoot>
<tr>
2020-04-14 07:40:47 +00:00
<th>Count {{ $x->count() }}</th>
2018-08-11 05:09:41 +00:00
<th colspan="4">&nbsp;</th>
</tr>
</tfoot>
</table>
@else
<p>No Service Movements</p>
@endif
</div>
</div>
@pa(datatables,rowgroup|conditionalpaging)
2018-08-11 05:09:41 +00:00
@section('page-scripts')
2018-08-11 05:09:41 +00:00
<script type="text/javascript">
$(document).ready(function() {
$('#service_movements').DataTable({
conditionalPaging: true,
order: [3, 'asc'],
2018-08-23 05:17:26 +00:00
rowGroup: {
2020-04-14 07:40:47 +00:00
dataSrc: 1,
startRender: function ( rows, group ) {
return group+': '+rows.count()+' Services';
2018-08-23 05:17:26 +00:00
},
},
orderFixed: [1, 'asc']
2018-08-11 05:09:41 +00:00
});
$('#service_movements tbody').on('click','tr', function () {
$(this).toggleClass('selected');
});
});
</script>
@append