<?php
include 'db.php';
$floor_id = $_POST['floor_id'];
$table_name = $_POST['table_name'];
$seats = $_POST['seats'] ?: 4;

$conn->query("INSERT INTO dinein_tables (floor_id, table_name, seats) VALUES ('$floor_id', '$table_name', '$seats')");
header("Location: table_list.php?success=1");
