00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014 #include <iostream>
00015 #include <iomanip>
00016 #include "cgiTemplates.h"
00017 #include "connectstring"
00018 #include "forms.h"
00019 #include "ocTypes.h"
00020 #include "ocString.h"
00021 #include "cgiTemplates.h"
00022
00023 #include "read_write_base.hpp"
00024 #include "list_base.hpp"
00025 #include "forms_base.hpp"
00026 #include "Payment_Service.hpp"
00027
00028 #include "openLogin.h"
00029
00030
00031
00032 using namespace std;
00033 openLogin oLogin;
00034
00035 class Payment_Service_List: public list_base
00036 {
00037 public:
00038
00039 Payment_Service_List(cgiScript&sc):list_base(sc){;}
00040 ~Payment_Service_List(){;}
00041
00042 bool list_display( void )
00043 {
00044 bool breturn = true;
00045
00046 hotCol=-2;
00047 editLink = listTemplate.getParagraph("hotcolumn");
00048 editLink = editLink.replace("$prog$","Payment_Service_ui.cgi");
00049 emitFilter( "Payment_Service_ui.cgi",
00050 " <B>FILTER (by ???)</B>" );
00051 string heading =
00052 "<a class='sortcol' href='Payment_Service_ui.cgi?sort=Id'>Id</a>|"
00053 "<a class='sortcol' href='Payment_Service_ui.cgi?sort=Type'>Type</a>|"
00054 "<a class='sortcol' href='Payment_Service_ui.cgi?sort=Name'>Name</a>|"
00055 "<a class='sortcol' href='Payment_Service_ui.cgi?sort=Label'>Label</a>|"
00056 "<a class='sortcol' href='Payment_Service_ui.cgi?sort=Instructions'>Instructions</a>|"
00057 ;
00058 emitHeadings(heading);
00059 getFilteredData(
00060 "Id, "
00061 "Type, "
00062 "Name, "
00063 "Label, "
00064 "Instructions "
00065 ,"Payment_Service",
00066 "??? like '$filter$%'" );
00067 emitData();
00068 emitNavigation("Payment_Service_ui.cgi");
00069 emitEnd();
00070 return breturn;
00071 }
00072 };
00073
00074 class Payment_Service_form: public Payment_Service_Obj, public forms_base
00075 {
00076 public:
00077 Payment_Service_form(cgiScript & script):Payment_Service_Obj(),forms_base(script){setKey(*this);}
00078 virtual ~Payment_Service_form(){;}
00079
00080 void form_id_transfer( void )
00081 {
00082 llongFXfer( "Id", Id );
00083 }
00084 void form_data_transfer( void )
00085 {
00086 llongFXfer( "Type", Type);
00087 stringFXfer( "Name", Name);
00088 stringFXfer( "Label", Label);
00089 stringFXfer( "Instructions", Instructions);
00090
00091 }
00092
00093 bool dbf_action( string mode, changeMap & changes )
00094 {
00095 return db_action( mode, changes );
00096 }
00097
00098
00099 bool form_display( void )
00100 {
00101 bool breturn = true;
00102 ocString sql;
00103
00104 script << makeTop("Payment_Service_ui.cgi", "Payment_Service")
00105 << formTemplate.getParagraph("advanced_begin");
00106 script << makeStaticBox("Id", "Id", Id ,"8");
00107 script << "<br class='clearall'>" << endl;
00108 script << formTemplate.getParagraph("advanced_end");
00109
00110 script << makeComboBox("Type", "Type", Type ,sql);
00111 script << "<br class='clearall'>" << endl;
00112 script << makeTextBox("Name", "Name", Name ,"35");
00113 script << "<br class='clearall'>" << endl;
00114 script << makeTextBox("Label", "Label", Label ,"35");
00115 script << "<br class='clearall'>" << endl;
00116 script << makeTextArea("Instructions", "Instructions", Instructions ,"2","55");
00117 script << "<br class='clearall'>" << endl;
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127
00128
00129
00130
00131
00132
00133
00134
00135
00136
00137
00138
00139 script << makeButtons( key() );
00140 script << makeBottom( m_result ) << endl;
00141 return breturn;
00142 }
00143 };
00144
00145
00146 int main( int argcount, char ** args )
00147 {
00148 cgiScript script( "text/html", false );
00149 Payment_Service_form myFrm(script);
00150 Payment_Service_List mylist(script);
00151 if( oLogin.testLoginStatus() )
00152 {
00153 script.closeHeader();
00154 cgiTemplates pgTemplate;
00155 pgTemplate.load("Templates/adminPane.htmp");
00156
00157 script << ocString(pgTemplate.getParagraph("top"))
00158 .replaceAll("$heading$","Payment_Service");
00159
00160 myFrm.loadControlTemplates("Templates/divform.htmp");
00161 myFrm.form_action();
00162 myFrm.form_display();
00163
00164 mylist.loadListTemplates("Templates/list.htmp");
00165 mylist.list_display();
00166
00167 ocString end = pgTemplate.getParagraph("bottom");
00168 script << end;
00169 }
00170 else
00171 {
00172 script.Redirect("signIn.html");
00173 }
00174 }
00175
00176 #include "read_write_base.cpp"
00177 #include "forms_base.cpp"
00178