xref: /webtrees/resources/views/search-phonetic-page.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
1f5402f3dSGreg Roach<?php
2f5402f3dSGreg Roach
3*10e06497SGreg Roachdeclare(strict_types=1);
4*10e06497SGreg Roach
5f5402f3dSGreg Roachuse Fisharebest\Webtrees\Http\RequestHandlers\SearchPhoneticAction;
6f5402f3dSGreg Roachuse Fisharebest\Webtrees\I18N;
7dc270d8cSGreg Roachuse Fisharebest\Webtrees\Individual;
8dc270d8cSGreg Roachuse Fisharebest\Webtrees\Tree;
9dc270d8cSGreg Roachuse Illuminate\Support\Collection;
10dc270d8cSGreg Roach
11dc270d8cSGreg Roach/**
1236779af1SGreg Roach * @var Collection<int,Tree>       $all_trees
13dc270d8cSGreg Roach * @var string                     $firstname
1436779af1SGreg Roach * @var Collection<int,Individual> $individuals
15dc270d8cSGreg Roach * @var string                     $lastname
16dc270d8cSGreg Roach * @var string                     $place
1736779af1SGreg Roach * @var Collection<int,Tree>       $search_trees
18dc270d8cSGreg Roach * @var string                     $soundex
19dc270d8cSGreg Roach * @var string                     $title
20dc270d8cSGreg Roach * @var Tree                       $tree
21dc270d8cSGreg Roach */
22f5402f3dSGreg Roach
23f5402f3dSGreg Roach?>
24dd6b2bfcSGreg Roach
25dd6b2bfcSGreg Roach<h2 class="wt-page-title">
26dd6b2bfcSGreg Roach    <?= $title ?>
27dd6b2bfcSGreg Roach</h2>
28dd6b2bfcSGreg Roach
29f5402f3dSGreg Roach<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">
309e3c2cf9SGreg Roach    <div class="row">
31dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label" for="firstname">
32dd6b2bfcSGreg Roach            <?= I18N::translate('Given name') ?>
33dd6b2bfcSGreg Roach        </label>
34dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
350d2905f7SGreg Roach            <div class="input-group">
360d2905f7SGreg Roach                <input class= "form-control" type="text" name="firstname" id="firstname" value="<?= e($firstname) ?>" autofocus>
37dd6b2bfcSGreg Roach                <?= view('edit/input-addon-keyboard', ['id' => 'firstname']) ?>
38dd6b2bfcSGreg Roach            </div>
39dd6b2bfcSGreg Roach        </div>
40dd6b2bfcSGreg Roach    </div>
41dd6b2bfcSGreg Roach
429e3c2cf9SGreg Roach    <div class="row">
43dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label"  for="lastname">
44dd6b2bfcSGreg Roach            <?= I18N::translate('Surname') ?>
45dd6b2bfcSGreg Roach        </label>
46dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
470d2905f7SGreg Roach            <div class="input-group">
480d2905f7SGreg Roach                <input class="form-control" type="text" name="lastname" id="lastname" value="<?= e($lastname) ?>">
49dd6b2bfcSGreg Roach                <?= view('edit/input-addon-keyboard', ['id' => 'lastname']) ?>
50dd6b2bfcSGreg Roach            </div>
51dd6b2bfcSGreg Roach        </div>
52dd6b2bfcSGreg Roach    </div>
53dd6b2bfcSGreg Roach
549e3c2cf9SGreg Roach    <div class="row">
55dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label" for="place">
56dd6b2bfcSGreg Roach            <?= I18N::translate('Place') ?>
57dd6b2bfcSGreg Roach        </label>
58dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
590d2905f7SGreg Roach            <input class="form-control" type="text" name="place" id="place" value="<?= e($place) ?>">
60dd6b2bfcSGreg Roach        </div>
61dd6b2bfcSGreg Roach    </div>
62dd6b2bfcSGreg Roach
639e3c2cf9SGreg Roach    <fieldset class="row">
64dd6b2bfcSGreg Roach            <label class="col-sm-3 col-form-label wt-page-options-label">
65dd6b2bfcSGreg Roach            <?= I18N::translate('Phonetic algorithm') ?>
66dd6b2bfcSGreg Roach        </label>
67dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
68dd6b2bfcSGreg Roach            <div class="form-check form-check-inline">
69ca2d6785SGreg Roach                <input class="form-check-input" type="radio" name="soundex" value="Russell" <?= $soundex === 'Russell' ? 'checked' : '' ?> id="russell">
70ca2d6785SGreg Roach                <label class="form-check-label" for="russell">
71dd6b2bfcSGreg Roach                    <?= I18N::translate('Russell') ?>
72dd6b2bfcSGreg Roach                </label>
73dd6b2bfcSGreg Roach            </div>
74dd6b2bfcSGreg Roach            <div class="form-check form-check-inline">
75ca2d6785SGreg Roach                <input class="form-check-input" type="radio" name="soundex" value="DaitchM" <?= $soundex === 'DaitchM' ? 'checked' : '' ?> id="d-m">
76ca2d6785SGreg Roach                <label class="form-check-label" for="d-m">
77dd6b2bfcSGreg Roach                    <?= I18N::translate('Daitch-Mokotoff') ?>
78dd6b2bfcSGreg Roach                </label>
79dd6b2bfcSGreg Roach            </div>
80dd6b2bfcSGreg Roach        </div>
81dd6b2bfcSGreg Roach    </fieldset>
82dd6b2bfcSGreg Roach
83ca2d6785SGreg Roach    <?= view('search-trees', ['all_trees' => $all_trees, 'search_trees' => $search_trees]) ?>
84dd6b2bfcSGreg Roach
859e3c2cf9SGreg Roach    <div class="row">
86dd6b2bfcSGreg Roach        <label class="col-sm-3 col-form-label wt-page-options-label"></label>
87dd6b2bfcSGreg Roach        <div class="col-sm-9 wt-page-options-value">
88dd6b2bfcSGreg Roach            <input type="submit" class="btn btn-primary" value="<?=  /* I18N: A button label. */ I18N::translate('search') ?>">
89dd6b2bfcSGreg Roach        </div>
90dd6b2bfcSGreg Roach    </div>
9181443e3cSGreg Roach
9281443e3cSGreg Roach    <?= csrf_field() ?>
93dd6b2bfcSGreg Roach</form>
94dd6b2bfcSGreg Roach
95dd6b2bfcSGreg Roach<?php if ($firstname !== '' || $lastname !== '' || $place !== '') : ?>
96075d1a05SGreg Roach    <?php if ($individuals->isEmpty()) : ?>
97dd6b2bfcSGreg Roach        <div class="alert alert-info row">
98dd6b2bfcSGreg Roach            <?= I18N::translate('No results found.') ?>
99dd6b2bfcSGreg Roach        </div>
100dd6b2bfcSGreg Roach    <?php else : ?>
101058ba724SGreg Roach        <?= 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]) ?>
102dd6b2bfcSGreg Roach    <?php endif ?>
103dd6b2bfcSGreg Roach<?php endif ?>
104dd6b2bfcSGreg Roach
105dd6b2bfcSGreg Roach<?= view('modals/on-screen-keyboard') ?>
106