-
Notifications
You must be signed in to change notification settings - Fork 2
/
functions-editor.php
52 lines (42 loc) · 1.05 KB
/
functions-editor.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
<?php
function getAllTemplates () {
global $db_connection;
$sql = 'SELECT * FROM `templates` ORDER BY `name`';
$results = mysql_query($sql);
$templates = array();
while ($result = mysql_fetch_array($results)) {
$templates[] = $result;
}
return $templates;
}
function getAllColours () {
global $db_connection;
$sql = 'SELECT * FROM `colours` ORDER BY `name`';
$results = mysql_query($sql);
$colours = array();
while ($result = mysql_fetch_array($results)) {
$colours[] = $result;
}
return $colours;
}
function getAllFonts () {
global $db_connection;
$sql = 'SELECT * FROM `fonts` ORDER BY `name`';
$results = mysql_query($sql);
$fonts = array();
while ($result = mysql_fetch_array($results)) {
$fonts[] = $result;
}
return $fonts;
}
function getTemplateFields ($template_id) {
global $db_connection;
$sql = 'SELECT * FROM `fields` WHERE `template_id` = '.$template_id.' ORDER BY `name`';
$results = mysql_query($sql);
$fields = array();
while ($result = mysql_fetch_array($results)) {
$fields[] = $result;
}
return $fields;
}
?>