00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019 #include <stdio.h>
00020 #include <stdlib.h>
00021 #include <mysql/mysql.h>
00022 #include <libsql++.h>
00023 #include <string>
00024 using std::string;
00025 #include <libcgi++.h>
00026 #include <libwolfshade.h>
00027
00028 #include "BaseForm.h"
00029 #include "WolfshadeWeb.h"
00030
00031
00032 #include "FelForm.h"
00033
00034
00035 namespace cgi
00036 {
00037
00038
00039 FelForm::FelForm(Web *web)
00040 :BaseForm(web, "felform")
00041 ,m_edit(0)
00042 ,m_error(false)
00043 {
00044 }
00045
00046
00047 FelForm::~FelForm()
00048 {
00049 }
00050
00051
00052 void FelForm::Process()
00053 {
00054 char action[200];
00055
00056 if (GetForm() -> getvalue("felform",action,200))
00057 {
00058 }
00059 }
00060
00061
00062 void FelForm::Select(const string &)
00063 {
00064 }
00065
00066
00067 void FelForm::List()
00068 {
00069 }
00070
00071
00072 void FelForm::Display(long)
00073 {
00074
00075 Database *db = GetDatabase();
00076 Query q(db);
00077 int opposite[] = {2,3,0,1,5,4};
00078 char sql[200];
00079
00080 q.get_result("select * from room_door order by room");
00081 {
00082 Table tbl("#000000", 3, " Exits with no link back (might be ok)");
00083
00084 printf("<tr bgcolor=#ffffff>");
00085 printf("<th>From Room</th>");
00086 printf("<th>Direction</th>");
00087 printf("<th>To Room</th>");
00088 printf("</tr>");
00089 while (q.fetch_row())
00090 {
00091 db::Room_door x(db,&q);
00092 db::Room_dir dir(db,x.direction);
00093 sprintf(sql,"select * from room_door where room=%ld and direction=%d and toroom=%ld",
00094 x.toroom,opposite[x.direction],x.room);
00095 db::Room_door y(db,sql);
00096 if (!y.num)
00097 {
00098 db::Room room1(db,x.room);
00099 db::Room room2(db,x.toroom);
00100 if (room2.num)
00101 {
00102 printf("<tr bgcolor=#808080>");
00103 ShowRoom(room1,true,true);
00104 printf("<td bgcolor=#c0c0c0 align=middle> %s </td>",dir.name);
00105 ShowRoom(room2,true,true);
00106 printf("</tr>");
00107 }
00108 }
00109 }
00110 }
00111 q.free_result();
00112 }
00113
00114
00115 }
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126