-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.php
More file actions
207 lines (165 loc) · 8.92 KB
/
install.php
File metadata and controls
207 lines (165 loc) · 8.92 KB
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
<?php
$con = __DIR__ . "/lib/config/conn.php";
require_once __DIR__ . '/lib/functions.php';
if (file_exists($con)) {
require_once $con;
} else {
die("Config.php is not found");
}
if ($config['app.installed'] == '1') {
$messageType = 'info';
$message = 'Please delete "install.php" file in your root directory before launching your site';
}
$app['name'] = $config['app.title'];
createDB();
//if (isset($_POST['install']) && $_POST['install'] == '1') {
// writeConfig(array(
// 'host' => $_POST['data']['DB_HOST'],
// 'user' => $_POST['data']['DB_USER'],
// 'password' => $_POST['data']['DB_PASSWORD'],
// 'dbname' => $_POST['data']['DB_NAME'],
// 'dbprefix' => $_POST['data']['TABLES_PREFIX'],
// 'driver' => 'pdo_mysql',
// )
// );
// createDB();
//
// // WASD::loadConfig(ROOT_DIR . "/config.php");
// // WASD::setDB();
//}
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<title> Install <?php echo $app['name'] ?></title>
<!-- <link rel="stylesheet" type="text/css" media="screen" href="//netdna.bootstrapcdn.com/bootswatch/3.0.3/yeti/bootstrap.min.css"> -->
<link rel="stylesheet" type="text/css" media="screen"
href="lib/vendor/twitter/bootstrap/dist/css/bootstrap.min.css">
<!-- <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script> -->
<script type="text/javascript" src="lib/jquery-2.1.1.min.js"></script>
<script type="text/javascript" src="lib/vendor/twitter/bootstrap/dist/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container">
<div class="page-header" id="banner">
<div class="row">
<div class="col-lg-12">
<h1>Install <?php echo $app['name'] ?></h1>
</div>
</div>
</div>
<div class="bs-docs-section">
<!-- Headings -->
<div class="row">
<div class="col-lg-8">
<div class="bs-example">
<h3>Before installation</h3>
<p>
Please read the documentation carefully before installing. <br/>
Make sure your web host have the minimum requirements to run <?php echo $app['name'] ?>. <br/>
</p>
<hr>
<div class="clearfix"></div>
<hr>
<?php if (isset($message)): ?>
<div
class="alert alert-dismissable alert-<?php echo $messageType ?>"><?php echo $message ?></div>
<?php endif; ?>
<?php if (!isset($message) || $messageType == 'danger'): ?>
<h3>Insert database info</h3>
<br/>
<form class="bs-example form-horizontal" method="POST" action="">
<input type="hidden" name="INSTALL" value="1">
<fieldset>
<div class="form-group">
<label class="col-lg-2 control-label">Database HOST</label>
<div class="col-lg-10">
<input type="text" name="data[DB_HOST]" class="form-control" id="inputEmail"
required placeholder="127.0.0.1">
<label>Insert an IP address will help the system run faster than a hostname. Eg.
127.0.0.1 instead of localhost</label>
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Username (*)</label>
<div class="col-lg-10">
<input type="text" name="data[DB_USER]" class="form-control" id="inputPassword"
required placeholder="Database USER">
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Password</label>
<div class="col-lg-10">
<input type="password" name="data[DB_PASSWORD]" class="form-control"
id="inputPassword" placeholder="Database password for user above">
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Database NAME</label>
<div class="col-lg-10">
<input type="text" name="data[DB_NAME]" class="form-control" id="inputPassword"
required placeholder="Database Name">
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Database PREFIX</label>
<div class="col-lg-10">
<input type="text" name="data[TABLES_PREFIX]" class="form-control"
id="inputPassword" placeholder="Database Prefix (Optional)">
<label>This field is optional, if you install two applications with one
database, use prefix to distinguish them apart</label>
</div>
</div>
<hr>
<h3>Site details</h3>
<br/>
<div class="form-group">
<label class="col-lg-2 control-label">SITE NAME</label>
<div class="col-lg-10">
<input type="text" name="data[UNIK_SITE]" class="form-control"
id="inputPassword" required placeholder="<?php echo $app['name'] ?>">
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">SITE URL</label>
<div class="col-lg-10">
<input type="url" name="data[UNIK_URL]" class="form-control" id="inputPassword"
required placeholder="http://hyteck.com.br">
</div>
</div>
<hr>
<h3>Insert Admin username and password</h3>
<br/>
<div class="form-group">
<label class="col-lg-2 control-label">Username</label>
<div class="col-lg-10">
<input type="text" name="data[AD_USERNAME]" required class="form-control"
id="inputUser" placeholder="ADMIN">
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Email</label>
<div class="col-lg-10">
<input type="email" name="data[AD_EMAIL]" required class="form-control"
id="inputEmail" placeholder="admin@hyteck.com.br">
</div>
</div>
<div class="form-group">
<label class="col-lg-2 control-label">Password</label>
<div class="col-lg-10">
<input type="password" name="data[AD_PW]" required class="form-control"
id="inputPassword" placeholder="PASSWORD">
</div>
</div>
<input type="hidden" name="install" value="1">
<button type="submit" class="btn btn-info col-lg-offset-2">Install</button>
</form>
<?php endif; ?>
</div>
</div>
</div>
</div>
</div>
</body>
</html>