Created At: 2026-06-14T16:16:54Z
Completed At: 2026-06-14T16:16:54Z
File Path: `file:///c:/Users/HP/Downloads/climate-system/climate-system/index.php`
Total Lines: 3868
Total Bytes: 161155
Showing lines 585 to 720
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.
585:             } else {
586:                 echo json_encode(['success' => false, 'message' => 'Data tidak ditemukan.']);
587:             }
588:             exit;
589:         }
590: 
591:         // 4. Simpan Data Future Climate (Settings)
592:         if ($action === 'save_future') {
593:             if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
594:                 echo json_encode(['error' => 'Metode request tidak valid.']);
595:                 exit;
596:             }
597: 
598:             $raw_input = file_get_contents('php://input');
599:             $input = json_decode($raw_input, true);
600: 
601:             $location = isset($input['location']) ? trim($input['location']) : '';
602:             $variable = isset($input['variable']) ? trim($input['variable']) : '';
603:             $period = isset($input['period']) ? trim($input['period']) : '';
604:             $description = isset($input['description']) ? trim($input['description']) : '';
605:             $imageClimateMap = isset($input['imageClimateMap']) ? trim($input['imageClimateMap']) : '';
606:             $imageClimateMap2 = isset($input['imageClimateMap2']) ? trim($input['imageClimateMap2']) : '';
607:             $imageTimeSeries = isset($input['imageTimeSeries']) ? trim($input['imageTimeSeries']) : '';
608:             $imageClimateStripe = isset($input['imageClimateStripe']) ? trim($input['imageClimateStripe']) : '';
609: 
610:             $graphBaseValue = isset($input['graphBaseValue']) && $input['graphBaseValue'] !== '' ? floatval($input['graphBaseValue']) : null;
611:             $gra
<truncated 4471 bytes>
CLUDED.graph_ssp1_slope,
685:                     graph_ssp2_slope = EXCLUDED.graph_ssp2_slope,
686:                     graph_ssp3_slope = EXCLUDED.graph_ssp3_slope,
687:                     graph_ssp5_slope = EXCLUDED.graph_ssp5_slope,
688:                     csv_data = EXCLUDED.csv_data,
689:                     updated_at = CURRENT_TIMESTAMP
690:             ");
691: 
692:             $stmt->execute([
693:                 ':location_id' => $location_id,
694:                 ':variable_id' => $variable_id,
695:                 ':period_id' => $period_id,
696:                 ':description' => $description,
697:                 ':image_climate_map' => $imageClimateMap,
698:                 ':image_climate_map_2' => $imageClimateMap2,
699:                 ':image_time_series' => $imageTimeSeries,
700:                 ':image_climate_stripe' => $imageClimateStripe,
701:                 ':graph_base_value' => $graphBaseValue,
702:                 ':graph_uncertainty' => $graphUncertainty,
703:                 ':graph_ssp1_slope' => $graphSSP1Slope,
704:                 ':graph_ssp2_slope' => $graphSSP2Slope,
705:                 ':graph_ssp3_slope' => $graphSSP3Slope,
706:                 ':graph_ssp5_slope' => $graphSSP5Slope,
707:                 ':csv_data' => $csvData
708:             ]);
709: 
710:             echo json_encode(['success' => true, 'message' => 'Data Future berhasil disimpan!']);
711:             exit;
712:         }
713: 
714:         // 5. Ambil data Dropdown Filter dinamis
715:         if ($action === 'get_filters') {
716:             $locs = $db->query("SELECT name FROM locations ORDER BY name ASC")->fetchAll(PDO::FETCH_COLUMN);
717:             $vars = $db->query("
718:                 SELECT name FROM variables 
719:                 ORDER BY CASE name 
720:                     WHEN 'Precipitation' THEN 1
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.
