Changed home screen to use account models instead of user model. Home screen now shows multiple accounts

This commit is contained in:
Deon George
2023-05-09 19:28:51 +09:00
parent 790ece14d1
commit dde11f73f5
11 changed files with 174 additions and 157 deletions

View File

@@ -1,4 +1,4 @@
<!-- $o = User::class -->
<!-- $o = Account::class -->
<!-- Show active services -->
<div class="card card-light">
<div class="card-header">
@@ -6,8 +6,8 @@
</div>
<div class="card-body">
@if ($o->services->count())
<table class="table table-striped table-hover w-100" id="services_active">
@if (($x=$o->services->where('active',TRUE))->count())
<table class="table table-striped table-hover w-100" id="services_active_{{ $ao->id }}">
<thead>
<tr>
<th>ID</th>
@@ -19,19 +19,19 @@
</thead>
<tbody>
@foreach ($o->services as $oo)
@foreach ($x as $so)
<tr>
<td><a href="{{ url('u/service',[$oo->id]) }}">{{ $oo->sid }}</a></td>
<td>{{ $oo->product->category_name }}</td>
<td>{{ $oo->name_short }}</td>
<td>{{ $oo->product->name }}</td>
<td>{{ $oo->external_billing ? '-' : $oo->invoice_next->format('Y-m-d') }}</td>
<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>
@endforeach
</tbody>
<tfoot>
<tr>
<th>Count {{ $o->services->count() }}</th>
<th>Count {{ $x->count() }}</th>
<th colspan="4">&nbsp;</th>
</tr>
</tfoot>
@@ -47,19 +47,9 @@
@css(datatables,bootstrap4|rowgroup)
@js(datatables,bootstrap4|rowgroup)
<style>
table.dataTable tr.dtrg-group.dtrg-end.dtrg-level-0 {
font-size: 75%;
background-color: #eeeeee !important;
}
table.dataTable tr.dtrg-group.dtrg-end.dtrg-level-0 td {
background-color: #fefefe !important;
}
</style>
<script type="text/javascript">
$(document).ready(function() {
$('#services_active').DataTable({
$('#services_active_{{ $ao->id }}').DataTable({
order: [[1,'asc'],[2,'asc']],
rowGroup: {
dataSrc: 1,
@@ -75,7 +65,7 @@
],
});
$('#services_active tbody').on('click','tr', function () {
$('#services_active_{{ $ao->id }} tbody').on('click','tr', function () {
$(this).toggleClass('selected');
});
});