xref: /webtrees/resources/views/search-advanced-page.phtml (revision 9b152ff9230017d2c03aa1bf603a98b18250446d)
1<?php
2
3use Fisharebest\Webtrees\Http\RequestHandlers\SearchAdvancedAction;
4use Fisharebest\Webtrees\I18N;
5
6?>
7
8<h2 class="wt-page-title">
9    <?= $title ?>
10</h2>
11
12<div id="advanced-search-page">
13    <form method="post" action="<?= e(route(SearchAdvancedAction::class, ['tree' => $tree->name()])) ?>" class="wt-page-options wt-page-options-search-advanced hidden-print mb-4">
14        <?= csrf_field() ?>
15
16        <div class="row form-group wt-page-options-label mt-4">
17            <div class="form-row mx-auto">
18                <?= I18N::translate('Individual') ?>
19            </div>
20        </div>
21
22        <?php foreach ($fields as $field_name => $field_value) : ?>
23            <?php if (substr($field_name, 0, 5) !== 'FAMC:') : ?>
24                <?= view('search-advanced-field', ['field_name' => $field_name, 'field_value' => $field_value, 'modifier' => $modifiers[$field_name] ?? '', 'date_options' => $date_options, 'name_options' => $name_options]) ?>
25            <?php endif ?>
26        <?php endforeach ?>
27
28        <div class="row form-group">
29            <div class="col-sm-3 col-form-label wt-page-options-label">
30                <?= I18N::translate('Add more fields') ?>
31            </div>
32
33            <div class="col-sm-3 wt-page-options-value">
34                <?= view('components/select', ['name' => 'other_field', 'selected' => '', 'options' => ['' => ''] + $other_fields]) ?>
35            </div>
36
37            <div class="col-sm-3 wt-page-options-value">
38                <input type="text" class="form-control" name="other_value">
39            </div>
40
41            <div class="col-sm-3 wt-page-options-value">
42            </div>
43        </div>
44
45        <div class="row form-group wt-page-options-label mt-4">
46            <div class="form-row mx-auto">
47                <?= I18N::translate('Father') ?>
48            </div>
49        </div>
50
51        <?php foreach ($fields as $field_name => $field_value) : ?>
52            <?php if (substr($field_name, 0, 10) === 'FAMC:HUSB:') : ?>
53                <?= view('search-advanced-field', ['field_name' => $field_name, 'field_value' => $field_value, 'modifier' => $modifiers[$field_name] ?? '', 'date_options' => $date_options, 'name_options' => $name_options]) ?>
54            <?php endif ?>
55        <?php endforeach ?>
56
57        <div class="row form-group wt-page-options-label mt-4">
58            <div class="form-row mx-auto">
59                <?= I18N::translate('Mother') ?>
60            </div>
61        </div>
62
63        <?php foreach ($fields as $field_name => $field_value) : ?>
64            <?php if (substr($field_name, 0, 10) === 'FAMC:WIFE:') : ?>
65                <?= view('search-advanced-field', ['field_name' => $field_name, 'field_value' => $field_value, 'modifier' => $modifiers[$field_name] ?? '', 'date_options' => $date_options, 'name_options' => $name_options]) ?>
66            <?php endif ?>
67        <?php endforeach ?>
68
69        <div class="row form-group my-3">
70            <div class="form-row mx-auto">
71                <input type="submit" class="btn btn-primary" value="<?= /* I18N: A button label. */
72                I18N::translate('search') ?>">
73            </div>
74        </div>
75    </form>
76</div>
77
78<?php if (true) : ?>
79    <?php if ($individuals->isEmpty()) : ?>
80        <div class="alert alert-info row">
81            <?= I18N::translate('No results found.') ?>
82        </div>
83    <?php else : ?>
84        <?= view('search-results', ['individuals' => $individuals, 'search_families' => false, 'search_individuals' => true, 'search_notes' => false, 'search_sources' => false, 'search_repositories' => false, 'tree' => $tree]) ?>
85    <?php endif ?>
86<?php endif ?>
87
88