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 "read_write_base.hpp"
00021 #include "list_base.hpp"
00022 #include "forms_base.hpp"
00023 #include "Payment_Type_Parameter.hpp"
00024
00025
00026 #include "openLogin.h"
00027
00028 using namespace std;
00029 openLogin oLogin;
00030
00031 class Payment_Type_Parameter_List: public list_base
00032 {
00033 public:
00034
00035 Payment_Type_Parameter_List(cgiScript&sc):list_base(sc){;}
00036 ~Payment_Type_Parameter_List(){;}
00037
00038 bool list_display( void )
00039 {
00040 bool breturn = true;
00041
00042 hotCol=-2;
00043 editLink = listTemplate.getParagraph("hotcolumn");
00044 editLink = editLink.replace("$prog$","Payment_Type_Parameter_ui.cgi");
00045 emitFilter( "Payment_Type_Parameter_ui.cgi",
00046 " <B>FILTER (by ???)</B>" );
00047 string heading =
00048 "<a class='sortcol' href='Payment_Type_Parameter_ui.cgi?sort=Id'>Id</a>|"
00049 "<a class='sortcol' href='Payment_Type_Parameter_ui.cgi?sort=Service_Type'>Service_Type</a>|"
00050 "<a class='sortcol' href='Payment_Type_Parameter_ui.cgi?sort=Value_Location'>Value_Location</a>|"
00051 "<a class='sortcol' href='Payment_Type_Parameter_ui.cgi?sort=Param_Type'>Param_Type</a>|"
00052 "<a class='sortcol' href='Payment_Type_Parameter_ui.cgi?sort=Interface_Type'>Interface_Type</a>|"
00053 "<a class='sortcol' href='Payment_Type_Parameter_ui.cgi?sort=Name'>Name</a>|"
00054 "<a class='sortcol' href='Payment_Type_Parameter_ui.cgi?sort=Machine_Name'>Machine_Name</a>|"
00055 "<a class='sortcol' href='Payment_Type_Parameter_ui.cgi?sort=Value'>Value</a>|"
00056 "<a class='sortcol' href='Payment_Type_Parameter_ui.cgi?sort=Instructions'>Instructions</a>|"
00057 ;
00058 emitHeadings(heading);
00059 getFilteredData(
00060 "Id, "
00061 "Service_Type, "
00062 "Value_Location, "
00063 "Param_Type, "
00064 "Interface_Type, "
00065 "Name, "
00066 "Machine_Name, "
00067 "Value, "
00068 "Instructions "
00069 ,"Payment_Type_Parameter",
00070 "??? like '$filter$%'" );
00071 emitData();
00072 emitNavigation("Payment_Type_Parameter_ui.cgi");
00073 emitEnd();
00074 return breturn;
00075 }
00076
00077
00078 virtual void sendHotField( int iField, ocString & td )
00079 {
00080 string data = rs.getField(iField).format().c_str();
00081 switch( iField )
00082 {
00083 case 2:
00084 data=pay_val_location[atol(data.c_str())];
00085 break;
00086 case 3:
00087 data=pay_types[atol(data.c_str())];
00088 break;
00089 case 4:
00090 data=pay_interface_type[atol(data.c_str())];
00091 break;
00092 }
00093 webIO << td.replace( "$data$",
00094 editLink.replaceAll( "$key$",rs.getField(0).format().c_str())
00095 .replaceAll( "$col$",data ).c_str());
00096 }
00097 };
00098
00099 class Payment_Type_Parameter_form: public Payment_Type_Parameter_Obj, public forms_base
00100 {
00101 public:
00102 Payment_Type_Parameter_form(cgiScript & script):Payment_Type_Parameter_Obj(),forms_base(script){setKey(*this);}
00103 virtual ~Payment_Type_Parameter_form(){;}
00104
00105 void form_id_transfer( void )
00106 {
00107 llongFXfer( "Id", Id );
00108 }
00109 void form_data_transfer( void )
00110 {
00111 llongFXfer( "Service_Type", Service_Type);
00112 longFXfer( "Value_Location", Value_Location);
00113 longFXfer( "Param_Type", Param_Type);
00114 longFXfer( "Interface_Type", Interface_Type);
00115 stringFXfer( "Name", Name);
00116 stringFXfer( "Machine_Name", Machine_Name);
00117 stringFXfer( "Value", Value);
00118 stringFXfer( "Instructions", Instructions);
00119
00120 }
00121
00122 bool dbf_action( string mode, changeMap & changes )
00123 {
00124 return db_action( mode, changes );
00125 }
00126
00127
00128 bool form_display( void )
00129 {
00130 bool breturn = true;
00131 ocString sql;
00132
00133 script << makeTop("Payment_Type_Parameter_ui.cgi", "Payment_Type_Parameter")
00134 << formTemplate.getParagraph("advanced_begin");
00135 script << makeStaticBox("Id", "Id", Id ,"8");
00136 script << "<br class='clearall'>" << endl;
00137 script << formTemplate.getParagraph("advanced_end");
00138 sql="select Type, Name from Payment_Service";
00139 script << makeComboBox("Service_Type", "Service_Type", Service_Type ,sql);
00140
00141
00142
00143 script << "<br class='clearall'>" << endl;
00144 script << makeManualComboBox("Value_Location", "Value_Location", Value_Location ,pay_val_location,pay_loc_count);
00145 script << "<br class='clearall'>" << endl;
00146 script << makeManualComboBox("Param_Type", "Param_Type", Param_Type ,pay_types,pay_type_count);
00147 script << "<br class='clearall'>" << endl;
00148 script << makeManualComboBox("Interface_Type", "Interface_Type", Interface_Type ,pay_interface_type,pay_iface_count);
00149 script << "<br class='clearall'>" << endl;
00150 script << makeTextBox("Name", "Name", Name ,"25");
00151 script << "<br class='clearall'>" << endl;
00152 script << makeTextBox("Machine_Name", "Machine_Name", Machine_Name ,"25");
00153 script << "<br class='clearall'>" << endl;
00154 script << makeTextBox("Value", "Value", Value ,"25");
00155 script << "<br class='clearall'>" << endl;
00156 script << makeTextArea("Instructions", "Instructions", Instructions ,"5","50");
00157 script << "<br class='clearall'>" << endl;
00158
00159
00160
00161
00162
00163
00164
00165
00166
00167
00168
00169
00170
00171
00172
00173
00174
00175
00176
00177
00178
00179 script << makeButtons( key() );
00180 script << makeBottom( m_result ) << endl;
00181 return breturn;
00182 }
00183 };
00184
00185
00186 int main( int argcount, char ** args )
00187 {
00188 cgiScript script( "text/html", false );
00189 Payment_Type_Parameter_form myFrm(script);
00190 Payment_Type_Parameter_List mylist(script);
00191 if( oLogin.testLoginStatus() )
00192 {
00193 script.closeHeader();
00194 cgiTemplates pgTemplate;
00195 pgTemplate.load("Templates/adminPane.htmp");
00196
00197 script << ocString(pgTemplate.getParagraph("top"))
00198 .replaceAll("$heading$","Payment_Type_Parameter");
00199
00200 myFrm.loadControlTemplates("Templates/divform.htmp");
00201 myFrm.form_action();
00202 myFrm.form_display();
00203
00204 mylist.loadListTemplates("Templates/list.htmp");
00205 mylist.list_display();
00206
00207 ocString end = pgTemplate.getParagraph("bottom");
00208 script << end;
00209 }
00210 else
00211 {
00212 script.Redirect("signIn.html");
00213 }
00214 }
00215
00216 #include "read_write_base.cpp"
00217 #include "forms_base.cpp"
00218