1 | unit HostingPage;
|
---|
2 |
|
---|
3 | interface
|
---|
4 |
|
---|
5 | uses
|
---|
6 | Classes, SysUtils, FileUtil, WebPage, HTTPServer, SqlDatabase, HtmlClasses,
|
---|
7 | ModuleUser;
|
---|
8 |
|
---|
9 | type
|
---|
10 |
|
---|
11 | { THostingPage }
|
---|
12 |
|
---|
13 | THostingPage = class(TWebPage)
|
---|
14 | procedure DataModuleProduce(HandlerData: THTTPHandlerData);
|
---|
15 | end;
|
---|
16 |
|
---|
17 | var
|
---|
18 | HostingPage: THostingPage;
|
---|
19 |
|
---|
20 |
|
---|
21 | implementation
|
---|
22 |
|
---|
23 | {$R *.lfm}
|
---|
24 |
|
---|
25 | uses
|
---|
26 | Core, WebSession;
|
---|
27 |
|
---|
28 | { THostingPage }
|
---|
29 |
|
---|
30 | procedure THostingPage.DataModuleProduce(HandlerData: THTTPHandlerData);
|
---|
31 | var
|
---|
32 | I: Integer;
|
---|
33 | DbRows: TDbRows;
|
---|
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 | Text := 'V nabídce je provoz virtualizovaných Linuxových serverů dle dohodnutých parameterů.<br/><br/>' +
|
---|
46 | '<strong>Standardní varianty:</strong><br/>' +
|
---|
47 | '<table class="WideTable">' +
|
---|
48 | '<tr><th>Označení</th><th>Rychlost</th><th>Vyhrazená paměť</th><th>Pevný disk</th><th>Procesor</th><th>Cena [Kč/měsíc]</th></tr>';
|
---|
49 | try
|
---|
50 | DbRows := TDbRows.Create;
|
---|
51 | Database.Query(DbRows, 'SELECT * FROM VPSHosting ORDER BY Price DESC');
|
---|
52 | for I := 0 to DbRows.Count - 1 do
|
---|
53 | Text := Text + '<tr><td>' + DbRows[I].Items['Name'] + '</td><td align="center">' +
|
---|
54 | DbRows[I].Items['Internet'] + '</td><td align="center">' + DbRows[I].Items['Memory'] +
|
---|
55 | '</td><td align="center">' + DbRows[I].Items['Space'] + '</td><td align="center">' +
|
---|
56 | DbRows[I].Items['CPU'] + '</td><td align="center">' + DbRows[I].Items['Price'] + '</td></tr>';
|
---|
57 | finally
|
---|
58 | DbRows.Free;
|
---|
59 | end;
|
---|
60 | Text := Text + '</table>' +
|
---|
61 | '<br/>' +
|
---|
62 | 'Prvních 7 dní zdarma, denní zálohování disků, ceny včetně DPH<br/>' +
|
---|
63 | 'Použité technologie: <a href="http://www.linux.cz/">GNU/Linux</a>, <a href="https://linuxcontainers.org/">LXC</a>, <a href="http://pve.proxmox.com/">Proxmox VE</a>, <a href="http://backuppc.sourceforge.net/">BackupPC</a><br/>' +
|
---|
64 | '<br/>' +
|
---|
65 | '<i>Aktualizováno: 1.10.2012</i><br/><br/>';
|
---|
66 |
|
---|
67 | Text := Text + '<p>Hosting je využíván např. pro provoz herních serverů MMORPG her jako např. World of Warcraft (WoW), Lineage II, Aion, aj.</p>';
|
---|
68 |
|
---|
69 | Text := Text + '<strong>Projekty využívající VPS hosting</strong><br/><ul>';
|
---|
70 | try
|
---|
71 | DbRows := TDbRows.Create;
|
---|
72 | Database.Query(DbRows, 'SELECT * FROM `HostedProject` WHERE `Active`=1 AND `WebHosting`=0');
|
---|
73 | for I := 0 to DbRows.Count - 1 do
|
---|
74 | if DbRows[I].Items['Homepage'] <> '' then
|
---|
75 | Text := Text + '<li><a href="' + DbRows[I].Items['Homepage'] + '">' +
|
---|
76 | DbRows[I].Items['Name'] + '</a></li>'
|
---|
77 | else Text := Text + '<li>' + DbRows[I].Items['Name'] + '</li>';
|
---|
78 | Text := Text + '</ul>';
|
---|
79 | finally
|
---|
80 | DbRows.Free;
|
---|
81 | end;
|
---|
82 |
|
---|
83 | Text := Text + '<br/><strong>Projekty využívající web hosting</strong><br/><ul>';
|
---|
84 | try
|
---|
85 | DbRows := TDbRows.Create;
|
---|
86 | Database.Query(DbRows, 'SELECT * FROM `HostedProject` WHERE `Active`=1 AND `WebHosting`=1');
|
---|
87 | for I := 0 to DbRows.Count - 1 do
|
---|
88 | Text := Text + '<li><a href="' + DbRows[I].Items['Homepage'] + '">' +
|
---|
89 | DbRows[I].Items['Name'] + '</a></li>';
|
---|
90 | Text := Text + '</ul>';
|
---|
91 | finally
|
---|
92 | DbRows.Free;
|
---|
93 | end;
|
---|
94 | end;
|
---|
95 | GeneratePage(Self);
|
---|
96 | end;
|
---|
97 | end;
|
---|
98 |
|
---|
99 | end.
|
---|
100 |
|
---|