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