<?php
//session_start();
include_once 'functions/fungsi.php';
include_once 'connection/koneksi.php';

$query = "SELECT menu.harga as harga, pesanan.jumlah as jumlah FROM pesanan INNER JOIN menu ON pesanan.id_menu = menu.id";
$result_set = $database->query($query);
?>



<body>
    <div class="checkout grid_16">
        <div class="billInfo grid_11 alpha">
            <h4>Daftar Pesanan</h4><br>
        </div>
    </div>
    <br>
    <p>
    <table border="2px">
        <tr>
            <td>Total harga</td>
        </tr>
        <?php
        $total = 0;
        while ($row = $result_set->fetch_array()) {
            $total = $total + ($row['harga'] * $row['jumlah']);
        }
        ?>
        <tr><td><?= $total ?></td></tr>
    </table>
    <a href="bayar_process.php?harga=<?= $total ?>">oke</a>
</p>
</div>
</div>
</div>
<div class="clear"></div>
</div>


</body>