Created At: 2026-06-14T15:55:47Z
Completed At: 2026-06-14T15:55:47Z
File Path: `file:///c:/Users/HP/Downloads/climate-system/climate-system/index.php`
Total Lines: 3856
Total Bytes: 159351
Showing lines 580 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.
580:         if ($action === 'save_future') {
581:             if ($_SERVER['REQUEST_METHOD'] !== 'POST') {
582:                 echo json_encode(['error' => 'Metode request tidak valid.']);
583:                 exit;
584:             }
585: 
586:             $raw_input = file_get_contents('php://input');
587:             $input = json_decode($raw_input, true);
588: 
589:             $location = isset($input['location']) ? trim($input['location']) : '';
590:             $variable = isset($input['variable']) ? trim($input['variable']) : '';
591:             $period = isset($input['period']) ? trim($input['period']) : '';
592:             $description = isset($input['description']) ? trim($input['description']) : '';
593:             $imageClimateMap = isset($input['imageClimateMap']) ? trim($input['imageClimateMap']) : '';
594:             $imageClimateMap2 = isset($input['imageClimateMap2']) ? trim($input['imageClimateMap2']) : '';
595:             $imageTimeSeries = isset($input['imageTimeSeries']) ? trim($input['imageTimeSeries']) : '';
596:             $imageClimateStripe = isset($input['imageClimateStripe']) ? trim($input['imageClimateStripe']) : '';
597: 
598:             $graphBaseValue = isset($input['graphBaseValue']) && $input['graphBaseValue'] !== '' ? floatval($input['graphBaseValue']) : null;
599:             $graphUncertainty = isset($input['graphUncertainty']) && $input['graphUncertainty'] !== '' ? floatval($input['graphUncertainty']) : null;
600:             $graphSSP1Slope = isset($input['graphSSP1Slope']) && $input['graphSSP1Slope'] !== '' ? floatva
<truncated 4890 bytes>
imageClimateMap,
686:                 ':image_climate_map_2' => $imageClimateMap2,
687:                 ':image_time_series' => $imageTimeSeries,
688:                 ':image_climate_stripe' => $imageClimateStripe,
689:                 ':graph_base_value' => $graphBaseValue,
690:                 ':graph_uncertainty' => $graphUncertainty,
691:                 ':graph_ssp1_slope' => $graphSSP1Slope,
692:                 ':graph_ssp2_slope' => $graphSSP2Slope,
693:                 ':graph_ssp3_slope' => $graphSSP3Slope,
694:                 ':graph_ssp5_slope' => $graphSSP5Slope,
695:                 ':csv_data' => $csvData
696:             ]);
697: 
698:             echo json_encode(['success' => true, 'message' => 'Data Future berhasil disimpan!']);
699:             exit;
700:         }
701: 
702:         // 5. Ambil data Dropdown Filter dinamis
703:         if ($action === 'get_filters') {
704:             $locs = $db->query("SELECT name FROM locations ORDER BY name ASC")->fetchAll(PDO::FETCH_COLUMN);
705:             $vars = $db->query("
706:                 SELECT name FROM variables 
707:                 ORDER BY CASE name 
708:                     WHEN 'Precipitation' THEN 1
709:                     WHEN 'Suhu Udara Rata-rata' THEN 2
710:                     WHEN 'Suhu Udara Maksimum' THEN 3
711:                     WHEN 'Suhu Udara Minimum' THEN 4
712:                     WHEN 'Kelembaban Relatif' THEN 5
713:                     WHEN 'Kecepatan Angin' THEN 6
714:                     WHEN 'Radiasi Matahari' THEN 7
715:                     WHEN 'Suhu Permukaan Laut' THEN 8
716:                     WHEN 'Anomali Tinggi Muka Laut' THEN 9
717:                     WHEN 'Salinitas Permukaan Laut' THEN 10
718:                     WHEN 'pH Permukaan Laut' THEN 11
719:                     ELSE 12
720:                 END ASC, name ASC
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.
