xref: /webtrees/resources/views/search-advanced-field.phtml (revision f91b18eb982c7e34a27d159389c9b2e0f48d8614)
1<?php
2
3use Fisharebest\Webtrees\GedcomTag;
4
5/**
6 * @var string[] $date_options
7 * @var string   $field_label
8 * @var string   $field_name
9 * @var string   $field_value
10 * @var string   $modifier
11 * @var string[] $name_options
12 */
13
14?>
15
16<div class="row form-group">
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 (substr($field_name, -5) === ':DATE') :
23            ?>onchange="valid_date(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)) : ?>
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)) : ?>
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