Compare commits
1 Commits
main
...
peserta-yusron
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e94fe0a047 |
@@ -0,0 +1,99 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers;
|
||||
|
||||
use App\Models\Customer;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
class PasienController extends Controller
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
|
||||
return view('dashbord.dashbord');
|
||||
|
||||
}
|
||||
|
||||
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,166 @@
|
||||
@extends('layouts.admin_master')
|
||||
|
||||
@section('content')
|
||||
|
||||
<main>
|
||||
<div class="container">
|
||||
<div class="row justify-content-center">
|
||||
<div class="col-lg-7">
|
||||
<div class="card shadow-lg border-0 rounded-lg mt-5">
|
||||
<div class="card-header">
|
||||
<h1 class="text-center font-weight-light my-4"><b>Pasien Baru</b></h1>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<form id="myForm">
|
||||
<div class="form-row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="small mb-1" for="inputFirstName">Tipe Pasien</label>
|
||||
<div class="form-check">
|
||||
<input checked class="form-check-input" type="radio" onclick="javascript:yesnoCheck();" name="tipe_pasien" id="yesCheck">
|
||||
<label class="form-check-label" for="flexRadioDefault1">
|
||||
Pasien Lama
|
||||
</label>
|
||||
</div>
|
||||
<div class="form-check">
|
||||
<input class="form-check-input" type="radio" onclick="javascript:yesnoCheck();" name="tipe_pasien" id="noCheck">
|
||||
<label class="form-check-label" for="flexRadioDefault2">
|
||||
Pasien Baru
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12" id="ifYes" style="visibility:hidden">
|
||||
<div class="form-group">
|
||||
<label class="small mb-1" for="inputFirstName">Nomor Rekam Medis</label>
|
||||
<select class="mySelect2" name="no_rekam_medis" style="width: 100%;" name="state">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="small mb-1" for="inputFirstName">Nama Pasien</label>
|
||||
<input class="form-control py-4" name="nama" type="text" placeholder="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="small mb-1" for="inputLastName">Nomor Telepon</label>
|
||||
<input class="form-control py-4" name="telp" type="text" placeholder="" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="small mb-1" for="inputLastName">Alamat</label>
|
||||
<input class="form-control py-4" name="alamat" type="text" placeholder="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="small mb-1" for="inputFirstName">Nomor BPJS</label>
|
||||
<input class="form-control py-4" name="nomor_bpjs" type="text" placeholder="" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="small mb-1" for="Poliklinik">Poli Klinik</label>
|
||||
<select class="form-control py-4" name="poliklinik" id="poliklinik">
|
||||
</select>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label class="small mb-1" for="Dokter">Dokter</label>
|
||||
<select class="form-control py-4" name="dokter" id="dokter">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group mt-4 mb-0"><button id="daftar" type="submit" class="btn btn-primary btn-block">Submit</button></div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</main>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('#myForm').on('submit', function (e) {
|
||||
e.preventDefault();
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "http://10.10.123.135:8083/api/v1/visit",
|
||||
data: $("#myForm").serialize(),
|
||||
success: function(response) {
|
||||
console.log(response);
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('.mySelect2').select2({
|
||||
// ajax: {
|
||||
// url: 'https://api.github.com/orgs/select2/repos',
|
||||
// data: function (params) {
|
||||
// var query = {
|
||||
// search: params.term,
|
||||
// type: 'public'
|
||||
// }
|
||||
|
||||
// // Query parameters will be ?search=[term]&type=public
|
||||
// return query;
|
||||
// }
|
||||
// }
|
||||
});
|
||||
|
||||
$.ajax({
|
||||
url: "http://10.10.123.135:8083/api/v1/healthcare",
|
||||
type: 'GET',
|
||||
dataType: 'json', // added data type
|
||||
success: function(res) {
|
||||
let data = res.data
|
||||
$.each(data, function(index) {
|
||||
$('#poliklinik')
|
||||
.append("<option value='" + data[index].id + "'>" + data[index].name + "</option>");
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function selectDokter(id) {
|
||||
$.ajax({
|
||||
url: "http://10.10.123.135:8083/api/v1/doctor?poli=" + id,
|
||||
type: 'GET',
|
||||
dataType: 'json', // added data type
|
||||
success: function(res) {
|
||||
let data = res.data
|
||||
$.each(data, function(index) {
|
||||
$('#dokter').append($('<option>', {
|
||||
value: data[index].id
|
||||
}).text(data[index].name));
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
$('#poliklinik').on('change', function() {
|
||||
selectDokter(this.value);
|
||||
// alert(this.value)
|
||||
});
|
||||
|
||||
function yesnoCheck() {
|
||||
if (document.getElementById('yesCheck').checked) {
|
||||
document.getElementById('ifYes').style.visibility = 'visible';
|
||||
} else document.getElementById('ifYes').style.visibility = 'hidden';
|
||||
}
|
||||
yesnoCheck();
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,48 @@
|
||||
@extends('layouts.admin_master')
|
||||
@section('content')
|
||||
|
||||
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-table mr-1"></i>
|
||||
Dashboard
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row" id="card-pasien">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('script')
|
||||
<link href="https://cdn.datatables.net/1.10.20/css/dataTables.bootstrap4.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$.ajax({
|
||||
url: "http://10.10.123.135:8083/api/v1/healthcare",
|
||||
type: 'GET',
|
||||
dataType: 'json', // added data type
|
||||
success: function(res) {
|
||||
let data = res.data
|
||||
$.each(data, function(index) {
|
||||
$('#card-pasien')
|
||||
.append(`<div class="col-xl-3 col-md-6">
|
||||
<div class="card bg-primary text-white mb-4">
|
||||
<div class="card-body">
|
||||
<h3>${data[index].id+10}</h3>
|
||||
${data[index].name}
|
||||
</div>
|
||||
<div class="card-footer d-flex align-items-center justify-content-between">
|
||||
<a class="small text-white stretched-link" href="{{ route('list.pasien') }}">View Details</a>
|
||||
<div class="small text-white"><i class="fas fa-angle-right"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`);
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -0,0 +1,64 @@
|
||||
@extends('layouts.admin_master')
|
||||
@section('content')
|
||||
|
||||
|
||||
|
||||
<div class="card mb-4">
|
||||
<div class="card-header">
|
||||
<i class="fas fa-table mr-1"></i>
|
||||
Pasien List
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered" id="dataTable" width="100%" cellspacing="0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>barcode</th>
|
||||
<th>registration date</th>
|
||||
<th>service date</th>
|
||||
<th>action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@endsection
|
||||
@section('script')
|
||||
<link href="https://cdn.datatables.net/1.10.20/css/dataTables.bootstrap4.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
|
||||
<script>
|
||||
$('#dataTable').DataTable({
|
||||
ajax: "http://10.10.123.135:8083/api/v1/visit",
|
||||
columns: [{
|
||||
mData: 'barcode',
|
||||
"render": function ( data) {
|
||||
return '<img src="https://api.qrserver.com/v1/create-qr-code/?size=50x50&data='+data.barcode+'">';}
|
||||
},
|
||||
{
|
||||
mData: 'registration_date'
|
||||
},
|
||||
{
|
||||
mData: 'service_date'
|
||||
},
|
||||
{
|
||||
mData: "id",
|
||||
"render": function ( data) {
|
||||
return `
|
||||
<div class="btn-group mr-2" role="group" aria-label="First group">
|
||||
<button type="button" onclick="alert('Coming Soon')" class="btn btn-primary btn-sm">Detail</button>
|
||||
<button type="button" onclick="alert('Coming Soon')" class="btn btn-success btn-sm">Edit</button>
|
||||
<button type="button" onclick="alert('Coming Soon')" class="btn btn-danger btn-sm">Batal</button>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
}
|
||||
],
|
||||
pagination : false
|
||||
})
|
||||
</script>
|
||||
|
||||
@endsection
|
||||
@@ -8,10 +8,14 @@ Products<!DOCTYPE html>
|
||||
<meta name="author" content="" />
|
||||
<title>InventoryManagementSystem</title>
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" crossorigin="anonymous"></script>
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
|
||||
<link href="{{ asset('backend') }}/css/styles.css" rel="stylesheet" />
|
||||
<link href="https://cdn.datatables.net/1.10.20/css/dataTables.bootstrap4.min.css" rel="stylesheet" crossorigin="anonymous" />
|
||||
<link rel="stylesheet" href="https://cdn.datatables.net/buttons/1.7.0/css/buttons.dataTables.min.css">
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.15.1/js/all.min.js" crossorigin="anonymous"></script>
|
||||
<link href="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/css/select2.min.css" rel="stylesheet" />
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@4.1.0-rc.0/dist/js/select2.min.js"></script>
|
||||
</head>
|
||||
<body class="sb-nav-fixed">
|
||||
<nav class="sb-topnav navbar navbar-expand navbar-dark bg-dark">
|
||||
@@ -122,6 +126,27 @@ Products<!DOCTYPE html>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
<a class="nav-link collapsed" href="#" data-toggle="collapse" data-target="#collapsepasien" aria-expanded="false" aria-controls="collapsepasien">
|
||||
<div class="sb-nav-link-icon"><i class="fas fa-columns"></i></div>
|
||||
Test Teknikal
|
||||
<div class="sb-sidenav-collapse-arrow"><i class="fas fa-angle-down"></i></div>
|
||||
</a>
|
||||
<div class="collapse" id="collapsepasien" aria-labelledby="headingOne" data-parent="#sidenavAccordion">
|
||||
<nav class="sb-sidenav-menu-nested nav">
|
||||
<a class="nav-link" href="{{ route('dashboard.pasien') }}">Dashboard pasien</a>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="collapse" id="collapsepasien" aria-labelledby="headingOne" data-parent="#sidenavAccordion">
|
||||
<nav class="sb-sidenav-menu-nested nav">
|
||||
<a class="nav-link" href="{{ route('add.pasien') }}">Pasien Baru</a>
|
||||
</nav>
|
||||
</div>
|
||||
<div class="collapse" id="collapsepasien" aria-labelledby="headingOne" data-parent="#sidenavAccordion">
|
||||
<nav class="sb-sidenav-menu-nested nav">
|
||||
<a class="nav-link" href="{{ route('list.pasien') }}">Pasien List</a>
|
||||
</nav>
|
||||
</div>
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
@@ -145,7 +170,6 @@ Products<!DOCTYPE html>
|
||||
</footer>
|
||||
</div>
|
||||
</div>
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js" crossorigin="anonymous"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.3/dist/js/bootstrap.bundle.min.js" crossorigin="anonymous"></script>
|
||||
<script src="{{ asset('backend') }}/js/scripts.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/Chart.js/2.8.0/Chart.min.js" crossorigin="anonymous"></script>
|
||||
@@ -164,7 +188,6 @@ Products<!DOCTYPE html>
|
||||
<script src="https://cdn.datatables.net/buttons/1.7.0/js/buttons.html5.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/1.7.0/js/buttons.colVis.min.js"></script> -->
|
||||
|
||||
<script src="https://code.jquery.com/jquery-3.5.1.js"></script>
|
||||
<script src="https://cdn.datatables.net/1.10.24/js/jquery.dataTables.min.js"></script>
|
||||
<script src="https://cdn.datatables.net/buttons/1.7.0/js/dataTables.buttons.min.js"></script>
|
||||
<script src="https://cdnjs.cloudflare.com/ajax/libs/jszip/3.1.3/jszip.min.js"></script>
|
||||
|
||||
@@ -80,6 +80,20 @@ Route::post('/insert-customer',[CustomerController::class,'store'])->middleware(
|
||||
|
||||
Route::get('/all-customers',[CustomerController::class,'customersData'])->middleware(['auth'])->name('all.customers');
|
||||
|
||||
//pasien
|
||||
Route::get('/add-pasien', function () {
|
||||
return view('Admin.add_pasien');
|
||||
})->middleware(['auth'])->name('add.pasien');
|
||||
|
||||
//pasien
|
||||
Route::get('/list-pasien', function () {
|
||||
return view('Admin.list_pasien');
|
||||
})->middleware(['auth'])->name('list.pasien');
|
||||
|
||||
//pasien
|
||||
Route::get('/dashboard-pasien', function () {
|
||||
return view('Admin.dashboard_pasien');
|
||||
})->middleware(['auth'])->name('dashboard.pasien');
|
||||
|
||||
Route::get('/dashboard', function () {
|
||||
return view('dashboard');
|
||||
|
||||
Reference in New Issue
Block a user