From 49602aa5a00280483c62c44a459b48a8edc64881 Mon Sep 17 00:00:00 2001 From: Basoro Date: Sat, 26 Oct 2024 04:44:06 +0800 Subject: [PATCH] Remove add, edit, del button --- plugins/detail_pemberian_obat/Admin.php | 66 ------ .../detail_pemberian_obat/js/admin/scripts.js | 195 ------------------ .../view/admin/manage.html | 134 ------------ plugins/riwayat_barang_medis/Admin.php | 66 ------ .../riwayat_barang_medis/js/admin/scripts.js | 195 ------------------ .../view/admin/manage.html | 132 ------------ 6 files changed, 788 deletions(-) diff --git a/plugins/detail_pemberian_obat/Admin.php b/plugins/detail_pemberian_obat/Admin.php index 3f70ec7f..393f75ba 100644 --- a/plugins/detail_pemberian_obat/Admin.php +++ b/plugins/detail_pemberian_obat/Admin.php @@ -97,72 +97,6 @@ public function postAksi() $act = ''; } - if ($act=='add') { - - $tgl_perawatan = $_POST['tgl_perawatan']; -$jam = $_POST['jam']; -$no_rawat = $_POST['no_rawat']; -$kode_brng = $_POST['kode_brng']; -$h_beli = $_POST['h_beli']; -$biaya_obat = $_POST['biaya_obat']; -$jml = $_POST['jml']; -$embalase = $_POST['embalase']; -$tuslah = $_POST['tuslah']; -$total = $_POST['total']; -$status = $_POST['status']; -$kd_bangsal = $_POST['kd_bangsal']; -$no_batch = $_POST['no_batch']; -$no_faktur = $_POST['no_faktur']; - - - $detail_pemberian_obat_add = $this->db()->pdo()->prepare('INSERT INTO detail_pemberian_obat VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)'); - $detail_pemberian_obat_add->execute([$tgl_perawatan, $jam, $no_rawat, $kode_brng, $h_beli, $biaya_obat, $jml, $embalase, $tuslah, $total, $status, $kd_bangsal, $no_batch, $no_faktur]); - - } - if ($act=="edit") { - - $tgl_perawatan = $_POST['tgl_perawatan']; -$jam = $_POST['jam']; -$no_rawat = $_POST['no_rawat']; -$kode_brng = $_POST['kode_brng']; -$h_beli = $_POST['h_beli']; -$biaya_obat = $_POST['biaya_obat']; -$jml = $_POST['jml']; -$embalase = $_POST['embalase']; -$tuslah = $_POST['tuslah']; -$total = $_POST['total']; -$status = $_POST['status']; -$kd_bangsal = $_POST['kd_bangsal']; -$no_batch = $_POST['no_batch']; -$no_faktur = $_POST['no_faktur']; - - - // BUANG FIELD PERTAMA - - $detail_pemberian_obat_edit = $this->db()->pdo()->prepare("UPDATE detail_pemberian_obat SET tgl_perawatan=?, jam=?, no_rawat=?, kode_brng=?, h_beli=?, biaya_obat=?, jml=?, embalase=?, tuslah=?, total=?, status=?, kd_bangsal=?, no_batch=?, no_faktur=? WHERE tgl_perawatan=?"); - $detail_pemberian_obat_edit->execute([$tgl_perawatan, $jam, $no_rawat, $kode_brng, $h_beli, $biaya_obat, $jml, $embalase, $tuslah, $total, $status, $kd_bangsal, $no_batch, $no_faktur,$tgl_perawatan]); - - } - - if ($act=="del") { - $tgl_perawatan= $_POST['tgl_perawatan']; - $check_db = $this->db()->pdo()->prepare("DELETE FROM detail_pemberian_obat WHERE tgl_perawatan='$tgl_perawatan'"); - $result = $check_db->execute(); - $error = $check_db->errorInfo(); - if (!empty($result)){ - $data = array( - 'status' => 'success', - 'msg' => $no_rkm_medis - ); - } else { - $data = array( - 'status' => 'error', - 'msg' => $error['2'] - ); - } - echo json_encode($data); - } - if ($act=="lihat") { $search_field_detail_pemberian_obat= $_POST['search_field_detail_pemberian_obat']; diff --git a/plugins/detail_pemberian_obat/js/admin/scripts.js b/plugins/detail_pemberian_obat/js/admin/scripts.js index 9993dc7c..3a487a8e 100644 --- a/plugins/detail_pemberian_obat/js/admin/scripts.js +++ b/plugins/detail_pemberian_obat/js/admin/scripts.js @@ -70,86 +70,6 @@ jQuery().ready(function () { dom: "<'row'<'col-sm-12'tr>><<'pmd-datatable-pagination' l i p>>" }); - // ============================================================== - // FORM VALIDASI - // ============================================================== - - $("form[name='form_detail_pemberian_obat']").validate({ - rules: { -tgl_perawatan: 'required', -jam: 'required', -no_rawat: 'required', -kode_brng: 'required', -h_beli: 'required', -biaya_obat: 'required', -jml: 'required', -embalase: 'required', -tuslah: 'required', -total: 'required', -status: 'required', -kd_bangsal: 'required', -no_batch: 'required', -no_faktur: 'required' - - }, - messages: { -tgl_perawatan:'tgl_perawatan tidak boleh kosong!', -jam:'jam tidak boleh kosong!', -no_rawat:'no_rawat tidak boleh kosong!', -kode_brng:'kode_brng tidak boleh kosong!', -h_beli:'h_beli tidak boleh kosong!', -biaya_obat:'biaya_obat tidak boleh kosong!', -jml:'jml tidak boleh kosong!', -embalase:'embalase tidak boleh kosong!', -tuslah:'tuslah tidak boleh kosong!', -total:'total tidak boleh kosong!', -status:'status tidak boleh kosong!', -kd_bangsal:'kd_bangsal tidak boleh kosong!', -no_batch:'no_batch tidak boleh kosong!', -no_faktur:'no_faktur tidak boleh kosong!' - - }, - submitHandler: function (form) { - var tgl_perawatan= $('#tgl_perawatan').val(); -var jam= $('#jam').val(); -var no_rawat= $('#no_rawat').val(); -var kode_brng= $('#kode_brng').val(); -var h_beli= $('#h_beli').val(); -var biaya_obat= $('#biaya_obat').val(); -var jml= $('#jml').val(); -var embalase= $('#embalase').val(); -var tuslah= $('#tuslah').val(); -var total= $('#total').val(); -var status= $('#status').val(); -var kd_bangsal= $('#kd_bangsal').val(); -var no_batch= $('#no_batch').val(); -var no_faktur= $('#no_faktur').val(); - - var typeact = $('#typeact').val(); - - var formData = new FormData(form); // tambahan - formData.append('typeact', typeact); // tambahan - - $.ajax({ - url: "{?=url([ADMIN,'detail_pemberian_obat','aksi'])?}", - method: "POST", - contentType: false, // tambahan - processData: false, // tambahan - data: formData, - success: function (data) { - if (typeact == "add") { - alert("Data Berhasil Ditambah"); - } - else if (typeact == "edit") { - alert("Data Berhasil Diubah"); - } - $("#modal_cs").hide(); - location.reload(true); - } - }) - } - }); - // ============================================================== // KETIKA MENGETIK DI INPUT SEARCH // ============================================================== @@ -164,121 +84,6 @@ var no_faktur= $('#no_faktur').val(); var_tbl_detail_pemberian_obat.draw(); }); - // =========================================== - // Ketika tombol Edit di tekan - // =========================================== - - $("#edit_data_detail_pemberian_obat").click(function () { - var rowData = var_tbl_detail_pemberian_obat.rows({ selected: true }).data()[0]; - if (rowData != null) { - - var tgl_perawatan = rowData['tgl_perawatan']; -var jam = rowData['jam']; -var no_rawat = rowData['no_rawat']; -var kode_brng = rowData['kode_brng']; -var h_beli = rowData['h_beli']; -var biaya_obat = rowData['biaya_obat']; -var jml = rowData['jml']; -var embalase = rowData['embalase']; -var tuslah = rowData['tuslah']; -var total = rowData['total']; -var status = rowData['status']; -var kd_bangsal = rowData['kd_bangsal']; -var no_batch = rowData['no_batch']; -var no_faktur = rowData['no_faktur']; - - - - $("#typeact").val("edit"); - - $('#tgl_perawatan').val(tgl_perawatan); -$('#jam').val(jam); -$('#no_rawat').val(no_rawat); -$('#kode_brng').val(kode_brng); -$('#h_beli').val(h_beli); -$('#biaya_obat').val(biaya_obat); -$('#jml').val(jml); -$('#embalase').val(embalase); -$('#tuslah').val(tuslah); -$('#total').val(total); -$('#status').val(status); -$('#kd_bangsal').val(kd_bangsal); -$('#no_batch').val(no_batch); -$('#no_faktur').val(no_faktur); - - //$("#tgl_perawatan").prop('disabled', true); // GA BISA DIEDIT KALI DISABLE - $('#modal-title').text("Edit Data Detail Pemberian Obat"); - $("#modal_detail_pemberian_obat").modal(); - } - else { - alert("Silakan pilih data yang akan di edit."); - } - - }); - - // ============================================================== - // TOMBOL DELETE DI CLICK - // ============================================================== - jQuery("#hapus_data_detail_pemberian_obat").click(function () { - var rowData = var_tbl_detail_pemberian_obat.rows({ selected: true }).data()[0]; - - - if (rowData) { -var tgl_perawatan = rowData['tgl_perawatan']; - var a = confirm("Anda yakin akan menghapus data dengan tgl_perawatan=" + tgl_perawatan); - if (a) { - - $.ajax({ - url: "{?=url([ADMIN,'detail_pemberian_obat','aksi'])?}", - method: "POST", - data: { - tgl_perawatan: tgl_perawatan, - typeact: 'del' - }, - success: function (data) { - data = JSON.parse(data); - if(data.status === 'success') { - alert(data.msg); - } else { - alert(data.msg); - } - location.reload(true); - } - }) - } - } - else { - alert("Pilih satu baris untuk dihapus"); - } - }); - - // ============================================================== - // TOMBOL TAMBAH DATA DI CLICK - // ============================================================== - jQuery("#tambah_data_detail_pemberian_obat").click(function () { - - $('#tgl_perawatan').val(''); -$('#jam').val(''); -$('#no_rawat').val(''); -$('#kode_brng').val(''); -$('#h_beli').val(''); -$('#biaya_obat').val(''); -$('#jml').val(''); -$('#embalase').val(''); -$('#tuslah').val(''); -$('#total').val(''); -$('#status').val(''); -$('#kd_bangsal').val(''); -$('#no_batch').val(''); -$('#no_faktur').val(''); - - - $("#typeact").val("add"); - $("#tgl_perawatan").prop('disabled', false); - - $('#modal-title').text("Tambah Data Detail Pemberian Obat"); - $("#modal_detail_pemberian_obat").modal(); - }); // =========================================== // Ketika tombol lihat data di tekan diff --git a/plugins/detail_pemberian_obat/view/admin/manage.html b/plugins/detail_pemberian_obat/view/admin/manage.html index c2215e0c..c8d7d464 100644 --- a/plugins/detail_pemberian_obat/view/admin/manage.html +++ b/plugins/detail_pemberian_obat/view/admin/manage.html @@ -10,15 +10,6 @@

Kelola

- - - @@ -85,131 +76,6 @@

Kelola

- - -