xref: /webtrees/resources/views/search-advanced-field.phtml (revision b62a8ecaef02a45d7e018fdb0f702d4575d8d0de)
1<?php
2
3/**
4 * @var string[] $date_options
5 * @var string   $field_label
6 * @var string   $field_name
7 * @var string   $field_value
8 * @var string   $modifier
9 * @var string[] $name_options
10 */
11
12?>
13
14<div class="row form-group">
15    <label class="col-sm-3 col-form-label wt-page-options-label" for="fields[<?= e($field_name) ?>]">
16        <?= $field_label ?>
17    </label>
18
19    <div class="col-sm-6 wt-page-options-value">
20        <input class="form-control form-control" type="text" id="fields[<?= e($field_name) ?>]" name="fields[<?= e($field_name) ?>]" value="<?= e($field_value) ?>" <?php if (substr($field_name, -5) === ':DATE') :
21            ?>onchange="webtrees.reformatDate(this, 'dmy')" <?php
22                                                                        endif ?>>
23    </div>
24
25    <div class="col-sm-3 wt-page-options-value">
26        <?php if (preg_match('/(GIVN|SURN)$/', $field_name)) : ?>
27            <?= view('components/select', ['name' => 'modifiers[' . $field_name . ']', 'id' => 'modifiers-' . $field_name, 'selected' => $modifier, 'options' => $name_options]) ?>
28        <?php endif ?>
29
30        <?php if (preg_match('/(DATE)$/', $field_name)) : ?>
31            <?= view('components/select', ['name' => 'modifiers[' . $field_name . ']', 'id' => 'modifiers-' . $field_name, 'selected' => $modifier, 'options' => $date_options]) ?>
32        <?php endif ?>
33    </div>
34</div>
35