foreach ($employee as $value) {
echo ' <div class="new-form" data-employee-id="'.$value['id_employee'].'">
<input type="text" disabled value="'.$value['first_name'].'">
<input type="text" disabled value="'.$value['second_name'].'">
<input type="text" disabled value="'.$value['middle_name'].'">
<select name="list-position" id="list-position">';
foreach ($positions as $val) {
echo '<option value="'.$val['id_position'].'">'.$val['position'].'</option>';
}'</select>
<input type="text" disabled value="'.$value['position'].'">
<input type="text" disabled value="'.$value['salary'].'">
<button class="change-employee" data-id="'.$id.'">Изменить</button>
<button id="js-save-change-employee" class="save-change-employee hide" data-id="'.$id.'">Сохранить изменения</button>
</div>';
}
'<select name="list-position" id="list-position">';
foreach ($positions as $val) {
echo '<option value="'.$val['id_position'].'">'.$val['position'].'</option>';
}'</select>
;
в конце вот этой строки '<select name="list-position" id="list-position">';
. Но без ;
в этом месте выводится вот такая ошибка Parse error: syntax error, unexpected 'foreach' (T_FOREACH), expecting ',' or ';' in .....
foreach ($employee as $value) {
echo ' <div class="new-form" data-employee-id="'.$value['id_employee'].'">
<input type="text" disabled value="'.$value['first_name'].'">
<input type="text" disabled value="'.$value['second_name'].'">
<input type="text" disabled value="'.$value['middle_name'].'">
<select name="list-position" id="list-position">';
foreach ($positions as $val) {
echo '<option value="'.$val['id_position'].'">'.$val['position'].'</option>';
}
// echo забыл
echo '</select>
<input type="text" disabled value="'.$value['position'].'">
<input type="text" disabled value="'.$value['salary'].'">
<button class="change-employee" data-id="'.$id.'">Изменить</button>
<button id="js-save-change-employee" class="save-change-employee hide" data-id="'.$id.'">Сохранить изменения</button>
</div>';
}
<?php foreach ($employee as $value) { ?>
<div class="new-form" data-employee-id="<?= $value['id_employee'] ?>">
<input type="text" disabled value="<?= $value['first_name'] ?>">
<input type="text" disabled value="<?= $value['second_name'] ?>">
<input type="text" disabled value="<?= $value['middle_name'] ?>">
<select name="list-position" id="list-position">';
<?php foreach ($positions as $val) { ?>
<option value="<?= $val['id_position'] ?>"><?= $val['position'] ?></option>
<?php } ?>
</select>
<input type="text" disabled value="<?= $value['position'] ?>">
<input type="text" disabled value="<?= $value['salary'] ?>">
<button class="change-employee" data-id="<?= $id ?>">Изменить</button>
<button id="js-save-change-employee" class="save-change-employee hide" data-id="<?= $id ?>">Сохранить изменения</button>
</div>
<?php } ?>
foreach ($employee as $value) {
echo ' <div class="new-form" data-employee-id="'.$value['id_employee'].'">
<input type="text" disabled value="'.$value['first_name'].'">
<input type="text" disabled value="'.$value['second_name'].'">
<input type="text" disabled value="'.$value['middle_name'].'">
<select name="list-position" id="list-position">';
foreach ($positions as $val) {
echo '<option value="'.$val['id_position'].'">'.$val['position'].'</option>';
}
echo '</select>
<input type="text" disabled value="'.$value['position'].'">
<input type="text" disabled value="'.$value['salary'].'">
<button class="change-employee" data-id="'.$id.'">Изменить</button>
<button id="js-save-change-employee" class="save-change-employee hide" data-id="'.$id.'">Сохранить изменения</button>
</div>';
}