prepare("SELECT stock FROM products WHERE id=? AND active=1");
$s->execute([$pid]);
$stock = $s->fetchColumn();
if ($stock !== false && $stock > 0) {
$_SESSION['cart'][$pid] = min($stock, ($_SESSION['cart'][$pid] ?? 0) + 1);
flash('Added to cart');
}
redirect(BASE . '/index.php');
}
$q = trim($_GET['q'] ?? '');
$services = $pdo->query("SELECT * FROM services WHERE active=1 ORDER BY category, name")->fetchAll();
$prodSql = "SELECT * FROM products WHERE active=1";
$params = [];
if ($q) { $prodSql .= " AND (name LIKE ? OR category LIKE ?)"; $params[] = "%$q%"; $params[] = "%$q%"; }
$prodSql .= " ORDER BY category, name";
$s = $pdo->prepare($prodSql); $s->execute($params);
$products = $s->fetchAll();
include 'header.php';
?>
Caring for every paw since 2010 Book appointments, save pet profiles, track vaccinations — all in one place.Your pet deserves the best care.
= e($svc['description']) ?> · = (int)$svc['duration_min'] ?>min