$cr=mysqli_query($GLOBALS['con'],"SELECT * FROM `agents` WHERE `agent_number`='".$_REQUEST['agent_number']."'")or die(mysqli_error());
$cd=mysqli_fetch_array($cr);?>
<div id="printbox">
    <div class="row mb-4 mt-0 mt-md-n5">

        <div class="col-12 col-md-12">
            <div class="float-end"><a id="phone" href="tel:<?= $cd['tel']?>" class="btn-sm btn btn-secondary m-0 px-3 waves-effect waves-light noprint"><i class="fad fa-phone"></i></a> <a
                   href="index.php?t=includes/master&p=agent.php&agent_number=<?= $_REQUEST['agent_number']?>&view=edit" class="btn-sm btn btn-secondary m-0 px-3 waves-effect waves-light noprint"><i class="fad fa-edit"></i></a> <a href="#"
                   class="btn-sm btn btn-secondary m-0 px-3 waves-effect waves-light noprint emailButton" data-values="<?= $cd['agent_number']?>|<?= $cd['pri_contact']?>|<?= $cd['email']?>|<?= $cd['agent_name']?>"
                   data-href="<?=ROOT_URL?>/includes/master/mailer.php"><i class="fad fa-envelope"></i></a> <a id="print" href="#" class="btn-sm btn btn-secondary m-0 px-3 waves-effect waves-light noprint"><i class="fad fa-print"></i></a>
                <a href="#" class="btn-sm btn btn-secondary m-0 px-3 waves-effect waves-light noprint"><i class="fad fa-archive"></i></a>
            </div>
        </div>
    </div>


    <div class="col-12">

        <div class="card">
            <div class="card-header text-center">
                <h5 class="font-weight-bold">Agent Details</h5>
            </div>
            <div class="card-body">
                <div class="row">
                    <!-- Left Column -->
                    <div class="col-md-6">
                        <ul class="list-group">
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                <span class="font-weight-bold">ID</span>
                                <span><?= $cd['agent_number']?></span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                <span class="font-weight-bold">Name</span>
                                <span><?= $cd['agent_name']?></span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                <span class="font-weight-bold">Address 1</span>
                                <span><?= $cd['address1']?></span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                <span class="font-weight-bold">Address 2</span>
                                <span><?= $cd['address2']?></span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                <span class="font-weight-bold">Town</span>
                                <span><?= $cd['town']?></span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                <span class="font-weight-bold">County</span>
                                <span><?= $cd['county']?></span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                <span class="font-weight-bold">Post Code</span>
                                <span><?= $cd['post']?></span>
                            </li>
                        </ul>
                    </div>

                    <!-- Right Column -->
                    <div class="col-md-6">
                        <ul class="list-group">
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                <span class="font-weight-bold">Tel</span>
                                <span><?= $cd['tel']?></span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                <span class="font-weight-bold">Fax</span>
                                <span><?= $cd['fax']?></span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                <span class="font-weight-bold">Email</span>
                                <span><?= $cd['email']?></span>
                            </li>
                            <li class="list-group-item d-flex justify-content-between align-items-center">
                                <span class="font-weight-bold">Commission Rate</span>
                                <span><?= $cd['commission_rate']?></span>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </div>

    </div>



    <script>
    document.getElementById('navBox').innerHTML =
        '<li class="breadcrumb-item"><a href="index.php?t=includes/master&p=agent.php&view=list>Agents</a><i class="fad fa-angle-double-right mx-2 mt-1" aria-hidden="true"></i></li><li class="breadcrumb-item"><a href="index.php?t=includes/master&p=agent.php&agent_number=<?= $_REQUEST['agent_number']?>&view=load">View Agent</a><i class="fad fa-angle-double-right mx-2 mt-1" aria-hidden="true"></i></li><li class="breadcrumb-item active"><a href="javascript:void(0)"><?= $cd['agent_name']?></a></li>'
    </script>