Created At: 2026-06-14T14:01:23Z
Completed At: 2026-06-14T14:01:23Z
File Path: `file:///c:/Users/HP/Downloads/climate-system/climate-system/index.php`
Total Lines: 4592
Total Bytes: 194080
Showing lines 3990 to 4040
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.
3990:         console.error(err);
3991:         alert('Gagal mengirim data penyimpanan ke server.');
3992:       }
3993:     }
3994: 
3995:     async function loadFutureGraphSettingsData() {
3996:       const lokasi = document.getElementById('futureSetLocationGraph').value.trim();
3997:       const variable = document.getElementById('futureSetVariableGraph').value.trim();
3998: 
3999:       if (!lokasi || !variable) return;
4000: 
4001:       try {
4002:         const res = await fetch(`?action=get_future&location=${encodeURIComponent(lokasi)}&variable=${encodeURIComponent(variable)}`);
4003:         const result = await res.json();
4004: 
4005:         if (result.success && result.data) {
4006:           const d = result.data;
4007:           document.getElementById('futureSetGraphBaseValue').value = d.graphBaseValue !== null ? d.graphBaseValue : '';
4008:           document.getElementById('futureSetGraphUncertainty').value = d.graphUncertainty !== null ? d.graphUncertainty : '';
4009:           document.getElementById('futureSetGraphSSP1Slope').value = d.graphSSP1Slope !== null ? d.graphSSP1Slope : '';
4010:           document.getElementById('futureSetGraphSSP2Slope').value = d.graphSSP2Slope !== null ? d.graphSSP2Slope : '';
4011:           document.getElementById('futureSetGraphSSP3Slope').value = d.graphSSP3Slope !== null ? d.graphSSP3Slope : '';
4012:           document.getElementById('futureSetGraphSSP5Slope').value = d.graphSSP5Slope !== null ? d.graphSSP5Slope : '';
4013:           
4014:           const csvDataVal = d.csvData || '';
4015:           document.getElementById('futureSetCsvData').value = csvDataVal;
4016: 
4017:           const indicator = document.getElementById('csvStatusIndicator');
4018:           if (indicator) {
4019:             if (csvDataVal !== '') {
4020:               try {
4021:                 const rows = JSON.parse(csvDataVal);
4022:                 const years = rows.map(r => r.year).filter(y => !isNaN(y));
4023:                 const minYear = Math.min(...years);
4024:                 const maxYear = Math.max(...years);
4025:                 indicator.innerText = `CSV Terdeteksi di DB: ${rows.length} baris data (${minYear} - ${maxYear}).`;
4026:                 indicator.style.color = '#16a34a';
4027:               } catch (e) {
4028:                 indicator.innerText = 'CSV Terdeteksi (format error)';
4029:                 indicator.style.color = '#dc2626';
4030:               }
4031:             } else {
4032:               indicator.innerText = '';
4033:             }
4034:           }
4035:         } else {
4036:           // Clear inputs if no data exists
4037:           document.getElementById('futureSetGraphBaseValue').value = '';
4038:           document.getElementById('futureSetGraphUncertainty').value = '';
4039:           document.getElementById('futureSetGraphSSP1Slope').value = '';
4040:           document.getElementById('futureSetGraphSSP2Slope').value = '';
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.
