Commit 9591079c authored by Azy Mushofy Anwary's avatar Azy Mushofy Anwary

memperbaiki Kondisi

parent 7251ee06
<div class="container-fluid">
<div class="col-xl-12 col-lg-12 col-md-12">
<div class="card o-hidden border-0 shadow-lg my-5">
<div class="card-body ">
<h1 class="h4 text-center text-gray-900 mb-4" style="font-size: 50px;font-weight: bold">Antrian Terlewat</h1>
<!-- <form class="form-inline">
<div class="form-group form-control-lg ">
<label >Pilih poli </label>
<select name="nama_poli" id="poli" class="form-control" >
<option disabled selected>Pilih </option>
</select>
</div>
<div class="form-group form-control-lg">
<label>Pilih dokter</label> <br>
<select id="dokter" name="nama_dokter" class="form-control">
<option disabled selected> Pilih </option>
</select>
</div>
</form> -->
<br>
<table class="table table-bordered" id="dataTable">
<thead >
<tr>
<th style="width: 70px">NO</th>
<th colspan="" class=" thLeftText">NO Antrian Pasien</th>
<th colspan="" class=" thLeftText">Nama Pasien</th>
<th colspan="" class=" thLeftText">Nama Dokter</th>
<th colspan="" class=" thLeftText">Nama Poli</th>
<th colspan="" class=" thLeftText">Status</th>
<th colspan="" class=" thLeftText">Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
<div class="container-fluid">
<div class="col-xl-12 col-lg-12 col-md-12">
<div class="card o-hidden border-0 shadow-lg my-5">
<div class="card-body ">
<h1 class="h4 text-center text-gray-900 mb-4" style="font-size: 50px;font-weight: bold">Antrian Unregister</h1>
<br>
<table class="table table-bordered" id="dataTable">
<thead >
<tr>
<th style="width: 70px">NO</th>
<th colspan="" class=" thLeftText">No Rekam Medis</th>
<th colspan="" class=" thLeftText">No Induk Kependudukan (NIK)</th>
<th colspan="" class=" thLeftText">Nama Pasien</th>
<th colspan="" class=" thLeftText">No Antrian</th>
<th colspan="" class=" thLeftText">Nama Poli</th>
<th colspan="" class=" thLeftText">Nama Dokter</th>
<th colspan="" class=" thLeftText">Action</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
</div>
</div>
</div>
<!-- breadcrumb start-->
<style>
.bg-login-image {
background: url("https://source.unsplash.com/K4mSJ7kc0As/600x800");
background-position: center;
background-size: cover;
}
</style>
<hr>
<hr>
<hr>
<hr>
<section class="breadcrumb_part breadcrumb_bg">
<div class="container">
<div class="row">
<div class="col-lg-12">
<div class="breadcrumb_iner">
<div class="breadcrumb_iner_item">
<h2>Deskripsi </h2>
<h2>Poli</h2>
</div>
</div>
</div>
</div>
</div>
</section>
<!-- breadcrumb start-->
<!-- feature_part start-->
<section class="doctor_part single_page_doctor_part" style="padding:50px;">
<div class="container">
<div class="row justify-content-center">
<div class="col-xl-8">
<div class="section_tittle text-center">
<h2> Poli Kami </h2>
</div>
</div>
</div>
<div class="row">
<div class="container-fluid DP">
</div>
<div class="container-fluid">
<div class=" row justify-content-center datapoli">
</div>
</div>
</div>
</div>
</section>
<!-- feature_part start-->
jumlahpasien();
function jumlahpasien() {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadjumlahpasien',
data: {
},
success: function (result) {
// console.log(result)
var data = result.data;
// console.log(data[0].count);
$("#jumlah_pasien").html(data[0].count);
// document.getElementById("jumlah_pasien") = ;
}
});
}
pasiendalamantrian();
function pasiendalamantrian() {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadpasiendalamantrian',
data: {
},
success: function (result) {
// console.log(data[0].count)
var data = result.data;
// console.log(data[0].count);
$("#pasien_antrian").html(data[0].count);
// document.getElementById("jumlah_pasien") = ;
}
});
}
pasienterlewat();
function pasienterlewat() {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadpasienterlewat',
success: function (result) {
// console.log(data)
var data = result.data;
// console.log(data[0].count);
$("#pasien_terlewat").html(data[0].count);
// document.getElementById("jumlah_pasien") = ;
}
});
}
jumlahterlayani()
function jumlahterlayani() {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadterlayani',
success: function (result) {
// console.log(data)
var data = result.data;
// console.log(data[0].count);
$("#jumlah_terlayani").html(data[0].count);
// document.getElementById("jumlah_pasien") = ;
}
});
}
\ No newline at end of file
Loadpasien();
function Loadpasien() {
// var iddokter = $('#dokter').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadantrianmiss',
data: {
// id: iddokter
},
success: function (result) {
console.log(result);
$('table.table-bordered > tbody').empty();
// console.log(result);
if (result.code == 0) {
let data = result.data;
// console.log(data);
let counter = 1;
for (x in data) {
var newRow = $("<tr>");
var cols = "";
// onClick="openmyprofile('+reg[x].userid+',\''+reg[x].named+'\')">
cols += '<td class="">' + counter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].no_antrian + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].status_name + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center"> <span class="btn btn-primary btn-xs" onClick="actionqueue(' + data[x].id_pasien + "," + data[x].id_dokter + ')">Update</span></div> </td>';
console.log(data[x].id_pasien);
newRow.append(cols);
$("table.table-bordered").append(newRow);
counter++;
// $('.loaddata').append('' + x + '<span>' + data[x].nama + '</span>');
}
} else {
bootbox.alert({ message: 'Data Antrian Kosong', centerVertical: true });
}
$('#dataTable').DataTable({
"scrollY": '500px',
"scrollX": true,
fixedHeader: true,
scrollCollapse: true,
paging: true,
columnDefs: [
{ width: 30, targets: 0 },
{ width: 50, targets: 1 },
{ width: 130, targets: 2 },
{ width: 130, targets: 3 },
{ width: 130, targets: 4 },
{ width: 130, targets: 5 },
{ width: 100, targets: 6 },
],
});
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
function actionqueue(idpasien, iddokter) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/updateantrianmiss',
data: {
iddok: iddokter,
iidpasien: idpasien,
},
success: function (result) {
console.log()
if (result.code == 0) {
swal({
title: "",
text: "Data Berhasil Diupdate!",
icon: "succes",
button: "ok",
}, function () {
location.reload();
});
} else {
swal({
title: "",
text: "Data Gagal Diupdate!",
icon: "succes",
button: "ok",
});
}
}
});
}
Loadunregister();
function Loadunregister() {
// var iddokter = $('#dokter').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/loadantrianunregis',
// data: {
// id: iddokter
// },
success: function (result) {
// console.log(result.data);
$('table.table-bordered > tbody').empty();
// console.log(result);
if (result.code == 0) {
let data = result.data;
// console.log(data);
let counter = 1;
for (x in data) {
var newRow = $("<tr>");
var cols = "";
// onClick="openmyprofile('+reg[x].userid+',\''+reg[x].named+'\')">
cols += '<td class="">' + counter + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].no_rekam_medis + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].ktp + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].no_antrian + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_poli + '</td>';
cols += '<td class="tdCenterText bgtd1 tdBorder-left">' + data[x].nama_dokter + '</td>';
cols += '<td class="tdCenterText bgtd1 "> <div class="text-center"> <span class="btn btn-primary btn-xs" onClick="unregister(' + data[x].id_pasien + ')">Reset</span></div> </td>';
// console.log(data[x].id_pasien);
newRow.append(cols);
$("table.table-bordered").append(newRow);
counter++;
}
$('#dataTable').DataTable({
"scrollY": '500px',
"scrollX": true,
fixedHeader: true,
scrollCollapse: true,
paging: true,
columnDefs: [
{ width: 30, targets: 0 },
{ width: 130, targets: 1 },
{ width: 130, targets: 2 },
{ width: 120, targets: 3 },
{ width: 50, targets: 4 },
{ width: 100, targets: 5 },
{ width: 100, targets: 6 },
{ width: 100, targets: 7 },
],
});
} else {
bootbox.alert({ message: 'Data Antrian Kosong', centerVertical: true });
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
function unregister(id_pasien) {
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/updateunregister',
data: {
id_pasien: id_pasien,
},
success: function (result) {
console.log()
if (result.code == 0) {
swal({
title: "",
text: "Data Berhasil Diupdate!",
icon: "succes",
button: "ok",
}, function () {
location.reload();
});
} else {
swal({
title: "",
text: "Data Gagal Diupdate!",
icon: "succes",
button: "ok",
});
}
}
});
}
\ No newline at end of file
loadpoli();
function loadpoli() {
// console.log(id)
//let $id_dokter = $('#dokter').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/tampilpoli',
data: {
id: id
},
success: function (result) {
// console.log(result);
//console.log(result.data);
let data = result.data;
let counter = 0;
//Poli Seluruh
for (poli in data) {
var cols = "";
y = '';
y += ` <div class="col-lg-4">
<div class="card" style="height:330px;width:300px; " >
<div class="card-body text-center " >
<h5 class="card-title "> <img style="width:230px; height:200px;" src="/tamplate/img/poli/`+ data[counter]['image_poli'] + `" ></h5>
<h4 class="card-text font-weight-bold">` + `Poli ` + data[counter]['nama_poli'] + `</h4>
<h5 class="card-text">`+ `Kode Poli : ` + data[counter]['kode_poli'] + `</h5>
<a class="card-text" href="datapoli?id=`+ data[counter]['id_poli'] + `">Deskripsi Poli Klik Disini! </a>
</div>
</div>
<br>
</div>`;
counter++;
$(".poli").append(y);
}
//DOKTER
let data1 = result.data;
let counter1 = 0;
for (datapoli in data1) {
// console.log(data[counter1])
x = '';
x += `
<div class="card-hide" style="height:330px;width:200px; " >
<div class="card-body text-center " >
<h5 class="card-title "> <img style="width:180px; height:200px; " src="/tamplate/img/doctor/`+ data1[counter1]['image_dokter'] + `" ></h5>
<h4 class="card-text font-weight-bold">`+ `Nama Dokter : ` + data1[counter1]['nama_dokter'] + `</h4>
<h5 class="card-text">`+ `Kode Dokter : ` + data1[counter1]['kode_dokter'] + `</h5>
</div>
</div>`;
counter1++;
$(".datapoli").append(x);
}
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
loaddatapoli()
function loaddatapoli() {
// console.log(id)
//let $id_dokter = $('#dokter').val();
$.ajax({
type: 'POST',
dataType: 'json',
url: baseURL + '/api/tampildatapoli',
data: {
id: id
},
success: function (result) {
let data2 = result.data;
let counter2 = 0;
z = '';
z += ` <div class="row justify-content-center">
<div class="col-xl-10 col-lg-12 col-md-9">
<div class="card " style="min-height :430px">
<div class="card-body">
<div class="row " style="min-height :400px">
<div class="col-lg-6 text-center mt-4 ">
<img style="width:300px; height:350px;" src="/tamplate/img/poli/`+ data2[counter2]['image_poli'] + `">
</div>
<div class="col-lg-6">
<div class="p-5">
<div class="text-center card-text font-weight-bold">
<h2 >` + `Poli ` + data2[counter2]['nama_poli'] + ` (` + data2[counter2]['kode_poli'] + `)` + ` </h2>
</div>
<hr>
<div class= "text-center card-text" >
<h4 >` + `Poli ` + data2[counter2]['deskripsi_poli'] + ` </h4>
</div>
</div>
</div>
</div>
</div>
</div>
<div>
<h2 class="text-center font-weight-bold">`+ `Dokter Poli ` + data2[counter2]['nama_poli'] + `</h2>
</div>
</div>
</div>
<br>
`;
counter2++;
$(".DP").append(z);
},
error: function (xhr) {
alert(xhr.status + '-' + xhr.statusText);
}
});
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment