Created At: 2026-06-14T13:52:30Z
Completed At: 2026-06-14T13:52:30Z
File Path: `file:///c:/Users/HP/Downloads/climate-system/climate-system/index.php`
Total Lines: 4581
Total Bytes: 193572
Showing lines 3840 to 3920
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.
3840:           document.getElementById('futureImageClimateStripe').src = PLACEHOLDER_IMG;
3841:           document.getElementById('futureVariableTextStripe').innerText = "Variabel: " + variable;
3842:           document.getElementById('futurePeriodTextStripe').innerText = "Skenario: " + scenario + " (Data tidak ditemukan)";
3843:         }
3844:       } catch (err) {
3845:         console.error(err);
3846:         alert('Gagal memuat data stripe proyeksi.');
3847:       }
3848:     }
3849: 
3850:     async function applyFutureTSFilter() {
3851:       const lokasi = document.getElementById('futureLocationTS').value;
3852:       const variable = document.getElementById('futureVariableTS').value;
3853:       const period = document.getElementById('futurePeriodMap').value;
3854:       const statistic = document.getElementById('futureStatisticTS').value;
3855:       const startYear = document.getElementById('futureStartYearTS').value;
3856:       const endYear = document.getElementById('futureEndYearTS').value;
3857: 
3858:       if (!lokasi || !variable) {
3859:         alert('Silakan pilih lokasi dan variabel terlebih dahulu.');
3860:         return;
3861:       }
3862: 
3863:       let loadedCSV = false;
3864: 
3865:       try {
3866:         // 1. Fetch metadata and check if there is custom CSV data stored in the database
3867:         const res = await fetch(`?action=get_future&location=${encodeURIComponent(lokasi)}&variable=${encodeURIComponent(variable)}&period=${encodeURIComponent(period)}`);
3868:         const result = await res.json();
3869: 
3870:         
<truncated 994 bytes>
e;
3882:             }
3883:           } catch (err) {
3884:             console.error("Kesalahan AJAX CSV:", err);
3885:           }
3886: 
3887:           // Fallback to default simulation if split CSV files also failed to load
3888:           if (!loadedCSV) {
3889:             if (result.success && result.data) {
3890:               renderFutureClimateChart(variable, result.data, period);
3891:             } else {
3892:               renderFutureClimateChart(variable, null, period);
3893:             }
3894:           }
3895:         }
3896:       } catch (err) {
3897:         console.error(err);
3898:         // Fallback to default simulation
3899:         renderFutureClimateChart(variable, null, period);
3900:       }
3901: 
3902:       // Future Time Series metadata
3903:       document.getElementById('futureCategoryTitleTimeSeries').innerText = "Future Time Series Graph";
3904:       document.getElementById('futureVariableTextTS').innerText = "Variabel: " + variable;
3905:       document.getElementById('futurePeriodTextTS').innerText = "Rentang Tahun: " + startYear + " - " + endYear;
3906:     }
3907: 
3908:     async function loadFutureMapSettingsData() {
3909:       const lokasi = document.getElementById('futureSetLocationMap').value.trim();
3910:       const variable = document.getElementById('futureSetVariableMap').value.trim();
3911:       const period = document.getElementById('futureSetPeriodMap').value.trim();
3912: 
3913:       if (!lokasi || !variable || !period) return;
3914: 
3915:       try {
3916:         const res = await fetch(`?action=get_future&location=${encodeURIComponent(lokasi)}&variable=${encodeURIComponent(variable)}&period=${encodeURIComponent(period)}`);
3917:         const result = await res.json();
3918: 
3919:         if (result.success && result.data) {
3920:           const d = result.data;
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.
