12 |
|
|
13 |
<%session scope="global"> |
<%session scope="global"> |
14 |
std::string userName; |
std::string userName; |
|
bool isAdmin; |
|
15 |
</%session> |
</%session> |
16 |
|
|
17 |
|
|
22 |
<{ |
<{ |
23 |
|
|
24 |
if (userName.size() == 0) |
if (userName.size() == 0) |
|
reply.setHeader("Refresh", "0; url=login"); |
|
|
else |
|
25 |
{ |
{ |
26 |
tntdb::Connection conn = tntdb::connect(dburl); |
reply.setHeader("Location", "index"); |
27 |
|
return HTTP_MOVED_TEMPORARILY; |
28 |
|
} |
29 |
|
|
30 |
|
tntdb::Connection conn = tntdb::connectCached(dburl); |
31 |
|
|
32 |
std::stringstream query; |
std::stringstream query; |
33 |
query << "DELETE FROM customer WHERE id = " << id; |
query << "DELETE FROM customer WHERE id = " << id; |
34 |
conn.execute(query.str()); |
|
35 |
|
conn.execute(query.str()); |
36 |
|
reply.setHeader("Location", "adm_customer_list"); |
37 |
|
return HTTP_MOVED_TEMPORARILY; |
38 |
|
|
|
reply.setHeader("Refresh", "0; url=adm_customer_list"); |
|
|
} |
|
39 |
|
|
40 |
}> |
}> |
41 |
|
|