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 "Report_Templates.hpp"
00024 #include "list_base.hpp"
00025 #include "openLogin.h"
00026 using namespace std;
00027 openLogin oLogin;
00028 #include "InfoPoints.hpp"
00029
00030 class Report_Templates_form: public Report_Templates_Obj, public forms_base
00031 {
00032 public:
00033 Report_Templates_form(cgiScript & script):Report_Templates_Obj(),forms_base(script)
00034 {
00035 setKey(*this);
00036 }
00037 virtual ~Report_Templates_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( "Path", Path);
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("Report_Templates_Popup.cgi", "Report_Templates")
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 << makeTextBox("Name", "Name", Name ,"225","35");
00066 script << "<br class='clearall'>" << endl;
00067 script << makeFileBox("Path", "Path", Path ,"55");
00068 script << "<br class='clearall'>" << endl;
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092 script << makeButtons( key() );
00093 script << makeBottom( m_result ) << endl;
00094 return breturn;
00095 }
00096 };
00097
00098
00099 int main( int argcount, char ** args )
00100 {
00101 cgiScript script( "text/html", false );
00102 Report_Templates_form myFrm(script);
00103
00104 infoPoints iPoints;
00105 if( iPoints.idToken.length() )
00106 {
00107 oLogin.token = iPoints.idToken;
00108 }
00109
00110 if( oLogin.testLoginStatus() )
00111 {
00112 script.closeHeader();
00113 cgiTemplates pgTemplate;
00114 pgTemplate.load("Templates/childPane.htmp");
00115
00116 script << ocString(pgTemplate.getParagraph("top"))
00117 .replaceAll("$heading$","Report_Templates")
00118 .replace("<!--Added_Header_Content-->",
00119 "<SCRIPT type='text/javascript'>\n"
00120 "function placeFile(id)\n"
00121 "{\n"
00122 " ctrlId = id;\n"
00123 " window.open(\"filePick.cgi/reportTemplates\",\n"
00124 " \"_blank\",\n"
00125 " \"scrollbars=yes,toolbar=no,menubar=no,location=no\");\n"
00126 "}\n"
00127 "</script>");
00128
00129 myFrm.loadControlTemplates("Templates/childdivform.htmp");
00130 myFrm.form_action();
00131 myFrm.form_display();
00132
00133 ocString end = pgTemplate.getParagraph("bottom");
00134 script << end;
00135 }
00136 else
00137 {
00138 script.Redirect("/");
00139 }
00140 }
00141
00142 #include "read_write_base.cpp"
00143 #include "forms_base.cpp"
00144