Mercurial > hg > fapweb
annotate admajax.php @ 113:671330b7f5d1
Add "show_id" to compo entries, to designate the position they were shown at
in the competition.
author | Matti Hamalainen <ccr@tnsp.org> |
---|---|
date | Tue, 22 Oct 2013 12:09:32 +0300 |
parents | 91660a9d50f0 |
children | a95facb41c86 |
rev | line source |
---|---|
0 | 1 <? |
56 | 2 // |
3 // AJAX request handler backend module | |
4 // | |
59
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
5 $sessionType = "admin"; |
0 | 6 require "mconfig.inc.php"; |
7 require "msite.inc.php"; | |
33 | 8 require "msession.inc.php"; |
0 | 9 |
10 // Check if we are allowed to execute | |
5
76c3b89d7b11
Improve voting, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
3
diff
changeset
|
11 if (!stCheckHTTPS() || !stAdmSessionAuth()) |
0 | 12 { |
59
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
13 stSetupCacheControl(); |
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
14 |
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
15 stSessionEnd(SESS_ADMIN); |
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
16 |
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
17 header("Location: news"); |
0 | 18 exit; |
19 } | |
20 | |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
21 stSetupCacheControl(); |
0 | 22 |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
23 // Initiate SQL database connection |
0 | 24 if (!stConnectSQLDB()) |
25 die("Could not connect to SQL database."); | |
26 | |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
27 // Fetch non-"hardcoded" settings from SQL database |
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
28 stReloadSettings(); |
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
29 |
0 | 30 |
16 | 31 function saveButton() |
32 { | |
33 return "<input type=\"submit\" value=\" Save \" />\n"; | |
34 } | |
35 | |
36 | |
0 | 37 // XMLHttp responses |
38 $action = "ERROR"; | |
39 if (stChkRequestItem("action") && stChkRequestItem("type")) | |
40 { | |
41 $action = $_REQUEST["action"]; | |
42 $type = $_REQUEST["type"]; | |
43 } | |
44 | |
45 | |
46 switch ($action) | |
47 { | |
48 case "dump": | |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
49 // |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
50 // Perform generic data dump |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
51 // |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
52 if (($res = stExecSQLCond( |
0 | 53 "SELECT * FROM attendees WHERE email NOT NULL AND email != '' ORDER BY regtime DESC", |
54 "Dump OK.")) !== FALSE) | |
55 { | |
56 $out1 = array(); | |
57 $out2 = array(); | |
58 | |
59 foreach ($res as $item) | |
60 { | |
61 $out1[] = $item["name"]." <".$item["email"].">"; | |
62 $out2[] = $item["email"]; | |
63 } | |
64 | |
65 echo "<br /><hr />". | |
66 implode(", ", $out1)."<br /><hr /><br />". | |
67 implode("<br />", $out1)."<br /><hr /><br />". | |
68 implode(", ", $out2)."<br /><hr /><br />". | |
69 implode("<br />", $out2)."<br /><hr />"; | |
70 | |
71 } | |
72 break; | |
73 | |
74 case "get": | |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
75 // |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
76 // Get specific data |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
77 // |
0 | 78 switch ($type) |
79 { | |
80 case "news": | |
81 $sql = "SELECT * FROM news ORDER BY utime DESC"; | |
82 break; | |
83 | |
84 case "attendees": | |
85 $sql = "SELECT * FROM attendees ORDER BY regtime DESC"; | |
86 break; | |
87 | |
105
a85f258f6beb
Move some things around and modularize the code.
Matti Hamalainen <ccr@tnsp.org>
parents:
90
diff
changeset
|
88 case "voters": |
a85f258f6beb
Move some things around and modularize the code.
Matti Hamalainen <ccr@tnsp.org>
parents:
90
diff
changeset
|
89 break; |
a85f258f6beb
Move some things around and modularize the code.
Matti Hamalainen <ccr@tnsp.org>
parents:
90
diff
changeset
|
90 |
0 | 91 case "compos": |
92 $sql = "SELECT * FROM compos ORDER BY id DESC"; | |
93 break; | |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
94 |
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
95 case "settings": |
14
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
96 $prefix = "st"; |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
97 |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
98 echo |
16 | 99 "<h1>Site settings</h1>\n". |
14
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
100 "<table>\n"; |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
101 foreach (stExecSQL("SELECT * FROM settings WHERE vtype<>".VT_TEXT) as $item) |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
102 { |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
103 echo |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
104 " <tr>\n". |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
105 " <td>"; |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
106 $id = $item["key"]; |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
107 switch ($item["vtype"]) |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
108 { |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
109 case VT_INT: |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
110 echo stGetFormTextInput(10, 10, "", $id, $prefix, $item["vint"]); |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
111 break; |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
112 case VT_STR: |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
113 echo stGetFormTextInput(40, 128, "", $id, $prefix, $item["vstr"]); |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
114 break; |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
115 case VT_BOOL: |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
116 echo stGetFormCheckBoxInput("", $id, $prefix, $item["vint"], ""); |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
117 break; |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
118 } |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
119 echo "</td>\n". |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
120 " <td>".$item["desc"]."</td>\n". |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
121 " </tr>\n"; |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
122 } |
16 | 123 echo "</table>\n".saveButton(); |
14
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
124 |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
125 foreach (stExecSQL("SELECT * FROM settings WHERE vtype=".VT_TEXT) as $item) |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
126 { |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
127 echo "<h2>".chentities($item["desc"])."</h2>\n". |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
128 stGetFormTextArea(10, 60, "", $item["key"], $prefix, $item["vtext"]). |
16 | 129 "\n<br />\n".saveButton(); |
14
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
130 } |
8
4c5f651aa107
Migrate certain settings to SQL database, cleanups, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
5
diff
changeset
|
131 break; |
0 | 132 |
133 case "entries": | |
24
5bc8bd5c7ecc
Make voting toggle for individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents:
20
diff
changeset
|
134 stGetCompoList(FALSE, FALSE); |
0 | 135 |
136 foreach ($compos as $id => $compo) | |
137 { | |
138 echo | |
139 "<form>\n". | |
140 " <table class=\"misc\">\n". | |
141 " <tr>\n". | |
59
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
142 " <th colspan=\"5\">#".$id." - ".chentities($compo["name"])."</th>\n". |
0 | 143 " </tr>\n". |
144 " <tr>\n". | |
113
671330b7f5d1
Add "show_id" to compo entries, to designate the position they were shown at
Matti Hamalainen <ccr@tnsp.org>
parents:
112
diff
changeset
|
145 " <th style=\"width:4%;\">ID#</th>\n". |
671330b7f5d1
Add "show_id" to compo entries, to designate the position they were shown at
Matti Hamalainen <ccr@tnsp.org>
parents:
112
diff
changeset
|
146 " <th style=\"width:4%;\">S#</th>\n". |
0 | 147 " <th>Title</th>\n". |
29 | 148 " <th>Author(s)</th>\n". |
59
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
149 " <th>Filename</th>\n". |
0 | 150 " <th>Actions</th>\n". |
151 " </tr>\n"; | |
152 | |
153 $prefix = "en"; | |
154 foreach ($compo["entries"] as $eid => $entry) | |
155 { | |
156 echo | |
157 " <tr id=\"entry".$eid."\">\n". | |
113
671330b7f5d1
Add "show_id" to compo entries, to designate the position they were shown at
Matti Hamalainen <ccr@tnsp.org>
parents:
112
diff
changeset
|
158 " <td>".$eid."</td>\n". |
671330b7f5d1
Add "show_id" to compo entries, to designate the position they were shown at
Matti Hamalainen <ccr@tnsp.org>
parents:
112
diff
changeset
|
159 " <td>".($entry["show_id"] > 0 ? $entry["show_id"] : "-")."</td>\n". |
59
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
160 " <td>".stGetFormTextInput(30, 64, "name", $eid, "en", $entry["name"])."</td>\n". |
29 | 161 " <td>".stGetFormTextInput(30, 64, "author", $eid, "en", $entry["author"])."</td>\n". |
59
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
162 " <td>".stGetFormTextInput(20, 64, "filename", $eid, "en", $entry["filename"])."</td>\n". |
0 | 163 " <td>". |
113
671330b7f5d1
Add "show_id" to compo entries, to designate the position they were shown at
Matti Hamalainen <ccr@tnsp.org>
parents:
112
diff
changeset
|
164 stGetFormButtonInput("delete", $eid, $prefix, " Del ", "deleteEntry(".$eid.")"). |
671330b7f5d1
Add "show_id" to compo entries, to designate the position they were shown at
Matti Hamalainen <ccr@tnsp.org>
parents:
112
diff
changeset
|
165 stGetFormTextInput(3, 3, "compo_id", $eid, "en", $id). |
59
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
166 stGetFormButtonInput("update", $eid, $prefix, " Upd ", "updateEntry(".$eid.")"). |
0 | 167 "</td>\n". |
168 " </tr>\n"; | |
111 | 169 $index++; |
0 | 170 } |
59
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
171 |
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
172 $prefix = "ne"; |
0 | 173 echo |
59
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
174 " <tr>\n". |
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
175 " <td></td>\n". |
113
671330b7f5d1
Add "show_id" to compo entries, to designate the position they were shown at
Matti Hamalainen <ccr@tnsp.org>
parents:
112
diff
changeset
|
176 " <td></td>\n". |
59
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
177 " <td>".stGetFormTextInput(30, 64, "name", $id, "ne", "")."</td>\n". |
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
178 " <td>".stGetFormTextInput(30, 64, "author", $id, "ne", "")."</td>\n". |
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
179 " <td>".stGetFormTextInput(20, 64, "filename", $id, "ne", "")."</td>\n". |
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
180 " <td>".stGetFormButtonInput("add", $id, $prefix, " Add new ", "addEntry(".$id.")")."</td>\n". |
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
181 " </tr>\n". |
0 | 182 " </table>\n". |
183 "</form>\n"; | |
184 } | |
185 break; | |
186 } | |
187 | |
56 | 188 // |
189 // Perform query if we need to, output results | |
190 // | |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
191 if (isset($sql) && ($res = stExecSQLCond($sql, "")) !== FALSE) |
0 | 192 { |
193 if ($type == "news") | |
194 { | |
195 foreach ($res as $item) | |
196 { | |
197 $id = $item["id"]; | |
198 stPrintNewsItem($item, | |
199 "<br />". | |
200 " <button class=\"button\" id=\"ndel".$id. | |
201 "\" type=\"button\" onclick=\"deleteNews(".$id. | |
202 ")\">Delete</button>\n" | |
203 ); | |
204 } | |
205 } | |
206 else | |
207 if ($type == "attendees") | |
208 { | |
90 | 209 // List of attendees |
0 | 210 echo |
211 "<table class=\"attendees\">\n". | |
212 " <tr>\n". | |
83 | 213 " <th class=\"name\">Name</th>\n". |
214 " <th class=\"groups\">Groups</th>\n". | |
215 " <th class=\"regtime\">Registered</th>\n". | |
0 | 216 " <th class=\"oneliner\">Oneliner</th>\n". |
217 " <th class=\"email\">E-mail</th>\n". | |
218 " <th>Actions</th>\n". | |
219 " </tr>\n"; | |
220 $row = 0; | |
221 foreach ($res as $item) | |
222 stPrintAttendee($item, $row++, TRUE); | |
61
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
223 |
90 | 224 // For adding a new one |
61
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
225 $prefix = "ne"; |
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
226 echo |
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
227 "</table>\n". |
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
228 "<hr />\n". |
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
229 "<table>\n". |
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
230 " <tr>\n". |
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
231 " <th>Name</th>\n". |
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
232 " <th>Groups</th>\n". |
82
a071dacdcfc5
Change order of table fields.
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
233 " <th>Oneliner</th>\n". |
61
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
234 " <th>E-mail</th>\n". |
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
235 " <th>Actions</th>\n". |
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
236 " </tr>\n". |
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
237 " <tr>\n". |
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
238 " <td>".stGetFormTextInput(20, 64, "name", "x", $prefix, "")."</td>\n". |
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
239 " <td>".stGetFormTextInput(20, 64, "groups", "x", $prefix, "")."</td>\n". |
82
a071dacdcfc5
Change order of table fields.
Matti Hamalainen <ccr@tnsp.org>
parents:
75
diff
changeset
|
240 " <td>".stGetFormTextInput(30, 64, "oneliner", "x", $prefix, "")."</td>\n". |
61
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
241 " <td>".stGetFormTextInput(20, 64, "email", "x", $prefix, "")."</td>\n". |
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
242 " <td>".stGetFormButtonInput("add", "", $prefix, " Add new ", "addAttendee()")."</td>\n". |
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
243 " </tr>\n". |
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
244 "</table>\n"; |
0 | 245 } |
246 else | |
247 if ($type == "compos") | |
248 { | |
249 foreach ($res as $item) | |
250 { | |
251 $id = $item["id"]; | |
252 $prefix = "co"; | |
253 echo | |
254 "<div id=\"compo".$id."\">\n". | |
255 "<h2>#".$id." - ".chentities($item["name"])."</h2>\n". | |
256 stGetFormTextInput(40, 64, "name", $id, $prefix, $item["name"])."\n". | |
24
5bc8bd5c7ecc
Make voting toggle for individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents:
20
diff
changeset
|
257 stGetFormCheckBoxInput("visible", $id, $prefix, $item["visible"], "Visible")."\n". |
55
4fac95384753
Make visibility of entry authors per compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
53
diff
changeset
|
258 stGetFormCheckBoxInput("showAuthors", $id, $prefix, $item["showAuthors"], "Show authors")."\n". |
24
5bc8bd5c7ecc
Make voting toggle for individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents:
20
diff
changeset
|
259 stGetFormCheckBoxInput("voting", $id, $prefix, $item["voting"], "Enable voting")."<br />\n". |
0 | 260 stGetFormTextArea(5, 60, "description", $id, $prefix, $item["description"])."\n<br />\n". |
261 stGetFormButtonInput("update", $id, $prefix, " Update ", "updateCompo(".$id.")")."\n". | |
262 "</div>\n". | |
263 "<hr />\n"; | |
264 } | |
265 } | |
266 } | |
267 break; | |
268 | |
269 case "delete": | |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
270 // |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
271 // Delete entry |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
272 // |
0 | 273 if (stChkRequestItem("id")) |
274 { | |
275 $id = intval(stGetRequestItem("id")); | |
276 | |
277 if ($type == "news") | |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
278 { |
0 | 279 $sql = stPrepareSQL("DELETE FROM news WHERE id=%d AND persist=0", $id); |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
280 stExecSQLCond($sql, "OK, news item ".$id." deleted."); |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
281 } |
0 | 282 else |
283 if ($type == "attendees") | |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
284 { |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
285 // Attendees require some more work |
0 | 286 $sql = stPrepareSQL("DELETE FROM attendees WHERE id=%d", $id); |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
287 stExecSQLCond($sql, "OK, attendee ".$id." deleted."); |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
288 |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
289 $sql = stPrepareSQL("DELETE FROM votes WHERE voter_id=%d", $id); |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
290 stExecSQLCond($sql, "OK, attendee ".$id." votes deleted."); |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
291 } |
0 | 292 else |
293 if ($type == "entries") | |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
294 { |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
295 // .. as do compo entries |
0 | 296 $sql = stPrepareSQL("DELETE FROM entries WHERE id=%d", $id); |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
297 stExecSQLCond($sql, "OK, entry ".$id." deleted."); |
0 | 298 |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
299 $sql = stPrepareSQL("DELETE FROM votes WHERE entry_id=%d", $id); |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
300 stExecSQLCond($sql, "OK, entry ".$id." votes deleted."); |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
301 } |
0 | 302 } |
303 else | |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
304 stSetStatus(901, "No ID specified."); |
0 | 305 break; |
306 | |
307 case "add": | |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
308 // |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
309 // Add new entry |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
310 // |
26
7be3f8cf1f7a
Lots of cleanups, preparing for adding entry submission support.
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
311 if ($type == "news" && stChkRequestItem("text") && |
7be3f8cf1f7a
Lots of cleanups, preparing for adding entry submission support.
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
312 stChkRequestItem("author") && stChkRequestItem("title")) |
0 | 313 { |
314 $sql = stPrepareSQL( | |
315 "INSERT INTO news (utime,title,text,author) VALUES (%d,%S,%Q,%S)", | |
316 time(), "title", "text", "author"); | |
317 | |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
318 stExecSQLCond($sql, "OK, news item added."); |
0 | 319 } |
320 else | |
26
7be3f8cf1f7a
Lots of cleanups, preparing for adding entry submission support.
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
321 if ($type == "compo" && stChkRequestItem("name") && |
7be3f8cf1f7a
Lots of cleanups, preparing for adding entry submission support.
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
322 stChkRequestItem("description")) |
0 | 323 { |
324 $sql = stPrepareSQL( | |
55
4fac95384753
Make visibility of entry authors per compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
53
diff
changeset
|
325 "INSERT INTO compos (name,description,visible,voting,showAuthors) VALUES (%S,%Q,0,0,0)", |
26
7be3f8cf1f7a
Lots of cleanups, preparing for adding entry submission support.
Matti Hamalainen <ccr@tnsp.org>
parents:
24
diff
changeset
|
326 "name", "description"); |
0 | 327 |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
328 stExecSQLCond($sql, "OK, compo added."); |
0 | 329 } |
330 else | |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
331 if ($type == "attendees" && stChkRequestItem("name") && |
75 | 332 stChkRequestItem("groups") && stChkRequestItem("oneliner") && |
333 stChkRequestItem("email")) | |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
334 { |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
335 $sql = stPrepareSQL( |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
336 "INSERT INTO attendees (regtime,name,groups,oneliner,email) VALUES (%d,%S,%S,%S,%S)", |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
337 time(), "name", "groups", "oneliner", "email"); |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
338 |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
339 stExecSQLCond($sql, "OK, attendee added."); |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
340 } |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
341 else |
59
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
342 if ($type == "entry" && stChkRequestItem("name") && |
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
343 stChkRequestItem("author") && stChkRequestItem("compo_id")) |
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
344 { |
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
345 $sql = stPrepareSQL( |
61
e85ed35585fc
Work on attendee editing, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
59
diff
changeset
|
346 "INSERT INTO entries (name,author,compo_id,filename) VALUES (%S,%S,%D,%S)", |
59
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
347 "name", "author", "compo_id", "filename"); |
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
348 |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
349 stExecSQLCond($sql, "OK, entry added."); |
59
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
350 } |
e5e38ed4e837
Work on compo entry addition and editing.
Matti Hamalainen <ccr@tnsp.org>
parents:
57
diff
changeset
|
351 else |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
352 stSetStatus(902, "No data."); |
0 | 353 break; |
354 | |
355 case "update": | |
53
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
356 // |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
357 // Update existing entry |
71256605546b
More work on admin interface.
Matti Hamalainen <ccr@tnsp.org>
parents:
52
diff
changeset
|
358 // |
0 | 359 if ($type == "attendees" && stChkRequestItem("id") && |
52
cba0b944da79
Start combining "users" with "attendees".
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
360 stChkRequestItem("email") && stChkRequestItem("oneliner") && |
cba0b944da79
Start combining "users" with "attendees".
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
361 stChkRequestItem("active")) |
0 | 362 { |
363 $sql = stPrepareSQLUpdate("attendees", | |
364 "WHERE id=".intval(stGetRequestItem("id")), | |
365 array( | |
366 "email" => "S", | |
367 "oneliner" => "S", | |
52
cba0b944da79
Start combining "users" with "attendees".
Matti Hamalainen <ccr@tnsp.org>
parents:
33
diff
changeset
|
368 "active" => "B", |
0 | 369 )); |
370 | |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
371 stExecSQLCond($sql, "OK, attendee updated."); |
0 | 372 } |
373 else | |
374 if ($type == "news" && stChkRequestItem("id") && | |
375 stChkRequestItem("text") && stChkRequestItem("author") && | |
376 stChkRequestItem("title")) | |
377 { | |
378 $sql = stPrepareSQLUpdate("news", | |
379 "WHERE id=".intval(stGetRequestItem("id")), | |
380 array( | |
381 "title" => "S", | |
382 "text" => "Q", | |
383 "author" => "S" | |
384 )); | |
385 | |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
386 stExecSQLCond($sql, "OK, news item updated."); |
0 | 387 } |
388 else | |
389 if ($type == "compo" && stChkRequestItem("id") && | |
390 stChkRequestItem("name") && stChkRequestItem("description") && | |
55
4fac95384753
Make visibility of entry authors per compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
53
diff
changeset
|
391 stChkRequestItem("visible") && stChkRequestItem("voting") && |
4fac95384753
Make visibility of entry authors per compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
53
diff
changeset
|
392 stChkRequestItem("showAuthors")) |
0 | 393 { |
394 $sql = stPrepareSQLUpdate("compos", | |
395 "WHERE id=".intval(stGetRequestItem("id")), | |
396 array( | |
397 "name" => "S", | |
398 "description" => "Q", | |
24
5bc8bd5c7ecc
Make voting toggle for individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents:
20
diff
changeset
|
399 "visible" => "B", |
5bc8bd5c7ecc
Make voting toggle for individual compos.
Matti Hamalainen <ccr@tnsp.org>
parents:
20
diff
changeset
|
400 "voting" => "B", |
55
4fac95384753
Make visibility of entry authors per compo.
Matti Hamalainen <ccr@tnsp.org>
parents:
53
diff
changeset
|
401 "showAuthors" => "B", |
0 | 402 )); |
403 | |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
404 stExecSQLCond($sql, "OK, compo updated."); |
0 | 405 } |
406 else | |
407 if ($type == "entry" && stChkRequestItem("id") && | |
30
ad25827304b6
Adding entries is now done via the regular entry submission system .. which
Matti Hamalainen <ccr@tnsp.org>
parents:
29
diff
changeset
|
408 stChkRequestItem("name") && stChkRequestItem("author") && |
ad25827304b6
Adding entries is now done via the regular entry submission system .. which
Matti Hamalainen <ccr@tnsp.org>
parents:
29
diff
changeset
|
409 stChkRequestItem("compo_id")) |
0 | 410 { |
112
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
411 $cid = stGetRequestItem("compo_id"); |
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
412 if (stFetchSQLColumn("SELECT id FROM compos WHERE id=".$cid) === FALSE) |
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
413 { |
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
414 stSetStatus(903, "No such compo id."); |
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
415 } |
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
416 else |
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
417 { |
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
418 $sql = stPrepareSQLUpdate("entries", |
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
419 "WHERE id=".intval(stGetRequestItem("id")), |
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
420 array( |
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
421 "name" => "S", |
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
422 "author" => "S", |
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
423 "filename" => "S", |
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
424 "compo_id" => "D", |
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
425 )); |
0 | 426 |
112
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
427 stExecSQLCond($sql, "OK, entry updated."); |
91660a9d50f0
Add some error checking to compo id updating vs. compo entries.
Matti Hamalainen <ccr@tnsp.org>
parents:
111
diff
changeset
|
428 } |
0 | 429 } |
430 else | |
14
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
431 if ($type == "settings") |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
432 { |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
433 foreach (stExecSQL("SELECT * FROM settings") as $item) |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
434 if (stChkRequestItem($item["key"])) |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
435 { |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
436 $val = stGetRequestItem($item["key"]); |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
437 switch ($item["vtype"]) |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
438 { |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
439 case VT_INT: $vsql = stPrepareSQL("vint=%d", $val); break; |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
440 case VT_BOOL: $vsql = stPrepareSQL("vint=%d", $val ? 1 : 0); break; |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
441 case VT_STR: $vsql = stPrepareSQL("vstr=%s", $val); break; |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
442 case VT_TEXT: $vsql = stPrepareSQL("vtext=%s", $val); break; |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
443 } |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
444 |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
445 $sql = "UPDATE settings SET ".$vsql." WHERE key=".$db->quote($item["key"]); |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
446 stExecSQLCond($sql, "OK, setting updated."); |
14
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
447 } |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
448 } |
e36c4d2b09c4
Fix settings to work, clean up the code, etc.
Matti Hamalainen <ccr@tnsp.org>
parents:
8
diff
changeset
|
449 else |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
450 stSetStatus(902, "No data."); |
0 | 451 break; |
452 | |
453 default: | |
66
230aacc22cb4
Move some functions to site lib.
Matti Hamalainen <ccr@tnsp.org>
parents:
61
diff
changeset
|
454 stSetStatus(404, "Not Found"); |
0 | 455 break; |
456 } | |
457 | |
458 ?> |