<?php
require_once '../config/database.php';
$rows = $pdo->query("
    SELECT name, phone, whatsapp, email
    FROM customers
")->fetchAll();
?>
<!DOCTYPE html>
<html>
<head>
<title>Clients Print</title>
<style>
body { font-family:Arial; }
table { width:100%; border-collapse:collapse; }
th,td { border:1px solid #000; padding:6px; }
</style>
</head>
<body onload="window.print()">
<h2>Clients</h2>
<table>
<tr><th>Name</th><th>Phone</th><th>WhatsApp</th><th>Email</th></tr>
<?php foreach($rows as $r): ?>
<tr>
<td><?= $r['name'] ?></td>
<td><?= $r['phone'] ?></td>
<td><?= $r['whatsapp'] ?></td>
<td><?= $r['email'] ?></td>
</tr>
<?php endforeach; ?>
</table>
</body>
</html>
