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 "read_write_base.hpp"
00020 #include "forms_base.hpp"
00021 #include "list_base.hpp"
00022 #include "cgiTemplates.h"
00023 #include "Query.hpp"
00024 #include "list_base.hpp"
00025 #include "openLogin.h"
00026 #include "connectstring"
00027 using namespace std;
00028 openLogin oLogin;
00029
00030 class Query_form: public Query_Obj, public forms_base
00031 {
00032 public:
00033 Query_form(cgiScript & script):Query_Obj(),forms_base(script)
00034 {
00035 setKey(*this);
00036 }
00037 virtual ~Query_form(){;}
00038
00039 void form_id_transfer( void )
00040 {
00041 llongFXfer( "Id", Id );
00042 }
00043 void form_data_transfer( void )
00044 {
00045 stringFXfer( "Name", Name);
00046 stringFXfer( "Query", Query);
00047 }
00048
00049 bool dbf_action( string mode, changeMap & changes )
00050 {
00051 return db_action( mode, changes );
00052 }
00053
00054
00055 bool form_display( void )
00056 {
00057 bool breturn = true;
00058 ocString sql;
00059 script << makeTop("Query_Popup.cgi", "Query")
00060 << formTemplate.getParagraph("advanced_begin");
00061 script << makeStaticBox("Id", "Id", Id ,"8");
00062 script << "<br class='clearall'>" << endl;
00063 script << formTemplate.getParagraph("advanced_end");
00064
00065 script << "<br class='clearall'>" << endl;
00066 script << makeTextBox("Name", "Name", Name ,"25");
00067 script << "<br class='clearall'>" << endl;
00068 script << makeTextBox("Query", "Query", Query ,"25");
00069 script << "<br class='clearall'>" << endl;
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093 script << makeButtons( key() );
00094 script << makeBottom( m_result ) << endl;
00095 return breturn;
00096 }
00097 };
00098
00099
00100 int main( int argcount, char ** args )
00101 {
00102 cgiScript script( "text/html", false );
00103 Query_form myFrm(script);
00104
00105 if( oLogin.testLoginStatus() )
00106 {
00107 script.closeHeader();
00108 cgiTemplates pgTemplate;
00109 pgTemplate.load("Templates/childPane.htmp");
00110
00111 script << ocString(pgTemplate.getParagraph("top"))
00112 .replaceAll("$heading$","Query");
00113
00114 myFrm.loadControlTemplates("Templates/childdivform.htmp");
00115 myFrm.form_action();
00116 myFrm.form_display();
00117
00118 ocString end = pgTemplate.getParagraph("bottom");
00119 script << end;
00120 }
00121 else
00122 {
00123 script.Redirect("/");
00124 }
00125 }
00126
00127 #include "read_write_base.cpp"
00128 #include "forms_base.cpp"
00129