xref: /webtrees/resources/views/setup/step-4-database-sqlite.phtml (revision 10e0649788c8d7d4974d81c048ca2b225df8f22e)
1d70512abSGreg Roach<?php
2d70512abSGreg Roach
3*10e06497SGreg Roachdeclare(strict_types=1);
4*10e06497SGreg Roach
5d70512abSGreg Roachuse Fisharebest\Webtrees\I18N;
6d70512abSGreg Roachuse Fisharebest\Webtrees\Webtrees;
7dc270d8cSGreg Roachuse Illuminate\Support\Collection;
8dc270d8cSGreg Roach
9dc270d8cSGreg Roach/**
10dc270d8cSGreg Roach * @var string                 $dbhost
11dc270d8cSGreg Roach * @var string                 $dbname
12dc270d8cSGreg Roach * @var string                 $dbpass
13dc270d8cSGreg Roach * @var string                 $dbport
14dc270d8cSGreg Roach * @var string                 $dbtype
15dc270d8cSGreg Roach * @var string                 $dbuser
1636779af1SGreg Roach * @var Collection<int,string> $errors
17dc270d8cSGreg Roach * @var string                 $lang
18dc270d8cSGreg Roach * @var string                 $tblpfx
1936779af1SGreg Roach * @var Collection<int,string> $warnings
20dc270d8cSGreg Roach * @var string                 $wtemail
21dc270d8cSGreg Roach * @var string                 $wtname
22dc270d8cSGreg Roach * @var string                 $wtpass
23dc270d8cSGreg Roach * @var string                 $wtuser
24dc270d8cSGreg Roach */
25d70512abSGreg Roach
26d70512abSGreg Roach?>
27982d76d1SGreg Roach
2883615acfSGreg Roach<form method="post" autocomplete="off">
29982d76d1SGreg Roach    <input name="lang" type="hidden" value="<?= e($lang) ?>">
30982d76d1SGreg Roach    <input name="dbtype" type="hidden" value="<?= e($dbtype) ?>">
31982d76d1SGreg Roach    <input name="dbhost" type="hidden" value="<?= e($dbhost) ?>">
32982d76d1SGreg Roach    <input name="dbport" type="hidden" value="<?= e($dbport) ?>">
33982d76d1SGreg Roach    <input name="dbuser" type="hidden" value="<?= e($dbuser) ?>">
34982d76d1SGreg Roach    <input name="dbpass" type="hidden" value="<?= e($dbpass) ?>">
35982d76d1SGreg Roach    <input name="wtname" type="hidden" value="<?= e($wtname) ?>">
36982d76d1SGreg Roach    <input name="wtuser" type="hidden" value="<?= e($wtuser) ?>">
37982d76d1SGreg Roach    <input name="wtpass" type="hidden" value="<?= e($wtpass) ?>">
38982d76d1SGreg Roach    <input name="wtemail" type="hidden" value="<?= e($wtemail) ?>">
39982d76d1SGreg Roach
40982d76d1SGreg Roach    <h2>
41982d76d1SGreg Roach        <?= I18N::translate('Database connection') ?> – SQLite
42982d76d1SGreg Roach    </h2>
43982d76d1SGreg Roach
44982d76d1SGreg Roach    <?php foreach ($errors as $error) : ?>
45982d76d1SGreg Roach        <p class="alert alert-danger"><?= $error ?></p>
46982d76d1SGreg Roach    <?php endforeach ?>
47982d76d1SGreg Roach
48982d76d1SGreg Roach    <?php foreach ($warnings as $warning) : ?>
49982d76d1SGreg Roach        <p class="alert alert-warning"><?= $warning ?></p>
50982d76d1SGreg Roach    <?php endforeach ?>
51982d76d1SGreg Roach
529e3c2cf9SGreg Roach    <div class="row mb-3">
53982d76d1SGreg Roach        <label class="col-form-label col-sm-3" for="dbname">
54982d76d1SGreg Roach            <?= I18N::translate('Database name') ?>
55982d76d1SGreg Roach        </label>
56982d76d1SGreg Roach
57982d76d1SGreg Roach        <div class="col-sm-9">
58982d76d1SGreg Roach            <div class="input-group" dir="ltr">
59dc270d8cSGreg Roach                <span class="input-group-text"><?=e((string) realpath(Webtrees::ROOT_DIR)) ?>/data/</span>
60982d76d1SGreg Roach
617bf2ba3bSGreg Roach                <input class="form-control" id="dbname" name="dbname" pattern="[a-zA-Z0-9_]{1,63}" type="text" value="<?= e($dbname) ?>">
62982d76d1SGreg Roach
63982d76d1SGreg Roach                <span class="input-group-text">.sqlite</span>
64982d76d1SGreg Roach            </div>
65982d76d1SGreg Roach
66315eb316SGreg Roach            <div class="form-text">
67982d76d1SGreg Roach                <?= I18N::translate('Use letters A-Z, a-z, digits 0-9, or underscores') ?>
68315eb316SGreg Roach            </div>
69982d76d1SGreg Roach        </div>
70982d76d1SGreg Roach    </div>
71982d76d1SGreg Roach
729e3c2cf9SGreg Roach    <div class="row mb-3">
73982d76d1SGreg Roach        <label class="col-form-label col-sm-3" for="tblpfx">
74982d76d1SGreg Roach            <?= I18N::translate('Table prefix') ?>
75982d76d1SGreg Roach        </label>
76982d76d1SGreg Roach
77982d76d1SGreg Roach        <div class="col-sm-9">
7809331e47SGreg Roach            <input class="form-control" dir="ltr" id="tblpfx" maxlength="15" name="tblpfx" pattern="[a-zA-Z0-9_]+" type="text" value="<?= e($tblpfx) ?>">
79982d76d1SGreg Roach
80315eb316SGreg Roach            <div class="form-text">
81982d76d1SGreg Roach                <?= 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.') ?>
82982d76d1SGreg Roach                <?= I18N::translate('Use letters A-Z, a-z, digits 0-9, or underscores') ?>
83315eb316SGreg Roach            </div>
84982d76d1SGreg Roach        </div>
85982d76d1SGreg Roach    </div>
86982d76d1SGreg Roach
87982d76d1SGreg Roach    <hr>
88982d76d1SGreg Roach
89982d76d1SGreg Roach    <div class="d-flex justify-content-between">
90982d76d1SGreg Roach        <button class="btn btn-primary" name="step" type="submit" value="5">
91982d76d1SGreg Roach            <?= I18N::translate('next') ?>
92982d76d1SGreg Roach        </button>
933e0eba26SGreg Roach
943e0eba26SGreg Roach        <button class="btn btn-secondary" name="step" type="submit" value="3">
953e0eba26SGreg Roach            <?= I18N::translate('previous') ?>
963e0eba26SGreg Roach        </button>
97982d76d1SGreg Roach    </div>
98982d76d1SGreg Roach</form>
99