/[H9]/trunk/tntnet/dynamic/adm_customer_edit.ecpp
ViewVC logotype

Diff of /trunk/tntnet/dynamic/adm_customer_edit.ecpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 92 by torben, Thu Nov 29 05:21:04 2007 UTC revision 94 by torben, Thu Nov 29 08:04:13 2007 UTC
# Line 22  bool isAdmin; Line 22  bool isAdmin;
22  int id;  int id;
23  </%args>  </%args>
24    
25    <{
26    if (userName.size() == 0)
27    {
28            reply.setHeader("Location", "index");
29            return HTTP_MOVED_TEMPORARILY;
30    }
31    }>
32    
33    
34  <&header title="Customer Administration">  <&header title="Customer Administration">
35  </&header>  </&header>
36    
37    
   
38  <{  <{
39    
 if (userName.size() == 0)  
 {  
     reply.setHeader("Refresh", "0; url=login");  
         return HTTP_OK;  
 }  
   
40  if (id == -1)  if (id == -1)
41          reply.out() << "<h2>New Customer</h2>\n";          reply.out() << "<h2>New Customer</h2>\n";
42  else  else
# Line 50  tntdb::Connection conn = tntdb::connect( Line 52  tntdb::Connection conn = tntdb::connect(
52  std::string submit = qparam.param("submit");  std::string submit = qparam.param("submit");
53  if (submit == "1")  if (submit == "1")
54  {  {
55          std::string form_name = qparam.param("name");          std::string form_name = trim(qparam.param("name"));
56          std::string form_address = qparam.param("address");          std::string form_address = trim(qparam.param("address"));
57          std::string form_phone = qparam.param("phone");          std::string form_phone = trim(qparam.param("phone"));
58          std::string form_contact = qparam.param("contact");          std::string form_contact = trim(qparam.param("contact"));
59    
60    
61          if (id == -1)          if (id == -1)
# Line 64  if (submit == "1") Line 66  if (submit == "1")
66    
67                  //tntdb::Value v = conn.selectValue("SELECT lastval()"); //get the auto-generated id                  //tntdb::Value v = conn.selectValue("SELECT lastval()"); //get the auto-generated id
68                  //id = v.getInt();                  //id = v.getInt();
69                  reply.setHeader("Refresh", "0; url=adm_customer_list");  
70                  return HTTP_OK;                  reply.setHeader("Location", "adm_customer_list");
71                    return HTTP_MOVED_TEMPORARILY;
72          }          }
73          else          else
74          {          {

Legend:
Removed from v.92  
changed lines
  Added in v.94

  ViewVC Help
Powered by ViewVC 1.1.20