xref: /webtrees/resources/views/setup/step-3-database-type.phtml (revision 52550490b7095dd69811f3ec21ed5a3ca1a8968d)
1<?php
2
3declare(strict_types=1);
4
5use Fisharebest\Webtrees\DB;
6use Fisharebest\Webtrees\I18N;
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="dbname" type="hidden" value="<?= e($dbname) ?>">
31    <input name="tblpfx" type="hidden" value="<?= e($tblpfx) ?>">
32    <input name="wtname" type="hidden" value="<?= e($wtname) ?>">
33    <input name="wtuser" type="hidden" value="<?= e($wtuser) ?>">
34    <input name="wtpass" type="hidden" value="<?= e($wtpass) ?>">
35    <input name="wtemail" type="hidden" value="<?= e($wtemail) ?>">
36
37    <h2>
38        <?= I18N::translate('Connection to database server') ?>
39    </h2>
40
41    <?php foreach ($errors as $error) : ?>
42        <p class="alert alert-danger"><?= $error ?></p>
43    <?php endforeach ?>
44
45    <?php foreach ($warnings as $warning) : ?>
46        <p class="alert alert-warning"><?= $warning ?></p>
47    <?php endforeach ?>
48
49    <p>
50        <?= I18N::translate('webtrees needs a database to store your genealogy data.') ?>
51    </p>
52
53    <div class="row mb-3">
54        <label class="col-form-label col-sm-3" for="dbhost">
55            <?= I18N::translate('Database type') ?>
56        </label>
57        <div class="col-sm-9">
58            <div class="form-check">
59                <input class="form-check-input" type="radio" name="dbtype" id="dbtype-mysql" value="mysql" <?= $dbtype === DB::MYSQL ? 'checked' : '' ?>>
60                <label class="form-check-label" for="dbtype-mysql">
61                    MySQL
62                </label>
63            </div>
64
65            <div class="form-check">
66                <input class="form-check-input" type="radio" name="dbtype" id="dbtype-sqlite" value="sqlite" <?= $dbtype === DB::SQLITE ? 'checked' : '' ?>>
67                <label class="form-check-label" for="dbtype-sqlite">
68                    SQLite
69                </label>
70            </div>
71
72            <div class="form-check">
73                <input class="form-check-input" type="radio" name="dbtype" id="dbtype-pgsql" value="pgsql" <?= $dbtype === DB::POSTGRES ? 'checked' : '' ?>>
74                <label class="form-check-label" for="dbtype-pgsql">
75                    PostgreSQL
76                </label>
77            </div>
78
79            <div class="form-check">
80                <input class="form-check-input" type="radio" name="dbtype" id="dbtype-sqlsrv" value="sqlsrv" <?= $dbtype === DB::SQL_SERVER ? 'checked' : '' ?>>
81                <label class="form-check-label" for="dbtype-sqlsrv">
82                    SQL Server
83                </label>
84            </div>
85
86            <div class="form-text">
87            </div>
88        </div>
89    </div>
90
91
92    <hr>
93
94    <div class="d-flex justify-content-between">
95        <button class="btn btn-primary" name="step" type="submit" value="4">
96            <?= I18N::translate('next') ?>
97        </button>
98
99        <button class="btn btn-secondary" name="step" type="submit" value="2">
100            <?= I18N::translate('previous') ?>
101        </button>
102    </div>
103</form>
104