forked from Frecuencio/sqlbuddy-php7
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.php
More file actions
237 lines (193 loc) · 5.1 KB
/
home.php
File metadata and controls
237 lines (193 loc) · 5.1 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
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<?php
/*
SQL Buddy - Web based MySQL administration
http://interruptorgeek.com/sql-buddy-ig-review/
home.php
- create a new database, links, etc
MIT license
Original : 2008 Calvin Lough <http://calv.in>
Reviewed : 2016 Carlos Martín Arnillas <https://interruptorgeek.com>
*/
include "functions.php";
loginCheck();
?>
<table class="hometable">
<tr>
<td>
<h4><?php echo __("Welcome to SQL Buddy - IG Review!"); ?></h4>
</td>
</tr>
<tr>
<td style="padding: 0 0 13px 10px">
<?php
$dbVersion = $conn->getVersion();
if (isset($_SESSION['SB_LOGIN_USER']) && $conn->getOptionValue("host")) {
$message = sprintf(__("You are connected to MySQL %s with the user %s. PHP Version: %s"), $dbVersion, $_SESSION['SB_LOGIN_USER'] . "@" . $conn->getOptionValue("host"), phpversion());
}
echo "<p>" . $message . "</p>";
?>
<table cellspacing="0" cellpadding="0">
<?php
/*
//Disabled version check at the moment
if (function_exists("curl_init") && ((isset($sbconfig['EnableUpdateCheck']) && $sbconfig['EnableUpdateCheck'] == true) || !isset($sbconfig['EnableUpdateCheck']))) {
//check for a new version
$crl = curl_init();
$url = "http://www.sqlbuddy.com/versioncheck2.php";
curl_setopt($crl, CURLOPT_URL, $url);
curl_setopt($crl, CURLOPT_RETURNTRANSFER, 1);
curl_setopt($crl, CURLOPT_CONNECTTIMEOUT, 5); // 5 seconds
$content = curl_exec($crl);
curl_close($crl);
if (strlen($content) > 0) {
$content = strip_tags($content);
list($version, $notes) = explode("\n", $content, 2);
?>
<tr>
<td class="inputfield">
<?php echo __("Updates"); ?>:
</td>
<td>
<?php
if (version_compare($version, VERSION_NUMBER, ">")) {
echo '<span style="background-color: rgb(255, 255, 200); padding: 1px 3px 1px 4px">' . __("A new version of SQL Buddy is available!") . '</span> <a href="http://www.sqlbuddy.com/download/dl.php">' . __("Download") . ' »</a>';
} else {
echo __("There are no updates available") . ".";
}
?>
</td>
</tr>
<?php
}
}
*/
?>
<tr>
<td class="inputfield">
<?php echo __("Language"); ?>:
</td>
<td>
<?php
if (sizeof($langList) > 0) {
echo '<select id="langSwitcher" onchange="switchLanguage()">';
foreach ($langList as $langCode => $langName) {
echo '<option value="' . $langCode . '"';
if ($lang == $langCode)
echo " selected";
echo '>' . $langName . '</option>';
}
echo '</select>';
}
?>
</td>
</tr>
<tr>
<td class="inputfield">
<?php echo __("Theme"); ?>:
</td>
<td>
<select id="themeSwitcher" onchange="switchTheme()">
<?php
foreach ($themeList as $t => $n) {
echo '<option value="' . $t . '"';
if ($theme == $t) {
echo " selected";
}
echo '>' . $n . '</option>';
}
?>
</select>
</td>
</tr>
</table>
</td>
</tr>
<tr>
<td>
<h4><?php echo __("Getting started"); ?></h4>
</td>
</tr>
<tr>
<td style="padding: 1px 0 15px 10px">
<ul>
<li><a href="http://www.interruptorgeek.com/sql-buddy-ig-review/"><?php echo __("Help"); ?></a></li>
<li><a href="https://github.com/Frecuencio/sqlbuddy-php7"><?php echo __("GitHub"); ?></a></li>
<li><a href="http://sqlbuddy.com/"><?php echo __("Original"); ?></a></li>
</ul>
</td>
</tr>
<tr>
<td>
<h4><?php echo __("Did you know..."); ?></h4>
</td>
</tr>
<tr>
<td style="padding: 0 0 10px 10px;">
<p><?php
$didYouKnow[] = __("There is an easier way to select a large group of items when browsing table rows. Check the first row, hold the shift key, and check the final row. The checkboxes between the two rows will be automatically checked for you.");
$didYouKnow[] = __("The columns in the browse and query tabs are resizable. Adjust them to as wide or narrow as you like.");
$didYouKnow[] = __("The login page is based on a default user of root@localhost. By editing config.php, you can change the default user and host to whatever you want.");
$rand = rand(0, count($didYouKnow) - 1);
echo $didYouKnow[$rand];
?></p>
</td>
</tr>
<tr>
<td>
<h4><?php echo __("Keyboard shortcuts"); ?></h4>
</td>
</tr>
<tr>
<td style="padding: 4px 0 5px 10px">
<table class="keyboardtable">
<tr>
<th><?php echo __("Press this key..."); ?></th>
<th><?php echo __("...and this will happen"); ?></th>
</tr>
<tr>
<td>a</td>
<td><?php echo __("select all"); ?></td>
</tr>
<tr>
<td>n</td>
<td><?php echo __("select none"); ?></td>
</tr>
<tr>
<td>e</td>
<td><?php echo __("edit selected items"); ?></td>
</tr>
<tr>
<td>d</td>
<td><?php echo __("delete selected items"); ?></td>
</tr>
<tr>
<td>r</td>
<td><?php echo __("refresh page"); ?></td>
</tr>
<tr>
<td>q</td>
<td><?php echo __("load the query tab"); ?></td>
</tr>
<tr>
<td>f</td>
<td><?php echo __("browse tab - go to first page of results"); ?></td>
</tr>
<tr>
<td>l</td>
<td><?php echo __("browse tab - go to last page of results"); ?></td>
</tr>
<tr>
<td>g</td>
<td><?php echo __("browse tab - go to previous page of results"); ?></td>
</tr>
<tr>
<td>h</td>
<td><?php echo __("browse tab - go to next page of results"); ?></td>
</tr>
<tr>
<td>o</td>
<td><?php echo __("optimize selected tables"); ?></td>
</tr>
</table>
</tr>
</table>