Created At: 2026-06-14T15:56:10Z
Completed At: 2026-06-14T15:56:10Z
File Path: `file:///c:/Users/HP/Downloads/climate-system/climate-system/index.php`
Total Lines: 3856
Total Bytes: 159351
Showing lines 3450 to 3490
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.
3450:           console.warn("Gagal memuat data CSV:", csvResult.error);
3451:         }
3452:       } catch (err) {
3453:         console.error("Kesalahan AJAX CSV:", err);
3454:       }
3455: 
3456:       // B. Jika CSV gagal dimuat, fallback ke grafik interaktif simulasi bawaan DB
3457:       if (!loadedCSV) {
3458:         renderFutureClimateChart(variable, null, period);
3459:       }
3460: 
3461:       try {
3462:         const res = await fetch(`?action=get_future&location=${encodeURIComponent(lokasi)}&variable=${encodeURIComponent(variable)}&period=${encodeURIComponent(period)}`);
3463:         const result = await res.json();
3464: 
3465:         if (result.success && result.data) {
3466:           const savedData = result.data;
3467:           document.getElementById('futureDescription').innerText = savedData.description || '';
3468:           
3469:           // Re-render grafik interaktif dengan parameter kustom dari DB jika ada
3470:           renderFutureClimateChart(variable, savedData, period);
3471: 
3472:           // Climate Change Map
3473:           document.getElementById('futureImageClimateMap').src = savedData.imageClimateMap ? normalizeImageUrl(savedData.imageClimateMap) : PLACEHOLDER_IMG;
3474:           document.getElementById('futureImageClimateMap2').src = savedData.imageClimateMap2 ? normalizeImageUrl(savedData.imageClimateMap2) : PLACEHOLDER_IMG;
3475:           switchClimateMap(1); // Reset slider to show Map 1 first
3476:           document.getElementById('futureCategoryTitleMap').innerText = "Climate Change Map";
3477:           document.getElementById('futureVariableText').innerText = "Variabel: " + variable;
3478:           document.getElementById('futurePeriodText').innerText = "Periode: " + period;
3479: 
3480:           // Future Time Series metadata
3481:           document.getElementById('futureCategoryTitleTimeSeries').innerText = "Future Time Series Graph";
3482:           document.getElementById('futureVariableTextTS').innerText = "Variabel: " + variable;
3483:           document.getElementById('futurePeriodTextTS').innerText = "Periode: " + period;
3484: 
3485:           // Future Climate Stripe
3486:           document.getElementById('futureImageClimateStripe').src = savedData.imageClimateStripe ? normalizeImageUrl(savedData.imageClimateStripe) : PLACEHOLDER_IMG;
3487:           document.getElementById('futureCategoryTitleStripe').innerText = "Future Climate Stripe";
3488:           document.getElementById('futureVariableTextStripe').innerText = "Variabel: " + variable;
3489:           document.getElementById('futurePeriodTextStripe').innerText = "Periode: " + period;
3490: 
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.
