Created At: 2026-06-14T15:00:56Z
Completed At: 2026-06-14T15:00:56Z
File Path: `file:///c:/Users/HP/Downloads/climate-system/climate-system/index.php`
Total Lines: 4628
Total Bytes: 195635
Showing lines 3955 to 4015
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.
3955:     async function loadFutureMapSettingsData() {
3956:       const lokasi = document.getElementById('futureSetLocationMap').value.trim();
3957:       const variable = document.getElementById('futureSetVariableMap').value.trim();
3958:       const period = document.getElementById('futureSetPeriodMap').value.trim();
3959: 
3960:       if (!lokasi || !variable || !period) return;
3961: 
3962:       try {
3963:         const res = await fetch(`?action=get_future&location=${encodeURIComponent(lokasi)}&variable=${encodeURIComponent(variable)}&period=${encodeURIComponent(period)}`);
3964:         const result = await res.json();
3965: 
3966:         if (result.success && result.data) {
3967:           const d = result.data;
3968:           document.getElementById('futureSetDescriptionMap').value = d.description || '';
3969:           document.getElementById('futureSetImageClimateMap').value = d.imageClimateMap || '';
3970:           document.getElementById('futureSetImageClimateMap2').value = d.imageClimateMap2 || '';
3971:           document.getElementById('futureSetImageClimateStripe').value = d.imageClimateStripe || '';
3972:         } else {
3973:           // Clear inputs if no data exists
3974:           document.getElementById('futureSetDescriptionMap').value = '';
3975:           document.getElementById('futureSetImageClimateMap').value = '';
3976:           document.getElementById('futureSetImageClimateMap2').value = '';
3977:           document.getElementById('futureSetImageClimateStripe').value = '';
3978:         }
3979:       } catch (err) {
3980:         console.error(err);
3981:       }
3982:     }
3983: 
3984:     // Mengirim data baru Future Climate ke backend (settings)
3985:     async function saveFutureMapSettings() {
3986:       const lokasi = document.getElementById('futureSetLocationMap').value.trim();
3987:       const variable = document.getElementById('futureSetVariableMap').value.trim();
3988:       const period = document.getElementById('futureSetPeriodMap').value.trim();
3989:       const description = document.getElementById('futureSetDescriptionMap').value.trim();
3990:       const imageClimateMap = normalizeImageUrl(document.getElementById('futureSetImageClimateMap').value.trim());
3991:       const imageClimateMap2 = normalizeImageUrl(document.getElementById('futureSetImageClimateMap2').value.trim());
3992:       const imageClimateStripe = normalizeImageUrl(document.getElementById('futureSetImageClimateStripe').value.trim());
3993: 
3994:       if (!lokasi || !variable || !period) {
3995:         alert('Lokasi, Variable, dan Periode wajib diisi!');
3996:         return;
3997:       }
3998: 
3999:       const data = {
4000:         location: lokasi,
4001:         variable: variable,
4002:         period: period,
4003:         description: description,
4004:         imageClimateMap: imageClimateMap,
4005:         imageClimateMap2: imageClimateMap2,
4006:         imageClimateStripe: imageClimateStripe
4007:       };
4008: 
4009:       try {
4010:         const res = await fetch('?action=save_future', {
4011:           method: 'POST',
4012:           headers: {
4013:             'Content-Type': 'application/json'
4014:           },
4015:           body: JSON.stringify(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.
