217 lines
7.1 KiB
PHP
217 lines
7.1 KiB
PHP
<?php
|
|
|
|
if($_REQUEST['cari_bill']) {
|
|
|
|
if($_REQUEST['by'] == 'rajal') {
|
|
// parameter yang dibutuhkan idxdaftar,nomr
|
|
include _DOCROOT_.'cartbill.php';
|
|
}
|
|
elseif($_REQUEST['by'] == 'ranap') {
|
|
// parameter yang dibutuhkan idxb,nobill
|
|
include _DOCROOT_.'cartbillranap.php';
|
|
}
|
|
elseif($_REQUEST['by'] == 'nonreg' || $_REQUEST['by'] == 'nonpasien') {
|
|
// parameter yang dibutuhkan idxnonreg,no_nonreg
|
|
include _DOCROOT_.'cartbill_nonreg.php';
|
|
}
|
|
|
|
}
|
|
else {
|
|
?>
|
|
<div id="frame" style="margin-top:10px">
|
|
<div class="container-fluid">
|
|
<div class="row">
|
|
<div class="col-md-6 offset-md-3">
|
|
<div class="card">
|
|
<div class="card-header">Pencarian Bill</div>
|
|
<div class="card-body">
|
|
<form id="form_cari" action="" method="post">
|
|
<input type="hidden" name="idxdaftar" id="frm_idxdaftar" value>
|
|
<input type="hidden" name="nomr" id="frm_nomr" value>
|
|
<input type="hidden" name="idxb" id="frm_idxb" value>
|
|
<input type="hidden" name="idx_nonreg" id="frm_idxnonreg" value>
|
|
<input type="hidden" name="no_nonreg" id="frm_nononreg" value>
|
|
<input type="hidden" name="aps" id="frm_aps" value>
|
|
<input type="hidden" name="cari_bill" id="frm_caribill" value="1">
|
|
<?php
|
|
if(array_key_exists('ranap', $_REQUEST) && $_REQUEST['ranap'] == 1) {
|
|
echo '<div class="form-group row">
|
|
<label class="col-sm-4">Sistem</label>
|
|
|
|
<div class="col-sm-8">
|
|
<div class="form-check form-check-inline"><input class="form-check-input" type="radio" name="by" id="rdRanap" value="ranap" checked>
|
|
<label class="form-check-label" for="rdRanap">Rawat Inap</label>
|
|
</div>
|
|
</div>
|
|
</div>';
|
|
}
|
|
else {
|
|
?>
|
|
<div class="form-group row">
|
|
<label class="col-sm-4">Sistem</label>
|
|
|
|
<div class="col-sm-8">
|
|
<div class="form-check form-check-inline">
|
|
<input class="form-check-input" type="radio" name="by" id="rdRajal" value="rajal" checked>
|
|
<label class="form-check-label" for="rdRajal">Rawat Jalan</label>
|
|
</div>
|
|
<div class="form-check form-check-inline">
|
|
<input class="form-check-input" type="radio" name="by" id="rdRanap" value="ranap">
|
|
<label class="form-check-label" for="rdRanap">Rawat Inap</label>
|
|
</div>
|
|
<div class="form-check form-check-inline">
|
|
<input class="form-check-input" type="radio" name="by" id="rdNonreg" value="nonreg">
|
|
<label class="form-check-label" for="rdNonreg">Non Register</label>
|
|
</div>
|
|
<div class="form-check form-check-inline">
|
|
<input class="form-check-input" type="radio" name="by" id="rdNonPasien" value="nonpasien">
|
|
<label class="form-check-label" for="rdNonPasien">Non Pasien</label>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<?php } ?>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-sm-4">No Billing</label>
|
|
<div class="col-sm-7">
|
|
<input type="number" name="nobill" id="nobill" class="mask-decimal form-control form-control-sm">
|
|
</div>
|
|
<div class="col-sm-1">
|
|
<span class="alert alert-success p-1 d-none" id="info_nobill_ok"><i class="fa fa-check"></i></span>
|
|
<span class="alert alert-danger p-1 d-none" id="info_nobill_salah"><i class="fa fa-times"></i></span>
|
|
</div>
|
|
</div>
|
|
|
|
<div class="form-group row">
|
|
<label class="col-sm-4"> </label>
|
|
<div class="col-sm-8">
|
|
<button type="button" name="btn_cari_bill" id="btn_cari_bill" class="btn btn-outline-primary" disabled>Cari</button>
|
|
</div>
|
|
</div>
|
|
</form>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<?php
|
|
array_push($form_plugin['ui_plugins_js'], $typing_js);
|
|
|
|
$js_init .= '
|
|
$("#btn_cari_bill").click(function(){
|
|
$("#form_cari").trigger("submit");
|
|
});
|
|
$("input[type=radio][name=by]").click(function(){
|
|
$("#nobill").val("").trigger("focus");
|
|
});
|
|
|
|
$("#nobill").focus();
|
|
|
|
$("#nobill").typing({
|
|
stop : function(e,elm){
|
|
validasi_billing($(elm).val());
|
|
},
|
|
delay : 200
|
|
});
|
|
|
|
$("#nobill").bind("paste",function(e) {
|
|
catchPaste(e, this, function(val) {
|
|
validasi_billing(val);
|
|
});
|
|
});
|
|
|
|
$("#nobill").on("keypress",function(e){
|
|
if(e.keyCode == 13) {
|
|
e.preventDefault();
|
|
nomr = $("#frm_nomr").val();
|
|
nomr2 = $("#frm_nononreg").val();
|
|
if(nomr != "" || nomr2 != "") {
|
|
$("#btn_cari_bill").trigger("click");
|
|
}
|
|
else {
|
|
|
|
}
|
|
}
|
|
});
|
|
|
|
function catchPaste(evt, elem, callback) {
|
|
if (navigator.clipboard && navigator.clipboard.readText) {
|
|
// modern approach with Clipboard API
|
|
navigator.clipboard.readText().then(callback);
|
|
} else if (evt.originalEvent && evt.originalEvent.clipboardData) {
|
|
// OriginalEvent is a property from jQuery, normalizing the event object
|
|
callback(evt.originalEvent.clipboardData.getData("text"));
|
|
} else if (evt.clipboardData) {
|
|
// used in some browsers for clipboardData
|
|
callback(evt.clipboardData.getData("text/plain"));
|
|
} else if (window.clipboardData) {
|
|
// Older clipboardData version for Internet Explorer only
|
|
callback(window.clipboardData.getData("Text"));
|
|
} else {
|
|
// Last resort fallback, using a timer
|
|
setTimeout(function() {
|
|
callback(elem.value)
|
|
}, 100);
|
|
}
|
|
}
|
|
|
|
function validasi_billing(pre_nobill) {
|
|
|
|
nobill = (pre_nobill != "") ? pre_nobill : $("#nobill").val();
|
|
|
|
sistem = $("input[type=radio][name=by]:checked").val();
|
|
|
|
$.post("'._BASE_.'include/master.php",{cari_billing:true,nobill,sistem},function(data){
|
|
if(data.type == "success"){
|
|
$("#info_nobill_ok").removeClass("d-none");
|
|
$("#info_nobill_salah").addClass("d-none");
|
|
|
|
if(sistem == "rajal"){
|
|
$("#frm_idxdaftar").val(data.pasien.idxdaftar);
|
|
$("#frm_aps").val(data.pasien.aps);
|
|
$("#frm_nomr").val(data.pasien.nomr);
|
|
$("#frm_idxb,#frm_nononreg,#frm_idxnonreg").val("");
|
|
}
|
|
else if(sistem == "ranap") {
|
|
$("#frm_idxb").val(data.pasien.idxdaftar);
|
|
$("#frm_nomr").val(data.pasien.nomr);
|
|
$("#frm_idxdaftar,#frm_nononreg,#frm_idxnonreg").val("");
|
|
}
|
|
else if(sistem == "nonreg" || sistem == "nonpasien") {
|
|
$("#frm_idxnonreg").val(data.pasien.idx_nonreg);
|
|
$("#frm_nononreg").val(data.pasien.no_nonreg);
|
|
$("#frm_idxdaftar,#frm_idxb,#frm_nomr").val("");
|
|
}
|
|
$("#btn_cari_bill").prop("disabled",false);
|
|
}
|
|
else {
|
|
$("#info_nobill_ok").addClass("d-none");
|
|
$("#info_nobill_salah").removeClass("d-none");
|
|
|
|
if(sistem == "rajal"){
|
|
$("#frm_idxdaftar").val("");
|
|
$("#frm_nomr").val("");
|
|
$("#frm_idxb,#frm_nononreg,#frm_idxnonreg").val("");
|
|
}
|
|
else if(sistem == "ranap") {
|
|
$("#frm_idxb").val("");
|
|
$("#frm_nomr").val("");
|
|
$("#frm_idxdaftar,#frm_nononreg,#frm_idxnonreg").val("");
|
|
}
|
|
else if(sistem == "nonreg" || sistem == "nonpasien") {
|
|
$("#frm_idxdaftar").val("");
|
|
$("#frm_nononreg").val("");
|
|
$("#frm_idxdaftar,#frm_idxb,#frm_nomr").val("");
|
|
}
|
|
|
|
$("#btn_cari_bill").prop("disabled",true);
|
|
}
|
|
},"json");
|
|
}
|
|
';
|
|
}
|
|
?>
|
|
|