<?php
// Include the database connection
include 'db_connection.php';

$description = $_POST['description'];
$amount = $_POST['amount'];
$date = $_POST['date'];

$query = "INSERT INTO assets (description, amount, date) VALUES (?, ?, ?)";
$stmt = $conn->prepare($query);
$stmt->bind_param("sds", $description, $amount, $date);
$stmt->execute();

if ($stmt->affected_rows > 0) {
    echo "Asset added successfully.";
} else {
    echo "Error adding asset.";
}

$stmt->close();
$conn->close();
?>
