1 |
torben |
101 |
<%pre> |
2 |
|
|
#include <tntdb/connect.h> |
3 |
|
|
#include <tntdb/connection.h> |
4 |
|
|
#include <tntdb/result.h> |
5 |
|
|
#include <tntdb/row.h> |
6 |
|
|
#include <sstream> |
7 |
|
|
</%pre> |
8 |
|
|
|
9 |
|
|
<%config> |
10 |
|
|
dburl; |
11 |
|
|
</%config> |
12 |
|
|
|
13 |
|
|
<%session scope="global"> |
14 |
|
|
std::string userName; |
15 |
|
|
bool isAdmin; |
16 |
|
|
</%session> |
17 |
|
|
|
18 |
|
|
|
19 |
|
|
<%args> |
20 |
|
|
int id; |
21 |
|
|
int customerid; |
22 |
|
|
std::string name; |
23 |
|
|
</%args> |
24 |
|
|
|
25 |
|
|
<{ |
26 |
|
|
|
27 |
|
|
if (userName.size() == 0) |
28 |
|
|
{ |
29 |
|
|
reply.setHeader("Location", "index"); |
30 |
|
|
return HTTP_MOVED_TEMPORARILY; |
31 |
|
|
} |
32 |
|
|
|
33 |
|
|
tntdb::Connection conn = tntdb::connect(dburl); |
34 |
|
|
|
35 |
|
|
std::stringstream query; |
36 |
|
|
query << "DELETE FROM installation WHERE id = " << id; |
37 |
|
|
|
38 |
|
|
conn.execute(query.str()); |
39 |
|
|
|
40 |
|
|
std::stringstream url; |
41 |
|
|
url << "adm_installation_list?customerid=" << customerid << "&name=" << name; |
42 |
|
|
reply.setHeader("Location", url.str()); |
43 |
|
|
return HTTP_MOVED_TEMPORARILY; |
44 |
|
|
|
45 |
|
|
|
46 |
|
|
}> |