| 50 |
IWLink5: TIWLink; |
IWLink5: TIWLink; |
| 51 |
IWFrame1: TIWFrame1; |
IWFrame1: TIWFrame1; |
| 52 |
IWLink6: TIWLink; |
IWLink6: TIWLink; |
| 53 |
|
IWLink7: TIWLink; |
| 54 |
procedure IWAppFormRender(Sender: TObject); |
procedure IWAppFormRender(Sender: TObject); |
| 55 |
procedure IWLink2Click(Sender: TObject); |
procedure IWLink2Click(Sender: TObject); |
| 56 |
procedure IWAppFormCreate(Sender: TObject); |
procedure IWAppFormCreate(Sender: TObject); |
| 84 |
|
|
| 85 |
{$R *.dfm} |
{$R *.dfm} |
| 86 |
|
|
| 87 |
uses Unit3, ServerController, Unit6, Unit4, Unit9, Unit10, Unit5; |
uses Unit3, ServerController, Unit6, Unit4, Unit9, Unit10, Unit5, Unit11; |
| 88 |
|
|
| 89 |
procedure TIWForm1.CallBack(EventParams: TStringList); |
procedure TIWForm1.CallBack(EventParams: TStringList); |
| 90 |
begin |
begin |
| 199 |
with DM.FDQuery1 do |
with DM.FDQuery1 do |
| 200 |
begin |
begin |
| 201 |
SQL.Clear; |
SQL.Clear; |
| 202 |
SQL.Add('select volume,name,price from cart_data join item_data'); |
SQL.Add('select volume,name,price from cart_data,item_data'); |
| 203 |
SQL.Add(' on (cart_data.serial = item_data.serial)'); |
SQL.Add(' where cart_data.serial = item_data.serial'); |
| 204 |
SQL.Add(' where number = :num;'); |
SQL.Add(' and number = :num;'); |
| 205 |
Params.ParamByName('num').AsInteger := UserSession.user_number; |
ParamByName('num').AsInteger := UserSession.user_number; |
| 206 |
Open; |
Open; |
| 207 |
First; |
First; |
| 208 |
i := 0; |
i := 0; |
| 217 |
Close; |
Close; |
| 218 |
IWList3.Items.Clear; |
IWList3.Items.Clear; |
| 219 |
SQL.Clear; |
SQL.Clear; |
| 220 |
SQL.Add('select name from recent_data join item_data'); |
SQL.Add('select name from recent_data,item_data'); |
| 221 |
SQL.Add(' on (recent_data.serial = item_data.serial)'); |
SQL.Add(' where recent_data.serial = item_data.serial'); |
| 222 |
SQL.Add(' where number = :num;'); |
SQL.Add(' and number = :num;'); |
| 223 |
Params.ParamByName('num').AsInteger := UserSession.user_number; |
ParamByName('num').AsInteger := UserSession.user_number; |
| 224 |
Open; |
Open; |
| 225 |
First; |
First; |
| 226 |
while Eof = false do |
while Eof = false do |
| 232 |
end; |
end; |
| 233 |
LoadImage; |
LoadImage; |
| 234 |
if IWGrid1.Visible = true then |
if IWGrid1.Visible = true then |
| 235 |
IWLabel6.Visible := Filter; |
IWLabel6.Visible := Filter |
| 236 |
|
else |
| 237 |
|
DM.FDTable2.Locate('SERIAL',UserSession.Serial); |
| 238 |
end; |
end; |
| 239 |
|
|
| 240 |
procedure TIWForm1.IWButton1Click(Sender: TObject); |
procedure TIWForm1.IWButton1Click(Sender: TObject); |
| 312 |
const ARow, AColumn: Integer); |
const ARow, AColumn: Integer); |
| 313 |
begin |
begin |
| 314 |
Thumbnail := false; |
Thumbnail := false; |
|
IWFrame8.IWEdit1.Text := '1'; |
|
| 315 |
UserSession.Serial := Integer(IWGrid1.Cell[ARow, AColumn].Tag); |
UserSession.Serial := Integer(IWGrid1.Cell[ARow, AColumn].Tag); |
| 316 |
end; |
end; |
| 317 |
|
|
| 338 |
begin |
begin |
| 339 |
with DM.FDQuery1 do |
with DM.FDQuery1 do |
| 340 |
begin |
begin |
| 341 |
Open('select * from user_data where number = :num',[i]); |
Open('select * from user_data where number = :num', [i]); |
| 342 |
Delete; |
Delete; |
| 343 |
Open('select number from cart_data where number = :num;',[i]); |
Open('select number from cart_data where number = :num;', [i]); |
| 344 |
First; |
First; |
| 345 |
while Eof = false do |
while Eof = false do |
| 346 |
begin |
begin |
| 380 |
procedure TIWForm1.IWLink6Click(Sender: TObject); |
procedure TIWForm1.IWLink6Click(Sender: TObject); |
| 381 |
begin |
begin |
| 382 |
Page := true; |
Page := true; |
| 383 |
TAdminPage.Create(WebApplication).Show; |
if Sender = IWLink6 then |
| 384 |
|
TAdminPage.Create(WebApplication).Show |
| 385 |
|
else |
| 386 |
|
TAdminFile.Create(WebApplication).Show; |
| 387 |
end; |
end; |
| 388 |
|
|
| 389 |
procedure TIWForm1.LoadImage; |
procedure TIWForm1.LoadImage; |
| 393 |
pic: TIWImage; |
pic: TIWImage; |
| 394 |
i: Integer; |
i: Integer; |
| 395 |
j: Integer; |
j: Integer; |
|
x: Boolean; |
|
| 396 |
t: string; |
t: string; |
| 397 |
label label1; |
label label1; |
| 398 |
begin |
begin |
| 419 |
end |
end |
| 420 |
else if DM.FDTable2.Found = false then |
else if DM.FDTable2.Found = false then |
| 421 |
goto label1; |
goto label1; |
| 422 |
if DM.FDTable2.FieldByName('THUMBNAIL').AsBytes <> nil then |
if DM.FDTable2.FieldByName('THUMBNAIL').IsNull = false then |
| 423 |
begin |
begin |
| 424 |
s := DM.FDTable2.CreateBlobStream |
s := DM.FDTable2.CreateBlobStream |
| 425 |
(DM.FDTable2.FieldByName('THUMBNAIL'), bmRead); |
(DM.FDTable2.FieldByName('THUMBNAIL'), bmRead); |
| 447 |
end; |
end; |
| 448 |
label1: |
label1: |
| 449 |
end |
end |
| 450 |
else if (DM.FDTable2.Locate('SERIAL', UserSession.Serial, []) = true) and |
else if DM.FDTable2.Locate('SERIAL', UserSession.Serial, []) = true then |
| 451 |
(DM.FDTable2.FieldByName('THUMBNAIL').AsBytes <> nil) then |
if DM.FDTable2.FieldByName('IMAGE').IsNull = false then |
| 452 |
begin |
begin |
| 453 |
s := DM.FDTable2.CreateBlobStream |
s := DM.FDTable2.CreateBlobStream |
| 454 |
(DM.FDTable2.FieldByName('THUMBNAIL'), bmRead); |
(DM.FDTable2.FieldByName('IMAGE'), bmRead); |
| 455 |
try |
try |
| 456 |
png.LoadFromStream(s); |
png.LoadFromStream(s); |
| 457 |
|
finally |
| 458 |
|
s.Free; |
| 459 |
|
end; |
| 460 |
IWFrame8.IWImage1.Picture.Assign(png); |
IWFrame8.IWImage1.Picture.Assign(png); |
| 461 |
finally |
end |
| 462 |
s.Free; |
else |
| 463 |
end; |
IWFrame8.IWImage1.Picture.Assign(nil); |
|
end |
|
|
else |
|
|
IWFrame8.IWImage1.Picture.Assign(nil); |
|
| 464 |
finally |
finally |
| 465 |
png.Free; |
png.Free; |
| 466 |
end; |
end; |
|
png := nil; |
|
|
s := nil; |
|
| 467 |
Randomize; |
Randomize; |
| 468 |
if DM.FDTable2.Filtered = true then |
DM.FDTableView.Filter := 'DATE > '+QuotedStr(DateTimeToStr(Date-10)); |
| 469 |
begin |
DM.FDTableView.First; |
| 470 |
x := true; |
DM.FDTableView.MoveBy(Random(DM.FDTableView.RecordCount)); |
| 471 |
DM.FDTable2.Filtered := false; |
if DM.FDTableView.FieldByName('THUMBNAIL').IsNull = false then |
|
end |
|
|
else |
|
|
x := false; |
|
|
DM.FDTable2.Last; |
|
|
if DM.FDTable2.Bof = true then |
|
|
Exit; |
|
|
DM.FDTable2.MoveBy(-Random(DM.FDTable2.RecordCount div 5)); |
|
|
if DM.FDTable2.FieldByName('THUMBNAIL').AsBytes <> nil then |
|
| 472 |
begin |
begin |
| 473 |
s := DM.FDTable2.CreateBlobStream |
s := DM.FDTableView.CreateBlobStream |
| 474 |
(DM.FDTable2.FieldByName('THUMBNAIL'), bmRead); |
(DM.FDTableView.FieldByName('THUMBNAIL'), bmRead); |
| 475 |
png := TPngImage.Create; |
png := TPngImage.Create; |
| 476 |
try |
try |
| 477 |
png.LoadFromStream(s); |
png.LoadFromStream(s); |
| 481 |
s.Free; |
s.Free; |
| 482 |
end; |
end; |
| 483 |
end; |
end; |
| 484 |
if x = true then |
IWLabel4.Caption := DM.FDTableView.FieldByName('NAME').AsString; |
|
DM.FDTable2.Filtered := true; |
|
|
IWLabel4.Caption := DM.FDTable2.FieldByName('NAME').AsString; |
|
| 485 |
end; |
end; |
| 486 |
|
|
| 487 |
procedure TIWForm1.SetPage(const Value: Boolean); |
procedure TIWForm1.SetPage(const Value: Boolean); |
| 509 |
Filter := false; |
Filter := false; |
| 510 |
if DM.FDTable1.FieldByName('EMAIL').AsString <> '' then |
if DM.FDTable1.FieldByName('EMAIL').AsString <> '' then |
| 511 |
begin |
begin |
| 512 |
WebApplication.Response.Cookies.AddCookie('user_cookie', '0', '/', Date - 1); |
WebApplication.Response.Cookies.AddCookie('user_cookie', '0', '/', |
| 513 |
|
Date - 1); |
| 514 |
UserSession.user_number := 0; |
UserSession.user_number := 0; |
| 515 |
end; |
end; |
| 516 |
end; |
end; |