<?php
include 'koneksi.php';
$id = $_GET['id'];

$produk = mysqli_query($conn, "SELECT * FROM produk WHERE id='$id'");
$p = mysqli_fetch_array($produk);
?>
<!DOCTYPE html>
<html>
<head>
    <title>Detail Produk</title>
    <style>
        body { font-family: Arial; margin: 20px; }
        .container {
            max-width: 600px;
            margin: auto;
            border: 1px solid #ddd;
            padding: 20px;
        }
    </style>
</head>
<body>

<div class="container">
    <h1><?php echo $p['nama_produk']; ?></h1>

    <?php
    $detail = mysqli_query($conn, "SELECT * FROM detail_produk WHERE produk_id='$id'");
    while($d = mysqli_fetch_array($detail)){
    ?>
        <p><b>Jenis:</b> <?php echo $d['jenis']; ?></p>
        <p><b>Harga:</b> Rp <?php echo number_format($d['harga']); ?></p>
        <hr>
    <?php } ?>

    <a href="index.php">Kembali ke Beranda</a>
</div>

</body>
</html>