<?php
require_once __DIR__ . '/../core/auth.php';
require_login();
$pdo = db();

if ($_POST) {
  $stmt = $pdo->prepare("INSERT INTO CustomerPhones (CustomerID, Phone, IsDefault) VALUES (?,?,?)");
  $stmt->execute([$_POST['CustomerID'], $_POST['Phone'], isset($_POST['IsDefault']) ? 1 : 0]);
}
header("Location: customers.php");
