Template
username : backend-kynantio password : test-programmer-20205
This commit is contained in:
@@ -1,145 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Customer;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class CustomerController extends Controller
|
||||
// {
|
||||
|
||||
// public function customersData(){
|
||||
// $customers = Customer::all();
|
||||
// return view('Admin.all_customers',compact('customers'));
|
||||
// }
|
||||
|
||||
// public function update($id,Request $request)
|
||||
// {
|
||||
|
||||
// $customers = Customer::find($id);
|
||||
// $customers->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]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Doctor;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class DoctorController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$doctor = new Doctor();
|
||||
$doctor = $doctor->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'));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,140 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Patient;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PatientController extends Controller
|
||||
// {
|
||||
|
||||
// public function customersData(){
|
||||
// $customers = Customer::all();
|
||||
// return view('Admin.all_customers',compact('customers'));
|
||||
// }
|
||||
|
||||
// public function update($id,Request $request)
|
||||
// {
|
||||
|
||||
// $customers = Customer::find($id);
|
||||
// $customers->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'));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\PatientVisit;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PatientVisitController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$patientVisit = new PatientVisit();
|
||||
$patientVisit = $patientVisit->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'));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Poliklinik;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PoliklinikController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$poliklinik = new Poliklinik();
|
||||
$poliklinik = $poliklinik->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'));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,19 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\ms_doctor_healthcare_service;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class ms_doctor_healthcare_serviceController extends Controller
|
||||
{
|
||||
public function store(Request $request)
|
||||
{
|
||||
$ms_doctor_healthcare_service = new ms_doctor_healthcare_service();
|
||||
$ms_doctor_healthcare_service->id_ms_doctor_healthcare_service = $request->id_ms_doctor_healthcare_service;
|
||||
|
||||
$poliklinik->save();
|
||||
return Redirect()->route('add.ms_doctor_healthcare_service');
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user