source: trunk/Modules/ZdechovNET/ProjectsPage.pas

Last change on this file was 151, checked in by chronos, 9 months ago
File size: 1.6 KB
Line 
1unit ProjectsPage;
2
3interface
4
5uses
6 Classes, SysUtils, FileUtil, WebPage, HtmlClasses, HTTPServer, SqlDatabase,
7 ModuleUser;
8
9type
10
11 { TProjectsPage }
12
13 TProjectsPage = class(TWebPage)
14 procedure DataModuleProduce(HandlerData: THTTPHandlerData);
15 end;
16
17var
18 ProjectsPage: TProjectsPage;
19
20
21implementation
22
23{$R *.lfm}
24
25uses
26 Core, WebSession;
27
28{ TProjectsPage }
29
30procedure TProjectsPage.DataModuleProduce(HandlerData: THTTPHandlerData);
31var
32 DbRows: TDbRows;
33 I: Integer;
34 ModuleUser: TModuleUser;
35begin
36 with TWebSession(HandlerData) do begin
37 ModuleUser := TModuleUser(ModuleManager.FindModuleByName('User'));
38 if Request.Path.Count > 1 then begin
39 PageNotFound;
40 Exit;
41 end;
42
43 ModuleUser.LoadUserInfo;
44 with HtmlDocument.Body, SubItems.AddString do begin
45 try
46 DbRows := TDbRows.Create;
47 Text := '<strong>Projekty:</strong><br />' +
48 '<table class="WideTable">' +
49 '<tr><th>Čas vytvoření</th><th>Čas dokončení</th><th>Popis</th><th>Veřejné</th></tr>';
50 Database.Query(DbRows, 'SELECT * FROM `Plans` ORDER BY `TimeCreate` DESC');
51 for I := 0 to DbRows.Count - 1 do begin
52 Text := Text + '<tr><td>' + DbRows[I].Items['TimeCreate'] + '</td>' +
53 '<td>' + DbRows[I].Items['TimeFinished'] + '</td>' +
54 '<td>' + DbRows[I].Items['Description'] + '</td>' +
55 '<td>' + DbRows[I].Items['Public'] + '</td></tr>';
56 end;
57 Text := Text + '</table>';
58 finally
59 DbRows.Free;
60 end;
61 end;
62 GeneratePage(Self);
63 end;
64end;
65
66end.
67
Note: See TracBrowser for help on using the repository browser.