From 961c95553f9f7cde0c27d0b324779580f8efe1c8 Mon Sep 17 00:00:00 2001 From: yose Date: Tue, 2 Dec 2025 13:34:49 +0700 Subject: [PATCH] username : backend-kynantio password : test-programmer-20205 --- app/Http/Controllers/CustomerController.php | 145 ------------------ app/Http/Controllers/DoctorController.php | 84 ++++++++++ app/Http/Controllers/PatientController.php | 140 +++++++++++++++++ .../Controllers/PatientVisitController.php | 90 +++++++++++ app/Http/Controllers/PoliklinikController.php | 85 ++++++++++ ...ms_doctor_healthcare_serviceController.php | 19 +++ app/Models/{Customer.php => Doctor.php} | 5 +- app/Models/Patient.php | 14 ++ app/Models/PatientVisit.php | 14 ++ app/Models/Poliklinik.php | 14 ++ app/Models/ms_doctor_healthcare_service.php | 14 ++ app/Models/ms_healthcare_service.php | 14 ++ .../ms_healthcare_service_payment_type.php | 14 ++ app/Models/ms_healthcare_service_schedule.php | 14 ++ app/Models/ms_healthcare_service_shift.php | 14 ++ .../ms_healthcare_service_visit_type.php | 14 ++ app/Models/ms_kiosk.php | 14 ++ app/Models/ms_kiosk_healthcare_service.php | 14 ++ app/Models/ms_kiosk_payment_type.php | 14 ++ app/Models/ms_kiosk_schedule.php | 14 ++ app/Models/ms_kiosk_visit_type.php | 14 ++ app/Models/ms_patient_payment_type.php | 14 ++ resources/views/dashboard.blade.php | 4 +- resources/views/doctor.blade.php | 0 resources/views/patient.blade.php | 0 resources/views/patientVisit.blade.php | 0 resources/views/poliklinik.blade.php | 0 routes/web.php | 36 +++-- 28 files changed, 658 insertions(+), 160 deletions(-) delete mode 100644 app/Http/Controllers/CustomerController.php create mode 100644 app/Http/Controllers/DoctorController.php create mode 100644 app/Http/Controllers/PatientController.php create mode 100644 app/Http/Controllers/PatientVisitController.php create mode 100644 app/Http/Controllers/PoliklinikController.php create mode 100644 app/Http/Controllers/ms_doctor_healthcare_serviceController.php rename app/Models/{Customer.php => Doctor.php} (56%) create mode 100644 app/Models/Patient.php create mode 100644 app/Models/PatientVisit.php create mode 100644 app/Models/Poliklinik.php create mode 100644 app/Models/ms_doctor_healthcare_service.php create mode 100644 app/Models/ms_healthcare_service.php create mode 100644 app/Models/ms_healthcare_service_payment_type.php create mode 100644 app/Models/ms_healthcare_service_schedule.php create mode 100644 app/Models/ms_healthcare_service_shift.php create mode 100644 app/Models/ms_healthcare_service_visit_type.php create mode 100644 app/Models/ms_kiosk.php create mode 100644 app/Models/ms_kiosk_healthcare_service.php create mode 100644 app/Models/ms_kiosk_payment_type.php create mode 100644 app/Models/ms_kiosk_schedule.php create mode 100644 app/Models/ms_kiosk_visit_type.php create mode 100644 app/Models/ms_patient_payment_type.php create mode 100644 resources/views/doctor.blade.php create mode 100644 resources/views/patient.blade.php create mode 100644 resources/views/patientVisit.blade.php create mode 100644 resources/views/poliklinik.blade.php diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php deleted file mode 100644 index 07fd7c5..0000000 --- a/app/Http/Controllers/CustomerController.php +++ /dev/null @@ -1,145 +0,0 @@ -name = $request->name; -// // $customers->email = $request->email; -// // $customers->password = $request->password; -// // $customers->gender = $request->gender; -// // if($request->is_active){ -// // $employee->is_active = 1; - -// // } - -// // $employee->date_of_birth = $request->date_of_birth; -// // $employee->roll = $request->roll; - -// if($employee->save()) -// { - -// return redirect()->back()->with(['msg' => 1]); -// } -// else -// { -// return redirect()->back()->with(['msg' => 2]); -// } - -// return view('update.customer',compact('customers')); - -// } - -// public function edit($id){ -// $customers = Customer::find($id); -// return view('edit.customer', compact('customers')); -// } - -// } -{ - public function index() - { - $customer = new Customer(); - $customer = $customer->get(); - return view('dashbord.dashbord',[ - 'customer' =>$customer - ]); - - } - - public function edit($id) - { - $customers = Customer::where('id' ,'=',$id)->get(); - - return view('customer.edit_customer',compact('customers')); - - } - - - public function create() - { - return view('customer.create'); - - } - - public function store(Request $request) - { - $customer = new Customer(); - $customer->name = $request->name; - $customer->email = $request->email; - $customer->company = $request->company; - $customer->address = $request->address; - $customer->phone = $request->phone; - - $customer->save(); - return Redirect()->route('add.customer'); - - } - - public function update($id,Request $request) - { - - $customer = Customer::find($id); - $customer->name = $request->name; - $customer->email = $request->email; - $customer->password = $request->password; - $customer->gender = $request->gender; - if($request->is_active){ - $customer->is_active = 1; - - } - - $customer->date_of_birth = $request->date_of_birth; - $customer->roll = $request->roll; - - if($customer->save()) - { - - return redirect()->back()->with(['msg' => 1]); - } - else - { - return redirect()->back()->with(['msg' => 2]); - } - - return view('customer.edit',compact('customers')); - - } - - - public function customersData(){ - $customers = Customer::all(); - return view('Admin.all_customers',compact('customers')); - } - - - - public function delete($id) - { - $customer = Customer::find($id); - if($customer->delete()) - { - - return redirect()->back()->with(['msg' => 1]); - } - else - { - return redirect()->back()->with(['msg' => 2]); - } - - } - -} \ No newline at end of file diff --git a/app/Http/Controllers/DoctorController.php b/app/Http/Controllers/DoctorController.php new file mode 100644 index 0000000..1207074 --- /dev/null +++ b/app/Http/Controllers/DoctorController.php @@ -0,0 +1,84 @@ +get(); + return view('doctor.index',[ + 'doctor' =>$doctor + ]); + + } + + public function edit($id) + { + $doctors = Doctor::where('id_doctor' ,'=',$id)->get(); + return view('doctor.edit_doctor',compact('doctors')); + + } + + + public function create() + { + return view('doctor.create'); + + } + + public function store(Request $request) + { + $doctor = new Doctor(); + $doctor->id_doctor = $request->id_doctor; + $doctor->doctor_name = $request->doctor_name; + + $doctor->save(); + return Redirect()->route('add.doctor'); + + return redirect()->route('doctor.index')->with('success', 'Data berhasil tambahkan.'); + } + + public function update($id,Request $request) + { + $doctor = Doctor::find($id); + $doctor->id_doctor = $request->id_doctor; + $doctor->doctor_name = $request->doctor_name; + + if($doctor->save()) + { + return redirect()->back()->with(['msg' => 1]); + } + else + { + return redirect()->back()->with(['msg' => 2]); + } + return view('doctor.edit',compact('doctors')); + + return redirect()->route('doctor.index')->with('success', 'Data berhasil diperbarui.'); + } + + + public function doctorsData(){ + $doctors = Doctor::all(); + return view('Admin.all_doctors',compact('doctors')); + } + + public function delete($id_doctor) + { + $doctor = Doctor::find($id); + $doctor->delete(); + } + + public function show() + { + $doctor = Doctor::findOrFail($id_doctor); + + return view('doctor.show', compact('doctors')); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/PatientController.php b/app/Http/Controllers/PatientController.php new file mode 100644 index 0000000..cc23450 --- /dev/null +++ b/app/Http/Controllers/PatientController.php @@ -0,0 +1,140 @@ +name = $request->name; +// // $customers->email = $request->email; +// // $customers->password = $request->password; +// // $customers->gender = $request->gender; +// // if($request->is_active){ +// // $employee->is_active = 1; + +// // } + +// // $employee->date_of_birth = $request->date_of_birth; +// // $employee->roll = $request->roll; + +// if($employee->save()) +// { + +// return redirect()->back()->with(['msg' => 1]); +// } +// else +// { +// return redirect()->back()->with(['msg' => 2]); +// } + +// return view('update.customer',compact('customers')); + +// } + +// public function edit($id){ +// $customers = Customer::find($id); +// return view('edit.customer', compact('customers')); +// } + +// } +{ + public function index() + { + $patient = new Patient(); + $patient = $patient->get(); + return view('patient.index',[ + 'patient' =>$patient + ]); + } + + public function edit($id) + { + $patients = Patient::where('id_patient' ,'=',$id)->get(); + + return view('patient.edit_patient',compact('patients')); + + } + + + public function create() + { + return view('patient.create'); + + } + + public function store(Request $request) + { + $patient = new Patient(); + $patient->id_patient = $request->id_patient; + $patient->patient_name = $request->patient_name; + $patient->medical_record_number = $request->medical_record_number; + $patient->phone_number = $request->phone_number; + $patient->gender = $request->gender; + $patient->birth_date = $request->birth_date; + $patient->address = $request->address; + $patient->active = $request->active; + + $patient->save(); + return Redirect()->route('add.patient'); + + return redirect()->route('patient.index')->with('success', 'Data berhasil tambahkan.'); + } + + public function update($id,Request $request) + { + $patient = Patient::find($id); + $patient->id_patient = $request->id_patient; + $patient->patient_name = $request->patient_name; + $patient->medical_record_number = $request->medical_record_number; + $patient->phone_number = $request->phone_number; + $patient->gender = $request->gender; + $patient->birth_date = $request->birth_date; + $patient->address = $request->address; + if($request->is_active){ + $patient->is_active = 1; + } + if($patient->save()) + { + return redirect()->back()->with(['msg' => 1]); + } + else + { + return redirect()->back()->with(['msg' => 2]); + } + return view('patient.edit',compact('patients')); + + return redirect()->route('patient.index')->with('success', 'Data berhasil diperbarui.'); + } + + + public function patientsData(){ + $patients = Patient::all(); + return view('Admin.all_patients',compact('patients')); + } + + public function delete($id_patient) + { + $patient = Patient::find($id); + $patient->delete(); + } + + public function show() + { + $patient = Patient::findOrFail($id_patient); + + return view('patient.show', compact('patients')); + } + +} \ No newline at end of file diff --git a/app/Http/Controllers/PatientVisitController.php b/app/Http/Controllers/PatientVisitController.php new file mode 100644 index 0000000..11ebb96 --- /dev/null +++ b/app/Http/Controllers/PatientVisitController.php @@ -0,0 +1,90 @@ +get(); + return view('patientVisit.index',[ + 'patientVisit' =>$patientVisit + ]); + } + + public function edit($id) + { + $patientVisits = PatientVisit::where('barcode' ,'=',$barcode)->get(); + return view('patientVisit.edit_patientVisit',compact('patientVisits')); + } + + + public function create() + { + return view('patientVisit.create'); + } + + public function store(Request $request) + { + $patientVisit = new PatientVisit(); + $patientVisit->barcode = $request->barcode; + $patientVisit->registration_date = $request->registration_date; + $patientVisit->service_date = $request->service_date; + $patientVisit->check_in_date = $request->check_in_date; + $patientVisit->check_in = $request->check_in; + $patientVisit->active = $request->active; + + $patientVisit->save(); + return Redirect()->route('add.patientVisit'); + + return redirect()->route('patientVisit.index')->with('success', 'Data berhasil tambahkan.'); + } + + public function update($id,Request $request) + { + $patientVisit = PatientVisit::find($id); + $patientVisit->barcode = $request->barcode; + $patientVisit->registration_date = $request->registration_date; + $patientVisit->service_date = $request->service_date; + $patientVisit->check_in_date = $request->check_in_date; + $patientVisit->check_in = $request->check_in; + if($request->is_active){ + $patientVisit->is_active = 1; + } + + if($patientvisit->save()) + { + return redirect()->back()->with(['msg' => 1]); + } + else + { + return redirect()->back()->with(['msg' => 2]); + } + return view('patientVisits.edit',compact('patientVisits')); + + return redirect()->route('patientVisit.index')->with('success', 'Data berhasil diperbarui.'); + } + + + public function patientVisitsData(){ + $patientVisits = PatientVisit::all(); + return view('Admin.all_patientvVsits',compact('patientVisits')); + } + + public function delete($barcode) + { + $patientVisit = PatientVisit::find($barcode); + $patientVisit->delete(); + } + + public function show() + { + $patientVisit = PatientVisit::findOrFail($barcode); + + return view('patientVisit.show', compact('patientVisits')); + } +} diff --git a/app/Http/Controllers/PoliklinikController.php b/app/Http/Controllers/PoliklinikController.php new file mode 100644 index 0000000..78619c1 --- /dev/null +++ b/app/Http/Controllers/PoliklinikController.php @@ -0,0 +1,85 @@ +get(); + return view('poliklinik.index',[ + 'poliklinik' =>$poliklinik + ]); + } + + public function edit($id) + { + $polikliniks = Poliklinik::where('id_poliklinik' ,'=',$id)->get(); + return view('poliklinik.edit_poliklinik',compact('polikliniks')); + } + + + public function create() + { + return view('poliklinik.create'); + } + + public function store(Request $request) + { + $poliklinik = new Poliklinik(); + $poliklinik->id_poliklinik = $request->id_poliklinik; + $poliklinik->poliklinik_name = $request->poliklinik_name; + $poliklinik->poliklinik_code = $request->poliklinik_code; + $poliklinik->active = $request->active; + $poliklinik->save(); + return Redirect()->route('add.poliklinik'); + + return redirect()->route('poliklinik.index')->with('success', 'Data berhasil tambahkan.'); + } + + public function update($id,Request $request) + { + $poliklinik = Poliklinik::find($id); + $poliklinik->id_poliklinik = $request->id_poliklinik; + $poliklinik->poliklinik_name = $request->poliklinik_name; + $poliklinik->poliklinik_code = $request->poliklinik_code; + if($request->is_active){ + $poliklinik->is_active = 1; + } + + if($poliklinik->save()) + { + return redirect()->back()->with(['msg' => 1]); + } + else + { + return redirect()->back()->with(['msg' => 2]); + } + return view('poliklinik.edit',compact('polikliniks')); + + return redirect()->route('poliklinik.index')->with('success', 'Data berhasil diperbarui.'); + } + + + public function polikliniksData(){ + $polikliniks = Poliklinik::all(); + return view('Admin.all_polikliniks',compact('polikliniks')); + } + + public function delete($id_poliklinik) + { + $poliklinik = Poliklinik::find($id_poliklinik); + $poliklinik->delete(); + } + + public function show() + { + $poliklinik = Poliklinik::findOrFail($id_poliklinik); + + return view('poliklinik.show', compact('polikliniks')); + } +} diff --git a/app/Http/Controllers/ms_doctor_healthcare_serviceController.php b/app/Http/Controllers/ms_doctor_healthcare_serviceController.php new file mode 100644 index 0000000..92fbca0 --- /dev/null +++ b/app/Http/Controllers/ms_doctor_healthcare_serviceController.php @@ -0,0 +1,19 @@ +id_ms_doctor_healthcare_service = $request->id_ms_doctor_healthcare_service; + + $poliklinik->save(); + return Redirect()->route('add.ms_doctor_healthcare_service'); + + } +} diff --git a/app/Models/Customer.php b/app/Models/Doctor.php similarity index 56% rename from app/Models/Customer.php rename to app/Models/Doctor.php index bd96440..801e0f6 100644 --- a/app/Models/Customer.php +++ b/app/Models/Doctor.php @@ -5,7 +5,10 @@ namespace App\Models; use Illuminate\Database\Eloquent\Factories\HasFactory; use Illuminate\Database\Eloquent\Model; -class Customer extends Model +class Doctor extends Model { use HasFactory; + + protected $table = 'doctor'; + protected $fillable = ['id_doctor', 'doctor_name']; } diff --git a/app/Models/Patient.php b/app/Models/Patient.php new file mode 100644 index 0000000..b0bae1c --- /dev/null +++ b/app/Models/Patient.php @@ -0,0 +1,14 @@ +
-

Dashboard

+

Web Service Sistem

- +
@endsection diff --git a/resources/views/doctor.blade.php b/resources/views/doctor.blade.php new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/patient.blade.php b/resources/views/patient.blade.php new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/patientVisit.blade.php b/resources/views/patientVisit.blade.php new file mode 100644 index 0000000..e69de29 diff --git a/resources/views/poliklinik.blade.php b/resources/views/poliklinik.blade.php new file mode 100644 index 0000000..e69de29 diff --git a/routes/web.php b/routes/web.php index 6f314aa..d393f1b 100644 --- a/routes/web.php +++ b/routes/web.php @@ -4,20 +4,12 @@ use Illuminate\Support\Facades\Route; use App\Http\Controllers\ProductController; use App\Http\Controllers\InvoiceController; use App\Http\Controllers\OrderController; -use App\Http\Controllers\CustomerController; +use App\Http\Controllers\PatientController; +use App\Http\Controllers\DoctorController; +use App\Http\Controllers\PoliklinikController; +use App\Http\Controllers\PatientVisitController; use Illuminate\Http\Request; -/* -|-------------------------------------------------------------------------- -| Web Routes -|-------------------------------------------------------------------------- -| -| Here is where you can register web routes for your application. These -| routes are loaded by the RouteServiceProvider within a group which -| contains the "web" middleware group. Now create something great! -| -*/ - Route::get('/', function () { return view('auth.login'); }); @@ -26,4 +18,24 @@ Route::get('/dashboard', function () { return view('dashboard'); })->middleware(['auth'])->name('dashboard'); +Route::get('/doctor/create', [DoctorController::class, 'create'])->name('doctor.create'); +Route::post('/doctor', [DoctorController::class, 'store'])->name('doctor.store'); +Route::get('/doctor/{id_doctor}', [DoctorController::class, 'show'])->name('doctor.show'); +Route::delete('/doctor/{id_doctor}', [DoctorController::class, 'delete'])->name('doctor.delete'); + +Route::get('/patient/create', [PatientController::class, 'create'])->name('patient.create'); +Route::post('/patient', [PatientController::class, 'store'])->name('patient.store'); +Route::get('/patient/{id_patient}', [PatientController::class, 'show'])->name('patient.show'); +Route::delete('/patient/{id_patient}', [PatientController::class, 'delete'])->name('patient.delete'); + +Route::get('/poliklinik/create', [PoliklinikController::class, 'create'])->name('poliklinik.create'); +Route::post('/poliklinik', [PoliklinikController::class, 'store'])->name('poliklinik.store'); +Route::get('/poliklinik/{id_poliklinik}', [PoliklinikController::class, 'show'])->name('poliklinik.show'); +Route::delete('/poliklinik/{id_poliklinik}', [PoliklinikController::class, 'delete'])->name('poliklinik.delete'); + +Route::get('/patientVisit/create', [PatientVisitController::class, 'create'])->name('patientVisit.create'); +Route::post('/patientVisit', [PatientVisitController::class, 'store'])->name('patientVisit.store'); +Route::get('/patientVisit/{barcode}', [PatientVisitController::class, 'show'])->name('patientVisit.show'); +Route::delete('/patientVisit/{barcode}', [PatientVisitController::class, 'delete'])->name('patientVisit.delete'); + require __DIR__.'/auth.php';