xref: /webtrees/resources/views/setup/step-4-database-sqlite.phtml (revision 4a9a60957058ca2a34e30a0d6f783e1540606590)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\I18N;
6use Fisharebest\Webtrees\Webtrees;
7use Illuminate\Support\Collection;
8
9/**
10 * @var string                 $dbhost
11 * @var string                 $dbname
12 * @var string                 $dbpass
13 * @var string                 $dbport
14 * @var string                 $dbtype
15 * @var string                 $dbuser
16 * @var Collection<int,string> $errors
17 * @var string                 $lang
18 * @var string                 $tblpfx
19 * @var Collection<int,string> $warnings
20 * @var string                 $wtemail
21 * @var string                 $wtname
22 * @var string                 $wtpass
23 * @var string                 $wtuser
24 */
25
26?>
27
28<form method="post" autocomplete="off">
29    <input name="lang" type="hidden" value="<?= e($lang) ?>">
30    <input name="dbtype" type="hidden" value="<?= e($dbtype) ?>">
31    <input name="dbhost" type="hidden" value="<?= e($dbhost) ?>">
32    <input name="dbport" type="hidden" value="<?= e($dbport) ?>">
33    <input name="dbuser" type="hidden" value="<?= e($dbuser) ?>">
34    <input name="dbpass" type="hidden" value="<?= e($dbpass) ?>">
35    <input name="wtname" type="hidden" value="<?= e($wtname) ?>">
36    <input name="wtuser" type="hidden" value="<?= e($wtuser) ?>">
37    <input name="wtpass" type="hidden" value="<?= e($wtpass) ?>">
38    <input name="wtemail" type="hidden" value="<?= e($wtemail) ?>">
39
40    <h2>
41        <?= I18N::translate('Database connection') ?> – SQLite
42    </h2>
43
44    <?php foreach ($errors as $error) : ?>
45        <p class="alert alert-danger"><?= $error ?></p>
46    <?php endforeach ?>
47
48    <?php foreach ($warnings as $warning) : ?>
49        <p class="alert alert-warning"><?= $warning ?></p>
50    <?php endforeach ?>
51
52    <div class="row mb-3">
53        <label class="col-form-label col-sm-3" for="dbname">
54            <?= I18N::translate('Database name') ?>
55        </label>
56
57        <div class="col-sm-9">
58            <div class="input-group" dir="ltr">
59                <span class="input-group-text"><?=e((string) realpath(Webtrees::ROOT_DIR)) ?>/data/</span>
60
61                <input class="form-control" id="dbname" name="dbname" pattern="[a-zA-Z0-9_]{1,63}" type="text" value="<?= e($dbname) ?>">
62
63                <span class="input-group-text">.sqlite</span>
64            </div>
65
66            <div class="form-text">
67                <?= I18N::translate('Use letters A-Z, a-z, digits 0-9, or underscores') ?>
68            </div>
69        </div>
70    </div>
71
72    <div class="row mb-3">
73        <label class="col-form-label col-sm-3" for="tblpfx">
74            <?= I18N::translate('Table prefix') ?>
75        </label>
76
77        <div class="col-sm-9">
78            <input class="form-control" dir="ltr" id="tblpfx" maxlength="15" name="tblpfx" pattern="[a-zA-Z0-9_]+" type="text" value="<?= e($tblpfx) ?>">
79
80            <div class="form-text">
81                <?= I18N::translate('The prefix is optional, but recommended. By giving the table names a unique prefix you can let several different applications share the same database.') ?>
82                <?= I18N::translate('Use letters A-Z, a-z, digits 0-9, or underscores') ?>
83            </div>
84        </div>
85    </div>
86
87    <hr>
88
89    <div class="d-flex justify-content-between">
90        <button class="btn btn-primary" name="step" type="submit" value="5">
91            <?= I18N::translate('next') ?>
92        </button>
93
94        <button class="btn btn-secondary" name="step" type="submit" value="3">
95            <?= I18N::translate('previous') ?>
96        </button>
97    </div>
98</form>
99