32 lines
786 B
PHP
32 lines
786 B
PHP
<?php
|
|
include('includes/config/config.php');
|
|
include('includes/functions.php');
|
|
include('log_entry.php');
|
|
|
|
error_log("Start Printing Request Attributes");
|
|
$requestStr = "";
|
|
foreach ($_REQUEST as $key => $value) {
|
|
$requestStr .= $key . " : " . $value . "\n";
|
|
error_log($key . " : " . $value . "<br />\r\n");
|
|
}
|
|
|
|
$year = $_POST['year']; // Retrieve the year from POST data
|
|
|
|
$query = "SELECT * FROM yearly_budget WHERE year = '$year'";
|
|
|
|
if (!$result = mysqli_query($conn, $query)) {
|
|
exit(json_encode(["error" => mysqli_error($conn)]));
|
|
}
|
|
|
|
$data = array();
|
|
if (mysqli_num_rows($result) > 0) {
|
|
$row = mysqli_fetch_assoc($result);
|
|
$data['year'] = $row['year'];
|
|
echo json_encode($data);
|
|
} else {
|
|
echo json_encode(["error" => "No data found"]);
|
|
}
|
|
|
|
$conn->close();
|
|
?>
|