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

87 lines
1.9 KiB
PHP
Raw Normal View History

2024-07-05 12:56:02 +00:00
@php
use App\Models\Service;
@endphp
2020-04-14 07:40:47 +00:00
<!-- Show client movements -->
<div class="card card-dark">
2019-06-02 05:35:48 +00:00
<div class="card-header">
2021-06-29 06:36:34 +00:00
<h3 class="card-title">Service Movements</h3>
2018-08-11 05:09:41 +00:00
</div>
2019-06-02 05:35:48 +00:00
<div class="card-body">
2024-07-05 12:56:02 +00:00
@if (($x=Service::movements($user))->count())
2021-06-29 06:36:34 +00:00
<table class="table 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>
2024-07-05 09:15:07 +00:00
2024-07-05 07:23:06 +00:00
@section('page-styles')
@css(datatables,bootstrap4|rowgroup)
@append
2018-08-11 05:09:41 +00:00
@section('page-scripts')
@js(datatables,bootstrap4|rowgroup)
2018-08-11 05:09:41 +00:00
<script type="text/javascript">
$(document).ready(function() {
$('#service_movements').DataTable( {
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