Changeset 286 for branches/web
- Timestamp:
- Sep 8, 2010, 10:08:43 AM (14 years ago)
- Location:
- branches/web
- Files:
-
- 3 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/web/Pages/UMainPage.pas
r283 r286 86 86 // Zobrazení seznamu online počítačů 87 87 Output := Output + '<strong>Online počítače:</strong><br /><span style="font-size: smaller;">'; 88 DbRows := Database.Select('hosts', 'name', 'online=1 AND show_online=1 ORDER BY name'); 88 DbRows := Database.Query('SELECT NetworkDevice.Name FROM NetworkDevice LEFT JOIN NetworkDeviceType ' + 89 ' ON NetworkDeviceType.Id = NetworkDevice.Type WHERE (NetworkDeviceType.ShowOnline = 1) AND (NetworkDevice.Online = 1) ORDER BY NetworkDevice.Name'); 89 90 for I := 0 to DbRows.Count - 1 do with DbRows[I] do begin 90 Output := Output + Values[' name'] + '<br />';91 Output := Output + Values['Name'] + '<br />'; 91 92 end; 92 93 DbRows.Free; -
branches/web/UCore.pas
r279 r286 21 21 function PagesList(URL: string; Page, TotalCount, CountPerPage: Integer): string; 22 22 function StrRepeat(Data: string; Count: Integer): string; 23 function FormatOutput(Data: string): string; 24 23 25 24 type 26 25 TRegistredPage = record … … 177 176 end; 178 177 179 function FormatOutput(Data: string): string;180 var181 BlockStart, BlockEnd: Integer;182 Indention: Integer;183 Indention2: Integer;184 Line: string;185 Command: string;186 begin187 Result := '';188 Indention := 0;189 Indention2 := 0;190 while Data <> '' do begin191 //WebWrite('.');192 BlockStart := Pos('<', Data);193 BlockEnd := Pos('>', Data);194 if BlockStart > 1 then begin195 BlockEnd := BlockStart - 1;196 BlockStart := 1;197 end;198 Line := Trim(Copy(Data, BlockStart, BlockEnd));199 //WebWriteLn(Line);200 if Length(Line) > 0 then201 if Line[1] = '<' then begin202 if Data[BlockStart + 1] = '/' then begin203 Indention := Indention - 2;204 Indention2 := Indention;205 end else begin206 if Pos(' ', Line) > 0 then Command := Copy(Line, 2, Pos(' ', Line) - 2)207 else Command := Copy(Line, 2, Length(Line) - 2);208 //WebWriteLn(Command + ' ' + IntToStr(Indention));209 if Pos('</' + Command + '>', Data) > 0 then Indention := Indention + 2;210 //WebWriteLn(IntToStr(Indention) + ',' + IntToStr(Indention2));211 end;212 end;213 if Line <> '' then Result := Result + StrRepeat(' ', Indention2) + Line + #13#10;214 Data := Copy(Data, BlockEnd + 1, Length(Data));215 Indention2 := Indention;216 end;217 end;218 178 219 179 initialization -
branches/web/UNews.pas
r279 r286 55 55 procedure TNewsItem.LoadFromDbRecord(DbRow: TAssociativeArray); 56 56 begin 57 Id := StrToInt(DbRow.Values[' id']);58 Title := DbRow.Values[' title'];59 Content := DbRow.Values[' content'];60 Time := UnixToDateTime(StrToInt(DbRow.Values[' time']));61 Author := DbRow.Values[' author'];62 IPAddress := DbRow.Values[' ip'];63 Category := StrToInt(DbRow.Values[' category']);57 Id := StrToInt(DbRow.Values['Id']); 58 Title := DbRow.Values['Title']; 59 Content := DbRow.Values['Content']; 60 Time := UnixToDateTime(StrToInt(DbRow.Values['Time'])); 61 Author := DbRow.Values['Author']; 62 IPAddress := DbRow.Values['IP']; 63 Category := StrToInt(DbRow.Values['Category']); 64 64 end; 65 65 … … 69 69 begin 70 70 Values := TAssociativeArray.Create; 71 Values.AddKeyValue(' content', Content);72 Values.AddKeyValue(' title', Title);73 Values.AddKeyValue(' author', Author);74 Values.AddKeyValue(' ip', IPAddress);75 Values.AddKeyValue(' time', IntToStr(DateTimeToUnix(Time)));76 Values.AddKeyValue(' category', IntToStr(Category));77 Database.Update(' news', Values, 'id=' + IntToStr(Id));71 Values.AddKeyValue('Content', Content); 72 Values.AddKeyValue('Title', Title); 73 Values.AddKeyValue('Author', Author); 74 Values.AddKeyValue('IP', IPAddress); 75 Values.AddKeyValue('Time', IntToStr(DateTimeToUnix(Time))); 76 Values.AddKeyValue('Category', IntToStr(Category)); 77 Database.Update('News', Values, 'Id=' + IntToStr(Id)); 78 78 Values.Free; 79 79 inherited; … … 116 116 Where := ''; 117 117 for I := 0 to High(SelectParts) do 118 Where := Where + 'OR ( category=' + SelectParts[I] + ')';118 Where := Where + 'OR (Category=' + SelectParts[I] + ')'; 119 119 Where := Copy(Where, 3, Length(Where)); 120 120 if Where = '' then Where := '1'; 121 121 122 DbRows := Database.Query('SELECT *,UNIX_TIMESTAMP( date) as time FROM news WHERE ' + Where + ' ORDER BY date DESC LIMIT 0,' + IntToStr(MaxNewsItemCount)); for I := 0 to DbRows.Count - 1 do begin122 DbRows := Database.Query('SELECT *,UNIX_TIMESTAMP(Date) AS Time FROM News WHERE ' + Where + ' ORDER BY Date DESC LIMIT 0,' + IntToStr(MaxNewsItemCount)); for I := 0 to DbRows.Count - 1 do begin 123 123 NewsItem.LoadFromDbRecord(DbRows[I]); 124 124 NewItem := TRSSChannelItem.Create; … … 171 171 NewCategory: TNewsCategory; 172 172 begin 173 DbRows := Database.Select(' news_category', '*');173 DbRows := Database.Select('NewsCategory', '*'); 174 174 for I := 0 to DbRows.Count - 1 do begin 175 175 NewCategory := TNewsCategory.Create; … … 184 184 procedure TNewsCategory.LoadFromDbRecord(DbRow: TAssociativeArray); 185 185 begin 186 Id := StrToInt(DbRow.Values[' id']);187 Title := DbRow.Values[' caption'];188 Permission := StrToInt(DbRow.Values[' permission']);186 Id := StrToInt(DbRow.Values['Id']); 187 Title := DbRow.Values['Caption']; 188 Permission := StrToInt(DbRow.Values['Permission']); 189 189 end; 190 190 … … 194 194 begin 195 195 Values := TAssociativeArray.Create; 196 Values.AddKeyValue(' permission', IntToStr(Permission));197 Values.AddKeyValue(' title', Title);198 Database.Update(' news_category', Values, 'id=' + IntToStr(Id));196 Values.AddKeyValue('Permission', IntToStr(Permission)); 197 Values.AddKeyValue('Title', Title); 198 Database.Update('NewsCategory', Values, 'Id=' + IntToStr(Id)); 199 199 Values.Free; 200 200 inherited; … … 222 222 '<table class="NewsTable" cellspacing="0" cellpadding="0">'; 223 223 FontSize := 12; 224 DbRows := Database.Select(' news', '*', 'category=' + IntToStr(Category) + ' ORDER BY date DESC LIMIT 0,' + IntToStr(NewsCountPerCategory));224 DbRows := Database.Select('News', '*', 'Category=' + IntToStr(Category) + ' ORDER BY Date DESC LIMIT 0,' + IntToStr(NewsCountPerCategory)); 225 225 for I := 0 to DbRows.Count - 1 do with DbRows[I] do begin 226 Content := Values[' content'];226 Content := Values['Content']; 227 227 Content := StringReplace(Content, '<br>', '<br />', [rfReplaceAll]); 228 Result := Result + '<tr><td onclick="window.location=''?p=news-item&id=' + Values[' id'] + '''" onmouseover="zobraz(''new' + Values['id'] + ''')" class="NewsTableItemTitle">' +228 Result := Result + '<tr><td onclick="window.location=''?p=news-item&id=' + Values['Id'] + '''" onmouseover="zobraz(''new' + Values['id'] + ''')" class="NewsTableItemTitle">' + 229 229 '<table class="NewsTableItemTitle">' + 230 '<tr><td style="font-size: ' + IntToStr(FontSize) + 'pt"><strong>' + Values[' title'] + '</strong></td>'+231 '<td align="right" style="font-size: ' + IntToStr(FontSize) + 'pt">' + Values[' author'] + ' (' + HumanDate(Values['date']) + ')' +230 '<tr><td style="font-size: ' + IntToStr(FontSize) + 'pt"><strong>' + Values['Title'] + '</strong></td>'+ 231 '<td align="right" style="font-size: ' + IntToStr(FontSize) + 'pt">' + Values['Author'] + ' (' + HumanDate(Values['date']) + ')' + 232 232 '</td></tr></table>' + 233 '<div id="new' + Values[' id'] + '" class="NewsTableItem">' + Content;234 235 if Values[' enclosure'] <> '' then begin233 '<div id="new' + Values['Id'] + '" class="NewsTableItem">' + Content; 234 235 if Values['Enclosure'] <> '' then begin 236 236 Result := Result + '<br />Přílohy: '; 237 Enclosures := Explode(';', Values[' enclosure']);237 Enclosures := Explode(';', Values['Enclosure']); 238 238 for II := 0 to High(Enclosures) do begin 239 239 // if(file_exists($UploadedFilesFolder.$Enclosure)) echo(' <a href="'.$UploadedFilesFolder.$Enclosure.'">'.$Enclosure.'</a>') -
branches/web/index.lpi
r283 r286 2 2 <CONFIG> 3 3 <ProjectOptions> 4 <Version Value=" 8"/>4 <Version Value="9"/> 5 5 <General> 6 6 <Flags> … … 10 10 <LRSInOutputDirectory Value="False"/> 11 11 </Flags> 12 <MainUnit Value="0"/>13 <TargetFileExt Value=".exe"/>14 12 <Title Value="index"/> 15 13 <ActiveWindowIndexAtStart Value="0"/> 16 14 </General> 17 15 <VersionInfo> 18 <StringTable Comments="" CompanyName="" FileDescription="" FileVersion="0.0.0.0" InternalName="" LegalCopyright="" LegalTrademarks="" OriginalFilename="" ProductName=""ProductVersion=""/>16 <StringTable ProductVersion=""/> 19 17 </VersionInfo> 20 18 <PublishOptions> … … 30 28 </local> 31 29 </RunParams> 32 <Units Count=" 26">30 <Units Count="41"> 33 31 <Unit0> 34 32 <Filename Value="index.pas"/> … … 37 35 <EditorIndex Value="8"/> 38 36 <WindowIndex Value="0"/> 39 <TopLine Value="1 "/>40 <CursorPos X=" 53" Y="22"/>41 <UsageCount Value=" 96"/>37 <TopLine Value="18"/> 38 <CursorPos X="1" Y="30"/> 39 <UsageCount Value="145"/> 42 40 <Loaded Value="True"/> 43 41 <LoadedDesigner Value="True"/> … … 50 48 <EditorIndex Value="5"/> 51 49 <WindowIndex Value="0"/> 52 <TopLine Value=" 124"/>53 <CursorPos X=" 80" Y="21"/>54 < SyntaxHighlighter Value="Delphi"/>55 < UsageCount Value="96"/>56 < Loaded Value="True"/>50 <TopLine Value="68"/> 51 <CursorPos X="1" Y="89"/> 52 <UsageCount Value="145"/> 53 <Loaded Value="True"/> 54 <DefaultSyntaxHighlighter Value="Delphi"/> 57 55 </Unit1> 58 56 <Unit2> … … 62 60 <EditorIndex Value="0"/> 63 61 <WindowIndex Value="0"/> 64 <TopLine Value=" 319"/>65 <CursorPos X=" 46" Y="338"/>66 <UsageCount Value=" 96"/>62 <TopLine Value="291"/> 63 <CursorPos X="1" Y="311"/> 64 <UsageCount Value="145"/> 67 65 <Loaded Value="True"/> 68 66 <DefaultSyntaxHighlighter Value="Delphi"/> … … 71 69 <Filename Value="UXmlClasses.pas"/> 72 70 <IsPartOfProject Value="True"/> 73 < SyntaxHighlighter Value="Delphi"/>74 < UsageCount Value="96"/>71 <UsageCount Value="145"/> 72 <DefaultSyntaxHighlighter Value="Delphi"/> 75 73 </Unit3> 76 74 <Unit4> … … 78 76 <IsPartOfProject Value="True"/> 79 77 <UnitName Value="UCore"/> 80 <EditorIndex Value=" 10"/>81 <WindowIndex Value="0"/> 82 <TopLine Value="1 56"/>83 <CursorPos X=" 20" Y="170"/>84 <UsageCount Value=" 96"/>78 <EditorIndex Value="20"/> 79 <WindowIndex Value="0"/> 80 <TopLine Value="10"/> 81 <CursorPos X="1" Y="23"/> 82 <UsageCount Value="145"/> 85 83 <Loaded Value="True"/> 86 84 <DefaultSyntaxHighlighter Value="Delphi"/> … … 90 88 <IsPartOfProject Value="True"/> 91 89 <UnitName Value="UFinance"/> 92 <EditorIndex Value=" 13"/>90 <EditorIndex Value="29"/> 93 91 <WindowIndex Value="0"/> 94 92 <TopLine Value="217"/> 95 93 <CursorPos X="5" Y="236"/> 96 <UsageCount Value=" 96"/>94 <UsageCount Value="145"/> 97 95 <Loaded Value="True"/> 98 96 <DefaultSyntaxHighlighter Value="Delphi"/> … … 102 100 <IsPartOfProject Value="True"/> 103 101 <UnitName Value="UFinancePage"/> 104 <EditorIndex Value=" 12"/>105 <WindowIndex Value="0"/> 106 <TopLine Value=" 6"/>102 <EditorIndex Value="28"/> 103 <WindowIndex Value="0"/> 104 <TopLine Value="10"/> 107 105 <CursorPos X="27" Y="19"/> 108 <UsageCount Value="96"/> 109 <Loaded Value="True"/> 106 <UsageCount Value="145"/> 107 <Loaded Value="True"/> 108 <DefaultSyntaxHighlighter Value="Delphi"/> 110 109 </Unit6> 111 110 <Unit7> … … 115 114 <TopLine Value="17"/> 116 115 <CursorPos X="34" Y="30"/> 117 < SyntaxHighlighter Value="Delphi"/>118 < UsageCount Value="96"/>116 <UsageCount Value="145"/> 117 <DefaultSyntaxHighlighter Value="Delphi"/> 119 118 </Unit7> 120 119 <Unit8> … … 124 123 <EditorIndex Value="2"/> 125 124 <WindowIndex Value="0"/> 126 <TopLine Value=" 176"/>127 <CursorPos X="25" Y=" 195"/>128 <UsageCount Value=" 96"/>125 <TopLine Value="204"/> 126 <CursorPos X="25" Y="226"/> 127 <UsageCount Value="145"/> 129 128 <Loaded Value="True"/> 130 129 <DefaultSyntaxHighlighter Value="Delphi"/> … … 134 133 <IsPartOfProject Value="True"/> 135 134 <UnitName Value="UNewsPage"/> 136 <EditorIndex Value=" 9"/>135 <EditorIndex Value="19"/> 137 136 <WindowIndex Value="0"/> 138 137 <TopLine Value="102"/> 139 138 <CursorPos X="25" Y="107"/> 140 <UsageCount Value=" 96"/>139 <UsageCount Value="145"/> 141 140 <Loaded Value="True"/> 142 141 <DefaultSyntaxHighlighter Value="Delphi"/> 143 142 </Unit9> 144 143 <Unit10> 145 <Filename Value="/usr/share/fpcsrc/rtl/unix/sysutils.pp"/>146 <UnitName Value="sysutils"/>147 <TopLine Value="81"/>148 <CursorPos X="10" Y="94"/>149 <UsageCount Value="4"/>150 </Unit10>151 <Unit11>152 <Filename Value="/usr/share/fpcsrc/rtl/objpas/sysutils/sysutils.inc"/>153 <TopLine Value="121"/>154 <CursorPos X="26" Y="17"/>155 <UsageCount Value="4"/>156 </Unit11>157 <Unit12>158 <Filename Value="/usr/share/fpcsrc/rtl/objpas/sysutils/sysstrh.inc"/>159 <TopLine Value="18"/>160 <CursorPos X="4" Y="33"/>161 <UsageCount Value="4"/>162 </Unit12>163 <Unit13>164 144 <Filename Value="../../../../other/powtils/main/pwmain.pas"/> 165 145 <UnitName Value="pwmain"/> 166 146 <TopLine Value="2320"/> 167 147 <CursorPos X="30" Y="2342"/> 168 <UsageCount Value="19"/> 169 </Unit13> 170 <Unit14> 148 <UsageCount Value="14"/> 149 <DefaultSyntaxHighlighter Value="Delphi"/> 150 </Unit10> 151 <Unit11> 171 152 <Filename Value="URSS.pas"/> 172 153 <IsPartOfProject Value="True"/> … … 176 157 <TopLine Value="40"/> 177 158 <CursorPos X="9" Y="59"/> 178 <UsageCount Value=" 84"/>179 <Loaded Value="True"/> 180 <DefaultSyntaxHighlighter Value="Delphi"/> 181 </Unit1 4>182 <Unit1 5>159 <UsageCount Value="133"/> 160 <Loaded Value="True"/> 161 <DefaultSyntaxHighlighter Value="Delphi"/> 162 </Unit11> 163 <Unit12> 183 164 <Filename Value="/usr/share/fpcsrc/rtl/objpas/sysutils/datih.inc"/> 184 165 <TopLine Value="115"/> 185 166 <CursorPos X="10" Y="117"/> 186 <UsageCount Value="6"/> 187 </Unit15> 188 <Unit16> 167 <UsageCount Value="1"/> 168 <DefaultSyntaxHighlighter Value="Delphi"/> 169 </Unit12> 170 <Unit13> 189 171 <Filename Value="/usr/share/fpcsrc/rtl/objpas/dateutil.inc"/> 190 172 <TopLine Value="34"/> 191 173 <CursorPos X="3" Y="624"/> 192 <UsageCount Value="6"/> 174 <UsageCount Value="1"/> 175 <DefaultSyntaxHighlighter Value="Delphi"/> 176 </Unit13> 177 <Unit14> 178 <Filename Value="UConfig.pas"/> 179 <IsPartOfProject Value="True"/> 180 <UnitName Value="UConfig"/> 181 <EditorIndex Value="18"/> 182 <WindowIndex Value="0"/> 183 <TopLine Value="1"/> 184 <CursorPos X="88" Y="11"/> 185 <UsageCount Value="120"/> 186 <Loaded Value="True"/> 187 <DefaultSyntaxHighlighter Value="Delphi"/> 188 </Unit14> 189 <Unit15> 190 <Filename Value="style/style.css"/> 191 <IsPartOfProject Value="True"/> 192 <TopLine Value="108"/> 193 <CursorPos X="1" Y="134"/> 194 <UsageCount Value="120"/> 195 <DefaultSyntaxHighlighter Value="None"/> 196 </Unit15> 197 <Unit16> 198 <Filename Value="style/global.js"/> 199 <IsPartOfProject Value="True"/> 200 <TopLine Value="1"/> 201 <CursorPos X="1" Y="1"/> 202 <UsageCount Value="120"/> 203 <DefaultSyntaxHighlighter Value="JScript"/> 193 204 </Unit16> 194 205 <Unit17> 195 <Filename Value="UConfig.pas"/> 196 <IsPartOfProject Value="True"/> 197 <UnitName Value="UConfig"/> 198 <TopLine Value="1"/> 199 <CursorPos X="3" Y="14"/> 200 <SyntaxHighlighter Value="Delphi"/> 201 <UsageCount Value="71"/> 206 <Filename Value="UDatabase.pas"/> 207 <IsPartOfProject Value="True"/> 208 <UnitName Value="UDatabase"/> 209 <EditorIndex Value="1"/> 210 <WindowIndex Value="0"/> 211 <TopLine Value="608"/> 212 <CursorPos X="44" Y="627"/> 213 <UsageCount Value="114"/> 214 <Loaded Value="True"/> 215 <DefaultSyntaxHighlighter Value="Delphi"/> 202 216 </Unit17> 203 217 <Unit18> 204 <Filename Value="style/style.css"/> 205 <IsPartOfProject Value="True"/> 206 <TopLine Value="108"/> 207 <CursorPos X="1" Y="134"/> 208 <SyntaxHighlighter Value="None"/> 209 <UsageCount Value="71"/> 218 <Filename Value="UUser.pas"/> 219 <IsPartOfProject Value="True"/> 220 <UnitName Value="UUser"/> 221 <EditorIndex Value="6"/> 222 <WindowIndex Value="0"/> 223 <TopLine Value="39"/> 224 <CursorPos X="25" Y="58"/> 225 <UsageCount Value="114"/> 226 <Loaded Value="True"/> 227 <DefaultSyntaxHighlighter Value="Delphi"/> 210 228 </Unit18> 211 229 <Unit19> 212 <Filename Value="style/global.js"/> 213 <IsPartOfProject Value="True"/> 214 <TopLine Value="1"/> 215 <CursorPos X="1" Y="1"/> 216 <SyntaxHighlighter Value="JScript"/> 217 <UsageCount Value="71"/> 230 <Filename Value="Pages/UUserPage.pas"/> 231 <IsPartOfProject Value="True"/> 232 <UnitName Value="UUserPage"/> 233 <EditorIndex Value="4"/> 234 <WindowIndex Value="0"/> 235 <TopLine Value="1"/> 236 <CursorPos X="69" Y="19"/> 237 <UsageCount Value="110"/> 238 <Loaded Value="True"/> 239 <DefaultSyntaxHighlighter Value="Delphi"/> 218 240 </Unit19> 219 241 <Unit20> 220 <Filename Value="U Database.pas"/>221 <IsPartOfProject Value="True"/> 222 <UnitName Value="U Database"/>223 <EditorIndex Value=" 1"/>224 <WindowIndex Value="0"/> 225 <TopLine Value=" 608"/>226 <CursorPos X=" 44" Y="627"/>227 <UsageCount Value=" 65"/>242 <Filename Value="UBill.pas"/> 243 <IsPartOfProject Value="True"/> 244 <UnitName Value="UBill"/> 245 <EditorIndex Value="7"/> 246 <WindowIndex Value="0"/> 247 <TopLine Value="1"/> 248 <CursorPos X="52" Y="124"/> 249 <UsageCount Value="107"/> 228 250 <Loaded Value="True"/> 229 251 <DefaultSyntaxHighlighter Value="Delphi"/> 230 252 </Unit20> 231 253 <Unit21> 232 <Filename Value="UUser.pas"/> 233 <IsPartOfProject Value="True"/> 234 <UnitName Value="UUser"/> 235 <EditorIndex Value="6"/> 236 <WindowIndex Value="0"/> 237 <TopLine Value="39"/> 238 <CursorPos X="25" Y="58"/> 239 <UsageCount Value="65"/> 240 <Loaded Value="True"/> 254 <Filename Value="/usr/share/fpcsrc/packages/fv/src/dialogs.pas"/> 255 <UnitName Value="Dialogs"/> 256 <TopLine Value="1"/> 257 <CursorPos X="19" Y="4"/> 258 <UsageCount Value="5"/> 241 259 <DefaultSyntaxHighlighter Value="Delphi"/> 242 260 </Unit21> 243 261 <Unit22> 244 <Filename Value="Pages/UUserPage.pas"/> 245 <IsPartOfProject Value="True"/> 246 <UnitName Value="UUserPage"/> 247 <EditorIndex Value="4"/> 248 <WindowIndex Value="0"/> 249 <TopLine Value="1"/> 250 <CursorPos X="69" Y="19"/> 251 <UsageCount Value="61"/> 262 <Filename Value="../../../../other/powtils/release/1.7.1/main/dynpwu.pas"/> 263 <UnitName Value="dynpwu"/> 264 <EditorIndex Value="21"/> 265 <WindowIndex Value="0"/> 266 <TopLine Value="19"/> 267 <CursorPos X="2" Y="38"/> 268 <UsageCount Value="35"/> 252 269 <Loaded Value="True"/> 253 270 <DefaultSyntaxHighlighter Value="Delphi"/> 254 271 </Unit22> 255 272 <Unit23> 256 <Filename Value="UBill.pas"/> 257 <IsPartOfProject Value="True"/> 258 <UnitName Value="UBill"/> 259 <IsVisibleTab Value="True"/> 260 <EditorIndex Value="7"/> 261 <WindowIndex Value="0"/> 262 <TopLine Value="118"/> 263 <CursorPos X="52" Y="132"/> 264 <UsageCount Value="58"/> 273 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwbuffer.pas"/> 274 <UnitName Value="pwbuffer"/> 275 <EditorIndex Value="22"/> 276 <WindowIndex Value="0"/> 277 <TopLine Value="67"/> 278 <CursorPos X="6" Y="62"/> 279 <UsageCount Value="12"/> 265 280 <Loaded Value="True"/> 266 281 <DefaultSyntaxHighlighter Value="Delphi"/> 267 282 </Unit23> 268 283 <Unit24> 269 <Filename Value="/usr/share/fpcsrc/packages/fv/src/dialogs.pas"/> 270 <UnitName Value="Dialogs"/> 271 <TopLine Value="1"/> 272 <CursorPos X="19" Y="4"/> 273 <UsageCount Value="10"/> 284 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwbase64enc.pas"/> 285 <UnitName Value="pwbase64enc"/> 286 <EditorIndex Value="25"/> 287 <WindowIndex Value="0"/> 288 <TopLine Value="53"/> 289 <CursorPos X="9" Y="141"/> 290 <UsageCount Value="12"/> 291 <Loaded Value="True"/> 292 <DefaultSyntaxHighlighter Value="Delphi"/> 274 293 </Unit24> 275 294 <Unit25> 276 <Filename Value="../../../../other/powtils/release/1.7.1/main/dynpwu.pas"/> 277 <UnitName Value="dynpwu"/> 295 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwdirutil_test.pas"/> 296 <UnitName Value="pwdirutil_test"/> 297 <EditorIndex Value="23"/> 298 <WindowIndex Value="0"/> 299 <TopLine Value="1"/> 300 <CursorPos X="1" Y="1"/> 301 <UsageCount Value="12"/> 302 <Loaded Value="True"/> 303 <DefaultSyntaxHighlighter Value="Delphi"/> 304 </Unit25> 305 <Unit26> 306 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwdefaultcfg.pas"/> 307 <UnitName Value="pwdefaultcfg"/> 308 <EditorIndex Value="24"/> 309 <WindowIndex Value="0"/> 310 <TopLine Value="92"/> 311 <CursorPos X="29" Y="112"/> 312 <UsageCount Value="12"/> 313 <Loaded Value="True"/> 314 <DefaultSyntaxHighlighter Value="Delphi"/> 315 </Unit26> 316 <Unit27> 317 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwhtmtils.pas"/> 318 <UnitName Value="pwHTMtils"/> 319 <EditorIndex Value="26"/> 320 <WindowIndex Value="0"/> 321 <TopLine Value="1"/> 322 <CursorPos X="12" Y="10"/> 323 <UsageCount Value="12"/> 324 <Loaded Value="True"/> 325 <DefaultSyntaxHighlighter Value="Delphi"/> 326 </Unit27> 327 <Unit28> 328 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwhtmtool.pas"/> 329 <UnitName Value="pwhtmtool"/> 330 <WindowIndex Value="0"/> 331 <TopLine Value="1"/> 332 <CursorPos X="8" Y="1"/> 333 <UsageCount Value="10"/> 334 <DefaultSyntaxHighlighter Value="Delphi"/> 335 </Unit28> 336 <Unit29> 337 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwhtmw.pas"/> 338 <UnitName Value="pwHTMw"/> 339 <EditorIndex Value="27"/> 340 <WindowIndex Value="0"/> 341 <TopLine Value="1803"/> 342 <CursorPos X="39" Y="1806"/> 343 <UsageCount Value="12"/> 344 <Loaded Value="True"/> 345 <DefaultSyntaxHighlighter Value="Delphi"/> 346 </Unit29> 347 <Unit30> 348 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwhttp.pas"/> 349 <UnitName Value="pwhttp"/> 350 <WindowIndex Value="0"/> 351 <TopLine Value="173"/> 352 <CursorPos X="10" Y="192"/> 353 <UsageCount Value="10"/> 354 <DefaultSyntaxHighlighter Value="Delphi"/> 355 </Unit30> 356 <Unit31> 357 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwmailprep.pas"/> 358 <UnitName Value="pwmailprep"/> 359 <EditorIndex Value="17"/> 360 <WindowIndex Value="0"/> 361 <TopLine Value="31"/> 362 <CursorPos X="3" Y="49"/> 363 <UsageCount Value="12"/> 364 <Loaded Value="True"/> 365 <DefaultSyntaxHighlighter Value="Delphi"/> 366 </Unit31> 367 <Unit32> 368 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwsds.pas"/> 369 <UnitName Value="pwsds"/> 370 <WindowIndex Value="0"/> 371 <TopLine Value="2569"/> 372 <CursorPos X="27" Y="2594"/> 373 <UsageCount Value="10"/> 374 <DefaultSyntaxHighlighter Value="Delphi"/> 375 </Unit32> 376 <Unit33> 377 <Filename Value="UCGIApplication.pas"/> 378 <IsPartOfProject Value="True"/> 379 <UnitName Value="UCGIApplication"/> 380 <EditorIndex Value="10"/> 381 <WindowIndex Value="0"/> 382 <TopLine Value="112"/> 383 <CursorPos X="23" Y="125"/> 384 <UsageCount Value="21"/> 385 <Loaded Value="True"/> 386 <DefaultSyntaxHighlighter Value="Delphi"/> 387 </Unit33> 388 <Unit34> 389 <Filename Value="UMainCGI.pas"/> 390 <IsPartOfProject Value="True"/> 391 <UnitName Value="UMainCGI"/> 392 <EditorIndex Value="9"/> 393 <WindowIndex Value="0"/> 394 <TopLine Value="1"/> 395 <CursorPos X="1" Y="1"/> 396 <UsageCount Value="21"/> 397 <Loaded Value="True"/> 398 <DefaultSyntaxHighlighter Value="Delphi"/> 399 </Unit34> 400 <Unit35> 401 <Filename Value="/usr/share/fpcsrc/rtl/objpas/classes/classesh.inc"/> 402 <EditorIndex Value="16"/> 403 <WindowIndex Value="0"/> 404 <TopLine Value="562"/> 405 <CursorPos X="14" Y="579"/> 406 <UsageCount Value="10"/> 407 <Loaded Value="True"/> 408 <DefaultSyntaxHighlighter Value="Delphi"/> 409 </Unit35> 410 <Unit36> 411 <Filename Value="/usr/share/fpcsrc/rtl/objpas/sysutils/osutilsh.inc"/> 412 <EditorIndex Value="12"/> 413 <WindowIndex Value="0"/> 414 <TopLine Value="10"/> 415 <CursorPos X="22" Y="23"/> 416 <UsageCount Value="10"/> 417 <Loaded Value="True"/> 418 <DefaultSyntaxHighlighter Value="Delphi"/> 419 </Unit36> 420 <Unit37> 421 <Filename Value="/usr/share/fpcsrc/rtl/unix/sysutils.pp"/> 422 <UnitName Value="sysutils"/> 423 <EditorIndex Value="13"/> 424 <WindowIndex Value="0"/> 425 <TopLine Value="1140"/> 426 <CursorPos X="26" Y="1143"/> 427 <UsageCount Value="10"/> 428 <Loaded Value="True"/> 429 <DefaultSyntaxHighlighter Value="Delphi"/> 430 </Unit37> 431 <Unit38> 432 <Filename Value="/usr/share/fpcsrc/rtl/unix/sysunixh.inc"/> 433 <EditorIndex Value="15"/> 434 <WindowIndex Value="0"/> 435 <TopLine Value="43"/> 436 <CursorPos X="5" Y="61"/> 437 <UsageCount Value="10"/> 438 <Loaded Value="True"/> 439 <DefaultSyntaxHighlighter Value="Delphi"/> 440 </Unit38> 441 <Unit39> 442 <Filename Value="/usr/share/fpcsrc/rtl/objpas/sysutils/osutil.inc"/> 443 <EditorIndex Value="14"/> 444 <WindowIndex Value="0"/> 445 <TopLine Value="50"/> 446 <CursorPos X="10" Y="63"/> 447 <UsageCount Value="10"/> 448 <Loaded Value="True"/> 449 <DefaultSyntaxHighlighter Value="Delphi"/> 450 </Unit39> 451 <Unit40> 452 <Filename Value="Common/UStringListEx.pas"/> 453 <IsPartOfProject Value="True"/> 454 <UnitName Value="UStringListEx"/> 455 <IsVisibleTab Value="True"/> 278 456 <EditorIndex Value="11"/> 279 457 <WindowIndex Value="0"/> 280 458 <TopLine Value="24"/> 281 <CursorPos X=" 37" Y="46"/>282 <UsageCount Value=" 10"/>283 <Loaded Value="True"/> 284 </Unit 25>459 <CursorPos X="40" Y="41"/> 460 <UsageCount Value="20"/> 461 <Loaded Value="True"/> 462 </Unit40> 285 463 </Units> 286 <JumpHistory Count="2 1" HistoryIndex="20">464 <JumpHistory Count="29" HistoryIndex="28"> 287 465 <Position1> 288 <Filename Value=" UUser.pas"/>289 <Caret Line=" 36" Column="31" TopLine="14"/>466 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwhtmw.pas"/> 467 <Caret Line="1" Column="1" TopLine="1"/> 290 468 </Position1> 291 469 <Position2> 292 <Filename Value=" UUser.pas"/>293 <Caret Line=" 28" Column="51" TopLine="8"/>470 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwhtmw.pas"/> 471 <Caret Line="63" Column="6" TopLine="43"/> 294 472 </Position2> 295 473 <Position3> 296 <Filename Value=" UUser.pas"/>297 <Caret Line=" 43" Column="53" TopLine="24"/>474 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwhtmw.pas"/> 475 <Caret Line="682" Column="1" TopLine="663"/> 298 476 </Position3> 299 477 <Position4> 300 <Filename Value=" UUser.pas"/>301 <Caret Line=" 56" Column="23" TopLine="37"/>478 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwhtmw.pas"/> 479 <Caret Line="63" Column="8" TopLine="44"/> 302 480 </Position4> 303 481 <Position5> 304 <Filename Value=" UBill.pas"/>305 <Caret Line=" 60" Column="36" TopLine="34"/>482 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwhtmw.pas"/> 483 <Caret Line="1399" Column="76" TopLine="1380"/> 306 484 </Position5> 307 485 <Position6> 308 <Filename Value=" UBill.pas"/>309 <Caret Line=" 155" Column="21" TopLine="135"/>486 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwhtmw.pas"/> 487 <Caret Line="73" Column="9" TopLine="45"/> 310 488 </Position6> 311 489 <Position7> 312 <Filename Value=" UBill.pas"/>313 <Caret Line="1 57" Column="23" TopLine="138"/>490 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwhtmw.pas"/> 491 <Caret Line="1399" Column="76" TopLine="1380"/> 314 492 </Position7> 315 493 <Position8> 316 <Filename Value=" UBill.pas"/>317 <Caret Line=" 315" Column="21" TopLine="287"/>494 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwhtmw.pas"/> 495 <Caret Line="1837" Column="1" TopLine="1799"/> 318 496 </Position8> 319 497 <Position9> 320 <Filename Value=" UBill.pas"/>321 <Caret Line=" 317" Column="23" TopLine="287"/>498 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwhtmw.pas"/> 499 <Caret Line="75" Column="31" TopLine="61"/> 322 500 </Position9> 323 501 <Position10> 324 <Filename Value=" UBill.pas"/>325 <Caret Line=" 8" Column="52" TopLine="1"/>502 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwhtmw.pas"/> 503 <Caret Line="1399" Column="76" TopLine="1380"/> 326 504 </Position10> 327 505 <Position11> 328 <Filename Value=" UBill.pas"/>329 <Caret Line=" 25" Column="29" TopLine="1"/>506 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwmailprep.pas"/> 507 <Caret Line="1" Column="1" TopLine="1"/> 330 508 </Position11> 331 509 <Position12> 332 <Filename Value=" UBill.pas"/>333 <Caret Line=" 314" Column="1" TopLine="286"/>510 <Filename Value="../../../../other/powtils/release/1.7.1/main/pwmailprep.pas"/> 511 <Caret Line="49" Column="3" TopLine="29"/> 334 512 </Position12> 335 513 <Position13> 336 <Filename Value="U Bill.pas"/>337 <Caret Line="1 68" Column="16" TopLine="149"/>514 <Filename Value="UCGIApplication.pas"/> 515 <Caret Line="17" Column="34" TopLine="1"/> 338 516 </Position13> 339 517 <Position14> 340 <Filename Value=" USqlDatabase.pas"/>341 <Caret Line=" 308" Column="13" TopLine="70"/>518 <Filename Value="index.pas"/> 519 <Caret Line="14" Column="1" TopLine="1"/> 342 520 </Position14> 343 521 <Position15> 344 <Filename Value=" UBill.pas"/>345 <Caret Line=" 177" Column="16" TopLine="161"/>522 <Filename Value="index.pas"/> 523 <Caret Line="45" Column="9" TopLine="19"/> 346 524 </Position15> 347 525 <Position16> 348 <Filename Value="U Bill.pas"/>349 <Caret Line=" 314" Column="3" TopLine="286"/>526 <Filename Value="UCGIApplication.pas"/> 527 <Caret Line="19" Column="19" TopLine="9"/> 350 528 </Position16> 351 529 <Position17> 352 <Filename Value=" UBill.pas"/>353 <Caret Line=" 168" Column="16" TopLine="149"/>530 <Filename Value="index.pas"/> 531 <Caret Line="28" Column="12" TopLine="10"/> 354 532 </Position17> 355 533 <Position18> 356 <Filename Value="UC ore.pas"/>357 <Caret Line=" 210" Column="32" TopLine="199"/>534 <Filename Value="UCGIApplication.pas"/> 535 <Caret Line="49" Column="19" TopLine="25"/> 358 536 </Position18> 359 537 <Position19> 360 <Filename Value="UC ore.pas"/>361 <Caret Line=" 176" Column="28" TopLine="168"/>538 <Filename Value="UCGIApplication.pas"/> 539 <Caret Line="30" Column="17" TopLine="17"/> 362 540 </Position19> 363 541 <Position20> 364 <Filename Value=" ../../../../other/powtils/release/1.7.1/main/dynpwu.pas"/>365 <Caret Line=" 1" Column="1" TopLine="1"/>542 <Filename Value="index.pas"/> 543 <Caret Line="43" Column="18" TopLine="19"/> 366 544 </Position20> 367 545 <Position21> 368 <Filename Value=" ../../../../other/powtils/release/1.7.1/main/dynpwu.pas"/>369 <Caret Line=" 38" Column="31" TopLine="24"/>546 <Filename Value="index.pas"/> 547 <Caret Line="28" Column="8" TopLine="19"/> 370 548 </Position21> 549 <Position22> 550 <Filename Value="index.pas"/> 551 <Caret Line="24" Column="1" TopLine="11"/> 552 </Position22> 553 <Position23> 554 <Filename Value="UCore.pas"/> 555 <Caret Line="179" Column="1" TopLine="28"/> 556 </Position23> 557 <Position24> 558 <Filename Value="UCGIApplication.pas"/> 559 <Caret Line="58" Column="5" TopLine="35"/> 560 </Position24> 561 <Position25> 562 <Filename Value="UCGIApplication.pas"/> 563 <Caret Line="49" Column="50" TopLine="36"/> 564 </Position25> 565 <Position26> 566 <Filename Value="UCGIApplication.pas"/> 567 <Caret Line="15" Column="31" TopLine="1"/> 568 </Position26> 569 <Position27> 570 <Filename Value="UCGIApplication.pas"/> 571 <Caret Line="58" Column="21" TopLine="49"/> 572 </Position27> 573 <Position28> 574 <Filename Value="/usr/share/fpcsrc/rtl/unix/sysutils.pp"/> 575 <Caret Line="1143" Column="26" TopLine="1140"/> 576 </Position28> 577 <Position29> 578 <Filename Value="UCGIApplication.pas"/> 579 <Caret Line="58" Column="1" TopLine="47"/> 580 </Position29> 371 581 </JumpHistory> 372 582 </ProjectOptions> 373 583 <CompilerOptions> 374 584 <Version Value="9"/> 585 <Target> 586 <Filename Value="index.cgi"/> 587 </Target> 375 588 <SearchPaths> 376 <OtherUnitFiles Value="/usr/lib/mysql/;/usr/lib64/mysql/;Pages/ "/>589 <OtherUnitFiles Value="/usr/lib/mysql/;/usr/lib64/mysql/;Pages/;Common/"/> 377 590 <UnitOutputDirectory Value="bin"/> 378 591 <LCLWidgetType Value="gtk2"/> … … 402 615 </Verbosity> 403 616 <WriteFPCLogo Value="False"/> 617 <CompilerMessages> 618 <UseMsgFile Value="True"/> 619 </CompilerMessages> 404 620 <CompilerPath Value="$(CompPath)"/> 405 621 </Other> -
branches/web/index.pas
r283 r286 5 5 uses 6 6 UCore, USqlDatabase, SysUtils, UMainPage, 7 UFinancePage, UNewsPage, UUserPage, UBill; 7 UFinancePage, UNewsPage, UUserPage, UBill, UCGIApplication, UMainCGI, UStringListEx; 8 9 type 10 11 { TMyCGIApplication } 12 13 TMyCGIApplication = class(TCGIApplication) 14 procedure Execute; override; 15 end; 8 16 9 17 var 10 Output: string; 18 Application: TMyCGIApplication; 19 20 { TMyCGIApplication } 21 22 procedure TMyCGIApplication.Execute; 23 var 11 24 I: Integer; 12 25 PageName: string; 13 26 begin 14 // SetHeader('Content-Type', 'text/html; charset=utf-8'); 15 //PageName := GetCgiVar('p'); 27 Output.Add('Hello friend'); 28 SysInfo; 29 30 PageName := Query.Values['p']; 16 31 if PageName = '' then PageName := 'index'; 17 32 I := 0; 18 33 while (I < Length(Pages)) and (Pages[I].Name <> PageName) do Inc(I); 19 if I < Length(Pages) then Output := Pages[I].Producer20 else Output := 'Stránka nenalezena';34 if I < Length(Pages) then Output.Add(Pages[I].Producer) 35 else Output.Add('Stránka nenalezena'); 21 36 // WebWriteLn(FormatOutput(Output)); 37 end; 38 39 begin 40 Application := TMyCGIApplication.Create; 41 Application.Run; 42 Application.Free; 22 43 end.
Note:
See TracChangeset
for help on using the changeset viewer.