Skip to content

Commit

Permalink
add workSchedule for doctor: ver 0.0.1 alpha is finished :D
Browse files Browse the repository at this point in the history
  • Loading branch information
senaszel committed Jan 8, 2022
1 parent 8c159df commit e08f43e
Show file tree
Hide file tree
Showing 7 changed files with 100 additions and 1 deletion.
4 changes: 4 additions & 0 deletions app/Http/Controllers/DoctorController.php
Original file line number Diff line number Diff line change
Expand Up @@ -57,4 +57,8 @@ public function denyVaccination(Application $application)

return redirect()->route('doctor-work-today');
}

public function workSchedule(){
return view('work.index');
}
}
40 changes: 40 additions & 0 deletions app/View/Components/Doctor/Index.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
<?php

namespace App\View\Components\Doctor;

use App\Enums\ApplicationStatus;
use App\Models\Application;
use Illuminate\Support\Facades\DB;
use Illuminate\View\Component;

class Index extends Component
{
public $allPatients;

/**
* Create a new component instance.
*
* @return void
*/
public function __construct()
{
$this->allPatients =
Application::
selectRaw("COUNT(date_vaccination) as HOW_MANY,date(date_vaccination) as DATE_VACCINATION")
->where('status', ApplicationStatus::PENDING)
->where('doctor_id', auth()->user()->id)
->groupBy(DB::raw('Date(date_vaccination)'))
->orderBy('date_vaccination','ASC')
->get();
}

/**
* Get the view / contents that represent the component.
*
* @return \Illuminate\Contracts\View\View|\Closure|string
*/
public function render()
{
return view('components.doctor.index');
}
}
27 changes: 27 additions & 0 deletions public/css/workSchedule.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
table {
margin: 5% 25% 0 25%;
border-top: 1px solid black;
border-left: 1px solid black;
}

table th, table td {
text-align: center;
padding: 15px;
border-bottom: 1px solid black;
border-right: 1px solid black;
font-size: 2rem;
}

table th {
color: rgba(255, 255, 255, 0.75);
background-color: rgb(91, 162, 244);
}

table tr {
background-color: rgba(201, 187, 170, 0.5)
}

table tr:nth-child(2n) {
background-color: rgba(113, 128, 150, 0.5);
}

14 changes: 14 additions & 0 deletions resources/views/components/doctor/index.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<link rel="stylesheet" href="{{ asset('css/workSchedule.css') }}">

<table>
<tr>
<th> DATA </th>
<th> LICZBA CHĘTNYCH DO SZCZEPIENIA</th>
</tr>
@foreach($allPatients as $patient)
<tr>
<td> {{ $patient->DATE_VACCINATION }}</td>
<td> {{ $patient->HOW_MANY }}</td>
</tr>
@endforeach
</table>
2 changes: 1 addition & 1 deletion resources/views/components/layout/navigation.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@
szczepionek</a>
</li>
<li class="navItem">
<a class="nav-link disabled" aria-current="page" href="#">Harmonogram pracy</a>
<a class="nav-link active" aria-current="page" href="{{ route('doctor-work-schedule') }}">Harmonogram pracy</a>
</li>
@endcan
<li class="navItem" id="rightmost">
Expand Down
8 changes: 8 additions & 0 deletions resources/views/work/index.blade.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
<x-layout>

<x-layout.navigation> </x-layout.navigation>

<x-doctor.index> </x-doctor.index>

</x-layout>

6 changes: 6 additions & 0 deletions routes/web.php
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,12 @@ function () {
DoctorController::class, 'denyVaccination'
]
)->name('doctor-deny-vaccination');

Route::get(
'work/schedule', [
DoctorController::class, 'workSchedule'
]
)->name('doctor-work-schedule');
}
);

0 comments on commit e08f43e

Please sign in to comment.