added pengguna,kurir page, with socket.io,need to switch this to node.js first

This commit is contained in:
kicap1992
2025-05-16 11:43:38 +08:00
parent 5329fb8265
commit 0ba4e846dc
1095 changed files with 12336 additions and 35 deletions

View File

@ -25,6 +25,9 @@
<link rel="stylesheet" href="/fonts/material-design-iconic-font/css/material-design-iconic-font.min.css">
<link rel="stylesheet" href="/fonts/material-design/css/materialdesignicons.css">
<!-- Toastr -->
<link rel="stylesheet" href="/plugin/toastr/toastr.css">
</head>
<body>
@ -214,8 +217,35 @@
<!-- Full Screen Plugin -->
<script src="/plugin/fullscreen/jquery.fullscreen-min.js"></script>
<!-- Toastr -->
<script src="/plugin/toastr/toastr.min.js"></script>
<script src="/scripts/main.min.js"></script>
<script src="/my-js.js"></script>
<script src="/socketnya/client-dist/socket.io.js"></script>
<script>
const socket = io(); // Connects to your server
// function sendScanDia() {
// const data = "Hello from client!";
// socket.emit('scan_dia', data);
// console.log('scan_dia sent:', data);
// }
// sendScanDia();
socket.on('connect', () => {
console.log('Connected to server:', socket.id);
});
socket.on('pengiriman_baru1', (data) => {
console.log('Received scan_dia event:', "data");
toastr.info("Ada Pengiriman Baru Terdaftar");
// console.log('Received scan_dia event:', data);
// Do something with the received data
});
</script>
</body>
</html>

View File

@ -116,9 +116,13 @@
<button type="button" class="btn btn-sm btn-info btn-rounded waves-effect waves-light"
onclick="addKurirOpenModal()">Pendaftaran Kurir Baru</button>
</div>
<table id="tb-kurir" class="table table-striped table-bordered display" style="width:100%">
<div class="form-group" style="overflow-x: auto;">
<table id="tb-kurir" class="table table-striped table-bordered display"
style="width:100%">
</table>
</div>
</table>
</div>
</div>
@ -253,7 +257,8 @@
// destroy table
// $('#tb-kurir').DataTable().destroy();
$('#tb-kurir').DataTable({
responsive: true,
// responsive: true,
scrollX: true,
// order: [
// [0, 'asc']
// ],
@ -282,6 +287,13 @@
return data
}
},
{
"mData": "status",
"title": "Status",
"render": function (data, type, row) {
return data == null || data == "" || data == undefined ? "Tersedia" : data
}
},
{
"mData": null,
"title": "Aksi",
@ -443,7 +455,7 @@
$("#btn-update-kurir").hide()
$('#modal-kurir').modal('show')
var img = document.createElement('img');
img.src = 'kurir/gambar/' + data.no_telpon + '/'+ data.gambar_kurir;
img.src = 'kurir/gambar/' + data.no_telpon + '/' + data.gambar_kurir;
img.style.maxWidth = '100%'; // Make the image fit the width of the div
img.style.maxHeight = '100%'; // Make the image fit the height of the div
@ -457,7 +469,7 @@
previewDiv.appendChild(img);
var img = document.createElement('img');
img.src = 'kurir/gambar/' + data.no_telpon + '/'+ data.gambar_motor;
img.src = 'kurir/gambar/' + data.no_telpon + '/' + data.gambar_motor;
img.style.maxWidth = '100%'; // Make the image fit the width of the div
img.style.maxHeight = '100%'; // Make the image fit the height of the div