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 "openLogin.h"
00024
00025 #include "Font.hpp"
00026 #include "list_base.hpp"
00027
00028 #include "openLogin.h"
00029
00030 using namespace std;
00031 openLogin oLogin;
00032
00033 class Font_List: public list_base
00034 {
00035 public:
00036
00037 Font_List(cgiScript&sc):list_base(sc){;}
00038 ~Font_List(){;}
00039
00040 bool list_display( void )
00041 {
00042 bool breturn = true;
00043
00044 hotCol=-2;
00045 editLink = listTemplate.getParagraph("hotcolumn");
00046 editLink = editLink.replace("$prog$","Font_ui.cgi");
00047 emitFilter( "Font_ui.cgi",
00048 " <B>FILTER (by Name)</B>" );
00049 string heading =
00050 "<a class='sortcol' href='Font_ui.cgi?sort=Id'>Id</a>|"
00051 "<a class='sortcol' href='Font_ui.cgi?sort=External_Id'>External_Id</a>|"
00052 "<a class='sortcol' href='Font_ui.cgi?sort=Name'>Name</a>|"
00053 "<a class='sortcol' href='Font_ui.cgi?sort=Abbreviation'>Abbreviation</a>|"
00054 ;
00055 emitHeadings(heading);
00056 getFilteredData(
00057 "Id, "
00058 "External_Id, "
00059 "Name, "
00060 "Abbreviation "
00061 ,"Font",
00062 "Name like '$filter$%'" );
00063 emitData();
00064 emitNavigation("Font_ui.cgi");
00065 emitEnd();
00066 return breturn;
00067 }
00068 };
00069
00070 class Font_form: public Font_Obj, public forms_base
00071 {
00072 public:
00073 Font_form(cgiScript & script):Font_Obj(),forms_base(script){setKey(*this);}
00074 virtual ~Font_form(){;}
00075
00076 void form_id_transfer( void )
00077 {
00078 llongFXfer( "Id", Id );
00079 }
00080 void form_data_transfer( void )
00081 {
00082 stringFXfer( "External_Id", External_Id);
00083 stringFXfer( "Name", Name);
00084 stringFXfer( "Abbreviation", Abbreviation);
00085
00086 }
00087
00088 bool dbf_action( string mode, changeMap & changes )
00089 {
00090 return db_action( mode, changes );
00091 }
00092
00093
00094 bool form_display( void )
00095 {
00096 bool breturn = true;
00097 script << makeTop("Font_ui.cgi", "Font");
00098 script << makeStaticBox("Id", "Id", Id ,"8");
00099 script << makeTextBox("External_Id", "External_Id", External_Id ,"25");
00100 script << makeTextBox("Name", "Name", Name ,"25");
00101 script << makeTextBox("Abbreviation", "Abbreviation", Abbreviation ,"25");
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123 script << makeButtons( key() );
00124 script << makeBottom( m_result ) << endl;
00125 return breturn;
00126 }
00127 };
00128
00129
00130 int main( int argcount, char ** args )
00131 {
00132 cgiScript script( "text/html", false );
00133 Font_form myFrm(script);
00134 Font_List mylist(script);
00135 if( oLogin.testLoginStatus() )
00136 {
00137 script.closeHeader();
00138 cgiTemplates pgTemplate;
00139 pgTemplate.load("Templates/adminPane.htmp");
00140
00141 script << ocString(pgTemplate.getParagraph("top"))
00142 .replaceAll("$heading$","Font");
00143
00144 myFrm.loadControlTemplates("Templates/form.htmp");
00145 myFrm.form_action();
00146 myFrm.form_display();
00147
00148 mylist.loadListTemplates("Templates/list.htmp");
00149 mylist.list_display();
00150
00151 ocString end = pgTemplate.getParagraph("bottom");
00152 script << end;
00153 }
00154 else
00155 {
00156 script.Redirect("signIn.html");
00157 }
00158 }
00159
00160 #include "read_write_base.cpp"
00161 #include "forms_base.cpp"
00162