<?php
$cr=mysqli_query($GLOBALS['con'],"SELECT * FROM `surveyor` WHERE `id`='".$_REQUEST['id']."'")or die(mysqli_error($GLOBALS['con']));
$cd=mysqli_fetch_array($cr);?>
<script>
$('#navBox').html(
    '<li class="breadcrumb-item"><a href="index.php?t=includes/master&p=surveyor.php&view=list">Surveyor</a><i class="fad fa-angle-double-right mx-2 mt-1"" aria-hidden="true"></i></li><li class="breadcrumb-item active">View Surveyor: <?= $cd['forename']?> <?= $cd['surname']?></li>'
)
</script>


<div id="printbox">
    <div class="row mb-4 mt-n5">
        <div class="col-12">
            <div class="float-end">
                <?php if($cd['phone1']!=""){?>
                <a data-mdb-tooltip-init data-mdb-placement="bottom" data-mdb-trigger="hover"tom" data-mdb-trigger="hover"  title="Phone <?= $cd['forename']?> <?= $cd['surname']?>" id="phone" href="tel:<?= $cd['phone1']?>" class="btn btn-secondary noprint"><i class="fad fa-phone"></i></a>
                <?php }?>
                <a data-mdb-tooltip-init data-mdb-placement="bottom" data-mdb-trigger="hover"tom" data-mdb-trigger="hover"  title="Edit Surveyor details" href="index.php?t=includes/master&p=surveyor.php&id=<?= $_REQUEST['id']?>&view=edit" class="btn btn-secondary"><i
                       class="fad fad fa-edit"></i></a>

                <?php if(!filter_var($cd['email'], FILTER_VALIDATE_EMAIL) === false) {?>
                <a data-mdb-tooltip-init data-mdb-placement="bottom" data-mdb-trigger="hover"tom" data-mdb-trigger="hover"  title="Email <?= $cd['forename']?> <?= $cd['surname']?>" href="javascript:void(0)" class="btn btn-secondary emailButton"
                   data-values="<?= $_REQUEST['clientnumber']?>|<?= $cd['forename']?> <?= $cd['surname']?>|<?= $cd['email']?>|<?= $cd['clientname']?>" data-href="<?=ROOT_URL?>/includes/master/mailer.php"><i class="fad fa-envelope"></i></a>
                <?php }?>
                <a data-mdb-tooltip-init data-mdb-placement="bottom" data-mdb-trigger="hover"tom" data-mdb-trigger="hover"  title="Archive Surveyor" href="javascript:void(0)" onClick="archive('surveyor','id','<?= $cd['id']?>','surveyor_functions.php','archiveSupplier')" class="btn btn-secondary"><i
                       class="fad fa-archive"></i></a>
            </div>
        </div>
    </div>
    <div class="row">
        <?php require_once('includes/forms/elements/surveyor_view.frm');?>
    </div>