Created At: 2026-06-14T15:51:54Z
Completed At: 2026-06-14T15:51:54Z
File Path: `file:///c:/Users/HP/Downloads/climate-system/climate-system/index.php`
Total Lines: 4761
Total Bytes: 203898
Showing lines 2530 to 2570
The following code has been modified to include a line number before every line, in the format: <line_number>: <original_line>. Please note that any changes targeting the original code should remove the line number, colon, and leading space.
2530:       
2531:       if (prevVal && items.includes(prevVal)) {
2532:         select.value = prevVal;
2533:       }
2534:     }
2535: 
2536:     // Pemanggilan AJAX ke PHP untuk filter Historical Climate
2537:     async function applyHistoricalFilter() {
2538:       const lokasi = document.getElementById('historicalLocation').value;
2539:       const variable = document.getElementById('historicalVariable').value;
2540:       
2541:       if (!lokasi || !variable) {
2542:         alert('Silakan pilih lokasi dan variabel terlebih dahulu.');
2543:         return;
2544:       }
2545: 
2546:       document.getElementById('historicalDataInfo').innerHTML =
2547:         'Lokasi: ' + lokasi + '<br>' +
2548:         'Variable: ' + variable + '<br>' +
2549:         'Kategori: Rata-rata Klimatologi';
2550: 
2551:       try {
2552:         const res = await fetch(`?action=get_historical&location=${encodeURIComponent(lokasi)}&variable=${encodeURIComponent(variable)}`);
2553:         const result = await res.json();
2554: 
2555:         if (result.success && result.data) {
2556:           const savedData = result.data;
2557:           document.getElementById('historicalDescription').innerText = savedData.description || '';
2558: 
2559:           // Annual Map
2560:           document.getElementById('historicalImageAnnual').src = savedData.imageAnnual ? normalizeImageUrl(savedData.imageAnnual) : PLACEHOLDER_IMG;
2561:           // Trend Map
2562:           document.getElementById('historicalImageTrend').src = savedData.imageTrend ? normalizeImageUrl(savedData.imageTrend) : PLACEHOLDER_IMG;
2563:           // Time Series Graph
2564:           document.getElementById('historicalImageTimeSeries').src = savedData.imageTimeSeries ? normalizeImageUrl(savedData.imageTimeSeries) : PLACEHOLDER_IMG;
2565:           // Monthly Map
2566:           document.getElementById('historicalImageMonthlyMap').src = savedData.imageMonthlyMap ? normalizeImageUrl(savedData.imageMonthlyMap) : PLACEHOLDER_IMG;
2567:           // Monthly Graph
2568:           document.getElementById('historicalImageMonthlyGraph').src = savedData.imageMonthlyGraph ? normalizeImageUrl(savedData.imageMonthlyGraph) : PLACEHOLDER_IMG;
2569: 
2570:           alert('Data climate berhasil dimuat dari database!');
The above content does NOT show the entire file contents. If you need to view any lines of the file which were not shown to complete your task, call this tool again to view those lines.
