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 @@ +