Good afternoon,
I have this code:
<div class="modal-body">
<p><?php echo $ee['Establecimiento']; ?> have <?php echo $totalbooks; ?> books.</p>
<p> Do you wish to move all the books to another library?</p>
<form method="post" action="<?php echo $CRDomain; ?>assets/private/library/establecimiento.php">
<input type="hidden" value="<?php echo $ee['IDEstablecimiento']; ?>" name="id" />
<input type="hidden" name="action" value="move"/>
<div class="form-group">
<div class="col-md-8">
<select class="form-control" name="tothis" required>
<?php foreach ($establecimiento as $gg): ?>
<option value="<?php echo $gg['IDEstablecimiento']; ?>"><?php echo $gg['Establecimiento']; ?></option>
<?php endforeach; ?>
</select>
</div>
<button type="submit" class="btn sbold green-jungle cold-md-4"> Move and Suspend </button>
</div>
</form>
<p>Or you can also suspend the library and leave the books in it</p>
<form method="post" action="<?php echo $CRDomain; ?>assets/private/library/establecimiento.php">
<input type="hidden" value="<?php echo $ee['IDEstablecimiento']; ?>" name="id" />
<input type="hidden" name="action" value="suspend"/>
<button type="submit" class="btn sbold red-thunderbird"> Suspend </button>
</form>
Basically what it does is to be able to eliminate an establishment, see if there are books assigned to that establishment, if it opens a modal (the code above) and gives the option to cancel it with books in the establishment , or transfer the books to another establishment.
In the select, it lists the establishments. Well, the question is (I'm very lost with this) as not showing the main establishment (which is going to transfer the books to another) as it makes no sense to move the books to the same establishment.
Does anyone have any idea how to filter the foreach and not show the establishment that is being removed?
Thanks in advance.