Line | |
---|
1 | unit ProjectsPage;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, FileUtil, WebPage, HtmlClasses, HTTPServer, SqlDatabase,
|
---|
7 | ModuleUser;
|
---|
8 |
|
---|
9 | type
|
---|
10 |
|
---|
11 | { TProjectsPage }
|
---|
12 |
|
---|
13 | TProjectsPage = class(TWebPage)
|
---|
14 | procedure DataModuleProduce(HandlerData: THTTPHandlerData);
|
---|
15 | end;
|
---|
16 |
|
---|
17 | var
|
---|
18 | ProjectsPage: TProjectsPage;
|
---|
19 |
|
---|
20 |
|
---|
21 | implementation
|
---|
22 |
|
---|
23 | {$R *.lfm}
|
---|
24 |
|
---|
25 | uses
|
---|
26 | Core, WebSession;
|
---|
27 |
|
---|
28 | { TProjectsPage }
|
---|
29 |
|
---|
30 | procedure TProjectsPage.DataModuleProduce(HandlerData: THTTPHandlerData);
|
---|
31 | var
|
---|
32 | DbRows: TDbRows;
|
---|
33 | I: Integer;
|
---|
34 | ModuleUser: TModuleUser;
|
---|
35 | begin
|
---|
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;
|
---|
64 | end;
|
---|
65 |
|
---|
66 | end.
|
---|
67 |
|
---|
Note:
See
TracBrowser
for help on using the repository browser.