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