diff --git a/app/Http/Controllers/CustomerController.php b/app/Http/Controllers/CustomerController.php index e9f8636..667b0f1 100644 --- a/app/Http/Controllers/CustomerController.php +++ b/app/Http/Controllers/CustomerController.php @@ -230,6 +230,7 @@ class CustomerController extends Controller 'total_harga' => $totalHarga, 'status_order' => "Belum Bayar", 'email' => $biodataResult['email'], + 'alamat' => $biodataResult['alamat'], ]; $order = Order::create($payloadOrder); foreach ($dataCart as $cart) { diff --git a/app/Http/Controllers/KaloriController.php b/app/Http/Controllers/KaloriController.php new file mode 100644 index 0000000..9856126 --- /dev/null +++ b/app/Http/Controllers/KaloriController.php @@ -0,0 +1,40 @@ + 'Master Kalori' + ]; + return view('dashboard.kalori.index', $payload); + } + + public function create(){ + // + } + + public function store(){ + // + } + + public function update(){ + // + } + + public function destroy(){ + // + } + + public function datatable(){ + return Kalori::where('statusenabled', true)->get(); + } + + public function option(){ + return Kalori::where('statusenabled', true)->select('kalori_id', 'nilai_kalori')->get(); + } +} diff --git a/app/Http/Controllers/PesananController.php b/app/Http/Controllers/PesananController.php index 400cf96..b64cb3f 100644 --- a/app/Http/Controllers/PesananController.php +++ b/app/Http/Controllers/PesananController.php @@ -6,6 +6,7 @@ use App\Models\Order; use App\Models\OrderDetail; use Carbon\Carbon; use Illuminate\Http\Request; +use Illuminate\Support\Arr; use Illuminate\Support\Facades\DB; class PesananController extends Controller @@ -212,12 +213,29 @@ class PesananController extends Controller } public function getPekerjaan(){ - $data = OrderDetail::get(); + $data = OrderDetail::with(['menu', 'paketMenu', 'order'])->whereHas('order', function($q){ + $q->where('status_order', 'Lunas'); + }); + $tanggal = request('tanggal'); + if(!empty($tanggal)){ + $flattened = is_array($tanggal[0]) ? Arr::flatten($tanggal) : $tanggal; + $data->whereIn('tgl_antar', $flattened); + } + $data = $data->get(); + return response()->json([ 'rows' => $data->values(), 'total' => $data->count() ]); } + + public function getPekerjaanDetail($order_detail_id){ + $data = OrderDetail::where('order_detail_id', $order_detail_id)->with(['order', 'menu', 'paketMenu'])->first(); + return response()->json([ + 'status' => true, + 'data' => $data + ]); + } /** * Show the form for creating a new resource. */ diff --git a/app/Models/Kalori.php b/app/Models/Kalori.php new file mode 100644 index 0000000..b467752 --- /dev/null +++ b/app/Models/Kalori.php @@ -0,0 +1,23 @@ +belongsTo(PaketMenu::class, 'master_paket_menu_id', 'master_paket_menu_id')->select('master_paket_menu_id', 'nama_paket', 'foto'); } + + public function order(){ + return $this->belongsTo(Order::class, 'order_id', 'order_id'); + } } diff --git a/public/gambar/2nY3o48jb2uQiO3.jpg b/public/gambar/2nY3o48jb2uQiO3.jpg new file mode 100644 index 0000000..65c49f2 Binary files /dev/null and b/public/gambar/2nY3o48jb2uQiO3.jpg differ diff --git a/public/gambar/2zEM6AiiseNuxLk.jpg b/public/gambar/2zEM6AiiseNuxLk.jpg new file mode 100644 index 0000000..f2484da Binary files /dev/null and b/public/gambar/2zEM6AiiseNuxLk.jpg differ diff --git a/public/gambar/7v66MY4Xtpdjy3c.jpg b/public/gambar/7v66MY4Xtpdjy3c.jpg new file mode 100644 index 0000000..ce2830e Binary files /dev/null and b/public/gambar/7v66MY4Xtpdjy3c.jpg differ diff --git a/public/gambar/Fm0EkEycIavWSNQ.jpg b/public/gambar/Fm0EkEycIavWSNQ.jpg new file mode 100644 index 0000000..deacad0 Binary files /dev/null and b/public/gambar/Fm0EkEycIavWSNQ.jpg differ diff --git a/public/gambar/HpMlnY6XHwXQjCV.jpg b/public/gambar/HpMlnY6XHwXQjCV.jpg new file mode 100644 index 0000000..66452f7 Binary files /dev/null and b/public/gambar/HpMlnY6XHwXQjCV.jpg differ diff --git a/public/gambar/HvsArIf6YT60S5w.jpg b/public/gambar/HvsArIf6YT60S5w.jpg new file mode 100644 index 0000000..9ace676 Binary files /dev/null and b/public/gambar/HvsArIf6YT60S5w.jpg differ diff --git a/public/gambar/HxAIKI2GOJJLK7e.jpeg b/public/gambar/HxAIKI2GOJJLK7e.jpeg new file mode 100644 index 0000000..1a971e2 Binary files /dev/null and b/public/gambar/HxAIKI2GOJJLK7e.jpeg differ diff --git a/public/gambar/J48ynecA0d9FeQO.jpg b/public/gambar/J48ynecA0d9FeQO.jpg new file mode 100644 index 0000000..66452f7 Binary files /dev/null and b/public/gambar/J48ynecA0d9FeQO.jpg differ diff --git a/public/gambar/KbGqXS6gOhXFmHj.jpg b/public/gambar/KbGqXS6gOhXFmHj.jpg new file mode 100644 index 0000000..7d8f1d1 Binary files /dev/null and b/public/gambar/KbGqXS6gOhXFmHj.jpg differ diff --git a/public/gambar/MGBdA7UjORdIDgm.jpg b/public/gambar/MGBdA7UjORdIDgm.jpg new file mode 100644 index 0000000..891abf5 Binary files /dev/null and b/public/gambar/MGBdA7UjORdIDgm.jpg differ diff --git a/public/gambar/lWjp5kmTfUP69gB.jpg b/public/gambar/lWjp5kmTfUP69gB.jpg new file mode 100644 index 0000000..f24b6b1 Binary files /dev/null and b/public/gambar/lWjp5kmTfUP69gB.jpg differ diff --git a/public/gambar/vcgovqG7eNzq0QH.jpg b/public/gambar/vcgovqG7eNzq0QH.jpg new file mode 100644 index 0000000..8d6d04c Binary files /dev/null and b/public/gambar/vcgovqG7eNzq0QH.jpg differ diff --git a/public/gambar/wbSKBIXT1xPyp03.jpg b/public/gambar/wbSKBIXT1xPyp03.jpg new file mode 100644 index 0000000..4acf3d8 Binary files /dev/null and b/public/gambar/wbSKBIXT1xPyp03.jpg differ diff --git a/public/gambar/wxzjWXhYqZCCaxh.jpg b/public/gambar/wxzjWXhYqZCCaxh.jpg new file mode 100644 index 0000000..8c199ec Binary files /dev/null and b/public/gambar/wxzjWXhYqZCCaxh.jpg differ diff --git a/public/gambar/xFoSyzDia8Roglp.png b/public/gambar/xFoSyzDia8Roglp.png new file mode 100644 index 0000000..df8c0ec Binary files /dev/null and b/public/gambar/xFoSyzDia8Roglp.png differ diff --git a/public/js/checkout/index.js b/public/js/checkout/index.js index 56336d4..2fd9881 100644 --- a/public/js/checkout/index.js +++ b/public/js/checkout/index.js @@ -147,11 +147,12 @@ function toggleCustomerFields() { const selected = $('input[name="jenis_customer"]:checked').val(); if (selected === 'Karyawan RSAB Harapan Kita') { $('.karyawan').show(); - $('.pasien').hide(); + $('.pasien, .umum').hide(); } else if (selected === 'Keluarga Pasien / Penunggu Pasien') { $('.pasien').show(); - $('.karyawan').hide(); + $('.karyawan, .umum').hide(); } else { + $('.umum').show(); $('.karyawan, .pasien').hide(); } } @@ -178,6 +179,7 @@ if (typeof checkout_biodata === 'object') { $('#bagian_instalasi').val(checkout_biodata.bagian_instalasi); $('#no_ekstensien').val(checkout_biodata.no_ekstensien); $('#email').val(checkout_biodata.email); + $('#alamat').val(checkout_biodata.alamat); } function isiKonfirmasi() { @@ -196,6 +198,7 @@ function isiKonfirmasi() { bagian_instalasi: $('#bagian_instalasi').val(), no_ekstensien: $('#no_ekstensien').val(), email: $('#email').val(), + alamat: $('#alamat').val(), }; sessionStorage.setItem('checkout_biodata', JSON.stringify(biodata)); @@ -514,6 +517,12 @@ function validateStepOne() { alert('Silakan lengkapi data pasien.'); return false; } + }else if(selected === "Masyarakat Umum"){ + const alamat = document.getElementById('alamat').value; + if(!alamat){ + alert('Silahkan lengkapi alamat') + return false + } } return true; @@ -591,7 +600,9 @@ function initFlatpickrTersedia(item, i) { const totalMenitFlatSekarang = jamFlat * 60 + menitFlat; const menitBatasFlat = 13 * 60; + const lewatBatasNormal = totalMenitFlatSekarang >= menitBatasFlat; + // Ambil string tgl_tersedia dan ubah jadi array tanggal lengkap const dayNumbers = (item.tgl_tersedia || "") .split(',') @@ -599,6 +610,8 @@ function initFlatpickrTersedia(item, i) { .filter(s => s !== '' && !isNaN(s)) .map(s => parseInt(s)); + + // Generate tanggal dalam format YYYY-MM-DD untuk 3 bulan ke depan let availableDates = []; const bulanKeDepan = 3; @@ -611,13 +624,14 @@ function initFlatpickrTersedia(item, i) { dayNumbers.forEach(day => { const dayStr = String(day).padStart(2, '0'); const fullDateStr = `${year}-${month}-${dayStr}`; - const fullDate = new Date(`${fullDateStr}T00:00:00`); + const fullDate = new Date(`${fullDateStr}T23:00:00`); // Jika bukan menu someday, cek aturan H-1 dan jam batas if (item.apakah_someday) { availableDates.push(fullDateStr); } else { const selisihHari = Math.floor((fullDate - now) / (1000 * 60 * 60 * 24)); + if (selisihHari >= 1 || (selisihHari === 1 && !lewatBatasNormal)) { availableDates.push(fullDateStr); } diff --git a/public/js/dashboard/index.js b/public/js/dashboard/index.js index c5f9d12..61d0860 100644 --- a/public/js/dashboard/index.js +++ b/public/js/dashboard/index.js @@ -29,27 +29,6 @@ $("#filterDashboard").on('click', function(){ columns: "fas fa-th-large" }, columns: [ - { - title: "Action", - field:'order_id', - formatter: function(value, row) { - let buttons = '' - if(row?.status_order === "Lunas"){ - buttons += ` - - ` - } - - return ` -
- ${buttons} -
- `; - } - }, - { title: "No.Order", field: 'no_order', diff --git a/public/js/kalori/_init.js b/public/js/kalori/_init.js new file mode 100644 index 0000000..bb061a7 --- /dev/null +++ b/public/js/kalori/_init.js @@ -0,0 +1,6 @@ +const datatableKalori = $("#datatableKalori") + +const modalKalori = document.getElementById("modalKalori") +const formKalori = $("#formKalori") +const modalKaloriEdit = document.getElementById("modalKaloriEdit") +const formKaloriEdit = $("#formKaloriEdit") diff --git a/public/js/kalori/action.js b/public/js/kalori/action.js new file mode 100644 index 0000000..78db452 --- /dev/null +++ b/public/js/kalori/action.js @@ -0,0 +1,194 @@ +function addKalori(){ + new bootstrap.Modal(modalKalori).show(); + formKalori.attr('action', `/dashboard/karbohidrat`) +} + +formKalori.on('submit', function(e){ + e.preventDefault(); + + const form = this; + const actionUrl = formKalori.attr('action'); + const formData = new FormData(form); + + fetch(actionUrl, { + method: 'POST', + headers: { + 'X-CSRF-TOKEN': document.querySelector('input[name="_token"]').value, + }, + body: formData + }).then(async(res) => { + const responseData = await res.json(); + + if (res.status === 422) { + // Tampilkan semua error ke swal + const errors = responseData.errors || {}; + let htmlList = ''; + + Swal.fire({ + icon: 'error', + title: 'Validasi Gagal', + html: htmlList, + }); + + throw new Error(); // Supaya masuk ke catch, tapi tidak tampil swal lagi + } + + if (responseData.status) { + const handler = function () { + Swal.fire({ + icon: 'success', + title: 'Berhasil', + text: responseData.message || 'Berhasil melakukan aksi!', + timer: 2000, + showConfirmButton: false, + backdrop: true, + }); + $("#col_add_karbohidrat").html(''); + colCount = 0; // reset counter + formKalori[0].reset(); + datatableKarbohidrat.bootstrapTable('refresh'); + modalKalori.removeEventListener('hidden.bs.modal', handler); + }; + modalKalori.addEventListener('hidden.bs.modal', handler); + bootstrap.Modal.getInstance(modalKalori).hide(); + } else { + throw new Error(responseData.message || 'Terjadi kesalahan saat menyimpan data.'); + } + + }).catch(err => { + if (err.message) { + Swal.fire({ + icon: 'error', + title: 'Gagal', + text: err.message + }); + } + }); +}); + + +function deleteKalori(e){ + let id =$(e).data('karbohidrat_id') + Swal.fire({ + title: "Apakah kamu yakin ingin menghapus data ini?", + text : $(e).data('nama'), + icon: "warning", + showCancelButton: true, + backdrop: true, + }).then((result) => { + if(result.isConfirmed){ + fetch(`/dashboard/kalori/${id}`, { + method:'DELETE', + headers: { + "X-CSRF-TOKEN": document.querySelector('input[name="_token"]').value, + "Content-Type": "application/json" + } + }).then((response) => { + if(!response.ok){ + throw new Error("Network response was not ok"); + } + return response.json(); + }) + .then((data) => { + if(data.status){ + Swal.fire({ + title: "Success", + text: "Data berhasil dihapus", + icon:"success", + showConfirmButton: false, + timer: 1000 + }).then(() => { + datatableKalori.bootstrapTable("refresh") + }) + }else{ + Swal.fire({ + title: "Error!", + text: data.message || "Failed to delete Item.", + icon: "error" + }); + } + }) + .catch(error => { + Swal.fire({ + title: "Error!", + text: "Something went wrong. Please try again later.", + icon: "error" + }); + }); + } + }) +} + +function editKalori(e){ + const data = $(e).data(); + new bootstrap.Modal(modalKaloriEdit).show(); + formKaloriEdit.attr('action', `/dashboard/kalori/${data?.kalori_id}`) + $("#nilai_kalori_edit").val(data.nama) +} + +formKaloriEdit.on('submit', function(e){ + e.preventDefault(); + + const form = this; + const actionUrl = formKaloriEdit.attr('action'); + const formData = new FormData(form); + formData.append('_method', 'PUT') + fetch(actionUrl, { + method: 'POST', + headers: { + 'X-CSRF-TOKEN': document.querySelector('input[name="_token"]').value, + }, + body: formData + }).then(async(res) => { + const responseData = await res.json(); + + if (res.status === 422) { + // Tampilkan semua error ke swal + const errors = responseData.errors || {}; + Swal.fire({ + icon: 'error', + title: 'Validasi Gagal', + html: errors.nilai_kalori[0], + }); + + throw new Error(); // Supaya masuk ke catch, tapi tidak tampil swal lagi + } + + if (responseData.status) { + const handler = function () { + Swal.fire({ + icon: 'success', + title: 'Berhasil', + text: responseData.message || 'Berhasil melakukan aksi!', + timer: 2000, + showConfirmButton: false, + backdrop: true, + }); + $("#nama_kategori_diet").val(''); + colCount = 0; // reset counter + formKaloriEdit[0].reset(); + datatableKalori.bootstrapTable('refresh'); + modalKaloriEdit.removeEventListener('hidden.bs.modal', handler); + }; + modalKaloriEdit.addEventListener('hidden.bs.modal', handler); + bootstrap.Modal.getInstance(modalKaloriEdit).hide(); + } else { + throw new Error(responseData.message || 'Terjadi kesalahan saat menyimpan data.'); + } + + }).catch(err => { + if (err.message) { + Swal.fire({ + icon: 'error', + title: 'Gagal', + text: err.message + }); + } + }); +}); diff --git a/public/js/kalori/dt.js b/public/js/kalori/dt.js new file mode 100644 index 0000000..52aa0fd --- /dev/null +++ b/public/js/kalori/dt.js @@ -0,0 +1,51 @@ + + datatableKalori.bootstrapTable({ + url: "/dashboard/datatable/kalori", + showColumns: true, + showColumnsToggleAll: true, + showRefresh: true, + sortable: true, + search: true, + searchOnEnterKey: false, + searchHighlight: true, + pagination: true, + serverSide:true, + pageSize: 10, + pageList: [10, 20, 30], + cookie: true, + cookieIdTable: "datatableKalori", + icons: { + refresh: "fas fa-sync-alt", // atau ganti ke icon lain + columns: "fas fa-th-large" + }, + + columns: [ + { + title: "Action", + field: 'kalori_id', + formatter: function(value, row) { + let buttons = '' + buttons += ` + + ` + buttons += ` + + ` + return ` +
+ ${buttons} +
+ `; + }, + width: 120 + }, + { + title:"Nilai Kalori", + field:"nilai_kalori" + } + ], + }); diff --git a/public/js/kalori/function.js b/public/js/kalori/function.js new file mode 100644 index 0000000..6dbafbf --- /dev/null +++ b/public/js/kalori/function.js @@ -0,0 +1,29 @@ +let colCount = 1; +function addForm(){ + console.log('et'); + + let col = $("#col_add_Kalori") + + let html = ''; + + html += ` +
+
+ + +
+
+ + +
+ ` + col.append(html) + colCount++; + +} + + +function removeCol(count){ + $(`#col-${count}`).remove() +} + diff --git a/public/js/karbohidrat/function.js b/public/js/karbohidrat/function.js index 3c4bc02..935b57d 100644 --- a/public/js/karbohidrat/function.js +++ b/public/js/karbohidrat/function.js @@ -8,7 +8,7 @@ function addForm(){
- +
diff --git a/public/js/pekerjaan/_init.js b/public/js/pekerjaan/_init.js index e17ab65..48e92e2 100644 --- a/public/js/pekerjaan/_init.js +++ b/public/js/pekerjaan/_init.js @@ -1 +1,5 @@ const datatablePekerjaan = $("#datatablePekerjaan") + +const modalDetailOrder = document.getElementById('modalDetailOrder'); + +const modalActionOrder = document.getElementById('modalActionApproveOrder'); diff --git a/public/js/pekerjaan/action.js b/public/js/pekerjaan/action.js new file mode 100644 index 0000000..4bd7401 --- /dev/null +++ b/public/js/pekerjaan/action.js @@ -0,0 +1,108 @@ +function detailOrder(id){ + new bootstrap.Modal(modalDetailOrder).show(); + fetch(`/dashboard/pekerjaan/detail/${id}`) + .then(res => res.json()) + .then(res => { + const data = res.data; + document.getElementById('pesanan_container').innerHTML = ''; + document.getElementById('confirm_nama_pesanan').textContent = data?.order?.nama_pemesan; + let html = ''; + html += ` +
+
+
+
+ Foto Menu +
+
+

Nama Menu: ${data?.menu?.nama_menu || data?.paket_menu?.nama_menu}

+

Tanggal Antar: ${data?.tgl_antar || 0}

+

Jumlah: ${data?.jumlah || 0}

+

Harga Satuan: Rp ${parseInt(data?.harga_satuan || 0).toLocaleString('id-ID')}

+

Status Pesanan: + + ${data?.status_order} + +

+
+

Pemesan: ${data?.order?.nama_pemesan || '-'}

+

Jenis Kelamin: ${data?.order?.jenis_kelamin || '-'}

+

Jenis Customer: ${data?.order?.jenis_customer || '-'}

+ ${data?.order?.jenis_customer === "Masyarakat Umum" ? + `

Alamat: ${data?.order?.alamat || '-'}

+ ` : data?.order?.jenis_customer === "Karyawan RSAB Harapan Kita" ? ` +

Bagian /Instalasi: ${data?.order?.bagian_instalasi || '-'}

+

No Ekstensien: ${data?.order?.no_ekstensien || '-'}

+ ` :` +

Nama Pasien: ${data?.order?.nama_pasien || '-'}

+

Ruang Perawatan: ${data?.order?.ruang_perawatan || '-'}

+

Nomor Kamar Perawatan: ${data?.order?.no_kamar_perawatan || '-'}

+

Kelas Perawatan: ${data?.order?.kelas_perawatan || '-'}

+ ` + } +
+
+
+
+
+ + ` + + document.getElementById('pesanan_container').innerHTML = html; + + }) + .catch(error => { + console.error(error); + + }) +} + + +function approve(e){ + const data = $(e).data(); + new bootstrap.Modal(modalActionOrder).show(); + $("#confirmActionApproveOrder").text(data?.menu + ' (' + data?.type +')') + $("#confirmNoOrder").text(data?.no_order + ' (' + data?.nama_pemesan +')') + document.getElementById('formActionApproveOrder').setAttribute(`action`, `/dashboard/pending/update-detail-status/${data.id}`) +} + + +document.getElementById('formActionApproveOrder').addEventListener('submit', function (e) { + e.preventDefault(); + const form = this; + const actionUrl = form.getAttribute('action'); + fetch(actionUrl, { + method: 'POST', + headers: { + 'X-CSRF-TOKEN': document.querySelector('input[name="_token"]').value, + } + }).then(async (res) => { + const data = await res.json(); + if (res.status) { + const handler = function () { + Swal.fire({ + icon: 'success', + title: 'Berhasil', + text: 'Pesanan berhasil diselesaikan!', + timer: 2000, + showConfirmButton: false, + backdrop: true, + }); + datatablePekerjaan.bootstrapTable('refresh'); + modalActionOrder.removeEventListener('hidden.bs.modal', handler); // ✅ pakai DOM + }; + + modalActionOrder.addEventListener('hidden.bs.modal', handler); // ✅ pakai DOM + bootstrap.Modal.getInstance(modalActionOrder).hide(); // ✅ pakai instance + } else { + throw new Error(data.message || 'Terjadi kesalahan saat mengubah status.'); + } + }).catch(err => { + console.error(err); + Swal.fire({ + icon: 'error', + title: 'Gagal', + text: err.message || 'Terjadi kesalahan pada server.', + }); + }); +}); diff --git a/public/js/pekerjaan/dt.js b/public/js/pekerjaan/dt.js index b511b5b..12a77c8 100644 --- a/public/js/pekerjaan/dt.js +++ b/public/js/pekerjaan/dt.js @@ -1,6 +1,13 @@ - datatablePekerjaan.bootstrapTable({ - url: "/dashboard/datatable/selesai", + function initDt(selectDate = []){ + datatablePekerjaan.bootstrapTable('destroy'); + datatablePekerjaan.bootstrapTable({ + url: "/dashboard/datatable/pekerjaan", + method:'get', + queryParams: function(params) { + params.tanggal = selectDate; + return params; + }, showColumns: true, showColumnsToggleAll: true, showRefresh: true, @@ -25,14 +32,21 @@ field:'order_id', formatter: function(value, row) { let buttons = '' - if(row?.status_order === "Lunas"){ - buttons += ` - + + if(row?.status_order !== "Selesai"){ + buttons += ` + ` } + buttons += ` + + ` + return `
${buttons} @@ -43,97 +57,57 @@ { title: "No.Order", - field: 'no_order', + field: 'order.no_order', sortable: true, }, { - title: "Cara Pembayaran", - field: 'cara_pembayaran', - sortable: true, - }, - { - title: "Status Pembayaran", - field: 'status_order', + title: "Status", + field: 'order_detail_id', sortable: true, formatter: function(value, row) { - const status = value; + const status = row?.status_order; let badgeClass = 'bg-secondary'; - if (status === "Belum Bayar") { - badgeClass = 'bg-warning text-dark'; - } else if (status === "Menunggu Konfirmasi Pembayaran") { - badgeClass = 'bg-primary'; - } else if (status === "Lunas" || status === "Sudah Bayar") { + if (status === "Selesai") { badgeClass = 'bg-success text-dark'; - } else if(status === "Dibatalkan"){ - badgeClass = 'bg-danger'; + } else{ + badgeClass = 'bg-primary'; } return ` ${status} - ${status === 'Dibatalkan' && row.note_dibatalkan ? ` -
- ${row.note_dibatalkan} -
- ` : ''} `; - } + }, }, { - title: "Status Pesanan", - formatter: function(value, row) { - const progress = parseInt(row.progress) || 0; - const total = row.total_detail || 0; - const selesai = row.selesai_detail || 0; - - return ` -
-
-
- ${progress}% -
-
- ${selesai} / ${total} selesai -
- `; - }, + title: "Menu", + field: 'order_detail_id', + formatter:function(value, row){ + return row?.menu?.nama_menu || row?.paket_menu?.nama_paket + }, sortable: true, }, { title: "Pemesan", - field:'nama_pemesan', - sortable: true, - }, - { - title: "Tgl Pemesanan", - field: 'entry_at', - formatter: function(value, row) { - if (!row?.entry_at) return '-'; - - const date = new Date(row.entry_at); - return date.toLocaleString('id-ID', { - day: '2-digit', - month: 'short', // Bisa diganti 'long' kalau mau 'Juli' bukan 'Jul' - year: 'numeric', - hour: '2-digit', - minute: '2-digit', - hour12: false // pakai format 24 jam - }); - }, - sortable: true, - }, - { - title: "Kategori Customer", - field: 'jenis_customer', - sortable: true, - }, - { - title: "Total Harga Pesanan", - field:'total_harga', + field:'order.nama_pemesan', formatter: function(value, row){ - return 'Rp ' + parseInt(row.total_harga).toLocaleString('id-ID') - } - } + return `` + }, + sortable: true, + }, + { + title: "Tgl Antar", + field: 'tgl_antar', + }, + { + title: "Waktu Pemesanan", + field: 'type', + sortable: true, + }, ], }); + } + + diff --git a/public/js/pesanan_pending/dt.js b/public/js/pesanan_pending/dt.js index c44318d..181c77a 100644 --- a/public/js/pesanan_pending/dt.js +++ b/public/js/pesanan_pending/dt.js @@ -1,5 +1,5 @@ - datatablePending.bootstrapTable({ + datatablePending.bootstrapTable({ url: "/dashboard/datatable/pending", showColumns: true, showColumnsToggleAll: true, diff --git a/resources/views/dashboard/kalori/index.blade.php b/resources/views/dashboard/kalori/index.blade.php new file mode 100644 index 0000000..eda575b --- /dev/null +++ b/resources/views/dashboard/kalori/index.blade.php @@ -0,0 +1,30 @@ +@extends('dashboard.layouts.main') + +@section('body_main') +
+ +

+ Dashboard / Master Kalori +

+ + +
+
+
Kalori
+ +
+
+
+
+
+
+ @include('dashboard.kalori.modal.create') + @include('dashboard.kalori.modal.edit') + + + + + +@endsection diff --git a/resources/views/dashboard/kalori/modal/create.blade.php b/resources/views/dashboard/kalori/modal/create.blade.php new file mode 100644 index 0000000..ebbf63f --- /dev/null +++ b/resources/views/dashboard/kalori/modal/create.blade.php @@ -0,0 +1,41 @@ + + diff --git a/resources/views/dashboard/kalori/modal/edit.blade.php b/resources/views/dashboard/kalori/modal/edit.blade.php new file mode 100644 index 0000000..1f35a0d --- /dev/null +++ b/resources/views/dashboard/kalori/modal/edit.blade.php @@ -0,0 +1,40 @@ + + diff --git a/resources/views/dashboard/layouts/main.blade.php b/resources/views/dashboard/layouts/main.blade.php index 9071c6a..f5660b3 100644 --- a/resources/views/dashboard/layouts/main.blade.php +++ b/resources/views/dashboard/layouts/main.blade.php @@ -42,7 +42,8 @@ - + {{-- flatcpicker css --}} + @@ -72,6 +73,8 @@ referrerpolicy="no-referrer" /> + {{-- flatcpicker --}} + diff --git a/resources/views/dashboard/master/menu/modal/add.blade.php b/resources/views/dashboard/master/menu/modal/add.blade.php index 74f4b05..3a45bc0 100644 --- a/resources/views/dashboard/master/menu/modal/add.blade.php +++ b/resources/views/dashboard/master/menu/modal/add.blade.php @@ -30,21 +30,21 @@
-
+
-
+
-
+
diff --git a/resources/views/dashboard/partials/sidenav.blade.php b/resources/views/dashboard/partials/sidenav.blade.php index dcb99d7..baf6754 100644 --- a/resources/views/dashboard/partials/sidenav.blade.php +++ b/resources/views/dashboard/partials/sidenav.blade.php @@ -34,6 +34,12 @@
Klasifikasi Menu
+