Work in progress, initial dashboard

This commit is contained in:
Deon George
2018-06-05 21:13:57 +10:00
parent feda44db8a
commit c6342abdc2
31 changed files with 17024 additions and 385 deletions

View File

@@ -77,3 +77,6 @@ Vue.component('reset-password-form', require('./components/auth/ResetPasswordFor
// cluster: process.env.MIX_PUSHER_APP_CLUSTER,
// encrypted: true
// });
import dt from 'datatables.net';
import 'datatables.net-dt/css/jquery.datatables.css';

View File

@@ -15,6 +15,15 @@
<div class="content">
<div class="row">
<div class="col-sm-3">
<div class="info-box">
<span class="info-box-icon bg-red"><i class="fa fa-dollar"></i></span>
<div class="info-box-content">
<span class="info-box-text">Account Balance</span>
<span class="info-box-number"><small>$</small>TBA {{ number_format($user->invoices_due->sum('due'),2) }}</span>
</div>
</div>
</div>
<div class="col-sm-3">
<div class="info-box">
<span class="info-box-icon bg-green"><i class="fa fa-clone"></i></span>
@@ -26,7 +35,7 @@
</div>
<div class="col-sm-3">
<div class="info-box">
<span class="info-box-icon bg-red"><i class="fa fa-dollar"></i></span>
<span class="info-box-icon bg-blue"><i class="fa fa-dollar"></i></span>
<div class="info-box-content">
<span class="info-box-text">Invoices Due</span>
<span class="info-box-number"><small>$</small>{{ number_format($user->invoices_due->sum('due'),2) }}</span>
@@ -42,11 +51,9 @@
<div class="col-xs-5">
@include('widgets.invoices_due')
</div>
{{--
<div class="col-xs-5">
@include('widgets.payment_history',['limit'=>10])
</div>
--}}
</div>
</div>
@endsection

View File

@@ -0,0 +1,15 @@
@extends('layouts.auth')
@section('htmlheader_title')
Supplier Add
@endsection
@section('content')
<body>
<form method="POST" action="/r/supplier/store">
{{ csrf_field() }}
Name: <input name="name" > <br>
<button>Submit</button>
</form>
</body>
@endsection

View File

@@ -0,0 +1,25 @@
@extends('layouts.auth')
@section('htmlheader_title')
Supplier List
@endsection
@section('content')
<body>
<table>
<tr>
<th>ID</th>
<th>Name</th>
</tr>
@foreach (\App\Models\Supplier::all() as $o)
<tr>
<td>{{ $o->id }}</td>
<td>{{ $o->name }}</td>
</tr>
@endforeach
</table>
Add new <a href="{{ url('r/supplier/create') }}">Supplier</a>.
</body>
@endsection

View File

@@ -1,4 +1,4 @@
<div class="box box-danger small">
<div class="box box-info small">
<div class="box-header">
<h3 class="box-title">Invoices Due</h3>
<div class="box-tools pull-right">

View File

@@ -1,4 +1,4 @@
<div class="box box-danger small">
<div class="box box-notice small">
<div class="box-header">
<h3 class="box-title">Payment History</h3>
<div class="box-tools pull-right">

View File

@@ -11,35 +11,62 @@
<div class="box-body">
@if ($user->services_active->count())
<table class="table table-bordered table-striped table-hover" id="table">
<tr>
<th>Type</th>
<th>Service</th>
<th>Name</th>
<th>Status</th>
<th>Next Invoice</th>
</tr>
@foreach ($user->services_active as $o)
<tr>
<td>{{ $o->category }}</td>
<td>{{ $o->service_number }}</td>
<td>{{ $o->service_name }}</td>
<td><span class="label
@switch($o->active)
@case(1) label-success">Active @break
@default label-warning">Unknown
@endswitch
</span></td>
<td>{{ $o->next_invoice }}</td>
</tr>
@endforeach
<tr>
<th>Count {{ $user->services_active->count() }}</th>
<th colspan="4">&nbsp;</th>
</tr>
<table class="table table-bordered table-striped table-hover" id="services" style="width: 100%;">
<thead>
<tr>
<th>Category</th>
<th>Service</th>
<th>Name</th>
<th>Status</th>
<th>Next Invoice</th>
</tr>
</thead>
<tfoot>
<tr>
<th>Count {{ $user->services_active->count() }}</th>
<th colspan="4">&nbsp;</th>
</tr>
</tfoot>
</table>
@else
<p>No services active</p>
@endif
</div>
</div>
</div>
@section('page-scripts')
@css('https://cdn.datatables.net/responsive/2.2.1/css/responsive.dataTables.min.css')
@css('https://cdn.datatables.net/rowgroup/1.0.2/css/rowGroup.dataTables.min.css')
@js('https://cdn.datatables.net/responsive/2.2.1/js/dataTables.responsive.min.js')
@js('https://cdn.datatables.net/rowgroup/1.0.2/js/dataTables.rowGroup.min.js')
<script type="text/javascript">
$(document).ready(function() {
var table = $('#services').DataTable( {
rowGroup: {
dataSrc: 'product_id',
startRender: null,
endRender: function ( rows, group ) {
return group +' ('+rows.count()+')';
},
},
orderFixed: [2, 'asc'],
responsive: true,
ajax: "/api/u/services",
columns: [
{
defaultContent: '&nbsp;'
},
{ data: "id" },
{ data: "product_id" },
{ data: "active" },
{ data: "date_next_invoice" }
],
language: {
emptyTable: "No Active Services"
},
order: [4, 'asc']
});
});
</script>
@append