From e08f43e908d340ba19a90bf6b432e253c4090f15 Mon Sep 17 00:00:00 2001 From: senaszel Date: Sat, 8 Jan 2022 22:28:53 +0100 Subject: [PATCH] add workSchedule for doctor: ver 0.0.1 alpha is finished :D --- app/Http/Controllers/DoctorController.php | 4 ++ app/View/Components/Doctor/Index.php | 40 +++++++++++++++++++ public/css/workSchedule.css | 27 +++++++++++++ .../views/components/doctor/index.blade.php | 14 +++++++ .../components/layout/navigation.blade.php | 2 +- resources/views/work/index.blade.php | 8 ++++ routes/web.php | 6 +++ 7 files changed, 100 insertions(+), 1 deletion(-) create mode 100644 app/View/Components/Doctor/Index.php create mode 100644 public/css/workSchedule.css create mode 100644 resources/views/components/doctor/index.blade.php create mode 100644 resources/views/work/index.blade.php diff --git a/app/Http/Controllers/DoctorController.php b/app/Http/Controllers/DoctorController.php index 5a5048f..ba4e43e 100644 --- a/app/Http/Controllers/DoctorController.php +++ b/app/Http/Controllers/DoctorController.php @@ -57,4 +57,8 @@ public function denyVaccination(Application $application) return redirect()->route('doctor-work-today'); } + + public function workSchedule(){ + return view('work.index'); + } } diff --git a/app/View/Components/Doctor/Index.php b/app/View/Components/Doctor/Index.php new file mode 100644 index 0000000..9bdda64 --- /dev/null +++ b/app/View/Components/Doctor/Index.php @@ -0,0 +1,40 @@ +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'); + } +} diff --git a/public/css/workSchedule.css b/public/css/workSchedule.css new file mode 100644 index 0000000..dbe43db --- /dev/null +++ b/public/css/workSchedule.css @@ -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); +} + diff --git a/resources/views/components/doctor/index.blade.php b/resources/views/components/doctor/index.blade.php new file mode 100644 index 0000000..a82ae66 --- /dev/null +++ b/resources/views/components/doctor/index.blade.php @@ -0,0 +1,14 @@ + + + + + + + +@foreach($allPatients as $patient) + + + + +@endforeach +
DATA LICZBA CHĘTNYCH DO SZCZEPIENIA
{{ $patient->DATE_VACCINATION }} {{ $patient->HOW_MANY }}
diff --git a/resources/views/components/layout/navigation.blade.php b/resources/views/components/layout/navigation.blade.php index b753f1a..0de29da 100644 --- a/resources/views/components/layout/navigation.blade.php +++ b/resources/views/components/layout/navigation.blade.php @@ -89,7 +89,7 @@ szczepionek @endcan