xref: /webtrees/resources/views/search-phonetic-page.phtml (revision b11cdcd45131b1585d66693fab363cfeb18c51a4)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\Http\RequestHandlers\SearchPhoneticAction;
6use Fisharebest\Webtrees\I18N;
7use Fisharebest\Webtrees\Individual;
8use Fisharebest\Webtrees\Tree;
9use Illuminate\Support\Collection;
10
11/**
12 * @var Collection<int,Tree>       $all_trees
13 * @var string                     $firstname
14 * @var Collection<int,Individual> $individuals
15 * @var string                     $lastname
16 * @var string                     $place
17 * @var Collection<int,Tree>       $search_trees
18 * @var string                     $soundex
19 * @var string                     $title
20 * @var Tree                       $tree
21 */
22
23?>
24
25<h2 class="wt-page-title">
26    <?= $title ?>
27</h2>
28
29<form method="post" action="<?= e(route(SearchPhoneticAction::class, ['tree' => $tree->name()])) ?>" class="wt-page-options wt-page-options-ancestors-chart hidden-print mb-4" name="searchform">
30    <div class="row">
31        <label class="col-sm-3 col-form-label wt-page-options-label" for="firstname">
32            <?= I18N::translate('Given name') ?>
33        </label>
34        <div class="col-sm-9 wt-page-options-value">
35            <div class="input-group">
36                <input class= "form-control" type="text" name="firstname" id="firstname" value="<?= e($firstname) ?>" autofocus>
37                <?= view('edit/input-addon-keyboard', ['id' => 'firstname']) ?>
38            </div>
39        </div>
40    </div>
41
42    <div class="row">
43        <label class="col-sm-3 col-form-label wt-page-options-label"  for="lastname">
44            <?= I18N::translate('Surname') ?>
45        </label>
46        <div class="col-sm-9 wt-page-options-value">
47            <div class="input-group">
48                <input class="form-control" type="text" name="lastname" id="lastname" value="<?= e($lastname) ?>">
49                <?= view('edit/input-addon-keyboard', ['id' => 'lastname']) ?>
50            </div>
51        </div>
52    </div>
53
54    <div class="row">
55        <label class="col-sm-3 col-form-label wt-page-options-label" for="place">
56            <?= I18N::translate('Place') ?>
57        </label>
58        <div class="col-sm-9 wt-page-options-value">
59            <input class="form-control" type="text" name="place" id="place" value="<?= e($place) ?>">
60        </div>
61    </div>
62
63    <fieldset class="row">
64            <label class="col-sm-3 col-form-label wt-page-options-label">
65            <?= I18N::translate('Phonetic algorithm') ?>
66        </label>
67        <div class="col-sm-9 wt-page-options-value">
68            <div class="form-check form-check-inline">
69                <input class="form-check-input" type="radio" name="soundex" value="Russell" <?= $soundex === 'Russell' ? 'checked' : '' ?> id="russell">
70                <label class="form-check-label" for="russell">
71                    <?= I18N::translate('Russell') ?>
72                </label>
73            </div>
74            <div class="form-check form-check-inline">
75                <input class="form-check-input" type="radio" name="soundex" value="DaitchM" <?= $soundex === 'DaitchM' ? 'checked' : '' ?> id="d-m">
76                <label class="form-check-label" for="d-m">
77                    <?= I18N::translate('Daitch-Mokotoff') ?>
78                </label>
79            </div>
80        </div>
81    </fieldset>
82
83    <?= view('search-trees', ['all_trees' => $all_trees, 'search_trees' => $search_trees]) ?>
84
85    <div class="row">
86        <label class="col-sm-3 col-form-label wt-page-options-label"></label>
87        <div class="col-sm-9 wt-page-options-value">
88            <input type="submit" class="btn btn-primary" value="<?=  /* I18N: A button label. */ I18N::translate('search') ?>">
89        </div>
90    </div>
91
92    <?= csrf_field() ?>
93</form>
94
95<?php if ($firstname !== '' || $lastname !== '' || $place !== '') : ?>
96    <?php if ($individuals->isEmpty()) : ?>
97        <div class="alert alert-info row">
98            <?= I18N::translate('No results found.') ?>
99        </div>
100    <?php else : ?>
101        <?= view('search-results', ['individuals' => $individuals, 'search_families' => false, 'search_individuals' => true, 'search_locations' => false, 'search_notes' => false, 'search_sources' => false, 'search_repositories' => false, 'tree' => $tree]) ?>
102    <?php endif ?>
103<?php endif ?>
104
105<?= view('modals/on-screen-keyboard') ?>
106