00001 /* 00002 checkOut.cpp 00003 00004 main file for checking out 00005 I am a meta page derivation. 00006 00007 */ 00008 #include "cgiClass.h" 00009 #include "connectstring" 00010 00011 // one global 00012 string baseUrl; 00013 #include "State_Tax.hpp" 00014 00015 // a global tax object! 00016 State_Tax globalTax; 00017 00018 #include "page.hpp" 00019 #include "checkout_control.hpp" 00020 00021 00022 using namespace std; 00023 00024 // Cross domain cart id fixup.. put crtid client argument into the client cookie 00025 void crtidFixup(cgiScript & script) 00026 { 00027 if( script.ClientArguments().count("crtid") ) 00028 { 00029 cgiCookie cookie; 00030 cookie.setPath("/"); 00031 cookie.set("crtid", script.ClientArguments()["crtid"].c_str() ); 00032 } 00033 } 00034 00035 // Standard main function 00036 int main(int argc, char ** argv) 00037 { 00038 baseUrl = "checkOut.cgi"; // this is my compiled name! 00039 cgiScript script("text/html",false); 00040 00041 // Work around for MSIE cookie confusion and bugs 00042 crtidFixup(script); 00043 00044 page pg(script); 00045 00046 if( pg.load() ) 00047 { 00048 page_control ctrl(pg); 00049 00050 // the extra operation besides normal page stuff 00051 ctrl.addOp ( "checkout", new chkout_functor(pg,script) ); 00052 00053 // close the http header before emiting any content 00054 script.closeHeader(); 00055 ctrl.emit(); 00056 } 00057 else 00058 { 00059 script.closeHeader(); 00060 script << "<html><head><title>Page Unavailable</title></head>" << endl 00061 << "<body><h1>Sorry</h1>" << endl 00062 << "<p>The page you requested is not available</p></body></html>"; 00063 } 00064 return 0; 00065 } 00066 00067 // As an alternative to building more objects 00068 #include "read_write_base.cpp" 00069 #include "forms_base.cpp"
1.5.5