Initial refactoring work

This commit is contained in:
Deon George 2018-05-20 22:53:14 +10:00
parent d6cb505e1c
commit feda44db8a
121 changed files with 6601 additions and 602 deletions

View File

@ -1,4 +1,6 @@
APP_NAME=Laravel APP_NAME=Laravel
APP_NAME_HTML_LONG="<b>Laravel</b>Application"
APP_NAME_HTML_SHORT="<b>L</b>A"
APP_ENV=local APP_ENV=local
APP_KEY= APP_KEY=
APP_DEBUG=true APP_DEBUG=true

View File

@ -1,10 +1,13 @@
APP_NAME=Laravel APP_NAME=Laravel
APP_NAME_HTML_LONG="<b>Laravel</b>Application"
APP_NAME_HTML_SHORT="<b>L</b>A"
APP_ENV=test APP_ENV=test
APP_KEY= APP_KEY=
APP_DEBUG=true APP_DEBUG=true
APP_LOG_LEVEL=debug
APP_URL=http://localhost APP_URL=http://localhost
LOG_CHANNEL=stack
DB_CONNECTION=mysql DB_CONNECTION=mysql
DB_HOST=mariadb DB_HOST=mariadb
DB_PORT=3306 DB_PORT=3306
@ -32,3 +35,7 @@ MAIL_ENCRYPTION=null
PUSHER_APP_ID= PUSHER_APP_ID=
PUSHER_APP_KEY= PUSHER_APP_KEY=
PUSHER_APP_SECRET= PUSHER_APP_SECRET=
PUSHER_APP_CLUSTER=mt1
MIX_PUSHER_APP_KEY="${PUSHER_APP_KEY}"
MIX_PUSHER_APP_CLUSTER="${PUSHER_APP_CLUSTER}"

View File

@ -39,4 +39,4 @@ class Kernel extends ConsoleKernel
require base_path('routes/console.php'); require base_path('routes/console.php');
} }
} }

View File

@ -36,4 +36,12 @@ class LoginController extends Controller
{ {
$this->middleware('guest')->except('logout'); $this->middleware('guest')->except('logout');
} }
/**
* Show our themed login page
*/
public function showLoginForm()
{
return view('adminlte::auth.login');
}
} }

View File

@ -0,0 +1,34 @@
<?php
namespace App\Http\Controllers\Auth;
use Illuminate\Support\Facades\Auth;
use App\Http\Controllers\Controller;
use Socialite;
class SocialLoginController extends Controller
{
public function redirectToProvider($provider)
{
return Socialite::with($provider)->redirect();
}
public function handleProviderCallback($provider)
{
$openiduser = Socialite::with($provider)->user();
$user = Socialite::with($provider)->findOrCreateUser($openiduser);
Auth::login($user,FALSE);
/*
if (! $user->profile_update)
{
return redirect()->to(url('settings'));
}
*/
return redirect()->intended();
}
}

View File

@ -0,0 +1,16 @@
<?php
namespace App\Http\Controllers;
class UserHomeController extends Controller
{
public function __construct()
{
$this->middleware('auth');
}
public function home()
{
return View('home');
}
}

View File

@ -0,0 +1,14 @@
<?php
namespace App\Http\Controllers;
class WelcomeController extends Controller
{
public function index() {
return view('welcome');
}
public function under_construction() {
abort(499,'Under Construction');
}
}

View File

@ -2,6 +2,7 @@
namespace App\Http; namespace App\Http;
use App\Http\Middleware\SetSite;
use Illuminate\Foundation\Http\Kernel as HttpKernel; use Illuminate\Foundation\Http\Kernel as HttpKernel;
class Kernel extends HttpKernel class Kernel extends HttpKernel
@ -36,6 +37,7 @@ class Kernel extends HttpKernel
\Illuminate\View\Middleware\ShareErrorsFromSession::class, \Illuminate\View\Middleware\ShareErrorsFromSession::class,
\App\Http\Middleware\VerifyCsrfToken::class, \App\Http\Middleware\VerifyCsrfToken::class,
\Illuminate\Routing\Middleware\SubstituteBindings::class, \Illuminate\Routing\Middleware\SubstituteBindings::class,
\App\Http\Middleware\SetSite::class,
], ],
'api' => [ 'api' => [
@ -57,6 +59,7 @@ class Kernel extends HttpKernel
'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class, 'bindings' => \Illuminate\Routing\Middleware\SubstituteBindings::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class, 'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class, 'can' => \Illuminate\Auth\Middleware\Authorize::class,
'demoMode' => \Spatie\DemoMode\DemoMode::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class, 'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class, 'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
'theme' => \Igaster\LaravelTheme\Middleware\setTheme::class, 'theme' => \Igaster\LaravelTheme\Middleware\setTheme::class,

View File

@ -27,7 +27,7 @@ class SetSite
public function handle($request, Closure $next) public function handle($request, Closure $next)
{ {
// @todo Figure out how to know if this is an API call - and deny it if it's not in the database. // @todo Figure out how to know if this is an API call - and deny it if it's not in the database.
$so = NULL; $so = new Site;
if (Schema::hasTable('site')) if (Schema::hasTable('site'))
{ {
@ -38,7 +38,7 @@ class SetSite
} }
// If we dont exist, we'll return a fake model. // If we dont exist, we'll return a fake model.
if (! $so) { if (! $so or ! $so->exists) {
$so = (new Site)->sample(); $so = (new Site)->sample();
} }
@ -50,4 +50,4 @@ class SetSite
return $next($request); return $next($request);
} }
} }

View File

@ -6,6 +6,7 @@ use Illuminate\Database\Eloquent\Model;
class Country extends Model class Country extends Model
{ {
protected $table = 'ab_country';
public $timestamps = FALSE; public $timestamps = FALSE;
/** /**
@ -13,7 +14,7 @@ class Country extends Model
*/ */
public function currency() public function currency()
{ {
return $this->belongsTo('App\Models\Currency'); return $this->belongsTo(Currency::class);
} }
/** /**
@ -21,6 +22,6 @@ class Country extends Model
*/ */
public function users() public function users()
{ {
return $this->hasMany('App\User'); return $this->hasMany(\App\User::class);
} }
} }

View File

@ -6,13 +6,26 @@ use Illuminate\Database\Eloquent\Model;
class Currency extends Model class Currency extends Model
{ {
// @todo - temp Until Implemented
protected $fillable = ['rounding'];
protected $table = 'ab_currency';
public $timestamps = FALSE; public $timestamps = FALSE;
const ROUND_HALF_UP = 1;
const ROUND_HALF_DOWN = 2;
const ROUND_HALF_EVEN = 3;
const ROUND_HALF_ODD = 4;
/** /**
* The accounts in this country * The accounts in this country
*/ */
public function countries() public function countries()
{ {
return $this->hasMany('App\Models\Country'); return $this->hasMany(Country::class);
}
public function round($value,$mode=self::ROUND_HALF_UP)
{
return round($value,$this->rounding,$mode);
} }
} }

15
app/Models/DomainTld.php Normal file
View File

@ -0,0 +1,15 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class DomainTld extends Model
{
protected $table = 'ab_domain_tld';
public function services()
{
return $this->hasMany(Service::class);
}
}

68
app/Models/Invoice.php Normal file
View File

@ -0,0 +1,68 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Invoice extends Model
{
protected $table = 'ab_invoice';
protected $dates = ['due_date'];
protected $with = ['invoiceitems.taxes','account.country.currency','paymentitems'];
private $_total = 0;
public function account()
{
return $this->belongsTo(\App\User::class);
}
public function invoiceitems()
{
return $this->hasMany(InvoiceItem::class);
}
public function paymentitems()
{
return $this->hasMany(PaymentItem::class);
}
public function getDueAttribute()
{
return $this->currency()->round($this->total - $this->paid);
}
public function getDateDueAttribute()
{
return $this->due_date->format('Y-m-d');
}
public function getInvoiceNumberAttribute()
{
return sprintf('%02s-%04s-%04s',$this->site_id,$this->account_id,$this->id);
}
public function getPaidAttribute()
{
return $this->currency()->round($this->paymentitems->sum('alloc_amt'));
}
public function getTotalAttribute()
{
if (! $this->_total)
{
foreach ($this->invoiceitems as $o)
{
//if ($o->active)
$this->_total += $this->currency()->round($o->total);
}
}
return $this->_total;
}
public function currency()
{
return $this->account->country->currency;
}
}

View File

@ -0,0 +1,46 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class InvoiceItem extends Model
{
protected $table = 'ab_invoice_item';
protected $with = ['taxes'];
private $_tax = 0;
public function invoice()
{
return $this->belongsTo(Invoice::class);
}
public function taxes()
{
return $this->hasMany(InvoiceItemTax::class);
}
public function getSubTotalAttribute()
{
return $this->quantity * $this->price_base;
}
public function getTaxAttribute()
{
if (! $this->_tax)
{
foreach ($this->taxes as $o)
{
$this->_tax += $o->amount;
}
}
return $this->_tax;
}
public function getTotalAttribute()
{
return $this->tax + $this->sub_total;
}
}

View File

@ -0,0 +1,15 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class InvoiceItemTax extends Model
{
protected $table = 'ab_invoice_item_tax';
public function invoice_item()
{
return $this->belongsTo(InvoiceItem::class);
}
}

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

@ -0,0 +1,10 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Language extends Model
{
protected $table = 'ab_language';
}

16
app/Models/Payment.php Normal file
View File

@ -0,0 +1,16 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Payment extends Model
{
protected $table = 'ab_payment';
protected $dates = ['date_payment'];
public function getPaymentDateAttribute()
{
return $this->date_payment->format('Y-m-d');
}
}

View File

@ -0,0 +1,10 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class PaymentItem extends Model
{
protected $table = 'ab_payment_item';
}

31
app/Models/Product.php Normal file
View File

@ -0,0 +1,31 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Product extends Model
{
protected $table = 'ab_product';
protected $with = ['descriptions'];
public function descriptions()
{
return $this->hasMany(ProductTranslate::class);
}
public function services()
{
return $this->hasMany(Service::class);
}
/**
* Get the language name
*
* @param Language $lo
*/
public function name(Language $lo)
{
return $this->descriptions->where('language_id',$lo->id)->first()->name;
}
}

View File

@ -0,0 +1,10 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ProductTranslate extends Model
{
protected $table = 'ab_product_translate';
}

73
app/Models/Service.php Normal file
View File

@ -0,0 +1,73 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class Service extends Model
{
protected $table = 'ab_service';
protected $dates = ['date_last_invoice','date_next_invoice'];
protected $with = ['product.descriptions','account.language','service_adsl','service_domain.tld','service_ssl'];
public function account()
{
return $this->belongsTo(\App\User::class);
}
public function service_adsl()
{
return $this->belongsTo(ServiceAdsl::class,'id','service_id');
}
public function service_domain()
{
return $this->belongsTo(ServiceDomain::class,'id','service_id');
}
public function service_ssl()
{
return $this->belongsTo(ServiceSsl::class,'id','service_id');
}
public function product()
{
return $this->belongsTo(Product::class);
}
/**
* This function will return the associated service model for the product type
*/
public function getServiceDetail()
{
switch ($this->product->prod_plugin_file)
{
case 'ADSL': return $this->service_adsl;
case 'DOMAIN': return $this->service_domain;
case 'SSL': return $this->service_ssl;
default: abort(500,'Havent handled case for: '.$this->product->prod_plugin_file);
}
}
public function getServiceExpireAttribute()
{
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());
return sprintf('%s: %s',$this->product->name($this->account->language),$this->getServiceDetail()->name);
}
public function getServiceNumberAttribute()
{
return sprintf('%02s.%04s.%04s',$this->site_id,$this->account_id,$this->id);
}
}

View File

@ -0,0 +1,20 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ServiceAdsl extends Model
{
protected $table = 'ab_service__adsl';
public function service()
{
return $this->belongsTo(Service::class);
}
public function getNameAttribute()
{
return $this->service_number;
}
}

View File

@ -0,0 +1,25 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ServiceDomain extends Model
{
protected $table = 'ab_service__domain';
public function service()
{
return $this->belongsTo(Service::class);
}
public function tld()
{
return $this->belongsTo(DomainTld::class,'domain_tld_id');
}
public function getNameAttribute()
{
return sprintf('%s.%s',$this->domain_name,$this->tld->name);
}
}

26
app/Models/ServiceSsl.php Normal file
View File

@ -0,0 +1,26 @@
<?php
namespace App\Models;
use Illuminate\Database\Eloquent\Model;
class ServiceSsl extends Model
{
protected $table = 'ab_service__ssl';
public function service()
{
return $this->belongsTo(Service::class);
}
public function tld()
{
return $this->belongsTo(DomainTld::class,'domain_tld_id');
}
public function getNameAttribute()
{
// @todo Merge in SSL functions from old site
return 'SSL';
}
}

View File

@ -6,6 +6,8 @@ use Illuminate\Database\Eloquent\Model;
class Site extends Model class Site extends Model
{ {
protected $table = 'ab_setup';
protected $casts = [ protected $casts = [
'address'=>'array', 'address'=>'array',
]; ];
@ -24,7 +26,95 @@ class Site extends Model
['title'=>'Project 4','description'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.','subtitle'=>'Lorem ipsum dolor sit amet','image_small'=>'/image/generic/150/75/d00','image_large'=>'/image/generic/500/400/a00'], ['title'=>'Project 4','description'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.','subtitle'=>'Lorem ipsum dolor sit amet','image_small'=>'/image/generic/150/75/d00','image_large'=>'/image/generic/500/400/a00'],
], ],
'activity_intro'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.', 'activity_intro'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
'blockquote'=>[['title'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.','image'=>'/image/generic/150/75/1A3AAA']], 'block_quotes'=>[
[
'title'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
'image'=>'/image/generic/150/75/1A3AAA'
],
],
'clients'=>[
[
'image'=>'/image/generic/200/100/999',
'hover'=>'/image/generic/200/100/399',
],
[
'image'=>'/image/generic/200/100/999',
'hover'=>'/image/generic/200/100/499',
],
[
'image'=>'/image/generic/200/100/999',
'hover'=>'/image/generic/200/100/599',
],
[
'image'=>'/image/generic/200/100/999',
'hover'=>'/image/generic/200/100/699',
],
[
'image'=>'/image/generic/200/100/999',
'hover'=>'/image/generic/200/100/689',
],
[
'image'=>'/image/generic/200/100/999',
'hover'=>'/image/generic/200/100/679',
],
[
'image'=>'/image/generic/200/100/999',
'hover'=>'/image/generic/200/100/669',
],
[
'image'=>'/image/generic/200/100/999',
'hover'=>'/image/generic/200/100/659',
],
[
'image'=>'/image/generic/200/100/999',
'hover'=>'/image/generic/200/100/649',
],
],
'clients_intro'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore',
'main_slider'=>[
[
'title'=>'Header <br/><span class="carousel-title-normal">and Title</span>',
'text'=>'This is what you were looking for',
'style'=>1,
'image'=>'url(/image/generic/300/300/eee)',
'button'=>['text'=>'Purchase Now','url'=>'#'],
],
[
'title'=>'Header and Title',
'text'=>'This is what you were looking for',
'text2'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit.<br/>Sed est nunc, sagittis at consectetur id.',
'style'=>2,
'image'=>'url(/image/generic/400/400/ddd)',
'button'=>['text'=>'Purchase Now','url'=>'#'],
],
[
'title'=>'Header and Title',
'text'=>'This is what you were looking for',
'text2'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit.<br/>Sed est nunc, sagittis at consectetur id.',
'style'=>2,
'image'=>'url(/image/generic/500/500/eee)',
//'button'=>['text'=>'Purchase Now','url'=>'#'],
],
],
'page_tabs'=>[
[
'title'=>'Title 1',
'image'=>'/image/generic/200/100/999',
'text'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua',
],
[
'title'=>'Title 2',
'image'=>'/image/generic/200/100/799',
'text'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua',
],
[
'title'=>'Title 3',
'image'=>'/image/generic/200/100/979',
'text'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua',
],
],
'site'=>[ 'site'=>[
'id'=>NULL, 'id'=>NULL,
'address'=>json_decode('{"address1":"PO Box 149","address2":"7 Woodlands Court","city":"Bendigo","state":"VIC","postcode":"3550"}'), 'address'=>json_decode('{"address1":"PO Box 149","address2":"7 Woodlands Court","city":"Bendigo","state":"VIC","postcode":"3550"}'),
@ -45,12 +135,38 @@ class Site extends Model
['title'=>'Title 2','text'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.','icon'=>'fa fa-compress green','image'=>NULL], ['title'=>'Title 2','text'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.','icon'=>'fa fa-compress green','image'=>NULL],
['title'=>'Title 3','text'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.','icon'=>'fa fa-check red','image'=>'/image/generic/200/100/999'], ['title'=>'Title 3','text'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.','icon'=>'fa fa-check red','image'=>'/image/generic/200/100/999'],
], ],
'social'=>['facebook','linkedin','googleplus','twitter'], 'social'=>[
[
'name'=>'facebook',
'url'=>'http://www.facebook.com',
],
[
'name'=>'linkedin',
'url'=>'http://www.linkedin.com',
],
[ 'name'=>'twitter',
'url'=>'http://www.twitter.com',
],
],
'steps'=>[ 'steps'=>[
['title'=>'Title 1','description'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud'], ['title'=>'Title 1','description'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud'],
['title'=>'Title 2','description'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud'], ['title'=>'Title 2','description'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud'],
['title'=>'Title 3','description'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud'], ['title'=>'Title 3','description'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud'],
], ],
'testimonials'=>[
[
'title'=>'Title 1',
'name'=>'Bart Simpson',
'quote'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud',
'photo'=>'/image/generic/200/100/999',
],
[
'title'=>'Title 2',
'name'=>'Lisa Simpson',
'quote'=>'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud',
'photo'=>'/image/generic/200/100/499',
],
],
'top_menu'=>[ 'top_menu'=>[
'Home'=>['name'=>'Home','url'=>'/','children'=>[ 'Home'=>['name'=>'Home','url'=>'/','children'=>[
['name'=>'Link 1','url'=>'#/l2', 'children'=>[]], ['name'=>'Link 1','url'=>'#/l2', 'children'=>[]],
@ -65,6 +181,66 @@ class Site extends Model
]; ];
} }
public function getActivitiesAttribute()
{
return array_get($this->_sampledata(),'activity');
}
public function getActivityIntroAttribute()
{
return array_get($this->_sampledata(),'activity_intro');
}
public function getClientsAttribute()
{
return array_get($this->_sampledata(),'clients');
}
public function getCLientsIntoAttribute()
{
return array_get($this->_sampledata(),'clients_info');
}
public function getServicesAttribute()
{
return array_get($this->_sampledata(),'services');
}
public function getBlockQuotesAttribute()
{
return array_get($this->_sampledata(),'block_quotes');
}
public function getPageTabsAttribute()
{
return array_get($this->_sampledata(),'page_tabs');
}
public function getSiteSliderAttribute()
{
return array_get($this->_sampledata(),'main_slider');
}
public function getSocialAttribute()
{
return array_get($this->_sampledata(),'social');
}
public function getStepsAttribute()
{
return array_get($this->_sampledata(),'steps');
}
public function getTestimonialsAttribute()
{
return array_get($this->_sampledata(),'testimonials');
}
public function getTopMenuAttribute()
{
return array_get($this->_sampledata(),'top_menu');
}
public function sample() public function sample()
{ {
return $this->forceFill(array_get($this->_sampledata(),'site')); return $this->forceFill(array_get($this->_sampledata(),'site'));
@ -93,18 +269,6 @@ class Site extends Model
return $return; return $return;
} }
public function activity()
{
// @todo To be implemented
return array_get($this->_sampledata(),'activity');
}
public function activity_intro()
{
// @todo To be implemented
return array_get($this->_sampledata(),'activity_intro');
}
public function address($type='plain') public function address($type='plain')
{ {
switch ($type) switch ($type)
@ -117,44 +281,12 @@ class Site extends Model
} }
} }
public function blockquote()
{
// @todo To be implemented
return array_get($this->_sampledata(),'blockquote');
}
// @todo
public function fax() public function fax()
{ {
return '@todo'; return '@todo';
} }
public function logo_url() public function logo_url()
{ {
return url($this->logo ? $this->logo : '/image/generic/150/20/fff'); return url($this->logo ? $this->logo : '/image/generic/150/20/fff');
} }
public function services()
{
// @todo To be implemented
return array_get($this->_sampledata(),'services');
}
public function social()
{
// @todo To be implemented
return array_get($this->_sampledata(),'social');
}
public function steps()
{
// @todo To be implemented
return array_get($this->_sampledata(),'steps');
}
public function top_menu()
{
// @todo To be implemented
return array_get($this->_sampledata(),'top_menu');
}
} }

View File

@ -7,6 +7,9 @@ use Illuminate\Foundation\Auth\User as Authenticatable;
class User extends Authenticatable class User extends Authenticatable
{ {
protected $table = 'ab_account';
private $_currency;
use Notifiable; use Notifiable;
/** /**
@ -32,7 +35,33 @@ class User extends Authenticatable
*/ */
public function country() public function country()
{ {
return $this->belongsTo('App\Models\Country'); return $this->belongsTo(Models\Country::class);
}
/**
* This users invoices
*/
public function invoices()
{
return $this->hasMany(Models\Invoice::class,'account_id');
}
public function language()
{
return $this->belongsTo(Models\Language::class);
}
public function payments()
{
return $this->hasMany(Models\Payment::class,'account_id');
}
/**
* This users invoices
*/
public function services()
{
return $this->hasMany(Models\Service::class,'account_id');
} }
/** /**
@ -46,8 +75,35 @@ class User extends Authenticatable
/** /**
* Return the user's full name * Return the user's full name
*/ */
public function getNameAttribute($value) public function getFullNameAttribute()
{ {
return $this->firstname.' '.$this->lastname; return $this->first_name.' '.$this->last_name;
}
public function getInvoicesDueAttribute()
{
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();
}
public function getNameAttribute()
{
return $this->full_name;
}
public function getServicesActiveAttribute()
{
return $this->services->where('active',TRUE);
} }
} }

View File

@ -1,21 +1,30 @@
{ {
"name": "laravel/laravel", "name": "laravel/laravel",
"description": "The Laravel Framework.", "description": "The Laravel Framework.",
"keywords": ["framework", "laravel"], "keywords": [
"framework",
"laravel"
],
"license": "MIT", "license": "MIT",
"type": "project", "type": "project",
"require": { "require": {
"php": ">=7.2.0", "php": ">=7.2.0",
"acacha/user": "^0.2.2", "acacha/user": "^0.2.2",
"barryvdh/laravel-debugbar": "^3.1", "barryvdh/laravel-debugbar": "^3.1",
"barryvdh/laravel-dompdf": "^0.8.2",
"clarkeash/doorman": "^2.0", "clarkeash/doorman": "^2.0",
"creativeorange/gravatar": "^1.0", "creativeorange/gravatar": "^1.0",
"doctrine/dbal": "^2.7",
"fideloper/proxy": "^4.0", "fideloper/proxy": "^4.0",
"igaster/laravel-theme": "^2.0",
"intervention/image": "^2.4", "intervention/image": "^2.4",
"laravel/framework": "5.6.*", "laravel/framework": "5.6.*",
"laravel/socialite": "^3.0",
"laravel/tinker": "^1.0", "laravel/tinker": "^1.0",
"orchestra/asset": "^3.6" "leenooks/laravel": "0.*",
"spatie/laravel-demo-mode": "^2.2",
"spatie/laravel-failed-job-monitor": "^3.0",
"spatie/laravel-sitemap": "^5.2",
"tymon/jwt-auth": "^0.5.12"
}, },
"require-dev": { "require-dev": {
"filp/whoops": "^2.0", "filp/whoops": "^2.0",
@ -40,10 +49,15 @@
}, },
"extra": { "extra": {
"laravel": { "laravel": {
"dont-discover": [ "dont-discover": []
]
} }
}, },
"repositories": [
{
"type": "vcs",
"url": "https://dev.leenooks.net/leenooks/laravel"
}
],
"scripts": { "scripts": {
"post-root-package-install": [ "post-root-package-install": [
"@php -r \"file_exists('.env') || copy('.env.example', '.env');\"" "@php -r \"file_exists('.env') || copy('.env.example', '.env');\""

2105
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -165,10 +165,10 @@ return [
/* /*
* Other Service Providers... * Other Service Providers...
*/ */
Igaster\LaravelTheme\themeServiceProvider::class, Acacha\User\Providers\GuestUserServiceProvider::class,
Intervention\Image\ImageServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
Orchestra\Asset\AssetServiceProvider::class, Orchestra\Asset\AssetServiceProvider::class,
Collective\Html\HtmlServiceProvider::class,
Tymon\JWTAuth\Providers\JWTAuthServiceProvider::class,
], ],
/* /*
@ -196,13 +196,14 @@ return [
'Cookie' => Illuminate\Support\Facades\Cookie::class, 'Cookie' => Illuminate\Support\Facades\Cookie::class,
'Crypt' => Illuminate\Support\Facades\Crypt::class, 'Crypt' => Illuminate\Support\Facades\Crypt::class,
'DB' => Illuminate\Support\Facades\DB::class, 'DB' => Illuminate\Support\Facades\DB::class,
'Debugbar' => Barryvdh\Debugbar\Facade::class,
'Doorman' => Clarkeash\Doorman\Facades\Doorman::class,
'Eloquent' => Illuminate\Database\Eloquent\Model::class, 'Eloquent' => Illuminate\Database\Eloquent\Model::class,
'Event' => Illuminate\Support\Facades\Event::class, 'Event' => Illuminate\Support\Facades\Event::class,
'File' => Illuminate\Support\Facades\File::class, 'File' => Illuminate\Support\Facades\File::class,
'Gravatar' => Creativeorange\Gravatar\Facades\Gravatar::class,
'Gate' => Illuminate\Support\Facades\Gate::class, 'Gate' => Illuminate\Support\Facades\Gate::class,
'Gravatar' => Creativeorange\Gravatar\Facades\Gravatar::class,
'Hash' => Illuminate\Support\Facades\Hash::class, 'Hash' => Illuminate\Support\Facades\Hash::class,
'Image' => Intervention\Image\Facades\Image::class,
'Lang' => Illuminate\Support\Facades\Lang::class, 'Lang' => Illuminate\Support\Facades\Lang::class,
'Log' => Illuminate\Support\Facades\Log::class, 'Log' => Illuminate\Support\Facades\Log::class,
'Mail' => Illuminate\Support\Facades\Mail::class, 'Mail' => Illuminate\Support\Facades\Mail::class,
@ -217,7 +218,6 @@ return [
'Schema' => Illuminate\Support\Facades\Schema::class, 'Schema' => Illuminate\Support\Facades\Schema::class,
'Session' => Illuminate\Support\Facades\Session::class, 'Session' => Illuminate\Support\Facades\Session::class,
'Storage' => Illuminate\Support\Facades\Storage::class, 'Storage' => Illuminate\Support\Facades\Storage::class,
'Theme' => Igaster\LaravelTheme\Facades\Theme::class,
'URL' => Illuminate\Support\Facades\URL::class, 'URL' => Illuminate\Support\Facades\URL::class,
'Validator' => Illuminate\Support\Facades\Validator::class, 'Validator' => Illuminate\Support\Facades\Validator::class,
'View' => Illuminate\Support\Facades\View::class, 'View' => Illuminate\Support\Facades\View::class,

View File

@ -43,9 +43,9 @@ return [
'driver' => 'mysql', 'driver' => 'mysql',
'host' => env('DB_HOST', '127.0.0.1'), 'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '3306'), 'port' => env('DB_PORT', '3306'),
'database' => env('DB_DATABASE', 'forge'), 'database' => env('DB_DATABASE', 'billing'),
'username' => env('DB_USERNAME', 'forge'), 'username' => env('DB_USERNAME', 'billing'),
'password' => env('DB_PASSWORD', ''), 'password' => env('DB_PASSWORD', 'billing'),
'unix_socket' => env('DB_SOCKET', ''), 'unix_socket' => env('DB_SOCKET', ''),
'charset' => 'utf8mb4', 'charset' => 'utf8mb4',
'collation' => 'utf8mb4_unicode_ci', 'collation' => 'utf8mb4_unicode_ci',
@ -78,6 +78,18 @@ return [
'prefix' => '', 'prefix' => '',
], ],
'cockroach' => [
'driver' => 'cockroach',
'host' => env('DB_HOST', '127.0.0.1'),
'port' => env('DB_PORT', '26257'),
'database' => env('DB_DATABASE', 'forge'),
'username' => env('DB_USERNAME', 'forge'),
'password' => env('DB_PASSWORD', ''),
'charset' => 'utf8',
'prefix' => '',
'schema' => env('DB_DATABASE', 'forge'),
'sslmode' => 'prefer',
],
], ],
/* /*

34
config/demo-mode.php Normal file
View File

@ -0,0 +1,34 @@
<?php
return [
/*
* This is the master switch to enable demo mode.
*/
'enabled' => env('DEMO_MODE_ENABLED', false),
/*
* Visitors browsing a protected url will be redirected to this path.
*/
'redirect_unauthorized_users_to_url' => '/under-construction',
/*
* After having gained access, visitors will be redirected to this path.
*/
'redirect_authorized_users_to_url' => '/',
/*
* The following IP's will automatically gain access to the
* app without having to visit the `demoAccess` route.
*/
'authorized_ips' => [
//
],
/*
* When strict mode is enabled, only IP's listed in `authorized_ips` will gain access.
* Visitors won't be able to gain access by visiting the `demoAccess` route anymore.
*/
'strict_mode' => false,
];

View File

@ -13,7 +13,7 @@ return array(
'fallback' => 'mm', 'fallback' => 'mm',
// would you like to return a https://... image // would you like to return a https://... image
'secure' => false, 'secure' => true,
// Gravatar allows users to self-rate their images so that they can indicate if an image // Gravatar allows users to self-rate their images so that they can indicate if an image
// is appropriate for a certain audience. By default, only 'G' rated images are displayed // is appropriate for a certain audience. By default, only 'G' rated images are displayed

177
config/jwt.php Normal file
View File

@ -0,0 +1,177 @@
<?php
/*
* This file is part of jwt-auth.
*
* (c) Sean Tymon <tymon148@gmail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
return [
/*
|--------------------------------------------------------------------------
| JWT Authentication Secret
|--------------------------------------------------------------------------
|
| Don't forget to set this, as it will be used to sign your tokens.
| A helper command is provided for this: `php artisan jwt:generate`
|
*/
'secret' => env('JWT_SECRET',
(file_exists(base_path('.jwt.'.env('APP_ENV').'.crt'))
? file_get_contents(base_path('.jwt.'.env('APP_ENV').'.crt'))
: 'changeme')
),
/*
|--------------------------------------------------------------------------
| JWT time to live
|--------------------------------------------------------------------------
|
| Specify the length of time (in minutes) that the token will be valid for.
| Defaults to 1 hour
|
*/
'ttl' => 60,
/*
|--------------------------------------------------------------------------
| Refresh time to live
|--------------------------------------------------------------------------
|
| Specify the length of time (in minutes) that the token can be refreshed
| within. I.E. The user can refresh their token within a 2 week window of
| the original token being created until they must re-authenticate.
| Defaults to 2 weeks
|
*/
'refresh_ttl' => 20160,
/*
|--------------------------------------------------------------------------
| JWT hashing algorithm
|--------------------------------------------------------------------------
|
| Specify the hashing algorithm that will be used to sign the token.
|
| See here: https://github.com/namshi/jose/tree/2.2.0/src/Namshi/JOSE/Signer
| for possible values
|
*/
'algo' => 'RS256',
/*
|--------------------------------------------------------------------------
| User Model namespace
|--------------------------------------------------------------------------
|
| Specify the full namespace to your User model.
| e.g. 'Acme\Entities\User'
|
*/
'user' => 'App\User',
/*
|--------------------------------------------------------------------------
| User identifier
|--------------------------------------------------------------------------
|
| Specify a unique property of the user that will be added as the 'sub'
| claim of the token payload.
|
*/
'identifier' => 'id',
/*
|--------------------------------------------------------------------------
| Required Claims
|--------------------------------------------------------------------------
|
| Specify the required claims that must exist in any token.
| A TokenInvalidException will be thrown if any of these claims are not
| present in the payload.
|
*/
'required_claims' => ['iss', 'iat', 'exp', 'nbf', 'sub', 'jti'],
/*
|--------------------------------------------------------------------------
| Blacklist Enabled
|--------------------------------------------------------------------------
|
| In order to invalidate tokens, you must have the blacklist enabled.
| If you do not want or need this functionality, then set this to false.
|
*/
'blacklist_enabled' => env('JWT_BLACKLIST_ENABLED', true),
/*
|--------------------------------------------------------------------------
| Providers
|--------------------------------------------------------------------------
|
| Specify the various providers used throughout the package.
|
*/
'providers' => [
/*
|--------------------------------------------------------------------------
| User Provider
|--------------------------------------------------------------------------
|
| Specify the provider that is used to find the user based
| on the subject claim
|
*/
'user' => 'Tymon\JWTAuth\Providers\User\EloquentUserAdapter',
/*
|--------------------------------------------------------------------------
| JWT Provider
|--------------------------------------------------------------------------
|
| Specify the provider that is used to create and decode the tokens.
|
*/
'jwt' => 'Tymon\JWTAuth\Providers\JWT\NamshiAdapter',
/*
|--------------------------------------------------------------------------
| Authentication Provider
|--------------------------------------------------------------------------
|
| Specify the provider that is used to authenticate users.
|
*/
'auth' => 'Tymon\JWTAuth\Providers\Auth\IlluminateAuthAdapter',
/*
|--------------------------------------------------------------------------
| Storage Provider
|--------------------------------------------------------------------------
|
| Specify the provider that is used to store tokens in the blacklist
|
*/
'storage' => 'Tymon\JWTAuth\Providers\Storage\IlluminateCacheAdapter',
],
];

View File

@ -1,35 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateUsersTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('users', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('email')->unique();
$table->string('password');
$table->rememberToken();
$table->timestamps();
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('users');
}
}

View File

@ -1,42 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableSites extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('sites', function (Blueprint $table) {
$table->increments('id');
$table->timestamps();
$table->string('url');
$table->string('devurl')->nullable();
$table->string('name');
$table->json('address')->nullable();
$table->string('description')->nullable();
$table->string('email');
$table->string('phone')->nullable();
$table->string('fax')->nullable();
$table->string('logo')->nullable();
$table->string('favicon')->nullable();
$table->string('theme');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('sites');
}
}

View File

@ -1,34 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCurrencies extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('currencies', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('symbol',2)->nullable();
$table->string('threecode',3);
$table->boolean('active');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('currencies');
}
}

View File

@ -1,37 +0,0 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class CreateTableCountries extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::create('countries', function (Blueprint $table) {
$table->increments('id');
$table->string('name');
$table->string('twocode',2)->nullable();
$table->string('threecode',3);
$table->integer('currency_id')->unsigned()->nullable();
$table->boolean('active');
$table->foreign('currency_id')->references('id')->on('currencies');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('countries');
}
}

View File

@ -0,0 +1,36 @@
<?php
use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use App\Models\Currency;
class CurrencyAddRounding extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('ab_currency', function (Blueprint $table) {
$table->smallInteger('rounding');
});
Currency::query()->update(['rounding'=>2]);
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('ab_currency', function (Blueprint $table) {
$table->dropColumn('rounding');
});
}
}

View File

@ -4,7 +4,7 @@ use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Migrations\Migration;
class CreatePasswordResetsTable extends Migration class AccountAddRememberToken extends Migration
{ {
/** /**
* Run the migrations. * Run the migrations.
@ -13,10 +13,8 @@ class CreatePasswordResetsTable extends Migration
*/ */
public function up() public function up()
{ {
Schema::create('password_resets', function (Blueprint $table) { Schema::table('ab_account', function (Blueprint $table) {
$table->string('email')->index(); $table->rememberToken();
$table->string('token');
$table->timestamp('created_at')->nullable();
}); });
} }
@ -27,6 +25,8 @@ class CreatePasswordResetsTable extends Migration
*/ */
public function down() public function down()
{ {
Schema::dropIfExists('password_resets'); Schema::table('ab_account', function (Blueprint $table) {
$table->dropRememberToken();
});
} }
} }

View File

@ -1,21 +1,20 @@
<IfModule mod_rewrite.c> <IfModule mod_rewrite.c>
<IfModule mod_negotiation.c> <IfModule mod_negotiation.c>
Options -MultiViews -Indexes Options -MultiViews
</IfModule> </IfModule>
RewriteEngine On RewriteEngine On
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# Redirect Trailing Slashes If Not A Folder... # Redirect Trailing Slashes If Not A Folder...
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} (.+)/$ RewriteRule ^(.*)/$ /$1 [L,R=301]
RewriteRule ^ %1 [L,R=301]
# Handle Front Controller... # Handle Front Controller...
RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L] RewriteRule ^ index.php [L]
# Handle Authorization Header
RewriteCond %{HTTP:Authorization} .
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
</IfModule> </IfModule>

File diff suppressed because it is too large Load Diff

View File

@ -95,29 +95,9 @@
min-height: 580px; min-height: 580px;
} }
/* Carousel Item Background Images */ .carousel-slider .carousel-item {
.carousel-slider .carousel-item-eight { background-size: cover !important;
background: url(/image/generic/300/300/eee); background-position: center center !important;
background-size: cover;
background-position: center center;
}
.carousel-slider .carousel-item-nine {
background: url(/image/generic/400/400/ddd);
background-size: cover;
background-position: center center;
}
.carousel-slider .carousel-item-ten {
background: url(/image/generic/500/500/ccc);
background-size: cover;
background-position: center center;
}
.carousel-slider .carousel-item-eleven {
background: url(/metronic/pages/img/frontend-slider/bg3.jpg);
background-size: cover;
background-position: center center;
} }
/* Carousel Titles */ /* Carousel Titles */

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

Before

Width:  |  Height:  |  Size: 80 KiB

After

Width:  |  Height:  |  Size: 80 KiB

View File

Before

Width:  |  Height:  |  Size: 7.9 KiB

After

Width:  |  Height:  |  Size: 7.9 KiB

View File

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 50 KiB

View File

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 1.4 KiB

View File

Before

Width:  |  Height:  |  Size: 54 KiB

After

Width:  |  Height:  |  Size: 54 KiB

View File

Before

Width:  |  Height:  |  Size: 2.5 KiB

After

Width:  |  Height:  |  Size: 2.5 KiB

View File

Before

Width:  |  Height:  |  Size: 82 KiB

After

Width:  |  Height:  |  Size: 82 KiB

View File

Before

Width:  |  Height:  |  Size: 5.1 KiB

After

Width:  |  Height:  |  Size: 5.1 KiB

View File

Before

Width:  |  Height:  |  Size: 74 KiB

After

Width:  |  Height:  |  Size: 74 KiB

View File

Before

Width:  |  Height:  |  Size: 4.3 KiB

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -1,32 +1,52 @@
@extends('layouts.app') @extends('adminlte::layouts.app')
@section('htmlheader_title') @section('htmlheader_title')
Page Title Home
@endsection @endsection
@section('contentheader_title') @section('contentheader_title')
Home Page {{ $user->full_name }}
@endsection @endsection
@section('contentheader_description') @section('contentheader_description')
Home Home
@endsection @endsection
@section('main-content') @section('main-content')
<div class="col-sm-2 col-md-offset-0"> <div class="content">
<div class="box">
<div class="box-header with-border"> <div class="row">
<h3 class="box-title">Content</h3> <div class="col-sm-3">
<div class="box-tools pull-right"> <div class="info-box">
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse"> <span class="info-box-icon bg-green"><i class="fa fa-clone"></i></span>
<i class="fa fa-minus"></i></button> <div class="info-box-content">
<button type="button" class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove"> <span class="info-box-text">Active Services</span>
<i class="fa fa-times"></i></button> <span class="info-box-number">{{ $user->services_active->count() }}</span>
</div>
</div> </div>
</div> </div>
<div class="col-sm-3">
<div class="box-body"> <div class="info-box">
Content Here <span class="info-box-icon bg-red"><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>
</div>
</div>
</div> </div>
</div> </div>
<div class="row">
<div class="col-xs-7">
@include('widgets.services_active')
</div>
<div class="col-xs-5">
@include('widgets.invoices_due')
</div>
{{--
<div class="col-xs-5">
@include('widgets.payment_history',['limit'=>10])
</div>
--}}
</div>
</div> </div>
@endsection @endsection

View File

@ -0,0 +1,44 @@
<div class="box box-danger small">
<div class="box-header">
<h3 class="box-title">Invoices Due</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fa fa-minus"></i></button>
<button type="button" class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove">
<i class="fa fa-times"></i></button>
</div>
</div>
<div class="box-body">
@if ($user->invoices_due->count())
<table class="table table-bordered table-striped table-hover" id="table">
<tr>
<th>Invoice</th>
<th>Total</th>
<th>Due</th>
<th>Date</th>
</tr>
@foreach ($user->invoices_due as $o)
@php
$co = $o->currency();
@endphp
<tr>
<td>{{ $o->invoice_number }}</td>
<td class="right">{{ number_format($o->total,$co->rounding) }}</td>
<td class="right">{{ number_format($o->due,$co->rounding) }}</td>
<td>{{ $o->date_due }}</td>
</tr>
@endforeach
<tr>
<th>Count {{ $user->invoices_due->count() }}</th>
{{-- @todo Number format should configured by currency --}}
<th class="right">{{ number_format($user->invoices_due->sum('total'),2) }}</th>
<th class="right">{{ number_format($user->invoices_due->sum('due'),2) }}</th>
<th>&nbsp;</th>
</tr>
</table>
@else
<p>No invoices due</p>
@endif
</div>
</div>

View File

@ -0,0 +1,37 @@
<div class="box box-danger small">
<div class="box-header">
<h3 class="box-title">Payment History</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fa fa-minus"></i></button>
<button type="button" class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove">
<i class="fa fa-times"></i></button>
</div>
</div>
<div class="box-body">
@if ($user->payment_history->count())
<table class="table table-bordered table-striped table-hover" id="table">
<tr>
<th>Date</th>
<th>Amount</th>
</tr>
@php
$c=0;
@endphp
@foreach ($user->payment_history as $o)
@if(! isset($limit) OR $c++ > $limit)
@break;
@endif
<tr>
<td>{{ $o->payment_date }}</td>
{{-- @todo Number format should configured by currency --}}
<td class="right">{{ number_format($o->total_amt,2) }}</td>
</tr>
@endforeach
</table>
@else
<p>No payments recorded</p>
@endif
</div>
</div>

View File

@ -0,0 +1,45 @@
<div class="box box-success small">
<div class="box-header">
<h3 class="box-title">Services</h3>
<div class="box-tools pull-right">
<button type="button" class="btn btn-box-tool" data-widget="collapse" data-toggle="tooltip" title="Collapse">
<i class="fa fa-minus"></i></button>
<button type="button" class="btn btn-box-tool" data-widget="remove" data-toggle="tooltip" title="Remove">
<i class="fa fa-times"></i></button>
</div>
</div>
<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>
@else
<p>No services active</p>
@endif
</div>
</div>

View File

@ -34,14 +34,15 @@
</div><!-- ./wrapper --> </div><!-- ./wrapper -->
{{-- BEGIN CORE PLUGINS (REQUIRED FOR ALL PAGES) --}} {{-- BEGIN CORE PLUGINS (REQUIRED FOR ALL PAGES) --}}
@js('/assets/jquery/1.11.2/js/jquery.min.js','jquery') @js('/site/js/jquery/1.11.2/js/jquery.min.js','jquery')
@js('/assets/jquery/plugins/migrate/1.2.1/js/jquery-migrate.min.js','jq-migrate','jquery') @js('/site/js/bootstrap/3.3.5/js/bootstrap.min.js','bootstrap-js','jquery')
@js('/assets/bootstrap/3.3.5/js/bootstrap.min.js','bootstrap-js','jquery') @js('/site/js/jquery/plugins/migrate/1.2.1/js/jquery-migrate.min.js','jq-migrate','jquery')
@js('/assets/jquery/plugins/back-to-top/back-to-top.js','back-to-top','jquery') @js('/site/js/jquery/plugins/back-to-top/back-to-top.js','back-to-top','jquery')
{{-- END CORE PLUGINS --}} {{-- END CORE PLUGINS --}}
{{-- Scripts --}} {{-- Scripts --}}
{!! Asset::scripts() !!} {!! Asset::scripts() !!}
@section('scripts') @section('scripts')
@include('layouts.partials.scripts') @include('layouts.partials.scripts')
@show @show

View File

@ -7,7 +7,7 @@
<!-- BEGIN BOTTOM ABOUT BLOCK --> <!-- BEGIN BOTTOM ABOUT BLOCK -->
<div class="col-md-4 col-sm-6 pre-footer-col"> <div class="col-md-4 col-sm-6 pre-footer-col">
<h2>About us</h2> <h2>About us</h2>
<p>{!! $site_aboutus !!}</p> <p>{!! $so->site_aboutus !!}</p>
<!-- <!--
<div class="photo-stream"> <div class="photo-stream">
<h2>Photos Stream</h2> <h2>Photos Stream</h2>
@ -80,11 +80,9 @@
<!-- BEGIN SOCIAL --> <!-- BEGIN SOCIAL -->
<div class="col-md-4 col-sm-4"> <div class="col-md-4 col-sm-4">
<ul class="social-footer list-unstyled list-inline pull-right"> <ul class="social-footer list-unstyled list-inline pull-right">
@if(isset($site_social) AND is_array($site_social)) @foreach ($so->social as $social)
@foreach ($site_social as $social) <li><a href="{{ $social['url'] }}"><i class="fa fa-{{ $social['name'] }}"></i></a></li>
<li><a href="{{ $social['url'] }}"><i class="fa fa-{{ $social['name'] }}"></i></a></li> @endforeach
@endforeach
@endif
</ul> </ul>
</div> </div>
<!-- END SOCIAL --> <!-- END SOCIAL -->

View File

@ -9,24 +9,20 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" />
<meta property="og:site_name" content="{{ config('app.name') }}" /> <meta property="og:site_name" content="{{ config('app.name') }}" />
<meta property="og:title" content="{{ $page_title }}" /> <meta property="og:title" content="{{ $so->name }}" />
<meta property="og:description" content="{{ $site_description }}" /> <meta property="og:description" content="{{ $so->site_description }}" />
<meta property="og:type" content="website" /> <meta property="og:type" content="website" />
<meta property="og:image" content="{{ $site_logo }}" /> <meta property="og:image" content="{{ $so->site_logo }}" />
<meta property="og:url" content="{{ url('/') }}" /> <meta property="og:url" content="{{ url('/') }}" />
<link rel="shortcut icon" href="{{ object_get($so,'favicon','favicon.ico') }}" /> <link rel="shortcut icon" href="{{ object_get($so,'favicon','favicon.ico') }}" />
{{-- Fonts START --}} {{-- Fonts START --}}
<link href="http://fonts.googleapis.com/css?family=Open+Sans:300,400,600,700|PT+Sans+Narrow|Source+Sans+Pro:200,300,400,600,700,900&amp;subset=all" rel="stylesheet" type="text/css"> <link href="//fonts.googleapis.com/css?family=Open+Sans:300,400,600,700|PT+Sans+Narrow|Source+Sans+Pro:200,300,400,600,700,900&amp;subset=all" rel="stylesheet" type="text/css">
{{-- Fonts END --}} {{-- Fonts END --}}
@css('/assets/animate/css/animate.css')
@css('/assets/jquery/plugins/fancybox/source/jquery.fancybox.css')
@css('/assets/jquery/plugins/owl.carousel/2.0.0/css/owl.carousel.css')
@css('/assets/jquery/plugins/uniform/2.1.0/css/uniform.default.css')
@css('/assets/font-awesome/css/font-awesome.min.css') @css('/assets/font-awesome/css/font-awesome.min.css')
@css('/assets/bootstrap/3.3.5/css/bootstrap.min.css') @css('/site/js/bootstrap/3.3.5/css/bootstrap.min.css')
{{-- Theme styles START --}} {{-- Theme styles START --}}
@css('/site/css/components.css') @css('/site/css/components.css')

View File

@ -27,32 +27,30 @@
<!-- BEGIN HEADER --> <!-- BEGIN HEADER -->
<div class="header"> <div class="header">
<div class="container"> <div class="container">
<a class="site-logo" href="{{ url('/') }}"><img src="{{ $site_logo }}" alt="{{ config('app.name') }}" height="32"></a> <a class="site-logo" href="{{ url('/') }}"><img src="{{ $so->logo_url() }}" alt="{{ config('app.name') }}" height="32"></a>
<a href="javascript:void(0);" class="mobi-toggler"><i class="fa fa-bars"></i></a> <a href="javascript:void(0);" class="mobi-toggler"><i class="fa fa-bars"></i></a>
<!-- BEGIN NAVIGATION --> <!-- BEGIN NAVIGATION -->
<div class="header-navigation pull-right font-transform-inherit"> <div class="header-navigation pull-right font-transform-inherit">
<ul> <ul>
{{-- @todo Replace this with a function that can traverse children with multiple depths --}} {{-- @todo Replace this with a function that can traverse children with multiple depths --}}
@if (isset($site_topmenu) AND is_array($site_topmenu)) @foreach ($so->top_menu as $item => $menu)
@foreach ($site_topmenu as $item => $menu) <li class="dropdown {{ Request::is($menu['url']) ? 'active' : '' }}">
<li class="dropdown {{ Request::is($menu['url']) ? 'active' : '' }}">
@if (! array_get($menu,'children')) @if (! array_get($menu,'children'))
<a {{ Request::is($menu['url']) ? 'class=active' : '' }} href="{{ url($menu['url']) }}">{{ $menu['name'] }}</a> <a {{ Request::is($menu['url']) ? 'class=active' : '' }} href="{{ url($menu['url']) }}">{{ $menu['name'] }}</a>
@else @else
<a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="javascript:;">{{ $item }}</a> <a class="dropdown-toggle" data-toggle="dropdown" data-target="#" href="javascript:;">{{ $item }}</a>
<ul class="dropdown-menu"> <ul class="dropdown-menu">
<li {{ (Request::is($menu['url']) ? 'class=active' : '') }}><a href="{{ url($menu['url']) }}">{{ $menu['name'] }}</a></li> <li {{ (Request::is($menu['url']) ? 'class=active' : '') }}><a href="{{ url($menu['url']) }}">{{ $menu['name'] }}</a></li>
@foreach($menu['children'] as $name => $menuitem) @foreach($menu['children'] as $name => $menuitem)
<li {{ (Request::is($menuitem['url']) ? 'class=active' : '') }}><a href="{{ url($menuitem['url']) }}">{{ $menuitem['name'] }}</a></li> <li {{ (Request::is($menuitem['url']) ? 'class=active' : '') }}><a href="{{ url($menuitem['url']) }}">{{ $menuitem['name'] }}</a></li>
@endforeach @endforeach
</ul> </ul>
@endif @endif
</li> </li>
@endforeach @endforeach
@endif
<!-- BEGIN TOP SEARCH --> <!-- BEGIN TOP SEARCH -->
<li class="menu-search"> <li class="menu-search">

Some files were not shown because too many files have changed in this diff Show More