<?php $cr=mysqli_query($GLOBALS['con'],"SELECT * FROM `contractors` WHERE `contractor_number`='".$_REQUEST['contractor_number']."'")or die(mysqli_error($GLOBALS['con']));
$cd=mysqli_fetch_array($cr);?>
<div id="printbox">
    <div class="row mb-4">
        <div class="col-12 col-md-12">
            <div class="float-end">
                <a id="phone" href="tel:<?= $cd['tel']?>" class="btn btn-secondary noprint"><i class="fad fa-phone"></i></a>
                <a href="index.php?t=includes/master&p=contractor.php&contractor_number=<?= $_REQUEST['contractor_number']?>&view=edit" class="btn btn-secondary noprint"><i class="fad fa-edit"></i></a>
                <a href="#" class="btn btn-secondary noprint emailButton" data-values="<?= $cd['contractor_number']?>|<?= $cd['pri_contact']?>|<?= $cd['email']?>|<?= $cd['contractor_name']?>"
                   data-href="<?=ROOT_URL?>/includes/master/mailer.php"><i class="fad fa-envelope"></i></a>

                <?php if($cd['statuslive']==1){?>
                <a href="javascript:void(0)" class="btn btn-secondary noprint archiveButton" data-mdb-tooltip-init data-mdb-placement="bottom" data-mdb-trigger="hover" totitle="hover" title="Archive Contractor"
                   onClick="archiveContractor('<?= $_REQUEST['contractor_number']?>')"><i class="fad fa-archive"></i></a>
                <?php }?>

                <?php if($cd['statuslive']==0){?>
                <a href="javascript:void(0)" class="btn btn-secondary noprint archiveButton" data-mdb-tooltip-init data-mdb-placement="bottom" data-mdb-trigger="hover" totitle="hover" title="Activate Contractor"
                   onClick="activateContractor('<?= $_REQUEST['contractor_number']?>')"><i class="fad fa-upload"></i></a>
                <?php }?>
            </div>
        </div>


        <div class="col-12 col-md-12">

            <div class="col-12 col-md-12">
                <div class="card">
                    <div class="card-header">Contractor Details</div>
                    <div class="card-body">
                        <div class="col-12 col-md-6">
                            <div class="row row-striped">
                                <div class="col-12 col-md-3 title">ID</div>
                                <div class="col-12 col-md-9"><?= $cd['contractor_number']?></div>
                            </div>
                            <div class="row row-striped">
                                <div class="col-12 col-md-3 title">Name</div>
                                <div class="col-12 col-md-9"><?= $cd['contractor_name']?></div>
                            </div>
                            <div class="row row-striped">
                                <div class="col-12 col-md-3 title">Address1</div>
                                <div class="col-12 col-md-9"><?= $cd['address1']?></div>
                            </div>
                            <div class="row row-striped">
                                <div class="col-12 col-md-3 title">Address2</div>
                                <div class="col-12 col-md-9"><?= $cd['address2']?></div>
                            </div>
                            <div class="row row-striped">
                                <div class="col-12 col-md-3 title">town</div>
                                <div class="col-12 col-md-9"><?= $cd['town']?></div>
                            </div>
                            <div class="row row-striped">
                                <div class="col-12 col-md-3 title">County</div>
                                <div class="col-12 col-md-9"><?= $cd['county']?></div>
                            </div>
                            <div class="row row-striped">
                                <div class="col-12 col-md-3 title">Post Code</div>
                                <div class="col-12 col-md-9"><?= $cd['post']?></div>
                            </div>
                        </div>
                        <div class="col-12 col-md-6">
                            <div class="row row-striped">
                                <div class="col-12 col-md-3 title">Tel</div>
                                <div class="col-12 col-md-9"><?= $cd['tel']?></div>
                            </div>
                            <div class="row row-striped">
                                <div class="col-12 col-md-3 title">Fax</div>
                                <div class="col-12 col-md-9"><?= $cd['fax']?></div>
                            </div>
                            <div class="row row-striped">
                                <div class="col-12 col-md-3 title">Email</div>
                                <div class="col-12 col-md-9"><?= $cd['email']?></div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>

        </div>

        <script>
        $('#navBox').html(
            '<li class="breadcrumb-item"><a href="index.php?t=includes/master&p=contractor.php&view=list>contractors</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=contractor.php&contractor_number=<?= $_REQUEST['contractor_number']?>&view=load">View Contractor</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['contractor_name']?></a></li>'
        )
        </script>