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