<?php  
$page_title = 'Inventory Amount by Category';  
require_once('includes/load.php');  
page_require_level(3);  
  
// Function to get inventory amount from products table  
function get_inventory_amount_from_products() {  
    global $db;  
    $sql = "SELECT c.id AS categorie_id, c.name AS category_name,   
                   SUM(p.quantity * p.buy_price) AS total_amount  
            FROM products p  
            JOIN categories c ON p.categorie_id = c.id  
            GROUP BY c.id, c.name";  
    $result = $db->query($sql);  
  
    $amounts = [];  
    if ($result) {  
        while ($row = $result->fetch_assoc()) {  
            $categorie_id = $row['categorie_id'];  
            $category_name = $row['category_name'];  
            $total_amount = $row['total_amount'];  
            $amounts[$categorie_id] = [  
                'category_name' => $category_name,  
                'total_amount' => $total_amount  
            ];  
        }  
    }  
    return $amounts;  
}  
  
// Function to get inventory amount from prod_loc table  
function get_inventory_amount_from_prod_loc() {  
    global $db;  
    $sql = "SELECT c.id AS categorie_id, c.name AS category_name,   
                   SUM(p.quantity * pr.buy_price) AS total_amount  
            FROM prod_loc p  
            JOIN products pr ON p.part_number = pr.part_number  
            JOIN categories c ON pr.categorie_id = c.id  
            GROUP BY c.id, c.name";  
    $result = $db->query($sql);  
  
    $amounts = [];  
    if ($result) {  
        while ($row = $result->fetch_assoc()) {  
            $categorie_id = $row['categorie_id'];  
            $category_name = $row['category_name'];  
            $total_amount = $row['total_amount'];  
            $amounts[$categorie_id] = [  
                'category_name' => $category_name,  
                'total_amount' => $total_amount  
            ];  
        }  
    }  
    return $amounts;  
}  
  
// Function to get inventory amount from warehouse tables  
function get_inventory_amount_from_warehouse($warehouse) {  
    global $db;  
    $sql = "SELECT c.id AS categorie_id, c.name AS category_name,   
                   SUM(w.quantity * w.buy_price) AS total_amount  
            FROM $warehouse w  
            JOIN categories c ON w.categorie_id = c.id  
            GROUP BY c.id, c.name";  
    $result = $db->query($sql);  
  
    $amounts = [];  
    if ($result) {  
        while ($row = $result->fetch_assoc()) {  
            $categorie_id = $row['categorie_id'];  
            $category_name = $row['category_name'];  
            $total_amount = $row['total_amount'];  
            $amounts[$categorie_id] = [  
                'category_name' => $category_name,  
                'total_amount' => $total_amount  
            ];  
        }  
    }  
    return $amounts;  
}  
  
// Function to get inventory amount from online_products table  
function get_inventory_amount_from_online_products() {  
    global $db;  
    $sql = "SELECT c.id AS categorie_id, c.name AS category_name,   
                   SUM(op.quantity * op.buy_price) AS total_amount  
            FROM online_products op  
            JOIN categories c ON op.categorie_id = c.id  
            GROUP BY c.id, c.name";  
    $result = $db->query($sql);  
  
    $amounts = [];  
    if ($result) {  
        while ($row = $result->fetch_assoc()) {  
            $categorie_id = $row['categorie_id'];  
            $category_name = $row['category_name'];  
            $total_amount = $row['total_amount'];  
            $amounts[$categorie_id] = [  
                'category_name' => $category_name,  
                'total_amount' => $total_amount  
            ];  
        }  
    } else {  
        // Error handling: Log the error or display a message  
        error_log("Error querying online_products table: " . $db->error);  
    }  
    return $amounts;  
}  
  
// Function to get inventory amount from online_products_jakarta table  
function get_inventory_amount_from_online_products_jakarta() {  
    global $db;  
    $sql = "SELECT c.id AS categorie_id, c.name AS category_name,   
                   SUM(opj.quantity * opj.buy_price) AS total_amount  
            FROM online_products_jakarta opj  
            JOIN categories c ON opj.categorie_id = c.id  
            GROUP BY c.id, c.name";  
    $result = $db->query($sql);  
  
    $amounts = [];  
    if ($result) {  
        while ($row = $result->fetch_assoc()) {  
            $categorie_id = $row['categorie_id'];  
            $category_name = $row['category_name'];  
            $total_amount = $row['total_amount'];  
            $amounts[$categorie_id] = [  
                'category_name' => $category_name,  
                'total_amount' => $total_amount  
            ];  
        }  
    } else {  
        // Error handling: Log the error or display a message  
        error_log("Error querying online_products_jakarta table: " . $db->error);  
    }  
    return $amounts;  
}  
  
// Function to get inventory amount from online_products_bali table  
function get_inventory_amount_from_online_products_bali() {  
    global $db;  
    $sql = "SELECT c.id AS categorie_id, c.name AS category_name,   
                   SUM(opb.quantity * opb.buy_price) AS total_amount  
            FROM online_products_bali opb  
            JOIN categories c ON opb.categorie_id = c.id  
            GROUP BY c.id, c.name";  
    $result = $db->query($sql);  
  
    $amounts = [];  
    if ($result) {  
        while ($row = $result->fetch_assoc()) {  
            $categorie_id = $row['categorie_id'];  
            $category_name = $row['category_name'];  
            $total_amount = $row['total_amount'];  
            $amounts[$categorie_id] = [  
                'category_name' => $category_name,  
                'total_amount' => $total_amount  
            ];  
        }  
    } else {  
        // Error handling: Log the error or display a message  
        error_log("Error querying online_products_bali table: " . $db->error);  
    }  
    return $amounts;  
}  
  
// Function to get inventory amount from online_products_makassar table  
function get_inventory_amount_from_online_products_makassar() {  
    global $db;  
    $sql = "SELECT c.id AS categorie_id, c.name AS category_name,   
                   SUM(opm.quantity * opm.buy_price) AS total_amount  
            FROM online_products_makassar opm  
            JOIN categories c ON opm.categorie_id = c.id  
            GROUP BY c.id, c.name";  
    $result = $db->query($sql);  
  
    $amounts = [];  
    if ($result) {  
        while ($row = $result->fetch_assoc()) {  
            $categorie_id = $row['categorie_id'];  
            $category_name = $row['category_name'];  
            $total_amount = $row['total_amount'];  
            $amounts[$categorie_id] = [  
                'category_name' => $category_name,  
                'total_amount' => $total_amount  
            ];  
        }  
    } else {  
        // Error handling: Log the error or display a message  
        error_log("Error querying online_products_makassar table: " . $db->error);  
    }  
    return $amounts;  
}  
  
// Function to get inventory amount from online_products_bandung table  
function get_inventory_amount_from_online_products_bandung() {  
    global $db;  
    $sql = "SELECT c.id AS categorie_id, c.name AS category_name,   
                   SUM(opb.quantity * opb.buy_price) AS total_amount  
            FROM online_products_bandung opb  
            JOIN categories c ON opb.categorie_id = c.id  
            GROUP BY c.id, c.name";  
    $result = $db->query($sql);  
  
    $amounts = [];  
    if ($result) {  
        while ($row = $result->fetch_assoc()) {  
            $categorie_id = $row['categorie_id'];  
            $category_name = $row['category_name'];  
            $total_amount = $row['total_amount'];  
            $amounts[$categorie_id] = [  
                'category_name' => $category_name,  
                'total_amount' => $total_amount  
            ];  
        }  
    } else {  
        // Error handling: Log the error or display a message  
        error_log("Error querying online_products_bandung table: " . $db->error);  
    }  
    return $amounts;  
}  
  
// Get the inventory amounts from products, prod_loc, and warehouse tables  
$inventory_amounts_from_products = get_inventory_amount_from_products();  
$inventory_amounts_from_prod_loc = get_inventory_amount_from_prod_loc();  
$inventory_amounts_from_wh_bali = get_inventory_amount_from_warehouse('wh_bali');  
$inventory_amounts_from_wh_jakarta = get_inventory_amount_from_warehouse('wh_jakarta');  
$inventory_amounts_from_wh_makassar = get_inventory_amount_from_warehouse('wh_makassar');  
$inventory_amounts_from_wh_semarang = get_inventory_amount_from_warehouse('wh_semarang');  
$inventory_amounts_from_wh_bandung = get_inventory_amount_from_warehouse('wh_bandung'); // New line for Bandung  
$inventory_amounts_from_online_products = get_inventory_amount_from_online_products(); // New line for online products  
$inventory_amounts_from_online_products_jakarta = get_inventory_amount_from_online_products_jakarta(); // New line for online products Jakarta  
$inventory_amounts_from_online_products_bali = get_inventory_amount_from_online_products_bali(); // New line for online products Bali  
$inventory_amounts_from_online_products_makassar = get_inventory_amount_from_online_products_makassar(); // New line for online products Makassar  
$inventory_amounts_from_online_products_bandung = get_inventory_amount_from_online_products_bandung(); // New line for online products Bandung  
  
// Calculate total amounts  
$total_amount_products = array_sum(array_column($inventory_amounts_from_products, 'total_amount'));  
$total_amount_prod_loc = array_sum(array_column($inventory_amounts_from_prod_loc, 'total_amount'));  
$total_amount_wh_bali = array_sum(array_column($inventory_amounts_from_wh_bali, 'total_amount'));  
$total_amount_wh_jakarta = array_sum(array_column($inventory_amounts_from_wh_jakarta, 'total_amount'));  
$total_amount_wh_makassar = array_sum(array_column($inventory_amounts_from_wh_makassar, 'total_amount'));  
$total_amount_wh_semarang = array_sum(array_column($inventory_amounts_from_wh_semarang, 'total_amount'));  
$total_amount_wh_bandung = array_sum(array_column($inventory_amounts_from_wh_bandung, 'total_amount')); // New line for Bandung  
$total_amount_online_products = array_sum(array_column($inventory_amounts_from_online_products, 'total_amount')); // New line for online products  
$total_amount_online_products_jakarta = array_sum(array_column($inventory_amounts_from_online_products_jakarta, 'total_amount')); // New line for online products Jakarta  
$total_amount_online_products_bali = array_sum(array_column($inventory_amounts_from_online_products_bali, 'total_amount')); // New line for online products Bali  
$total_amount_online_products_makassar = array_sum(array_column($inventory_amounts_from_online_products_makassar, 'total_amount')); // New line for online products Makassar  
$total_amount_online_products_bandung = array_sum(array_column($inventory_amounts_from_online_products_bandung, 'total_amount')); // New line for online products Bandung  
  
// Summarize total amounts  
$total_amount_summary = $total_amount_products + $total_amount_prod_loc + $total_amount_wh_bali + $total_amount_wh_jakarta + $total_amount_wh_makassar + $total_amount_wh_semarang + $total_amount_wh_bandung + $total_amount_online_products + $total_amount_online_products_jakarta + $total_amount_online_products_bali + $total_amount_online_products_makassar + $total_amount_online_products_bandung; // Updated summary  
?>  
  
<?php include_once('layouts/header.php'); ?>  
  
<div class="row">  
    <div class="col-md-12">  
        <?php echo display_msg($msg); ?>  
    </div>  
</div>  
  
<div class="row">  
    <div class="col-md-12">  
        <div class="panel panel-default">  
            <div class="panel-heading">  
                <strong>  
                    <span class="glyphicon glyphicon-th"></span>  
                    <span>Inventory Amount by Category (Warehouse Surabaya)</span>  
                </strong>  
            </div>  
            <div class="panel-body">  
                <table class="table table-bordered">  
                    <thead>  
                        <tr>  
                            <th class="text-center">Category ID</th>  
                            <th>Category Name</th>  
                            <th class="text-center">Total Amount</th>  
                        </tr>  
                    </thead>  
                    <tbody>  
                        <?php foreach ($inventory_amounts_from_products as $categorie_id => $data) : ?>  
                            <tr>  
                                <td class="text-center"><?php echo htmlspecialchars($categorie_id); ?></td>  
                                <td><?php echo htmlspecialchars($data['category_name']); ?></td>  
                                <td class="text-center"><?php echo number_format($data['total_amount'], 2); ?></td>  
                            </tr>  
                        <?php endforeach; ?>  
                    </tbody>  
                </table>  
            </div>  
        </div>  
    </div>  
</div>  
  
<div class="row">  
    <div class="col-md-12">  
        <div class="panel panel-default">  
            <div class="panel-heading">  
                <strong>  
                    <span class="glyphicon glyphicon-th"></span>  
                    <span>Inventory Amount by Category (Production Inventory)</span>  
                </strong>  
            </div>  
            <div class="panel-body">  
                <table class="table table-bordered">  
                    <thead>  
                        <tr>  
                            <th class="text-center">Category ID</th>  
                            <th>Category Name</th>  
                            <th class="text-center">Total Amount</th>  
                        </tr>  
                    </thead>  
                    <tbody>  
                        <?php foreach ($inventory_amounts_from_prod_loc as $categorie_id => $data) : ?>  
                            <tr>  
                                <td class="text-center"><?php echo htmlspecialchars($categorie_id); ?></td>  
                                <td><?php echo htmlspecialchars($data['category_name']); ?></td>  
                                <td class="text-center"><?php echo number_format($data['total_amount'], 2); ?></td>  
                            </tr>  
                        <?php endforeach; ?>  
                    </tbody>  
                </table>  
            </div>  
        </div>  
    </div>  
</div>  
  
<!-- Warehouse Bali Inventory -->  
<div class="row">  
    <div class="col-md-12">  
        <div class="panel panel-default">  
            <div class="panel-heading">  
                <strong>  
                    <span class="glyphicon glyphicon-th"></span>  
                    <span>Inventory Amount by Category (Warehouse Bali)</span>  
                </strong>  
            </div>  
            <div class="panel-body">  
                <table class="table table-bordered">  
                    <thead>  
                        <tr>  
                            <th class="text-center">Category ID</th>  
                            <th>Category Name</th>  
                            <th class="text-center">Total Amount</th>  
                        </tr>  
                    </thead>  
                    <tbody>  
                        <?php foreach ($inventory_amounts_from_wh_bali as $categorie_id => $data) : ?>  
                            <tr>  
                                <td class="text-center"><?php echo htmlspecialchars($categorie_id); ?></td>  
                                <td><?php echo htmlspecialchars($data['category_name']); ?></td>  
                                <td class="text-center"><?php echo number_format($data['total_amount'], 2); ?></td>  
                            </tr>  
                        <?php endforeach; ?>  
                    </tbody>  
                </table>  
            </div>  
        </div>  
    </div>  
</div>  
  
<!-- Warehouse Jakarta Inventory -->  
<div class="row">  
    <div class="col-md-12">  
        <div class="panel panel-default">  
            <div class="panel-heading">  
                <strong>  
                    <span class="glyphicon glyphicon-th"></span>  
                    <span>Inventory Amount by Category (Warehouse Jakarta)</span>  
                </strong>  
            </div>  
            <div class="panel-body">  
                <table class="table table-bordered">  
                    <thead>  
                        <tr>  
                            <th class="text-center">Category ID</th>  
                            <th>Category Name</th>  
                            <th class="text-center">Total Amount</th>  
                        </tr>  
                    </thead>  
                    <tbody>  
                        <?php foreach ($inventory_amounts_from_wh_jakarta as $categorie_id => $data) : ?>  
                            <tr>  
                                <td class="text-center"><?php echo htmlspecialchars($categorie_id); ?></td>  
                                <td><?php echo htmlspecialchars($data['category_name']); ?></td>  
                                <td class="text-center"><?php echo number_format($data['total_amount'], 2); ?></td>  
                            </tr>  
                        <?php endforeach; ?>  
                    </tbody>  
                </table>  
            </div>  
        </div>  
    </div>  
</div>  
  
<!-- Warehouse Makassar Inventory -->  
<div class="row">  
    <div class="col-md-12">  
        <div class="panel panel-default">  
            <div class="panel-heading">  
                <strong>  
                    <span class="glyphicon glyphicon-th"></span>  
                    <span>Inventory Amount by Category (Warehouse Makassar)</span>  
                </strong>  
            </div>  
            <div class="panel-body">  
                <table class="table table-bordered">  
                    <thead>  
                        <tr>  
                            <th class="text-center">Category ID</th>  
                            <th>Category Name</th>  
                            <th class="text-center">Total Amount</th>  
                        </tr>  
                    </thead>  
                    <tbody>  
                        <?php foreach ($inventory_amounts_from_wh_makassar as $categorie_id => $data) : ?>  
                            <tr>  
                                <td class="text-center"><?php echo htmlspecialchars($categorie_id); ?></td>  
                                <td><?php echo htmlspecialchars($data['category_name']); ?></td>  
                                <td class="text-center"><?php echo number_format($data['total_amount'], 2); ?></td>  
                            </tr>  
                        <?php endforeach; ?>  
                    </tbody>  
                </table>  
            </div>  
        </div>  
    </div>  
</div>  
  
<!-- Warehouse Semarang Inventory -->  
<div class="row">  
    <div class="col-md-12">  
        <div class="panel panel-default">  
            <div class="panel-heading">  
                <strong>  
                    <span class="glyphicon glyphicon-th"></span>  
                    <span>Inventory Amount by Category (Warehouse Semarang)</span>  
                </strong>  
            </div>  
            <div class="panel-body">  
                <table class="table table-bordered">  
                    <thead>  
                        <tr>  
                            <th class="text-center">Category ID</th>  
                            <th>Category Name</th>  
                            <th class="text-center">Total Amount</th>  
                        </tr>  
                    </thead>  
                    <tbody>  
                        <?php foreach ($inventory_amounts_from_wh_semarang as $categorie_id => $data) : ?>  
                            <tr>  
                                <td class="text-center"><?php echo htmlspecialchars($categorie_id); ?></td>  
                                <td><?php echo htmlspecialchars($data['category_name']); ?></td>  
                                <td class="text-center"><?php echo number_format($data['total_amount'], 2); ?></td>  
                            </tr>  
                        <?php endforeach; ?>  
                    </tbody>  
                </table>  
            </div>  
        </div>  
    </div>  
</div>  
  
<!-- Warehouse Bandung Inventory -->  
<div class="row">  
    <div class="col-md-12">  
        <div class="panel panel-default">  
            <div class="panel-heading">  
                <strong>  
                    <span class="glyphicon glyphicon-th"></span>  
                    <span>Inventory Amount by Category (Warehouse Bandung)</span>  
                </strong>  
            </div>  
            <div class="panel-body">  
                <table class="table table-bordered">  
                    <thead>  
                        <tr>  
                            <th class="text-center">Category ID</th>  
                            <th>Category Name</th>  
                            <th class="text-center">Total Amount</th>  
                        </tr>  
                    </thead>  
                    <tbody>  
                        <?php foreach ($inventory_amounts_from_wh_bandung as $categorie_id => $data) : ?>  
                            <tr>  
                                <td class="text-center"><?php echo htmlspecialchars($categorie_id); ?></td>  
                                <td><?php echo htmlspecialchars($data['category_name']); ?></td>  
                                <td class="text-center"><?php echo number_format($data['total_amount'], 2); ?></td>  
                            </tr>  
                        <?php endforeach; ?>  
                    </tbody>  
                </table>  
            </div>  
        </div>  
    </div>  
</div>  
  
<!-- Online Products Inventory -->  
<div class="row">  
    <div class="col-md-12">  
        <div class="panel panel-default">  
            <div class="panel-heading">  
                <strong>  
                    <span class="glyphicon glyphicon-th"></span>  
                    <span>Etalase Surabaya</span>  
                </strong>  
            </div>  
            <div class="panel-body">  
                <table class="table table-bordered">  
                    <thead>  
                        <tr>  
                            <th class="text-center">Category ID</th>  
                            <th>Category Name</th>  
                            <th class="text-center">Total Amount</th>  
                        </tr>  
                    </thead>  
                    <tbody>  
                        <?php foreach ($inventory_amounts_from_online_products as $categorie_id => $data) : ?>  
                            <tr>  
                                <td class="text-center"><?php echo htmlspecialchars($categorie_id); ?></td>  
                                <td><?php echo htmlspecialchars($data['category_name']); ?></td>  
                                <td class="text-center"><?php echo number_format($data['total_amount'], 2); ?></td>  
                            </tr>  
                        <?php endforeach; ?>  
                    </tbody>  
                </table>  
            </div>  
        </div>  
    </div>  
</div>  
  
<!-- Online Products Jakarta Inventory -->  
<div class="row">  
    <div class="col-md-12">  
        <div class="panel panel-default">  
            <div class="panel-heading">  
                <strong>  
                    <span class="glyphicon glyphicon-th"></span>  
                    <span>Etalase Jakarta</span>  
                </strong>  
            </div>  
            <div class="panel-body">  
                <table class="table table-bordered">  
                    <thead>  
                        <tr>  
                            <th class="text-center">Category ID</th>  
                            <th>Category Name</th>  
                            <th class="text-center">Total Amount</th>  
                        </tr>  
                    </thead>  
                    <tbody>  
                        <?php foreach ($inventory_amounts_from_online_products_jakarta as $categorie_id => $data) : ?>  
                            <tr>  
                                <td class="text-center"><?php echo htmlspecialchars($categorie_id); ?></td>  
                                <td><?php echo htmlspecialchars($data['category_name']); ?></td>  
                                <td class="text-center"><?php echo number_format($data['total_amount'], 2); ?></td>  
                            </tr>  
                        <?php endforeach; ?>  
                    </tbody>  
                </table>  
            </div>  
        </div>  
    </div>  
</div>  
  
<!-- Online Products Bali Inventory -->  
<div class="row">  
    <div class="col-md-12">  
        <div class="panel panel-default">  
            <div class="panel-heading">  
                <strong>  
                    <span class="glyphicon glyphicon-th"></span>  
                    <span>Etalase Bali</span>  
                </strong>  
            </div>  
            <div class="panel-body">  
                <table class="table table-bordered">  
                    <thead>  
                        <tr>  
                            <th class="text-center">Category ID</th>  
                            <th>Category Name</th>  
                            <th class="text-center">Total Amount</th>  
                        </tr>  
                    </thead>  
                    <tbody>  
                        <?php foreach ($inventory_amounts_from_online_products_bali as $categorie_id => $data) : ?>  
                            <tr>  
                                <td class="text-center"><?php echo htmlspecialchars($categorie_id); ?></td>  
                                <td><?php echo htmlspecialchars($data['category_name']); ?></td>  
                                <td class="text-center"><?php echo number_format($data['total_amount'], 2); ?></td>  
                            </tr>  
                        <?php endforeach; ?>  
                    </tbody>  
                </table>  
            </div>  
        </div>  
    </div>  
</div>  
  
<!-- Online Products Makassar Inventory -->  
<div class="row">  
    <div class="col-md-12">  
        <div class="panel panel-default">  
            <div class="panel-heading">  
                <strong>  
                    <span class="glyphicon glyphicon-th"></span>  
                    <span>Etalase Makassar</span>  
                </strong>  
            </div>  
            <div class="panel-body">  
                <table class="table table-bordered">  
                    <thead>  
                        <tr>  
                            <th class="text-center">Category ID</th>  
                            <th>Category Name</th>  
                            <th class="text-center">Total Amount</th>  
                        </tr>  
                    </thead>  
                    <tbody>  
                        <?php foreach ($inventory_amounts_from_online_products_makassar as $categorie_id => $data) : ?>  
                            <tr>  
                                <td class="text-center"><?php echo htmlspecialchars($categorie_id); ?></td>  
                                <td><?php echo htmlspecialchars($data['category_name']); ?></td>  
                                <td class="text-center"><?php echo number_format($data['total_amount'], 2); ?></td>  
                            </tr>  
                        <?php endforeach; ?>  
                    </tbody>  
                </table>  
            </div>  
        </div>  
    </div>  
</div>  
  
<!-- Online Products Bandung Inventory -->  
<div class="row">  
    <div class="col-md-12">  
        <div class="panel panel-default">  
            <div class="panel-heading">  
                <strong>  
                    <span class="glyphicon glyphicon-th"></span>  
                    <span>Elatase Bandung</span>  
                </strong>  
            </div>  
            <div class="panel-body">  
                <table class="table table-bordered">  
                    <thead>  
                        <tr>  
                            <th class="text-center">Category ID</th>  
                            <th>Category Name</th>  
                            <th class="text-center">Total Amount</th>  
                        </tr>  
                    </thead>  
                    <tbody>  
                        <?php foreach ($inventory_amounts_from_online_products_bandung as $categorie_id => $data) : ?>  
                            <tr>  
                                <td class="text-center"><?php echo htmlspecialchars($categorie_id); ?></td>  
                                <td><?php echo htmlspecialchars($data['category_name']); ?></td>  
                                <td class="text-center"><?php echo number_format($data['total_amount'], 2); ?></td>  
                            </tr>  
                        <?php endforeach; ?>  
                    </tbody>  
                </table>  
            </div>  
        </div>  
    </div>  
</div>  
  
<div class="row">  
    <div class="col-md-12">  
        <div class="panel panel-default">  
            <div class="panel-heading">  
                <strong>  
                    <span class="glyphicon glyphicon-th"></span>  
                    <span>Summary of Inventory Amounts</span>  
                </strong>  
            </div>  
            <div class="panel-body">  
                <table class="table table-bordered">  
                    <thead>  
                        <tr>  
                            <th class="text-center">Type</th>  
                            <th class="text-center">Total Amount</th>  
                        </tr>  
                    </thead>  
                    <tbody>  
                        <tr>  
                            <td class="text-center">Warehouse</td>  
                            <td class="text-center"><?php echo number_format($total_amount_products, 2); ?></td>  
                        </tr>  
                        <tr>  
                            <td class="text-center">Production Inventory</td>  
                            <td class="text-center"><?php echo number_format($total_amount_prod_loc, 2); ?></td>  
                        </tr>  
                        <tr>  
                            <td class="text-center">Warehouse Bali</td>  
                            <td class="text-center"><?php echo number_format($total_amount_wh_bali, 2); ?></td>  
                        </tr>  
                        <tr>  
                            <td class="text-center">Warehouse Jakarta</td>  
                            <td class="text-center"><?php echo number_format($total_amount_wh_jakarta, 2); ?></td>  
                        </tr>  
                        <tr>  
                            <td class="text-center">Warehouse Makassar</td>  
                            <td class="text-center"><?php echo number_format($total_amount_wh_makassar, 2); ?></td>  
                        </tr>  
                        <tr>  
                            <td class="text-center">Warehouse Semarang</td>  
                            <td class="text-center"><?php echo number_format($total_amount_wh_semarang, 2); ?></td>  
                        </tr>  
                        <tr>  
                            <td class="text-center">Warehouse Bandung</td> <!-- New line for Bandung -->  
                            <td class="text-center"><?php echo number_format($total_amount_wh_bandung, 2); ?></td> <!-- New line for Bandung -->  
                        </tr>  
                        <tr>  
                            <td class="text-center">Etalase Surabaya</td> <!-- New line for online products -->  
                            <td class="text-center"><?php echo number_format($total_amount_online_products, 2); ?></td> <!-- New line for online products -->  
                        </tr>  
                        <tr>  
                            <td class="text-center">Etalase Jakarta</td> <!-- New line for online products Jakarta -->  
                            <td class="text-center"><?php echo number_format($total_amount_online_products_jakarta, 2); ?></td> <!-- New line for online products Jakarta -->  
                        </tr>  
                        <tr>  
                            <td class="text-center">Etalase Bali</td> <!-- New line for online products Bali -->  
                            <td class="text-center"><?php echo number_format($total_amount_online_products_bali, 2); ?></td> <!-- New line for online products Bali -->  
                        </tr>  
                        <tr>  
                            <td class="text-center">Etalase Makassar</td> <!-- New line for online products Makassar -->  
                            <td class="text-center"><?php echo number_format($total_amount_online_products_makassar, 2); ?></td> <!-- New line for online products Makassar -->  
                        </tr>  
                        <tr>  
                            <td class="text-center">Etalase Bandung</td> <!-- New line for online products Bandung -->  
                            <td class="text-center"><?php echo number_format($total_amount_online_products_bandung, 2); ?></td> <!-- New line for online products Bandung -->  
                        </tr>  
                        <tr>  
                            <td class="text-center"><strong>Total Summary</strong></td>  
                            <td class="text-center"><strong><?php echo number_format($total_amount_summary, 2); ?></strong></td>  
                        </tr>  
                    </tbody>  
                </table>  
            </div>  
        </div>  
    </div>  
</div>  
  
<?php include_once('layouts/footer.php'); ?>  
