00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #include <iostream>
00013 #include <iomanip>
00014 #include "cgiTemplates.h"
00015 #include "connectstring"
00016 #include "forms.h"
00017 #include "ocTypes.h"
00018 #include "ocString.h"
00019 #include "cgiTemplates.h"
00020 #include "Customer.hpp"
00021 #include "list_base.hpp"
00022 #include "forms_base.hpp"
00023
00024 using namespace std;
00025
00026 class Customer_form: public Customer_Obj, public forms_base
00027 {
00028 public:
00029 Customer_form(cgiScript & script):Customer_Obj(),forms_base(script){setKey(*this);}
00030 virtual ~Customer_form(){;}
00031
00032 void form_id_transfer( void )
00033 {
00034 llongFXfer( "Id", Id );
00035 }
00036 void form_data_transfer( void )
00037 {
00038 stringFXfer( "First_Name", First_Name);
00039 stringFXfer( "Last_Name", Last_Name);
00040 stringFXfer( "EMail", EMail);
00041
00042 stringFXfer( "Address", Address);
00043 stringFXfer( "City", City);
00044 stringFXfer( "State", State);
00045 stringFXfer( "Zip", Zip);
00046 stringFXfer( "Phone", Phone);
00047 llongFXfer( "Payment_Service_Id", Payment_Service_Id);
00048
00049 }
00050
00051 bool dbf_action( string mode, changeMap & changes )
00052 {
00053 return db_action( mode, changes );
00054 }
00055
00056
00057 bool form_display( void )
00058 {
00059 bool breturn = true;
00060
00061 script << makeHiddenBox("Id", Id );
00062 script << makeTextBox("First Name", "First_Name", First_Name ,"35","25");
00063 script << makeTextBox("Last Name", "Last_Name", Last_Name ,"35","25");
00064 script << makeTextBox("E-Mail", "EMail", EMail ,"45","25");
00065
00066 script << makeTextBox("Shipping Address", "Address", Address ,"45","25");
00067 script << makeTextBox("City", "City", City ,"35","25");
00068 script << makeStateBox("State", "State", State );
00069 script << makeTextBox("Zip", "Zip", Zip ,"10");
00070 script << makeTextBox("Phone", "Phone", Phone ,"25");
00071 script << makeComboBox("Payment Type", "Payment_Service_Id", Payment_Service_Id ,
00072 "select Id, Name from Payment_Service ");
00073 return breturn;
00074 }
00075
00076 string makeTop(string uri, string name )
00077 {
00078 ocString ret = formTemplate.getParagraph("form_begin");
00079 return ret.replace("$step_title$","Check Out Step 2 : Customer Information")
00080 .replace("$action$",uri.c_str())
00081 .replace("$name$",name.c_str())
00082 .replace("$instructions$","Please fill out all of the information below, including the shipping address.");
00083 }
00084 string makeButtonedBottom( string action )
00085 {
00086 ocString ret = formTemplate.getParagraph("form_end");
00087 return ret.replaceAll("$ACTION",action);
00088 }
00089 };
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130