<?php $secHour = Client::clientHours($client->hour_id); echo '<option value="' . $secHour->id . '">' . $secHour->hours . '</option>'; foreach ($hours as $hour) { echo '<option value="' . $hour->id . '">' . $hour->hours . '</option>'; } ?> </select> </td> </tr> <tr> <td><label>Doktor</label></td> <?php $doctors = Client::doktorList(); ?> <td> <select name="doktor" class="form-control"> <?php if ($client->doctor_id != null) { $secDoctor = Client::clientDoctors($client->doctor_id); echo '<option value="' . $secDoctor->id . '">' . $secDoctor->name . ' ' . $secDoctor->last_name . '</option>'; } if ($authorization == 1) { foreach ($doctors as $doctor) { echo '<option value="' . $doctor->id . '">' . $doctor->name . ' ' . $doctor->last_name . '</option>'; } } ?>