first commit
This commit is contained in:
No files matched your search
@@ -0,0 +1,466 @@
|
||||
<?php
|
||||
$ss = $db->query('SELECT * FROM m_shift order by idshift ASC');
|
||||
$arr_shift = array(''=>'Pilih Shift');
|
||||
foreach($ss->fetchAll() as $ds){
|
||||
$arr_shift[$ds['idshift']] = $ds['nama_shift'];
|
||||
}
|
||||
|
||||
$ss = $db->query('SELECT * FROM m_unit order by nama_unit ASC');
|
||||
$arr_tempat = array(''=>'Pilih Tempat');
|
||||
foreach($ss->fetchAll() as $ds){
|
||||
$arr_tempat[$ds['kode_unit']] = $ds['nama_unit'];
|
||||
}
|
||||
if($_SESSION['KDUNIT'] == '55') {
|
||||
$hidden_tempat = '';
|
||||
$trigger_tempat = '$("#tempat_layanan_tarif").trigger("change");';
|
||||
}
|
||||
else if(array_key_exists('ruang', $_REQUEST) && $_REQUEST['ruang'] == 'tindakan') {
|
||||
$ss = $db->query("SELECT * FROM m_ruang where st_aktif = 1 and ruang='R.TINDAKAN' order by no ASC");
|
||||
$arr_ruang = array(''=>'Pilih Ruang');
|
||||
$arr_kdunit = [];
|
||||
foreach($ss->fetchAll() as $ds){
|
||||
$arr_ruang[$ds['no']] = $ds['nama'];
|
||||
$arr_kdunit[$ds['no']] = $ds['kdunit'];
|
||||
}
|
||||
$hidden_tempat = 'd-none';
|
||||
$trigger_tempat = '$("#tempat_layanan_tarif").trigger("change");';
|
||||
|
||||
$list_var_ruang = "let list_unit = ".json_encode($arr_kdunit,true).";";
|
||||
}
|
||||
else {
|
||||
$hidden_tempat = 'd-none';
|
||||
$trigger_tempat = '';
|
||||
}
|
||||
|
||||
array_push($form_plugin['ui_plugins_js'],$floatthead_js);
|
||||
array_push($form_plugin['ui_plugins_js'],$sweetalert_js);
|
||||
array_push($form_plugin['ui_plugins_js'],$jspm_js);
|
||||
?>
|
||||
<style type="text/css">
|
||||
.tt-hint {
|
||||
height: calc(1.8125rem + 2px) !important;
|
||||
padding: .25rem .5rem !important;
|
||||
font-size: .875rem !important;
|
||||
}
|
||||
</style>
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">Identitas Pasien</div>
|
||||
<div class="card-body">
|
||||
<form id="frm_identitas">
|
||||
<input type="hidden" name="st_rajal" value="" id="st_rajal">
|
||||
<input type="hidden" name="st_aps" value="" id="st_aps">
|
||||
<input type="hidden" name="idxdaftar" value="" id="idxdaftar">
|
||||
<input type="hidden" name="tempat" value="" id="tempat">
|
||||
<input type="hidden" name="unit" value="<?php echo $_SESSION['KDUNIT']; ?>" id="unit">
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4">No Billing</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="input[nobill]" value="" class="form-control form-control-sm mask-decimal" id="nobill">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4">No MR</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="input[nomr]" value="" class="form-control form-control-sm" id="nomr" readonly="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4">Nama Pasien</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="input[nama]" value="" class="form-control form-control-sm" id="nama" readonly="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4">Alamat</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="input[alamat]" value="" class="form-control form-control-sm" id="alamat" readonly="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4">No Telepon</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="input[no_telepon]" value="" class="form-control form-control-sm" id="no_telepon" readonly="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4">Tempat Layanan</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="input[tempat_layanan]" value="" class="form-control form-control-sm" id="tempat_layanan" readonly="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4">DPJP</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="dpjp" value="" class="form-control form-control-sm" id="dpjp" readonly="true">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<!-- <div class="card-footer text-right">
|
||||
<button class="btn btn-primary" type="button" onclick="simpanIdentitas()"><i class="fa fa-hdd-o"></i> Tambah</button>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="card">
|
||||
<div class="card-header">Tarif Tindakan</div>
|
||||
<div class="card-body">
|
||||
|
||||
<form id="frm_tarif">
|
||||
<input type="hidden" name="noitem" value="1" id="noitem">
|
||||
<input type="hidden" name="id_tarif" value="" id="id_tarif">
|
||||
<input type="hidden" name="petugas" value="<?php echo $_SESSION['NIP']; ?>" id="petugas">
|
||||
<div class="form-group row <?=$hidden_tempat?>">
|
||||
<label class="col-sm-4">Unit Layanan</label>
|
||||
<div class="col-sm-8">
|
||||
<?php echo form_dropdown('tempat_layanan_tarif',$arr_tempat,'','class="form-control form-control-sm" id="tempat_layanan_tarif"'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php if(array_key_exists('ruang', $_REQUEST) && $_REQUEST['ruang'] == 'tindakan') : ?>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4">Tempat Layanan</label>
|
||||
<div class="col-sm-8">
|
||||
<?php
|
||||
echo (array_key_exists('ruang_tindakan',$_SESSION) && $_SESSION['ruang_tindakan']) ? '<div class="form-control form-control-sm"><input type="hidden" name="ruang" value="'.$_SESSION['ruang_tindakan'].'" id="ruang_tindakan">'.$arr_ruang[$_SESSION['ruang_tindakan']].'</div>' : '<input type="hidden" name="ruang" value="" id="ruang_tindakan"><div class="alert alert-warning">Ruang tindakan belum diset, lakukan setting pada menu nama user diatas.</div>';
|
||||
// echo form_dropdown('ruang',$arr_ruang,'','class="form-control form-control-sm" id="ruang"'); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4">Kode Tarif</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="kode_tarif" value="" class="form-control form-control-sm" id="kode_tarif">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4">Uraian Tarif</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="uraian_tarif" value="" class="form-control form-control-sm" id="uraian_tarif" readonly="true">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group row">
|
||||
<label class="col-sm-4">Jumlah Tagihan</label>
|
||||
<div class="col-sm-8">
|
||||
<input type="text" name="jumlah_tagihan" value="" class="mask-decimal form-control form-control-sm" id="jumlah_tagihan">
|
||||
<input type="hidden" name="jasa_sarana" value="" id="jasa_sarana">
|
||||
<input type="hidden" name="jasa_pelayanan" value="" id="jasa_pelayanan">
|
||||
<input type="hidden" name="jasa_anastesi" value="" id="jasa_anastesi">
|
||||
</div>
|
||||
</div>
|
||||
<div id="dpjp_wrapper">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="card-footer text-right">
|
||||
<button class="btn btn-success" type="button" onclick="addItem()"><i class="fa fa-plus"></i> Tambah</button>
|
||||
<button class="btn btn-primary" type="button" onclick="simpan()"><i class="fa fa-tasks"></i> Simpan</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<hr>
|
||||
<div class="row"><div class="col-sm-12">
|
||||
<form id="form_billing">
|
||||
<div class="wrapper" style="overflow:auto;height:360px">
|
||||
<table class="table table-bordered table-striped table-sm" id="table_tarif">
|
||||
<thead>
|
||||
<tr class="bg-success text-white">
|
||||
<th style="width:5%">No</th>
|
||||
<th style="width:10%">Kode Tarif</th>
|
||||
<th style="width:25%">Uraian</th>
|
||||
<th style="width:10%">Jumlah</th>
|
||||
<th style="width:5%">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr class="table-info"><td colspan="3" class="text-right">Jumlah</td>
|
||||
<td id="jumlah_total"></td>
|
||||
<td></td>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</form>
|
||||
</div></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$js_init = $jspm_rawprint;
|
||||
$js_init .= $jspm_init;
|
||||
$js_init .= '
|
||||
$(document).ready(function() {
|
||||
async function load_kode_tarif() {
|
||||
const kode_tarif = await new Bloodhound({
|
||||
datumTokenizer: Bloodhound.tokenizers.obj.whitespace("text"),
|
||||
queryTokenizer: Bloodhound.tokenizers.whitespace,
|
||||
remote: {
|
||||
url : "'._BASE_.'keuangan/addtarif.php?page=load_kode_tarif&kode=%QUERY",
|
||||
wildcard: "%QUERY"
|
||||
}
|
||||
});
|
||||
$("#kode_tarif").typeahead({hint: true, highlight: true, minLength: 3 },{
|
||||
name: "kode_tarif",
|
||||
display: "text",
|
||||
source: kode_tarif,
|
||||
limit: 10
|
||||
}).on("typeahead:selected typeahead:autocompleted typeahead:matched", function (ev, datum) {
|
||||
$("#id_tarif").val(datum.id_tarif).prop("readonly",true);
|
||||
$("#uraian_tarif").val(datum.uraian_tarif).prop("readonly",true);
|
||||
$("#jasa_pelayanan").val(datum.jasa_pelayanan);
|
||||
$("#jasa_sarana").val(datum.jasa_sarana);
|
||||
$("#jasa_anastesi").val(datum.jasa_anastesi);
|
||||
if(datum.jumlah > 0) {
|
||||
$("#jumlah_tagihan").val(datum.jumlah).prop("readonly",true);
|
||||
if(datum.dpjp != false) {
|
||||
$("#dpjp_wrapper").html(datum.dpjp);
|
||||
$("select").select2();
|
||||
$("#dpjp_pelayanan").val(2).trigger("change");
|
||||
}
|
||||
else {
|
||||
$("#dpjp_wrapper").html("");
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#jumlah_tagihan").val(datum.jumlah).prop("readonly",false);
|
||||
$("#dpjp_wrapper").html("");
|
||||
}
|
||||
});
|
||||
}
|
||||
load_kode_tarif();
|
||||
|
||||
$("#tempat_layanan_tarif").on("change",function(){
|
||||
this_unit = $(this).find(":selected").val();
|
||||
$("#unit").val(this_unit);
|
||||
});
|
||||
|
||||
'.$trigger_tempat.'
|
||||
|
||||
'.$list_var_ruang.'
|
||||
$("#ruang").on("change",function(){
|
||||
this_ruang = $(this).find(":selected").val();
|
||||
$("#tempat").val(this_ruang);
|
||||
|
||||
$("#unit").val(list_unit[this_ruang])
|
||||
});
|
||||
'.(array_key_exists('ruang_tindakan',$_SESSION) ? '
|
||||
$("#tempat").val('.$_SESSION['ruang_tindakan'].');
|
||||
$("#unit").val(list_unit['.$_SESSION['ruang_tindakan'].']);' : '').'
|
||||
});
|
||||
|
||||
function printRaw(rajal_status,nomr,idxdaftar,nobill,nonota,aps) {
|
||||
$.post("'._BASE_.'print_nota_tindakan.php",{rajal_status,nomr,idxdaftar,nobill,nonota,aps,raw:1},function(print_command){
|
||||
jspm_print_raw(print_command);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function print_tindakan(nomor)
|
||||
{
|
||||
rajal = $("#st_rajal").val();
|
||||
nomr = $("#nomr").val();
|
||||
idxdaftar = $("#idxdaftar").val();
|
||||
nobill = $("#nobill").val().replace(/\./g,"");
|
||||
|
||||
jspm_print("'._BASE_.'print_nota_tindakan.php?rajal_status="+rajal+"&nomr="+nomr+"&idxdaftar="+idxdaftar+"&nobill="+nobill+"&nonota="+nomor,"modal-preview","Nota Tindakan "+nomr+".pdf",0);
|
||||
$("#modal-preview").on("hidden.bs.modal",function(e){ window.location.reload(); });
|
||||
|
||||
cek_tombol_cetak = $("#cetak_raw").length;
|
||||
if(cek_tombol_cetak > 0) {
|
||||
$("#cetak_raw").remove();
|
||||
}
|
||||
$("#modal-preview .modal-footer").append("<button type=\"button\" id=\"cetak_raw\" class=\"btn btn-primary\" onclick=\"printRaw("+rajal+","+nomr+","+idxdaftar+","+nobill+","+nomor+",0)\"><i class=\"fa fa-print\"></i> Cetak</button>");
|
||||
}
|
||||
|
||||
const Toast = Swal.mixin({
|
||||
toast: true,
|
||||
position: "top-end",
|
||||
showConfirmButton: false,
|
||||
timer: 3000
|
||||
});
|
||||
$("#nobill").trigger("focus");
|
||||
$("#nobill").focus();
|
||||
$("#nobill").on("keypress",function(e){
|
||||
if(e.which == 13 || e.keyCode == 13)
|
||||
{
|
||||
e.preventDefault();
|
||||
cari();
|
||||
}
|
||||
});
|
||||
$("#kode_tarif").on("keypress",function(e){
|
||||
if(e.which == 13 || e.keyCode == 13)
|
||||
{
|
||||
e.preventDefault();
|
||||
}
|
||||
});
|
||||
function cari() {
|
||||
$("#nomr,#nama,#alamat,#no_telepon").val("");
|
||||
$.post("'._BASE_.'keuangan/addtarif.php?page=cari",$("#frm_identitas").serialize(),function(data)
|
||||
{
|
||||
if(data.type != undefined) {
|
||||
Toast.fire({title:data.message,type:data.type});
|
||||
}
|
||||
else {
|
||||
$("#nomr").val(data.nomr).prop("readonly",true);
|
||||
$("#nama").val(data.nama).prop("readonly",true);
|
||||
$("#alamat").val(data.alamat).prop("readonly",true);
|
||||
$("#no_telepon").val(data.notelp).prop("readonly",true);
|
||||
$("#tempat_layanan").val(data.tempat_layanan).prop("readonly",true);
|
||||
/*$("#kode_tarif").trigger("focus");*/
|
||||
$("#tempat_layanan_tarif").trigger("focus");
|
||||
$("#st_rajal").val(data.st_rajal);
|
||||
$("#idxdaftar").val(data.idxdaftar);
|
||||
$("#tempat").val(data.kode_tempat);
|
||||
$("#dpjp").val(data.dpjp);
|
||||
$("#st_aps").val(data.st_aps);
|
||||
}
|
||||
},"json");
|
||||
}
|
||||
function cari_tarif() {
|
||||
$("#uraian_tarif,#jumlah_tagihan").val("");
|
||||
$.post("'._BASE_.'keuangan/addtarif.php?page=cari_tarif",$("#frm_tarif").serialize(),function(data)
|
||||
{
|
||||
if(data.type != undefined) {
|
||||
Toast.fire({title:data.message,type:data.type});
|
||||
$("#jumlah_tagihan").prop("readonly",false);
|
||||
}
|
||||
else {
|
||||
$("#id_tarif").val(data.tarif.id_tarif).prop("readonly",true);
|
||||
$("#uraian_tarif").val(data.tarif.uraian_tarif).prop("readonly",true);
|
||||
$("#jasa_pelayanan").val(data.tarif.jasa_pelayanan);
|
||||
$("#jasa_sarana").val(data.tarif.jasa_sarana);
|
||||
$("#jasa_anastesi").val(data.tarif.jasa_anastesi);
|
||||
if(data.tarif.jumlah > 0) {
|
||||
$("#jumlah_tagihan").val(data.tarif.jumlah).prop("readonly",true);
|
||||
if(data.dpjp != false) {
|
||||
$("#dpjp_wrapper").html(data.dpjp);
|
||||
$("select").select2();
|
||||
}
|
||||
else {
|
||||
$("#dpjp_wrapper").html("");
|
||||
}
|
||||
}
|
||||
else {
|
||||
$("#jumlah_tagihan").val(data.tarif.jumlah).prop("readonly",false);
|
||||
$("#dpjp_wrapper").html("");
|
||||
}
|
||||
}
|
||||
},"json");
|
||||
}
|
||||
var arr_item = [];
|
||||
var noitem = 1;
|
||||
function addItem() {
|
||||
id_tarif = $("#id_tarif").val();
|
||||
dpjp = $("#dpjp_pelayanan").val();
|
||||
if(dpjp == "") {
|
||||
Toast.fire({title:"Pilih DPJP dahulu!",type:"error"});
|
||||
}
|
||||
else if(id_tarif != "") {
|
||||
$.post("'._BASE_.'keuangan/addtarif.php?page=add_item",$("#frm_tarif").serialize(),function(data){
|
||||
// if($.inArray(data.kode_tarif,arr_item) > -1 ) {
|
||||
// Toast.fire({title:"Tarif sudah ditambahkan",type:"error"});
|
||||
// }
|
||||
// else {
|
||||
$("#table_tarif tbody").append(data.rowitem);
|
||||
arr_item.push(noitem);
|
||||
noitem += 1;
|
||||
$("#noitem").val(noitem);
|
||||
/*$("#frm_tarif").trigger("reset");*/
|
||||
$("#dpjp_wrapper").html("");
|
||||
$("#id_tarif").val("");
|
||||
hitung_total();
|
||||
// }
|
||||
},"json");
|
||||
}
|
||||
else {
|
||||
Toast.fire({title:"Masukkan kode terif yang benar",type:"error"});
|
||||
}
|
||||
}
|
||||
function hitung_total() {
|
||||
total = 0;
|
||||
$("#table_tarif .nominal_tarif").each(function(k,v){
|
||||
console.log($(v).val());
|
||||
total += parseFloat($(v).val());
|
||||
});
|
||||
|
||||
$("#jumlah_total").html("<span class=\"\">Rp. "+accounting.formatMoney(total)+"</span>");
|
||||
}
|
||||
function remItem(elm) {
|
||||
var item = $(elm).data("noitem");
|
||||
for( i = 0; i < arr_item.length; i++) {
|
||||
if(arr_item[i] == item) {
|
||||
arr_item.splice(i,1);
|
||||
}
|
||||
}
|
||||
$(elm).parent().parent().remove();
|
||||
hitung_total();
|
||||
}
|
||||
|
||||
function simpan() {
|
||||
nama = $("#nama").val();
|
||||
alamat = $("#alamat").val();
|
||||
no_telepon = $("#no_telepon").val();
|
||||
st_aps = $("#st_aps").val();
|
||||
lolos_cek = true;
|
||||
'.((array_key_exists('ruang',$_REQUEST) && $_REQUEST['ruang'] == 'tindakan') ? '
|
||||
tempat = $("#ruang_tindakan").val();
|
||||
unit = $("#unit").val();
|
||||
' : '').'
|
||||
if(nama == "" || alamat == "") {
|
||||
if(st_aps == 0) {
|
||||
Toast.fire({title:"Identitas belum terisi dengan lengkap",type:"error"});
|
||||
lolos_cek = false;
|
||||
}
|
||||
else {
|
||||
lolos_cek = true;
|
||||
}
|
||||
}
|
||||
'.((array_key_exists('ruang',$_REQUEST) && $_REQUEST['ruang'] == 'tindakan') ? '
|
||||
else if(tempat == "") {
|
||||
Toast.fire({title:"Belum memilih Tempat Layanan",type:"error"});
|
||||
lolos_cek = false;
|
||||
}
|
||||
' : '').'
|
||||
else if(arr_item.length == 0) {
|
||||
Toast.fire({title:"Belum terdapat tarif, tambahkan tarif terlebih dahulu",type:"error"});
|
||||
lolos_cek = false;
|
||||
}
|
||||
|
||||
if(lolos_cek) {
|
||||
form_identitas = $("#frm_identitas").serialize();
|
||||
form_billing = $("#form_billing").serialize();
|
||||
$.post("'._BASE_.'keuangan/addtarif.php?page=billing",form_identitas+"&"+form_billing,function(data){
|
||||
if(data.type == "error") {
|
||||
Toast.fire({title:data.message,type:data.type});
|
||||
}
|
||||
else {
|
||||
Toast.fire({title:data.message,type:data.type,onClose : function() {
|
||||
print_tindakan(data.nonota);
|
||||
reset_form();
|
||||
}});
|
||||
}
|
||||
},"json");
|
||||
}
|
||||
else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
function reset_form() {
|
||||
$("#frm_identitas").trigger("reset");
|
||||
$("#nama,#alamat,#no_telepon,#tempat_layanan").prop("readonly",false);
|
||||
$("#frm_tarif").trigger("reset");
|
||||
$("#jumlah_tagihan").prop("readonly",false);
|
||||
$("#dpjp_wrapper").html("");
|
||||
arr_item = [];
|
||||
noitem = 1;
|
||||
$("#table_tarif tbody").html("");
|
||||
hitung_total();
|
||||
}
|
||||
';
|
||||
?>
|
||||
Reference in New Issue
Block a user