Repository navigation
Expand file tree
/
Copy pathdefault.php
More file actions
232 lines (183 loc) · 5.8 KB
/
Copy pathdefault.php
File metadata and controls
232 lines (183 loc) · 5.8 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
<?php
require('common.php');
//
// Get the list of demo pages
//
$list = glob('./examples/*.php');
?>
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="chrome=1">
<meta name="robots" content="noindex, follow">
<title>SQLite Edit for PHP</title>
<link rel="stylesheet" href="css/common.css" type="text/css" media="screen" />
<style>
body {
text-align: left;
padding-top: 10px;
}
ul {
list-style: none;
}
</style>
<script src="js/jquery.min.351.js"></script>
</head>
<body>
<h1>SQLite Edit for PHP</h1>
<ul>
<li><a href="#introduction">Introduction</a></li>
<li><a href="#example-pages">Example pages</a></li>
<li><a href="#support">Support</a></li>
</ul>
<a name="introduction"></a>
<h2>Introduction</h2>
<p>
SQLite Edit for PHP is a tool for providing
add/edit/delete interfaces to your websites users.
The examples that are linked to below should work
straight-away without you having to configure anything
(assuming your server can run PHP files). SQLite is
built into modern PHP so you shouldn't have to
install that.
</p>
<div style="line-height: 25px; width: 75%; margin-left: auto; margin-right: auto">
<?php
$editor = new SQLiteEdit([
'filename' => 'examples/sqliteedit.db',
'table' => 'accounts',
'sql_select' => 'SELECT id,
forename,
surname,
username,
created
FROM accounts
WHERE {where}
{order}',
'columns_names' => $names = [
'id' => 'ID',
'forename' => 'First name',
'surname' => 'Second name',
'username' => 'Username',
'created' => 'Created'
],
'columns_widths' => [
'id' => 50,
'*' => 150
],
'search_columns' => array_keys($names),
'editable' => [
'username' => true,
'forename' => true
],
'editable_types' => [
'username' => 'text',
'forename' => 'select'
],
'editable_types_select_options' => [
'forename' => ',Richard,John,Dave,Edgar'
],
'style' => [
'tfoot button,tfoot input[type=submit] {font-size: 16pt;}',
'div.editor :where(th, td) div {padding-left: 5px;}',
'div.editor tfoot :where(button.editor_button_add, input.editor_button_delete) {font-size: 110%;}'
]
]);
$editor->draw();
?>
</div>
<pre class="code">
<?php
$editor = new SQLiteEdit([
'filename' => 'examples/sqliteedit.db',
'table' => 'accounts',
'sql_select' => 'SELECT id,
forename,
surname,
username,
created
FROM accounts
WHERE {where}
{order}',
'columns_names' => $names = [
'id' => 'ID',
'forename' => 'First name',
'surname' => 'Second name',
'username' => 'Username',
'created' => 'Created'
],
'columns_widths' => [
'id' => 50,
'*' => 150
],
'search_columns' => array_keys($names),
'editable' => [
'username' => true,
'forename' => true
],
'editable_types' => [
'username' => 'text',
'forename' => 'select'
],
'editable_types_select_options' => [
'forename' => ',Richard,John,Dave,Edgar'
],
'style' => [
'tfoot button,tfoot input[type=submit] {font-size: 16pt;}',
'div.editor :where(th, td) div {padding-left: 5px;}',
'div.editor tfoot :where(button.editor_button_add, input.editor_button_delete) {font-size: 110%;}'
]
]);
$editor->draw();
?>
</pre>
<a name="example-pages"></a>
<h2>Example pages</h2>
<p>
All of these are in the <a href="./examples/">./examples/</a> directory.
</p>
<ul>
<?php
foreach ($list as $l) {
printf('<li><a href="%s">%s</a></li>', $l, basename($l));
}
?>
</ul>
<a name="support"></a>
<h2>Support</h2>
<p>
If you have an issue with Sqlite Edit for PHP then please email me
directly using the email address richardheyes at Google's
popular wedbmail app.
</p>
<div>
<div style="float: right">
<i><a href="https://www.rgraph.net/sqliteedit/index.html" target="_blank" rel="nofollow">The SQLite Edit for PHP website</a></i>
</div>
</div>
<script>
//
// Make all anchor links scroll to the anchors
// instead of jumping to them.
//
// IMPORTANT: THIS IS REPEATED IN THE PAGE
// HEADER FOR THE WEBSITE
//
function scrollToAnchor(name)
{
var tag = $("a[name='" + name + "']");
$("html,body").animate({
scrollTop: tag.offset().top - 60
},"slow");
}
$("a").on('mousedown', function()
{
var href = this.getAttribute("href");
if (href.substr(0,1) === "#") {
var target = href.substr(1).replace(/'/i,'');
scrollToAnchor(target);
}
});
</script>
</body>
</html>