summaryrefslogtreecommitdiffstats
path: root/app/view/dbconfig.php
blob: 3c371e8cbdb7bc6302dff0e033700b276d432327 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
<?php

/*
 * SCROTT IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 * IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 *
 * For more information, please refer to UNLICENSE
 */

require_once "model/dbconfig.php";
require_once "view/stdpage.php";
require_once "view/formctrl.php";

?>

<!DOCTYPE html>

<html lang="en">
    <head>
        <?=stdpage\head( "Database Configuration" )?>
    </head>

    <body>
        <?=stdpage\top()?>

        <div class="container">
            <div class="jumbotron">
                <h2 class="text-center">
                    <span class="glyphicon glyphicon-user"></span>&nbsp;&nbsp;&nbsp;
                    <span class="glyphicon glyphicon-th"></span>&nbsp;&nbsp;&nbsp;
                    <span class="glyphicon glyphicon-edit"></span>&nbsp;&nbsp;&nbsp;
                    <span class="glyphicon glyphicon-tasks"></span>&nbsp;&nbsp;&nbsp;
                    <span class="glyphicon glyphicon-inbox"></span>&nbsp;&nbsp;&nbsp;
                    <span class="glyphicon glyphicon-envelope"></span>&nbsp;&nbsp;&nbsp;
                </h2>

                <h1 class="text-center">Welcome to Scrott!</h1>
                <hr />

                <p class="text-center">You're seeing this page because the file "dbconfig.php" is missing.</p>
                <p class="text-center">Please fill out the form below to configure Scrott to use your database.</p>
                <hr />

                <p class="text-center">This form will save your database parameters to the configuration file.<br />
                Scrott needs this information before it can begin working!</p>

                <h5 class="text-center">
                    It is presumed that you are the administrator for this Scrott install.<br />
                    There is a security risk involved with exposing this page to the public!
                </h5>

                <div class="row">
                    <div class="col-md-2"></div>

                    <div class="col-md-8">
                        <div class="panel panel-default">
                            <div class="panel-body">
                                <form method="post" action="<?=ap()?>">
                                    <?=formctrl\formname( "save" )?>
                                    <?=formctrl\text( "Engine", "dbEngine", "MySQL", "", false, true )?>
                                    <?=formctrl\text( "Hostname", "dbHost", "", "localhost" )?>
                                    <?=formctrl\text( "Username", "dbUname", "", "root" )?>
                                    <?=formctrl\password( "Password", "dbPasswd", false )?>
                                    <?=formctrl\text( "Database Name", "dbName", "", "db_scrott" )?>

                                    <button type="submit" class="btn btn-primary pull-right">
                                        Use these settings
                                    </button>
                                </form>
                            </div>
                        </div>
                    </div>

                    <div class="col-md-2"></div>
                </div>
            </div>
        </div>

        <?=stdpage\foot()?>
    </body>
</html>