Skip to content

Commit

Permalink
Sidenav setup.
Browse files Browse the repository at this point in the history
  • Loading branch information
ocornel committed Feb 7, 2021
1 parent 607c426 commit 7c4ef04
Show file tree
Hide file tree
Showing 8 changed files with 52 additions and 203 deletions.
5 changes: 5 additions & 0 deletions app/Http/Controllers/CreditController.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,11 @@ public function index($status_filter=null)
return $credit->cleared == true;
})->values();;
break;
case HC::CREDITS_OVERPAID:
$credits = Credit::all()->filter(function ($credit) {
return $credit->amount_due < 0;
})->values();;
break;
default:
$credits = Credit::all();
}
Expand Down
10 changes: 7 additions & 3 deletions app/Http/Controllers/HomeController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,14 @@ public function __construct()
$this->middleware('auth');
}

public const WIDGET_U5 = 'Clients Under 5';
public const WIDGET_O5 = 'Clients Over 5';
public const WIDGET_U5 = 'Under 5';
public const WIDGET_O5 = 'Over 5';
public const PATIENTS_WITH_DEBT = 'With Outstanding Debts';

public const WIDGET_OUTSTANDING = 'Total Outstanding Debts';
public const WIDGET_CLEARED = 'Total Cleared Debts';
public const WIDGET_CLEARED = 'Cleared Debt';
public const CREDITS_OVERPAID = 'Overpaid Debt';

public const WIDGET_DUE = 'Debts Due Soon';
public const WIDGET_DEBT_TREND = 'Debts Trend';

Expand Down
11 changes: 8 additions & 3 deletions app/Http/Controllers/PatientController.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ public function __construct()
*
* @return \Illuminate\Contracts\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Http\Response|\Illuminate\View\View
*/
public function index($age_filter=null)
public function index($filter=null)
{
switch ($age_filter) {
switch ($filter) {
case HC::WIDGET_O5:
$patients = Patient::all()->filter(function ($patient) {
return $patient->years >= 5;
Expand All @@ -36,11 +36,16 @@ public function index($age_filter=null)
return $patient->years < 5;
})->values();;
break;
case HC::PATIENTS_WITH_DEBT:
$patients = Patient::all()->filter(function ($patient) {
return $patient->credit_due > 0;
})->values();;
break;
default:
$patients = Patient::all();
}
$context = [
'age_filter' =>$age_filter,
'list_filter' =>$filter,
'patients' => $patients
];
return view('patient.index', $context);
Expand Down
1 change: 1 addition & 0 deletions app/Utils.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@

class Utils extends Model
{
const SUPER_ADMIN_ID = 1;
public static function safe_divide($numerator, $denominator, $decimals=2){
if ($numerator == 0 or $denominator == 0){
return round(0,$decimals);
Expand Down
1 change: 1 addition & 0 deletions database/seeds/UsersTableSeeder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public function run()
{
if ($this->command) $this->command->info('Creating Default Users');
User::create([
'id'=>\App\Utils::SUPER_ADMIN_ID,
'name' => 'System Admin',
'email' => "[email protected]",
'password' => bcrypt('Sy5@dm!n')
Expand Down
4 changes: 3 additions & 1 deletion resources/views/layouts/backend.blade.php
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE HTML>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="UTF-8">
Expand Down Expand Up @@ -27,6 +27,8 @@
{{-- <link rel="manifest" href="manifest.json">--}}
{{-- <link rel="mask-icon" href="safari-pinned-tab.svg" color="#27ae60">--}}
<meta name="theme-color" content="#ffffff">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">

<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Roboto:300,400,400italic,500,700">
<link href="{{ asset('css/vendor.min.css') }}" rel="stylesheet">
<link href="{{ asset('css/elephant.min.css') }}" rel="stylesheet">
Expand Down
221 changes: 26 additions & 195 deletions resources/views/layouts/sidenav.blade.php
Original file line number Diff line number Diff line change
@@ -1,224 +1,55 @@

<div class="layout-sidebar-backdrop"></div>
<div class="layout-sidebar-body">
<div class="custom-scrollbar">
<nav id="sidenav" class="sidenav-collapse collapse">
<br>
<br>
<ul class="sidenav">
<li class="sidenav-search hidden-md hidden-lg">
<form class="sidenav-form" action="http://demo.madebytilde.com/">
<div class="form-group form-group-sm">
<div class="input-with-icon">
<input class="form-control" type="text" placeholder="Search…">
<span class="icon icon-search input-icon"></span>
</div>
</div>
</form>
</li>
<li class="sidenav-heading">Navigation</li>
<li class="sidenav-item has-subnav">
<a href="dashboard-1.html" aria-haspopup="true">
<span class="sidenav-icon icon icon-home"></span>
<span class="sidenav-label">Dashboards</span>
</a>
<ul class="sidenav-subnav collapse">
<li class="sidenav-subheading">Dashboards</li>
<li><a href="dashboard-1.html">Dashboard 1</a></li>
<li><a href="dashboard-2.html">Dashboard 2</a></li>
<li><a href="dashboard-3.html">Dashboard 3</a></li>
</ul>
</li>
<li class="sidenav-item">
<a href="widgets.html">
<span class="badge badge-success">26</span>
<span class="sidenav-icon icon icon-th"></span>
<span class="sidenav-label">Widgets</span>
</a>
</li>
<li class="sidenav-item">
<a href="page-layouts.html">
<span class="sidenav-icon icon icon-columns"></span>
<span class="sidenav-label">Page layouts</span>
</a>
</li>
<li class="sidenav-heading">Components</li>
<li class="sidenav-item has-subnav">
<a href="blank-page.html#" aria-haspopup="true">
<span class="sidenav-icon icon icon-briefcase"></span>
<span class="sidenav-label">UI Elements</span>
</a>
<ul class="sidenav-subnav collapse">
<li class="sidenav-subheading">UI Elements</li>
<li><a href="arrows.html">Arrows</a></li>
<li><a href="badges.html">Badges</a></li>
<li><a href="buttons.html">Buttons</a></li>
<li><a href="cards.html">Cards</a></li>
<li><a href="dividers.html">Dividers</a></li>
<li><a href="files.html">Files</a></li>
<li><a href="flags.html">Flags</a></li>
<li><a href="grid-system.html">Grid system</a></li>
<li><a href="icons.html">Icons</a></li>
<li><a href="labels.html">Labels</a></li>
<li><a href="lists.html">Lists</a></li>
<li><a href="modals.html">Modals <span class="badge badge-danger">New</span></a></li>
<li><a href="pricing-cards.html">Pricing cards</a></li>
<li><a href="progress-bars.html">Progress bars</a></li>
<li><a href="spinners.html">Spinners</a></li>
<li><a href="tabs.html">Tabs <span class="badge badge-danger">New</span></a></li>
<li><a href="toastr.html">Toastr</a></li>
<li><a href="typography.html">Typography</a></li>
</ul>
</li>
<li class="sidenav-item has-subnav">
<a href="blank-page.html#" aria-haspopup="true">
<span class="sidenav-icon icon icon-edit"></span>
<span class="sidenav-label">Forms</span>
</a>
<ul class="sidenav-subnav collapse">
<li class="sidenav-subheading">Forms</li>
<li><a href="cropper.html">Cropper</a></li>
<li><a href="form-controls.html">Form controls</a></li>
<li><a href="form-layouts.html">Form layouts</a></li>
<li><a href="form-validation.html">Form validation</a></li>
<li><a href="form-wizard.html">Form wizard</a></li>
<li><a href="input-mask.html">Input mask</a></li>
<li><a href="md-form-controls.html">Material form controls</a></li>
<li><a href="md-form-validation.html">Material form validation</a></li>
<li><a href="pickers.html">Pickers</a></li>
<li><a href="select2.html">Select2</a></li>
<li><a href="sliders.html">Sliders</a></li>
<li><a href="toggles.html">Toggles</a></li>
<li><a href="uploader.html">Uploader</a></li>
</ul>
</li>
<li class="sidenav-item has-subnav">
<a href="blank-page.html#" aria-haspopup="true">
<span class="sidenav-icon icon icon-list"></span>
<span class="sidenav-label">Tables</span>
</a>
<ul class="sidenav-subnav collapse">
<li class="sidenav-subheading">Tables</li>
<li><a href="static-tables.html">Static tables</a></li>
<li><a href="responsive-tables.html">Responsive tables</a></li>
<li><a href="bootstrap-tables.html">Bootstrap tables</a></li>
<li><a href="datatables.html">Datatables</a></li>
<li><a href="datatables-buttons.html">Datatables Buttons</a></li>
<li><a href="datatables-responsive.html">Datatables Responsive</a></li>
<li><a href="datatables-fixedheader.html">Datatables FixedHeader</a></li>
<li><a href="datatables-rowreorder.html">Datatables RowReorder</a></li>
<li><a href="datatables-colreorder.html">Datatables ColReorder</a></li>
<li><a href="datatables-scroller.html">Datatables Scroller</a></li>
</ul>
</li>
<li class="sidenav-item has-subnav">
<a href="blank-page.html#" aria-haspopup="true">
<span class="sidenav-icon icon icon-pie-chart"></span>
<span class="sidenav-label">Charts</span>
<a href="{{ route('home') }}">
<span class="sidenav-icon icon icon-area-chart"></span>
<span class="sidenav-label">Dashboard</span>
</a>
<ul class="sidenav-subnav collapse">
<li class="sidenav-subheading">Charts</li>
<li><a href="peity.html">Peity</a></li>
<li><a href="chartjs.html">Chart.js</a></li>
</ul>
</li>
<li class="sidenav-item has-subnav">
<a href="blank-page.html#" aria-haspopup="true">
<span class="sidenav-icon icon icon-map-marker"></span>
<span class="sidenav-label">Maps</span>
</a>
<ul class="sidenav-subnav collapse">
<li class="sidenav-subheading">Maps</li>
<li><a href="vector-maps.html">Vector maps</a></li>
<li><a href="google-maps.html">Google maps</a></li>
</ul>
</li>
<li class="sidenav-heading">Pages</li>
<li class="sidenav-item has-subnav">
<a href="blank-page.html#" aria-haspopup="true">
<span class="sidenav-icon icon icon-lock"></span>
<span class="sidenav-label">Authentication</span>
<a href="" aria-haspopup="true">
<span class="sidenav-icon icon icon-heartbeat"></span>
<span class="sidenav-label">Patients</span>
</a>
<ul class="sidenav-subnav collapse">
<li class="sidenav-subheading">Authentication</li>
<li><a href="signup-1.html" target="_blank">Sign up 1</a></li>
<li><a href="signup-2.html" target="_blank">Sign up 2</a></li>
<li><a href="signup-3.html" target="_blank">Sign up 3</a></li>
<li><a href="login-1.html" target="_blank">Login 1</a></li>
<li><a href="login-2.html" target="_blank">Login 2</a></li>
<li><a href="login-3.html" target="_blank">Login 3</a></li>
<li><a href="password-1.html" target="_blank">Reset password 1</a></li>
<li><a href="password-2.html" target="_blank">Reset password 2</a></li>
<li><a href="password-3.html" target="_blank">Reset password 3</a></li>
<li class="sidenav-subheading">Patients</li>
<li><a href="{{ route('patients') }}">All Patients</a></li>
<li><a href="{{ route('patients', \App\Http\Controllers\HomeController::WIDGET_U5) }}">Under 5 years</a></li>
<li><a href="{{ route('patients', \App\Http\Controllers\HomeController::WIDGET_O5) }}">Over 5 years</a></li>
<li><a href="{{ route('patients', \App\Http\Controllers\HomeController::PATIENTS_WITH_DEBT) }}">With Outstanding Debts</a></li>
</ul>
</li>
<li class="sidenav-item">
<a href="contacts.html">
<span class="sidenav-icon icon icon-users"></span>
<span class="sidenav-label">Contacts</span>
<a href="{{ route('noks') }}">
<span class="sidenav-icon icon icon-phone"></span>
<span class="sidenav-label">Contact Perole (NOKs)</span>
</a>
</li>
<li class="sidenav-item has-subnav">
<a href="blank-page.html#" aria-haspopup="true">
<span class="sidenav-icon icon icon-envelope"></span>
<span class="sidenav-label">Mailbox</span>
<a href="" aria-haspopup="true">
<span class="sidenav-icon icon icon-credit-card"></span>
<span class="sidenav-label">Credits</span>
</a>
<ul class="sidenav-subnav collapse">
<li class="sidenav-subheading">Mailbox</li>
<li><a href="mail.html">Mail 1</a></li>
<li><a href="inbox.html">Mail 2</a></li>
<li><a href="compose.html">Compose</a></li>
<li class="sidenav-subheading">Credits</li>
<li><a href="{{ route('credits') }}">All Credits</a></li>
<li><a href="{{ route('credits', \App\Http\Controllers\HomeController::WIDGET_OUTSTANDING) }}">Pending <span class="badge badge-danger" style="font-size: 5px">&nbsp;</span></a></li>
<li><a href="{{ route('credits', \App\Http\Controllers\HomeController::CREDITS_OVERPAID) }}">Overpaid <span class="badge badge-warning" style="font-size: 5px">&nbsp;</span></a></li>
<li><a href="{{ route('credits', \App\Http\Controllers\HomeController::WIDGET_CLEARED) }}">Cleared <span class="badge badge-success" style="font-size: 5px">&nbsp;</span></a></li>
</ul>
</li>
<li class="sidenav-heading">Administration</li>
<li class="sidenav-item">
<a href="messenger.html">
<span class="sidenav-icon icon icon-comments"></span>
<span class="sidenav-label">Messenger</span>
</a>
</li>
<li class="sidenav-item">
<a href="profile.html">
<span class="sidenav-icon icon icon-user"></span>
<span class="sidenav-label">Profile</span>
</a>
</li>
<li class="sidenav-item">
<a href="drive.html">
<span class="sidenav-icon icon icon-cloud-upload"></span>
<span class="sidenav-label">Drive</span>
</a>
</li>
<li class="sidenav-item">
<a href="landing-page.html" target="_blank">
<span class="sidenav-badge badge badge-danger">Hot</span>
<span class="sidenav-icon icon icon-star"></span>
<span class="sidenav-label">Landing Page</span>
</a>
</li>
<li class="sidenav-item has-subnav">
<a href="blank-page.html#" aria-haspopup="true">
<span class="sidenav-icon icon icon-shopping-cart"></span>
<span class="sidenav-label">E-commerce</span>
</a>
<ul class="sidenav-subnav collapse">
<li class="sidenav-subheading">E-commerce</li>
<li><a href="store.html">Store</a></li>
<li><a href="shopping-cart.html">Shopping cart</a></li>
<li><a href="product.html">Product</a></li>
</ul>
</li>
<li class="sidenav-item has-subnav active">
<a href="blank-page.html#" aria-haspopup="true">
<span class="sidenav-icon icon icon-files-o"></span>
<span class="sidenav-label">Other pages</span>
<a href="{{ route('users') }}">
<span class="sidenav-icon icon icon-users"></span>
<span class="sidenav-label">System Users</span>
</a>
<ul class="sidenav-subnav collapse">
<li class="sidenav-subheading">Other pages</li>
<li class="active"><a href="blank-page.html">Blank Page</a></li>
<li><a href="404.html" target="_blank">404</a></li>
<li><a href="500.html" target="_blank">500</a></li>
<li><a href="invoice.html">Invoice</a></li>
</ul>
</li>
</ul>
</nav>
Expand Down
2 changes: 1 addition & 1 deletion resources/views/patient/index.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@section('page_content')
<div class="card">
<div class="card-header">{{ $age_filter }} Patients
<div class="card-header">Patients {{ $list_filter }}
<a style="float: right" href="{{ route('create_patient') }}" class="btn btn-primary">Add Patient</a>
</div>

Expand Down

0 comments on commit 7c4ef04

Please sign in to comment.