Created At: 2026-06-14T16:21:24Z
Completed At: 2026-06-14T16:21:25Z
File Path: `file:///c:/Users/HP/Downloads/climate-system/climate-system/index.php`
Total Lines: 4039
Total Bytes: 171733
Showing lines 3530 to 3590
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.
3530: 
3531:       if (!lokasi || !variable || !period) {
3532:         alert('Silakan pilih lokasi, variabel, dan periode terlebih dahulu.');
3533:         return;
3534:       }
3535: 
3536:       document.getElementById('futureDataInfo').innerHTML =
3537:         'Lokasi: ' + lokasi + '<br>' +
3538:         'Variable: ' + variable + '<br>' +
3539:         'Period: ' + period + '<br>' +
3540:         'Kategori: Proyeksi Perubahan Iklim';
3541: 
3542:       // A. Muat data CSV secara asinkron berdasarkan filter lokasi, variabel, statistik, tahun awal, tahun akhir
3543:       let loadedCSV = false;
3544:       try {
3545:         const csvRes = await fetch(`?action=get_future_csv&location=${encodeURIComponent(lokasi)}&variable=${encodeURIComponent(variable)}&statistic=${encodeURIComponent(statistic)}&start_year=${encodeURIComponent(startYear)}&end_year=${encodeURIComponent(endYear)}`);
3546:         const csvResult = await csvRes.json();
3547:         if (csvResult.success && csvResult.mean && csvResult.mean.length > 0) {
3548:           renderFutureCSVChart(csvResult, variable, statistic, startYear, endYear);
3549:           loadedCSV = true;
3550:         } else if (csvResult.error) {
3551:           console.warn("Gagal memuat data CSV:", csvResult.error);
3552:         }
3553:       } catch (err) {
3554:         console.error("Kesalahan AJAX CSV:", err);
3555:       }
3556: 
3557:       // B. Jika CSV gagal dimuat, fallback ke grafik interaktif simulasi bawaan DB
3558:       if (!loadedCSV) {
3559:         renderFutureClimateChart(variable, null, period);
3560: 
<truncated 414 bytes>
ription').innerText = savedData.description || '';
3569:           
3570:           // Re-render grafik interaktif dengan parameter kustom dari DB jika ada
3571:           renderFutureClimateChart(variable, savedData, period);
3572: 
3573:           // Climate Change Map
3574:           document.getElementById('futureImageClimateMap').src = savedData.imageClimateMap ? normalizeImageUrl(savedData.imageClimateMap) : PLACEHOLDER_IMG;
3575:           document.getElementById('futureImageClimateMap2').src = savedData.imageClimateMap2 ? normalizeImageUrl(savedData.imageClimateMap2) : PLACEHOLDER_IMG;
3576:           switchClimateMap(1); // Reset slider to show Map 1 first
3577:           document.getElementById('futureCategoryTitleMap').innerText = "Climate Change Map";
3578:           document.getElementById('futureVariableText').innerText = "Variabel: " + variable;
3579:           document.getElementById('futurePeriodText').innerText = "Periode: " + period;
3580: 
3581:           // Future Time Series metadata
3582:           document.getElementById('futureCategoryTitleTimeSeries').innerText = "Future Time Series Graph";
3583:           document.getElementById('futureVariableTextTS').innerText = "Variabel: " + variable;
3584:           document.getElementById('futurePeriodTextTS').innerText = "Periode: " + period;
3585: 
3586:           // Future Climate Stripe
3587:           document.getElementById('futureImageClimateStripe').src = savedData.imageClimateStripe ? normalizeImageUrl(savedData.imageClimateStripe) : PLACEHOLDER_IMG;
3588:           document.getElementById('futureCategoryTitleStripe').innerText = "Future Climate Stripe";
3589:           document.getElementById('futureVariableTextStripe').innerText = "Variabel: " + variable;
3590:           document.getElementById('futurePeriodTextStripe').innerText = "Periode: " + period;
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.
