<select class="form-control" name="cliente">
....
</select>
These lines are the opening and closing of the HTML tag to create a select (combo box or select) object on the HTML page, not to perform a select on a database. Probably this select was already done at an earlier point in the code, not shown in your example.
<?php if ($clientes) {
foreach($clientes as $ind => $valor) {
?>
<option value="<?php echo $valor->nome ?>"><?php echo $valor->nome ?></option>
<?php } } ?>
In this portion of code the combo box object is populated with options. In the line with if
it is tested if the variable $ clients has a true value, in this case if it is the "result" of the bank search, if it is null it will be considered false and will not enter if, otherwise it probably because it has return values, enter.
In the block of foreach
each record of the query result is traversed and the index placed in $ind
and the record in $valor
. The line that starts with the tag assembles the choice option that will be shown in the combo box object.