0) ', [Gr1 ]); p>
try p>
Result: = Result + GroupListProducer (GroupQuery, Kind); p>
if Gr10 then p>
Result: = Result + Format ( 'TхЕеєЄ № е ъ
юуиртихеш |
', p>
[Request.ScriptName, 0,0, Kind ]); p>
except p>
on E: EDBEngineError do p>
begin p>
Result: = Result + '+ ° шс'р BDE' + '
'; p>
for i: = 0 to E. ErrorCount -1 do p>
Result: = Result + E. Errors [i]. Message + '
'; p>
end; p>
end; p>
end; p>
Result: = Result + '| юшеъ' p>
+ CommonEnd; p>
end; p>
// QueryAction - GetGroup тvтюф ЄрсышЎv яю Єют.уЕєяях p>
threadvar OperKind: Integer; p>
procedure TWebModule1.WebModule1GetGroupAction (Sender: TObject; p>
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); p>
var gn1, gn2: Integer; OrderCol: THTMLTableColumn; p>
begin p>
with Request.QueryFields do p>
begin p>
gn1: = IndexOfName ( 'Kind'); p>
if (gn10) then OperKind: = StrToIntDef (Values [ 'Kind'], 0); p>
if gn1> = 0 then Delete (gn1); p>
gn1: = StrToIntDef (Values [ 'Gr1'], 0); p>
gn2: = StrToIntDef (Values [ 'Gr2'], 0); p>
end;// with p>
if gn1 = 0 then Response.Content: = CommonLook + CreateGroupList (gn1, gn2, OperKind) p>
else if gn2 = 0 then Response.Content: = CommonLook + CreateGroupList (gn1, gn2, OperKind) p>
else p>
begin p>
// define group name p>
with GroupQuery do p>
begin p>
SQL.Text: = 'SELECT * FROM Groups WHERE (MainGroup =: gn1) and (SubGroup =: gn2 )'; p>
Params [0]. AsInteger: = gn1; p>
Params [1]. AsInteger: = gn2; p>
Open; p>
with StoreQTP do p>
begin p>
Header.Clear; p>
Header.Add (CommonLook); p>
if OperKind> 0 then p>
begin p>
OrderCol: = THTMLTableColumn.Create (StoreQTP.Columns); p>
OrderCol.Title.Caption: = '| р'рч'; p>
end p>
else p>
OrderCol: = nil; p>
case OperKind of p>
1: Header.Add (''); p>
2: Header.Add (''); p>
end;// case p>
Header.Add ( '
| рЄхуюЕш:' + FieldByName ( 'GroupName'). AsString + '
'); p>
Close; p>
// p>
Footer.Clear; p>
if OperKind = 1 then Footer.Add ( '
TЕю' юяирЄv'); p>
if OperKind> 0 then p>
begin p>
Footer.Add ('' p>
+''); p>
end; p>
Footer.Add (Format ( 'TхЕеєЄ № е ъ
юуиртихеш |
', p>
[Request.ScriptName, gn1, 0, OperKind ])); p>
end;// with storeqtp p>
end;// with groupquery p>
Response.Content: = StoreQTP.Content; p>
if Assigned (OrderCol) then OrderCol.Free; p>
end;// generating table p>
end; p>
procedure TWebModule1.StoreQTPFormatCell (Sender: TObject; p>
CellRow, CellColumn: Integer; var BgColor: THTMLBgColor; p>
var Align: THTMLAlign; var VAlign: THTMLVAlign; var CustomAttrs, p>
CellData: String); p>
var s: string; p>
begin p>
if (CellRow0) then if (CellRow mod 2 = 0) then BgColor: = 'silver' else BgColor: = 'Gray'; p>
if (OperKind> 0) and (CellColumn = 0) and (CellRow> 0) then p>
begin p>
CellData: ='' p>
+ CellData; p>
end; p>
if (OperKind> 0) and (CellColumn = StoreQTP.Columns.Count-1) and (CellRow> 0) then p>
begin p>
CellData: = '| р'рчрЄ №'; p>
s: = '
'; p>
end; p>
end; p>
procedure TWebModule1.StoreQTPGetTableCaption (Sender: TObject; p>
var Caption: String; var Alignment: THTMLCaptionAlignment); p>
begin p>
Caption: = '= рщфхею чряшехщ:' + IntToStr (StoreQTP.Query.RecordCount); p>
end; p>
procedure TWebModule1.WebModule1ValidateAction (Sender: TObject; p>
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); p>
begin p>
with ValidateQuery do p>
begin p>
Params [0]. AsString: = Request.QueryFields.Values [ 'UserName']; p>
Params [1]. AsString: = Request.QueryFields.Values [ 'Password']; p>
try p>
Open; p>
if RecordCount> 0 then p>
begin p>
UserStatus: = FieldByName ( 'UserCategory'). AsInteger; p>
Response.Content: = CommonLook + '
Tv єеях ° ею чрЕхушеЄЕшЕютреv b >'; p>
if UserStatus> 0 then p>
Response.Content: = Response.Content + '
TvсхЕшЄх ЄютрЕеє | уЕєяяє ш ттхфшЄх
чр'рч
'+ CreateGroupList (0,0,1) p>
else p>
begin p>
Response.Content: = Response.Content + '
T ърўхеЄтх рфьшешеЄЕрЄюЕр' p>
+ '
TЄЕрэшЎр
рфьшешеЄЕрЄюЕр b >'; p>
end; p>
end p>
else p>
Response.Content: = CommonLook + 'Tр ° ш фрееvх юЄеєЄеЄтє | Є т срчх. + сЕрЄшЄхе № ъ ерь яю рфЕхеє [email protected] '; p>
finally p>
Close; p>
end; p>
end; p>
end; p>
procedure TWebModule1.WebModule1AcceptOrderAction (Sender: TObject; p>
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); p>
begin p>
Response.Content: = CommonLook + sOrderAccepted + CommonEnd; p>
//-ри № ° х теЄрт № Єх етющ'юф фы т'и | ўхэш чр'рчр т срчє p>
end; p>
procedure TWebModule1.WebModule1SearchAction (Sender: TObject; p>
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); p>
var s: string; p>
begin p>
s: = Request.QueryFields.Values [ 'Phrase']; p>
GroupQuery.SQL.Text: = 'SELECT * FROM Groups WHERE GroupName LIKE "%' + s +'%"'; p>
Response.Content: = CommonLook + '
| хчєи № ЄрЄv яюше'р' + s + ':
' p>
+ GroupListProducer (GroupQuery, 0) + CommonEnd; p>
end; p>
procedure TWebModule1.WebModule1AddMSgAction (Sender: TObject; p>
Request: TWebRequest; Response: TWebResponse; var Handled: Boolean); p>
var MCookies: TStringList; i: integer; p>
begin p>
Response.Content: = CommonLook; p>
with AddMsgQuery do p>
try p>
Params [0]. AsString: = Request.QueryFields.Values [ 'Sender']; p>
Params [1]. AsString: = Request.Host; p>
Params [2]. AsDateTime: = Request.Date; p>
Params [3]. AsMemo: = Request.QueryFields.Values [ 'Message']; p>
Prepare; p>
ExecSQL; p>
MCookies: = TStringList.Create; p>
MCookies.Add ( 'User =' + Request.PathTranslated); p>
MCookies.Add ( 'Test =' + Request.RemoteHost); p>
MCookies.Add ( 'Time =' + Request.UserAgent); p>
Response.SetCookieField (MCookies,'', Request.PathInfo, Date 1, False); p>
MCookies.Free; p>
Response.Content: = Response.Content + 'Tр ° х еююс • хэшх яЕшеЄю' + CommonEnd; p>
except p>
on E: EDBEngineError do p>
begin p>
Response.Content: = Response.Content + '+ ° шс'р BDE' + '
'; p>
for i: = 0 to E. ErrorCount -1 do p>
Response.Content: = Response.Content + E. Errors [i]. Message + '
'; p>
Response.Content: = Response.Content + CommonEnd; p>
end; p>
end; p>
end; p>
end. p>
Бібліографічний
список.
1. Комп'ютер Прес N2 1997р. P>
2. П. Дарахвелидзе, Є. Марков «Програмування в Delphi 4» p>
3. Комп'ютер Прес N4 1997р. P>
4. Комп'ютер Прес N5 1998р. P>
5. Computer Week Москва N4 (210) 1999р. P>
6. Computer Week Москва N17 (223) 1996р. P>
7. Computer Week Москва N18 (224) 1998р. P>
8. Компьютерра N15 (142) 1996. P>