xref: /webtrees/resources/views/search-phonetic-page.phtml (revision 9ae073be9786d4bd3f19b8bf1dac4f78c1a8c288)
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    <?= csrf_field() ?>
29
30    <div class="row form-group">
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 form-group">
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 form-group">
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 form-group">
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 form-group">
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</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