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