osb/resources/views/theme/backend/adminlte/account/widget/service_active.blade.php

76 lines
1.6 KiB
PHP
Raw Normal View History

<!-- $o = Account::class -->
2024-07-09 10:17:30 +00:00
@php
$o->load(['services_active.invoiced_service_items_active_recent']);
@endphp
2021-06-29 06:36:34 +00:00
<!-- Show active services -->
<div class="card card-light">
2021-06-29 06:36:34 +00:00
<div class="card-header">
<h3 class="card-title">Active Services</h3>
</div>
<div class="card-body">
2024-07-09 10:17:30 +00:00
@if (($x=$o->services_active)->count())
<table class="table table-striped table-hover w-100" id="services_active_{{ $ao->id }}">
2021-06-29 06:36:34 +00:00
<thead>
<tr>
<th>ID</th>
<th>Category</th>
2021-06-29 06:36:34 +00:00
<th>Service</th>
<th>Product</th>
<th>Next Invoice</th>
</tr>
</thead>
<tbody>
@foreach ($x as $so)
2024-07-05 06:38:31 +00:00
<tr>
<td><a href="{{ url('u/service',[$so->id]) }}">{{ $so->sid }}</a></td>
<td>{{ $so->product->category_name }}</td>
<td>{{ $so->name_short }}</td>
<td>{{ $so->product->name }}</td>
<td>{{ $so->external_billing ? '-' : $so->invoice_next->format('Y-m-d') }}</td>
</tr>
2021-06-29 06:36:34 +00:00
@endforeach
</tbody>
<tfoot>
<tr>
<th>Count {{ $x->count() }}</th>
2021-06-29 06:36:34 +00:00
<th colspan="4">&nbsp;</th>
</tr>
</tfoot>
</table>
@else
<p>No services active</p>
@endif
</div>
</div>
2024-07-05 06:38:31 +00:00
@section('page-styles')
@css(datatables,bootstrap4|rowgroup)
2024-07-05 06:38:31 +00:00
@append
@section('page-scripts')
@js(datatables,bootstrap4|rowgroup)
2021-06-29 06:36:34 +00:00
<script type="text/javascript">
$(document).ready(function() {
$('#services_active_{{ $ao->id }}').DataTable({
2022-04-19 07:07:39 +00:00
order: [[1,'asc'],[2,'asc']],
2021-06-29 06:36:34 +00:00
rowGroup: {
dataSrc: 1,
endRender: function ( rows, group ) {
return rows.count()+' x ' + group;
},
},
columnDefs: [
{
targets: [1],
visible: false,
},
],
2021-06-29 06:36:34 +00:00
});
});
</script>
@append