-
Notifications
You must be signed in to change notification settings - Fork 5
/
install.php
64 lines (50 loc) · 1.71 KB
/
install.php
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
<?PHP
include_once 'functions.php';
echo "<h1>TOOLBOX Setup</h1><hr />";
echo "<h3>Creating table 'devices'...";
$query = "CREATE TABLE IF NOT EXISTS `devices` (
`token` varchar(255) NOT NULL,
`appname` varchar(127) NOT NULL,
`appver` varchar(32) NOT NULL,
`uid` varchar(255) NOT NULL,
`name` varchar(127) NOT NULL,
`model` varchar(127) NOT NULL,
`sysver` varchar(32) NOT NULL,
`badge` tinyint(8) NOT NULL,
`alert` varchar(127) NOT NULL,
`sound` varchar(255) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
$results = mysql_query($query);
if (!$results) die(mysql_error());
else echo "Done.</h3>";
echo "<h3>Creating table 'apps'...";
$query = "CREATE TABLE IF NOT EXISTS `apps` (
`name` varchar(255) NOT NULL,
`url` varchar(255) NOT NULL,
`thumb` varchar(255) NOT NULL,
`comments` varchar(255) NOT NULL,
PRIMARY KEY (`name`),
KEY `app_name` (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
$results = mysql_query($query);
if (!$results) die(mysql_error());
else echo "Done.</h3>";
echo "<h3>Adding table 'users'...";
$query = "CREATE TABLE IF NOT EXISTS `users` (
`name` varchar(255) NOT NULL,
`pass` varchar(255) NOT NULL,
`fullname` varchar(255) NOT NULL,
`email` varchar(255) NOT NULL,
PRIMARY KEY (`name`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;";
$results = mysql_query($query);
if (!$results) die(mysql_error());
else echo "Done.</h3>";
echo "<h3>Adding users 'admin & demo' to table 'users'...";
$query = "INSERT IGNORE INTO `users` (`name`, `pass`, `fullname`, `email`) VALUES
('admin', 'passpush@07102013', 'Administrator', '[email protected]');";
$results = mysql_query($query);
if (!$results) die(mysql_error());
else echo "Done.</h3>";
echo "<hr /><p>Setup Finished.</p>";
?>