Created At: 2026-06-14T15:56:04Z
Completed At: 2026-06-14T15:56:04Z
File Path: `file:///c:/Users/HP/Downloads/climate-system/climate-system/index.php`
Total Lines: 3856
Total Bytes: 159351
Showing lines 3520 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.
3520:       const imageClimateMap2 = normalizeImageUrl(document.getElementById('futureSetImageClimateMap2').value.trim());
3521:       const imageTimeSeries = normalizeImageUrl(document.getElementById('futureSetImageTimeSeries').value.trim());
3522:       const imageClimateStripe = normalizeImageUrl(document.getElementById('futureSetImageClimateStripe').value.trim());
3523: 
3524:       const graphBaseValue = document.getElementById('futureSetGraphBaseValue').value.trim();
3525:       const graphUncertainty = document.getElementById('futureSetGraphUncertainty').value.trim();
3526:       const graphSSP1Slope = document.getElementById('futureSetGraphSSP1Slope').value.trim();
3527:       const graphSSP2Slope = document.getElementById('futureSetGraphSSP2Slope').value.trim();
3528:       const graphSSP3Slope = document.getElementById('futureSetGraphSSP3Slope').value.trim();
3529:       const graphSSP5Slope = document.getElementById('futureSetGraphSSP5Slope').value.trim();
3530:       const csvData = document.getElementById('futureSetCsvData').value.trim();
3531: 
3532:       if (!lokasi || !variable || !period) {
3533:         alert('Lokasi, Variable, dan Periode wajib diisi!');
3534:         return;
3535:       }
3536: 
3537:       const data = {
3538:         location: lokasi,
3539:         variable: variable,
3540:         period: period,
3541:         description: description,
3542:         imageClimateMap: imageClimateMap,
3543:         imageClimateMap2: imageClimateMap2,
3544:         imageTimeSeries: imageTimeSeries,
3545:         imageClimateStripe: imageClimat
<truncated 246 bytes>
seFloat(graphSSP1Slope) : '',
3549:         graphSSP2Slope: graphSSP2Slope !== '' ? parseFloat(graphSSP2Slope) : '',
3550:         graphSSP3Slope: graphSSP3Slope !== '' ? parseFloat(graphSSP3Slope) : '',
3551:         graphSSP5Slope: graphSSP5Slope !== '' ? parseFloat(graphSSP5Slope) : '',
3552:         csvData: csvData
3553:       };
3554: 
3555:       try {
3556:         const res = await fetch('?action=save_future', {
3557:           method: 'POST',
3558:           headers: {
3559:             'Content-Type': 'application/json'
3560:           },
3561:           body: JSON.stringify(data)
3562:         });
3563:         const result = await res.json();
3564: 
3565:         if (result.success) {
3566:           alert('Data future berhasil disimpan ke database SQLite!');
3567:           // Clear CSV input and indicators
3568:           const csvFileEl = document.getElementById('futureSetCsvFile');
3569:           if (csvFileEl) csvFileEl.value = '';
3570:           const csvDataEl = document.getElementById('futureSetCsvData');
3571:           if (csvDataEl) csvDataEl.value = '';
3572:           const csvIndicatorEl = document.getElementById('csvStatusIndicator');
3573:           if (csvIndicatorEl) csvIndicatorEl.innerText = '';
3574: 
3575:           // Segera perbarui dropdown list filter
3576:           await loadFilters();
3577:         } else {
3578:           alert('Gagal menyimpan: ' + (result.error || result.message));
3579:         }
3580:       } catch (err) {
3581:         console.error(err);
3582:         alert('Gagal mengirim data penyimpanan ke server.');
3583:       }
3584:     }
3585: 
3586:     // Tambah Lokasi Master
3587:     async function addMasterLocation() {
3588:       const nameInput = document.getElementById('masterLocationName');
3589:       const name = nameInput.value.trim();
3590:       if (!name) {
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.
