<?php
$servername = "153.92.1.116";
$username = "admin";
$password = 'Te$t@dm1n';
$dbname = "my_website_db";

$conn = new mysqli($servername, $username, $password, $dbname);

if ($conn->connect_error) {
    die("Savienojuma kļūda: " . $conn->connect_error);
}

$name = $_POST['name'];
$surname = $_POST['surname'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$service = $_POST['service'];
$notes = $_POST['notes'];

// Izveido sagatavotu vaicājumu
$stmt = $conn->prepare("INSERT INTO pasutijumu_veiksana (name, surname, email, phone, service, notes) VALUES (?, ?, ?, ?, ?, ?)");
$stmt->bind_param("ssssss", $name, $surname, $email, $phone, $service, $notes);

// Izpilda vaicājumu
if ($stmt->execute()) {
    echo "Pasūtījums veikts veiksmīgi!";
} else {
    echo "Kļūda: " . $stmt->error;
}

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