change on:off to ON:OFF from dashboard welcome
This commit is contained in:
parent
1253e2c26e
commit
435f85e66b
|
@ -6,6 +6,12 @@
|
||||||
<title>Report Data</title>
|
<title>Report Data</title>
|
||||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css">
|
||||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||||
|
<style>
|
||||||
|
/* CSS untuk memastikan tabel responsif */
|
||||||
|
.table-responsive {
|
||||||
|
overflow-x: auto;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
|
|
||||||
|
@ -31,6 +37,7 @@
|
||||||
@endphp
|
@endphp
|
||||||
|
|
||||||
@if($paginatedReports->count() > 0)
|
@if($paginatedReports->count() > 0)
|
||||||
|
<div class="table-responsive">
|
||||||
<table class="table table-bordered">
|
<table class="table table-bordered">
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -45,7 +52,12 @@
|
||||||
@foreach($paginatedReports as $key => $report)
|
@foreach($paginatedReports as $key => $report)
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{ $paginatedReports->firstItem() + $key }}</td>
|
<td>{{ $paginatedReports->firstItem() + $key }}</td>
|
||||||
<td>{{ \Carbon\Carbon::parse($report['timestamp'])->format('d-m-Y H:i:s') }}</td>
|
<td>
|
||||||
|
<!-- Format tanggal sesuai dengan pop-up -->
|
||||||
|
<script>
|
||||||
|
document.write(new Date("{{ $report['timestamp'] }}").toLocaleString());
|
||||||
|
</script>
|
||||||
|
</td>
|
||||||
<td>
|
<td>
|
||||||
@if($loop->first)
|
@if($loop->first)
|
||||||
Gerakan
|
Gerakan
|
||||||
|
@ -85,6 +97,7 @@
|
||||||
@endforeach
|
@endforeach
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
</div>
|
||||||
|
|
||||||
<!-- PAGINATION -->
|
<!-- PAGINATION -->
|
||||||
<div class="d-flex justify-content-center">
|
<div class="d-flex justify-content-center">
|
||||||
|
@ -115,8 +128,11 @@
|
||||||
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function showDetail(report) {
|
function showDetail(report) {
|
||||||
|
// Format tanggal sesuai dengan locale browser
|
||||||
|
let formattedDate = new Date(report.timestamp).toLocaleString();
|
||||||
|
|
||||||
let detailHtml = `
|
let detailHtml = `
|
||||||
<strong>Tanggal:</strong> ${new Date(report.timestamp).toLocaleString()}<br>
|
<strong>Tanggal waktu:</strong> ${formattedDate}<br>
|
||||||
<strong>Gerakan:</strong> ${report.security.motion}<br>
|
<strong>Gerakan:</strong> ${report.security.motion}<br>
|
||||||
<strong>Status Keamanan:</strong> ${report.security.status}<br>
|
<strong>Status Keamanan:</strong> ${report.security.status}<br>
|
||||||
<strong>Akses Terakhir:</strong> ${report.smartcab.last_access}<br>
|
<strong>Akses Terakhir:</strong> ${report.smartcab.last_access}<br>
|
||||||
|
|
|
@ -402,7 +402,7 @@ function toggleSecurity(checkbox) {
|
||||||
console.log('Toggle security called with state:', checkbox.checked);
|
console.log('Toggle security called with state:', checkbox.checked);
|
||||||
|
|
||||||
const securityRef = database.ref('security/status');
|
const securityRef = database.ref('security/status');
|
||||||
const newStatus = checkbox.checked ? 'on' : 'off';
|
const newStatus = checkbox.checked ? 'ON' : 'OFF';
|
||||||
|
|
||||||
checkbox.disabled = true;
|
checkbox.disabled = true;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue