<?php
require_once('includes/load.php');
$page_title = 'MRP Total';
require_once('layouts/header.php');

// Query to calculate total MRP
$sql = "SELECT SUM(total_mrp) AS total_mrp FROM mrp";
$total_mrp_result = $db->query($sql);
$total_mrp = $db->fetch_assoc($total_mrp_result);

include_once('layouts/header.php');
?>

<div class="row">
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h3 class="panel-title">MRP Total</h3>
            </div>
            <div class="panel-body">
                <?php if ($total_mrp['total_mrp']) : ?>
                    <p>Total MRP: $<?php echo number_format($total_mrp['total_mrp'], 2); ?></p>
                <?php else : ?>
                    <p>No MRP data available.</p>
                <?php endif; ?>
            </div>
        </div>
    </div>
</div>

<?php include_once('layouts/footer.php'); ?>
