<script>
document.getElementById('navBox').innerHTML =
    '<li class="breadcrumb-item"><a href="index.php?t=includes/master&p=client.php&view=list">Client List</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=client.php&clientnumber=<?= $_REQUEST['clientnumber']?>&clientname=<?= $_REQUEST['clientname']?>&view=asset"><?= $_REQUEST['clientname']?></a><i class="fad fa-angle-double-right mx-2 mt-1"" aria-hidden="true"></i><a href="index.php?t=includes/master&p=locations.php&clientnumber=<?= $_REQUEST['clientnumber']?>&clientname=<?= $_REQUEST['clientname']?>">Locations</a></li><i class="fad fa-angle-double-right mx-2 mt-1"" aria-hidden="true"></i></li><li class="breadcrumb-item active"><strong>Remove</strong> Location</li>'
</script>

<?php $cr=mysqli_query($GLOBALS['con'],"SELECT `itemnumber`,`desc`,`plantnumber`,`serialnumber` FROM `itemdetails` WHERE `locnumber`='".$_REQUEST['locnumber']."' ")or die(mysqli_error($GLOBALS['con']));
$ic=mysqli_num_rows($cr);
if($ic==0){?>
<div class="container text-center">
    <p class="lead text-center">You have 0 Assets at this location<br><a class="btn btn-info mt-5" href="javascript:void(0)" onclick="confirmNone()">Remove location</a></p>
</div>
<?php }
else{?>
<p class="lead text-center">You have <strong><?= $ic?></strong> Assets at this location</p>

<div style="max-height:250px; overflow:auto; position:relative">
    <table class="table table-striped table-sm">
        <thead style="position:fixed; width:96%; display:table">
            <tr>
                <th width="33%">Description</th>
                <th width="33%">Plant Number</th>
                <th width="33%">Serial Number</th>
            </tr>
        </thead>
        <tbody>
            <?php while($cd=mysqli_fetch_array($cr)){?>
            <tr>
                <td width="33%"><?= $cd['desc']?></td>
                <td width="33%"><?= $cd['plantnumber']?></td>
                <td width="33%"><?= $cd['serialnumber']?></td>
            </tr>

            <?php };?>
        </tbody>
    </table>
</div>
<?php $r=mysqli_query($GLOBALS['con'],"SELECT * FROM `locations` WHERE `clientnumber`='".$_REQUEST['clientnumber']."'");?>
<div class="alert-info mt-3 mb-3 p-2">
    <div class="row">
        <div class="col-12 col-md-1 lead">Select a new location for the items</div>
        <div class="col-12 col-md-3">
            <select id="newloc" class="form-control autocomplete" onchange="confirmChange()">
                <option value="NULL">SELECT</option>
                <?php while($cd=mysqli_fetch_array($r)){?>
                <?php if($cd['locnumber']!=$_REQUEST['locnumber']){?><option value="<?= $cd['locnumber']?>"><?= $cd['locname']?></option><?php }?>
                <?php }?>
            </select>
        </div>
        <div class="col-12 col-md-3">
        </div>
    </div>
</div>
<?php }