<?php
$inquiry_id = isset($_GET['inquiryid']) ? intval($_GET['inquiryid']) : 0;
$result = mysqli_query($conn, "SELECT i.*, c.name AS customer_name, c.phone AS customer_phone, c.email AS customer_email, c.address, u.name AS assigned_to_name FROM inquiries i JOIN customers c ON i.customer_id = c.id JOIN users u ON i.assigned_to = u.id WHERE i.id = '$inquiry_id'");
$row = mysqli_fetch_array($result);
$current_page = basename($_SERVER['PHP_SELF']); 
$breadcrumb_title = ($current_page == 'inquiry_followup.php') ? 'Follow Up' : 'Profile';
?>
<nav aria-label="breadcrumb">
    <ol class="breadcrumb">
        <li class="breadcrumb-item"><a href="index.php">Home</a></li>
        <li class="breadcrumb-item"><a href="inquiry_list.php">Inquiry list</a></li>
        <li class="breadcrumb-item active" aria-current="page"><?= $breadcrumb_title; ?></li>
    </ol>
</nav>

<div class="row">
    <div class="col-md-12">
        <div class="nav-align-top">
            <ul class="nav nav-pills flex-column flex-sm-row mb-6 gap-2 gap-lg-0">
                <li class="nav-item">
                    <a class="nav-link <?= ($current_page == 'inquiry_details.php') ? 'active' : ''; ?>" 
                       href="inquiry_details.php?inquiryid=<?= urlencode($inquiry_id); ?>">
                        <i class="ti-sm ti ti-user-check me-1-5"></i> Profile
                    </a>
                </li>
                <li class="nav-item">
                    <a class="nav-link <?= ($current_page == 'inquiry_followup.php') ? 'active' : ''; ?>" 
                       href="inquiry_followup.php?inquiryid=<?= urlencode($inquiry_id); ?>">
                        <i class="ti-sm ti ti-headset me-1-5"></i> Follow Up
                    </a>
                </li>
            </ul>
        </div>
    </div>
</div>
