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