<?php include '../db.php'; ?>

<?php
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $stmt = $conn->prepare("INSERT INTO clients (name, company_name, email, phone, address) VALUES (?, ?, ?, ?, ?)");
    $stmt->execute([$_POST['name'], $_POST['company_name'], $_POST['email'], $_POST['phone'], $_POST['address']]);
    header("Location: index.php");
}
?>

<h2>Add New Client</h2>
<form method="post">
    <input name="name" placeholder="Name" required><br>
    <input name="company_name" placeholder="Company Name"><br>
    <input name="email" placeholder="Email"><br>
    <input name="phone" placeholder="Phone"><br>
    <textarea name="address" placeholder="Address"></textarea><br>
    <button type="submit">Save</button>
</form>
