Merge branch 'staging' of https://git.putrakuningan.com/daengdeni/lpj into tender
This commit is contained in:
@@ -68,13 +68,10 @@ class BankDataController extends Controller
|
|||||||
'harga_penawaran' => $dataPembanding->harga_penawaran,
|
'harga_penawaran' => $dataPembanding->harga_penawaran,
|
||||||
];
|
];
|
||||||
|
|
||||||
$data['kordinat_lat'] = $lat;
|
|
||||||
$data['kordinat_lng'] = $lng;
|
|
||||||
|
|
||||||
BankData::updateOrCreate(
|
BankData::updateOrCreate(
|
||||||
[
|
[
|
||||||
'kordinat_lat' => $data['kordinat_lat'],
|
'kordinat_lat' => $lat,
|
||||||
'kordinat_lng' => $data['kordinat_lng']
|
'kordinat_lng' => $lng
|
||||||
],
|
],
|
||||||
$data
|
$data
|
||||||
);
|
);
|
||||||
@@ -222,6 +219,10 @@ class BankDataController extends Controller
|
|||||||
// Calculate the current page number
|
// Calculate the current page number
|
||||||
$currentPage = $request->get('page', 1);
|
$currentPage = $request->get('page', 1);
|
||||||
|
|
||||||
|
// Ensure current page doesn't exceed page count
|
||||||
|
$currentPage = min($currentPage, $pageCount);
|
||||||
|
|
||||||
|
|
||||||
// Return the response data as a JSON object
|
// Return the response data as a JSON object
|
||||||
return response()->json([
|
return response()->json([
|
||||||
'draw' => $request->get('draw'),
|
'draw' => $request->get('draw'),
|
||||||
|
|||||||
@@ -492,6 +492,7 @@
|
|||||||
dataTable.on('draw', () => {
|
dataTable.on('draw', () => {
|
||||||
const data = dataTable._data;
|
const data = dataTable._data;
|
||||||
updateMapMarkers(data);
|
updateMapMarkers(data);
|
||||||
|
updatePagination(data);
|
||||||
})
|
})
|
||||||
// Custom search functionality
|
// Custom search functionality
|
||||||
searchInput.addEventListener('input', function () {
|
searchInput.addEventListener('input', function () {
|
||||||
@@ -515,6 +516,20 @@
|
|||||||
dataTable.reload();
|
dataTable.reload();
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function updatePagination(response) {
|
||||||
|
const paginationInfo = document.querySelector('[data-datatable-info="true"]');
|
||||||
|
|
||||||
|
if (paginationInfo) {
|
||||||
|
if (response.recordsFiltered > 0) {
|
||||||
|
const start = (response.page - 1) * response.pageSize + 1;
|
||||||
|
const end = Math.min(start + response.pageSize - 1, response.recordsFiltered);
|
||||||
|
paginationInfo.textContent = `Showing ${start} to ${end} of ${response.recordsFiltered} entries`;
|
||||||
|
} else {
|
||||||
|
paginationInfo.textContent = 'No entries to show';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function initializeEverything() {
|
function initializeEverything() {
|
||||||
initMap();
|
initMap();
|
||||||
initializeDataTable();
|
initializeDataTable();
|
||||||
|
|||||||
Reference in New Issue
Block a user