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

@ -0,0 +1,102 @@
<?php
namespace App\Http\Controllers;
use App\Models\Supplier;
use Illuminate\Http\Request;
class SuppliersController extends Controller
{
public function __construct()
{
$this->middleware('auth ');
}
/**
* Display a listing of the resource.
*
* @return \Illuminate\Http\Response
*/
public function index()
{
return view('r/supplier/index');
}
/**
* Show the form for creating a new resource.
*
* @return \Illuminate\Http\Response
*/
public function create()
{
return view('r/supplier/create');
}
/**
* Store a newly created resource in storage.
*
* @param \Illuminate\Http\Request $request
* @return \Illuminate\Http\Response
*/
public function store(Request $request)
{
// @todo Insure site index is included.
$o = new Supplier;
$o->name = $request->input('name');
$o->active = 1;
$o->account_mgr = '';
$o->account_email = '';
$o->email_provision = '';
$o->email_support = '';
$o->phone_provision = '';
$o->phone_support = '';
$o->save();
echo 'REDIRECT TO <a href="'.url('r/supplier/index').'">here</a>';
}
/**
* Display the specified resource.
*
* @param \App\suppliers $suppliers
* @return \Illuminate\Http\Response
*/
public function show(suppliers $suppliers)
{
//
}
/**
* Show the form for editing the specified resource.
*
* @param \App\suppliers $suppliers
* @return \Illuminate\Http\Response
*/
public function edit(suppliers $suppliers)
{
//
}
/**
* Update the specified resource in storage.
*
* @param \Illuminate\Http\Request $request
* @param \App\suppliers $suppliers
* @return \Illuminate\Http\Response
*/
public function update(Request $request, suppliers $suppliers)
{
//
}
/**
* Remove the specified resource from storage.
*
* @param \App\suppliers $suppliers
* @return \Illuminate\Http\Response
*/
public function destroy(suppliers $suppliers)
{
//
}
}

View File

@ -0,0 +1,18 @@
<?php
namespace App\Http\Controllers;
use Auth;
class UserServicesController extends Controller
{
public function __construct()
{
//$this->middleware('auth');
}
public function services()
{
return ['data'=>Auth::user()->services_active->values()];
}
}

View File

@ -4,6 +4,11 @@ namespace App\Http\Controllers;
class WelcomeController extends Controller
{
public function __construct()
{
$this->middleware('demoMode');
}
public function index() {
return view('welcome');
}

View File

@ -38,6 +38,7 @@ class Kernel extends HttpKernel
\App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class,
\App\Http\Middleware\SetSite::class,
\Laravel\Passport\Http\Middleware\CreateFreshApiToken::class,
],
'api' => [

View File

@ -0,0 +1,10 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ProductType extends Model
{
//
}

View File

@ -35,6 +35,16 @@ class Service extends Model
return $this->belongsTo(Product::class);
}
public function getCategoryAttribute()
{
return $this->product->prod_plugin_file;
}
public function getNextInvoiceAttribute()
{
return $this->date_next_invoice->format('Y-m-d');
}
/**
* This function will return the associated service model for the product type
*/
@ -55,11 +65,6 @@ class Service extends Model
return 'TBA';
}
public function getNextInvoiceAttribute()
{
return $this->date_next_invoice->format('Y-m-d');
}
public function getServiceNameAttribute()
{
if (! isset($this->getServiceDetail()->name)) dd($this,$this->product,$this->getServiceDetail());

10
app/Models/Supplier.php Normal file
View File

@ -0,0 +1,10 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Supplier extends Model
{
//
}

View File

@ -0,0 +1,10 @@
<?php
namespace App;
use Illuminate\Database\Eloquent\Model;
class SupplierProduct extends Model
{
//
}

View File

@ -0,0 +1,10 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class SupplierProductType extends Model
{
//
}

View File

@ -2,6 +2,7 @@
namespace App\Providers;
use Laravel\Passport\Passport;
use Illuminate\Support\Facades\Gate;
use Illuminate\Foundation\Support\Providers\AuthServiceProvider as ServiceProvider;
@ -24,7 +25,7 @@ class AuthServiceProvider extends ServiceProvider
public function boot()
{
$this->registerPolicies();
//
Passport::routes();
// Passport::enableImplicitGrant();
}
}

View File

@ -2,15 +2,17 @@
namespace App;
use Laravel\Passport\HasApiTokens;
use Illuminate\Notifications\Notifiable;
use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable
{
protected $table = 'ab_account';
private $_currency;
// @todo We cannot use timestamps - we should create the normal timestamps columns under laravel.
public $timestamps = FALSE;
use Notifiable;
use HasApiTokens, Notifiable;
/**
* The attributes that are mass assignable.
@ -43,17 +45,17 @@ class User extends Authenticatable
*/
public function invoices()
{
return $this->hasMany(Models\Invoice::class,'account_id');
return $this->hasMany(Models\Invoice::class,'account_id');
}
public function language()
{
return $this->belongsTo(Models\Language::class);
return $this->belongsTo(Models\Language::class);
}
public function payments()
{
return $this->hasMany(Models\Payment::class,'account_id');
return $this->hasMany(Models\Payment::class,'account_id');
}
/**
@ -61,7 +63,7 @@ class User extends Authenticatable
*/
public function services()
{
return $this->hasMany(Models\Service::class,'account_id');
return $this->hasMany(Models\Service::class,'account_id');
}
/**
@ -82,28 +84,30 @@ class User extends Authenticatable
public function getInvoicesDueAttribute()
{
return $this->invoices
->where('active',TRUE)
->sortBy('id')
->transform(function ($item) { if ($item->due) return $item; })
->reverse()
->filter();
return $this->invoices
->where('active',TRUE)
->sortBy('id')
->transform(function ($item) { if ($item->due) return $item; })
->reverse()
->filter();
}
public function getPaymentHistoryAttribute()
{
return $this->payments
->sortBy('date_payment')
->reverse();
return $this->payments
->sortBy('date_payment')
->reverse();
}
public function getNameAttribute()
{
return $this->full_name;
return $this->full_name;
}
public function getServicesActiveAttribute()
{
return $this->services->where('active',TRUE);
return $this
->services
->where('active',TRUE);
}
}

View File

@ -18,6 +18,7 @@
"fideloper/proxy": "^4.0",
"intervention/image": "^2.4",
"laravel/framework": "5.6.*",
"laravel/passport": "^6.0",
"laravel/socialite": "^3.0",
"laravel/tinker": "^1.0",
"leenooks/laravel": "0.*",

563
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
"content-hash": "52422b03d294a79b4d7c5088492f0304",
"content-hash": "5a4e2e00a171115e4320b7a08386cd35",
"packages": [
{
"name": "acacha/user",
@ -289,6 +289,69 @@
],
"time": "2018-03-29T22:10:58+00:00"
},
{
"name": "defuse/php-encryption",
"version": "v2.2.0",
"source": {
"type": "git",
"url": "https://github.com/defuse/php-encryption.git",
"reference": "0d4d27c368ca6798bc162469e43248c363c73495"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/defuse/php-encryption/zipball/0d4d27c368ca6798bc162469e43248c363c73495",
"reference": "0d4d27c368ca6798bc162469e43248c363c73495",
"shasum": ""
},
"require": {
"ext-openssl": "*",
"paragonie/random_compat": "~2.0",
"php": ">=5.4.0"
},
"require-dev": {
"nikic/php-parser": "^2.0|^3.0|^4.0",
"phpunit/phpunit": "^4|^5"
},
"bin": [
"bin/generate-defuse-key"
],
"type": "library",
"autoload": {
"psr-4": {
"Defuse\\Crypto\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Hornby",
"email": "taylor@defuse.ca",
"homepage": "https://defuse.ca/"
},
{
"name": "Scott Arciszewski",
"email": "info@paragonie.com",
"homepage": "https://paragonie.com"
}
],
"description": "Secure PHP Encryption Library",
"keywords": [
"aes",
"authenticated encryption",
"cipher",
"crypto",
"cryptography",
"encrypt",
"encryption",
"openssl",
"security",
"symmetric key cryptography"
],
"time": "2018-04-23T19:33:40+00:00"
},
{
"name": "dnoegel/php-xdg-base-dir",
"version": "0.1",
@ -1068,6 +1131,52 @@
],
"time": "2018-02-07T20:20:57+00:00"
},
{
"name": "firebase/php-jwt",
"version": "v5.0.0",
"source": {
"type": "git",
"url": "https://github.com/firebase/php-jwt.git",
"reference": "9984a4d3a32ae7673d6971ea00bae9d0a1abba0e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/9984a4d3a32ae7673d6971ea00bae9d0a1abba0e",
"reference": "9984a4d3a32ae7673d6971ea00bae9d0a1abba0e",
"shasum": ""
},
"require": {
"php": ">=5.3.0"
},
"require-dev": {
"phpunit/phpunit": " 4.8.35"
},
"type": "library",
"autoload": {
"psr-4": {
"Firebase\\JWT\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Neuman Vong",
"email": "neuman+pear@twilio.com",
"role": "Developer"
},
{
"name": "Anant Narayanan",
"email": "anant@php.net",
"role": "Developer"
}
],
"description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
"homepage": "https://github.com/firebase/php-jwt",
"time": "2017-06-27T22:17:23+00:00"
},
{
"name": "guzzlehttp/guzzle",
"version": "6.3.3",
@ -1608,6 +1717,75 @@
],
"time": "2018-05-02T15:22:18+00:00"
},
{
"name": "laravel/passport",
"version": "v6.0.2",
"source": {
"type": "git",
"url": "https://github.com/laravel/passport.git",
"reference": "6041dc516c1c6414f3e27062108e416e1700b5d8"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/laravel/passport/zipball/6041dc516c1c6414f3e27062108e416e1700b5d8",
"reference": "6041dc516c1c6414f3e27062108e416e1700b5d8",
"shasum": ""
},
"require": {
"firebase/php-jwt": "~3.0|~4.0|~5.0",
"guzzlehttp/guzzle": "~6.0",
"illuminate/auth": "~5.6",
"illuminate/console": "~5.6",
"illuminate/container": "~5.6",
"illuminate/contracts": "~5.6",
"illuminate/database": "~5.6",
"illuminate/encryption": "~5.6",
"illuminate/http": "~5.6",
"illuminate/support": "~5.6",
"league/oauth2-server": "^7.0",
"php": ">=7.0",
"phpseclib/phpseclib": "^2.0",
"symfony/psr-http-message-bridge": "~1.0",
"zendframework/zend-diactoros": "~1.0"
},
"require-dev": {
"mockery/mockery": "~1.0",
"phpunit/phpunit": "~6.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "6.0-dev"
},
"laravel": {
"providers": [
"Laravel\\Passport\\PassportServiceProvider"
]
}
},
"autoload": {
"psr-4": {
"Laravel\\Passport\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Taylor Otwell",
"email": "taylor@laravel.com"
}
],
"description": "Laravel Passport provides OAuth2 server support to Laravel.",
"keywords": [
"laravel",
"oauth",
"passport"
],
"time": "2018-05-25T14:49:48+00:00"
},
{
"name": "laravel/socialite",
"version": "v3.0.9",
@ -1803,6 +1981,114 @@
],
"time": "2018-04-14T14:59:42+00:00"
},
{
"name": "lcobucci/jwt",
"version": "3.2.2",
"source": {
"type": "git",
"url": "https://github.com/lcobucci/jwt.git",
"reference": "0b5930be73582369e10c4d4bb7a12bac927a203c"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/lcobucci/jwt/zipball/0b5930be73582369e10c4d4bb7a12bac927a203c",
"reference": "0b5930be73582369e10c4d4bb7a12bac927a203c",
"shasum": ""
},
"require": {
"ext-openssl": "*",
"php": ">=5.5"
},
"require-dev": {
"mdanter/ecc": "~0.3.1",
"mikey179/vfsstream": "~1.5",
"phpmd/phpmd": "~2.2",
"phpunit/php-invoker": "~1.1",
"phpunit/phpunit": "~4.5",
"squizlabs/php_codesniffer": "~2.3"
},
"suggest": {
"mdanter/ecc": "Required to use Elliptic Curves based algorithms."
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "3.1-dev"
}
},
"autoload": {
"psr-4": {
"Lcobucci\\JWT\\": "src"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-3-Clause"
],
"authors": [
{
"name": "Luís Otávio Cobucci Oblonczyk",
"email": "lcobucci@gmail.com",
"role": "Developer"
}
],
"description": "A simple library to work with JSON Web Token and JSON Web Signature",
"keywords": [
"JWS",
"jwt"
],
"time": "2017-09-01T08:23:26+00:00"
},
{
"name": "league/event",
"version": "2.1.2",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/event.git",
"reference": "e4bfc88dbcb60c8d8a2939a71f9813e141bbe4cd"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/event/zipball/e4bfc88dbcb60c8d8a2939a71f9813e141bbe4cd",
"reference": "e4bfc88dbcb60c8d8a2939a71f9813e141bbe4cd",
"shasum": ""
},
"require": {
"php": ">=5.4.0"
},
"require-dev": {
"henrikbjorn/phpspec-code-coverage": "~1.0.1",
"phpspec/phpspec": "~2.0.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "2.2-dev"
}
},
"autoload": {
"psr-4": {
"League\\Event\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Frank de Jonge",
"email": "info@frenky.net"
}
],
"description": "Event package",
"keywords": [
"emitter",
"event",
"listener"
],
"time": "2015-05-21T12:24:47+00:00"
},
{
"name": "league/flysystem",
"version": "1.0.44",
@ -2011,6 +2297,76 @@
],
"time": "2016-08-17T00:36:58+00:00"
},
{
"name": "league/oauth2-server",
"version": "7.1.1",
"source": {
"type": "git",
"url": "https://github.com/thephpleague/oauth2-server.git",
"reference": "2e47fa7fcad3b207cfbefa0a0e26af00445f3906"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/oauth2-server/zipball/2e47fa7fcad3b207cfbefa0a0e26af00445f3906",
"reference": "2e47fa7fcad3b207cfbefa0a0e26af00445f3906",
"shasum": ""
},
"require": {
"defuse/php-encryption": "^2.1",
"ext-openssl": "*",
"lcobucci/jwt": "^3.2.2",
"league/event": "^2.1",
"php": ">=7.0.0",
"psr/http-message": "^1.0.1"
},
"replace": {
"league/oauth2server": "*",
"lncd/oauth2": "*"
},
"require-dev": {
"phpstan/phpstan": "^0.9.2",
"phpstan/phpstan-phpunit": "^0.9.4",
"phpstan/phpstan-strict-rules": "^0.9.0",
"phpunit/phpunit": "^6.3 || ^7.0",
"zendframework/zend-diactoros": "^1.3.2"
},
"type": "library",
"autoload": {
"psr-4": {
"League\\OAuth2\\Server\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Alex Bilbie",
"email": "hello@alexbilbie.com",
"homepage": "http://www.alexbilbie.com",
"role": "Developer"
}
],
"description": "A lightweight and powerful OAuth 2.0 authorization and resource server library with support for all the core specification grants. This library will allow you to secure your API with OAuth and allow your applications users to approve apps that want to access their data from your API.",
"homepage": "https://oauth2.thephpleague.com/",
"keywords": [
"Authentication",
"api",
"auth",
"authorisation",
"authorization",
"oauth",
"oauth 2",
"oauth 2.0",
"oauth2",
"protect",
"resource",
"secure",
"server"
],
"time": "2018-05-21T14:01:37+00:00"
},
{
"name": "leenooks/laravel",
"version": "0.1.2",
@ -2677,6 +3033,98 @@
"homepage": "https://github.com/PhenX/php-svg-lib",
"time": "2017-05-24T10:07:27+00:00"
},
{
"name": "phpseclib/phpseclib",
"version": "2.0.11",
"source": {
"type": "git",
"url": "https://github.com/phpseclib/phpseclib.git",
"reference": "7053f06f91b3de78e143d430e55a8f7889efc08b"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/phpseclib/phpseclib/zipball/7053f06f91b3de78e143d430e55a8f7889efc08b",
"reference": "7053f06f91b3de78e143d430e55a8f7889efc08b",
"shasum": ""
},
"require": {
"php": ">=5.3.3"
},
"require-dev": {
"phing/phing": "~2.7",
"phpunit/phpunit": "^4.8.35|^5.7|^6.0",
"sami/sami": "~2.0",
"squizlabs/php_codesniffer": "~2.0"
},
"suggest": {
"ext-gmp": "Install the GMP (GNU Multiple Precision) extension in order to speed up arbitrary precision integer arithmetic operations.",
"ext-libsodium": "SSH2/SFTP can make use of some algorithms provided by the libsodium-php extension.",
"ext-mcrypt": "Install the Mcrypt extension in order to speed up a few other cryptographic operations.",
"ext-openssl": "Install the OpenSSL extension in order to speed up a wide variety of cryptographic operations."
},
"type": "library",
"autoload": {
"files": [
"phpseclib/bootstrap.php"
],
"psr-4": {
"phpseclib\\": "phpseclib/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Jim Wigginton",
"email": "terrafrost@php.net",
"role": "Lead Developer"
},
{
"name": "Patrick Monnerat",
"email": "pm@datasphere.ch",
"role": "Developer"
},
{
"name": "Andreas Fischer",
"email": "bantu@phpbb.com",
"role": "Developer"
},
{
"name": "Hans-Jürgen Petrich",
"email": "petrich@tronic-media.com",
"role": "Developer"
},
{
"name": "Graham Campbell",
"email": "graham@alt-three.com",
"role": "Developer"
}
],
"description": "PHP Secure Communications Library - Pure-PHP implementations of RSA, AES, SSH2, SFTP, X.509 etc.",
"homepage": "http://phpseclib.sourceforge.net",
"keywords": [
"BigInteger",
"aes",
"asn.1",
"asn1",
"blowfish",
"crypto",
"cryptography",
"encryption",
"rsa",
"security",
"sftp",
"signature",
"signing",
"ssh",
"twofish",
"x.509",
"x509"
],
"time": "2018-04-15T16:55:05+00:00"
},
{
"name": "psr/container",
"version": "1.0.0",
@ -4367,6 +4815,66 @@
"homepage": "https://symfony.com",
"time": "2018-04-03T05:24:00+00:00"
},
{
"name": "symfony/psr-http-message-bridge",
"version": "v1.0.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/psr-http-message-bridge.git",
"reference": "c2b757934f2d9681a287e662efbc27c41fe8ef86"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/psr-http-message-bridge/zipball/c2b757934f2d9681a287e662efbc27c41fe8ef86",
"reference": "c2b757934f2d9681a287e662efbc27c41fe8ef86",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"psr/http-message": "~1.0",
"symfony/http-foundation": "~2.3|~3.0|~4.0"
},
"require-dev": {
"symfony/phpunit-bridge": "~3.2|4.0"
},
"suggest": {
"psr/http-message-implementation": "To use the HttpFoundation factory",
"zendframework/zend-diactoros": "To use the Zend Diactoros factory"
},
"type": "symfony-bridge",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Bridge\\PsrHttpMessage\\": ""
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
},
{
"name": "Fabien Potencier",
"email": "fabien@symfony.com"
}
],
"description": "PSR HTTP message bridge",
"homepage": "http://symfony.com",
"keywords": [
"http",
"http-message",
"psr-7"
],
"time": "2017-12-19T00:31:44+00:00"
},
{
"name": "symfony/routing",
"version": "v4.0.9",
@ -4791,6 +5299,59 @@
"environment"
],
"time": "2016-09-01T10:05:43+00:00"
},
{
"name": "zendframework/zend-diactoros",
"version": "1.7.2",
"source": {
"type": "git",
"url": "https://github.com/zendframework/zend-diactoros.git",
"reference": "741e7a571836f038de731105f4742ca8a164e43a"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/zendframework/zend-diactoros/zipball/741e7a571836f038de731105f4742ca8a164e43a",
"reference": "741e7a571836f038de731105f4742ca8a164e43a",
"shasum": ""
},
"require": {
"php": "^5.6 || ^7.0",
"psr/http-message": "^1.0"
},
"provide": {
"psr/http-message-implementation": "1.0"
},
"require-dev": {
"ext-dom": "*",
"ext-libxml": "*",
"phpunit/phpunit": "^5.7.16 || ^6.0.8",
"zendframework/zend-coding-standard": "~1.0"
},
"type": "library",
"extra": {
"branch-alias": {
"dev-master": "1.7.x-dev",
"dev-develop": "1.8.x-dev",
"dev-release-2.0": "2.0.x-dev"
}
},
"autoload": {
"psr-4": {
"Zend\\Diactoros\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"BSD-2-Clause"
],
"description": "PSR HTTP Message implementations",
"homepage": "https://github.com/zendframework/zend-diactoros",
"keywords": [
"http",
"psr",
"psr-7"
],
"time": "2018-05-29T16:53:08+00:00"
}
],
"packages-dev": [

View File

@ -42,7 +42,7 @@ return [
],
'api' => [
'driver' => 'token',
'driver' => 'passport',
'provider' => 'users',
],
],

15
package-lock.json generated
View File

@ -3276,7 +3276,6 @@
"version": "1.10.16",
"resolved": "https://registry.npmjs.org/datatables.net/-/datatables.net-1.10.16.tgz",
"integrity": "sha1-SwUtEIKCQmG2ju2dInQbcR09JGk=",
"dev": true,
"requires": {
"jquery": "3.3.1"
}
@ -3291,6 +3290,15 @@
"jquery": "3.3.1"
}
},
"datatables.net-dt": {
"version": "1.10.16",
"resolved": "https://registry.npmjs.org/datatables.net-dt/-/datatables.net-dt-1.10.16.tgz",
"integrity": "sha1-Z1ijCPueX5Yp+2VBzDAeSOyexVU=",
"requires": {
"datatables.net": "1.10.16",
"jquery": "3.3.1"
}
},
"date-now": {
"version": "0.1.4",
"resolved": "https://registry.npmjs.org/date-now/-/date-now-0.1.4.tgz",
@ -8085,8 +8093,7 @@
"jquery": {
"version": "3.3.1",
"resolved": "https://registry.npmjs.org/jquery/-/jquery-3.3.1.tgz",
"integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg==",
"dev": true
"integrity": "sha512-Ubldcmxp5np52/ENotGxlLe6aGMvmF4R8S6tZjsP6Knsaxd/xp3Zrh50cG93lR6nPXyUFwzN3ZSOQI0wRJNdGg=="
},
"jquery-knob": {
"version": "1.2.11",
@ -9814,7 +9821,7 @@
},
"onetime": {
"version": "1.1.0",
"resolved": "http://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
"resolved": "https://registry.npmjs.org/onetime/-/onetime-1.1.0.tgz",
"integrity": "sha1-ofeDj4MUxRbwXs78vEzP4EtO14k=",
"dev": true
},

View File

@ -37,5 +37,8 @@
"toastr": "^2.1.4",
"vue": "^2.5.7"
},
"dependencies": {}
"dependencies": {
"datatables.net": "^1.10.16",
"datatables.net-dt": "^1.10.16"
}
}

BIN
public/images/vendor/datatables.net-dt/sort_asc.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 148 B

BIN
public/images/vendor/datatables.net-dt/sort_both.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 201 B

BIN
public/images/vendor/datatables.net-dt/sort_desc.png generated vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 158 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 146 B

16452
public/js/app.js vendored

File diff suppressed because one or more lines are too long

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>
@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

View File

@ -18,3 +18,7 @@ Route::middleware('auth:api')->get('/user', function (Request $request) {
return $request->user();
});
*/
Route::group(['middleware'=>'auth:api'], function() {
Route::get('/u/services','UserServicesController@services');
});