| 9 |
IWContainer, IWHTMLContainer, IWHTML40Container, IWRegion, IWDBStdCtrls, |
IWContainer, IWHTMLContainer, IWHTML40Container, IWRegion, IWDBStdCtrls, |
| 10 |
IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWControl, IWCompLabel, |
IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWControl, IWCompLabel, |
| 11 |
IWCompGrids, IWCompText, IWCompTabControl, IWCompButton, IWCompEdit, |
IWCompGrids, IWCompText, IWCompTabControl, IWCompButton, IWCompEdit, |
| 12 |
IWHTMLControls, IWCompExtCtrls, UserSessionUnit, PngImage, Data.DB, |
IWHTMLControls, IWCompExtCtrls, PngImage, Data.DB, |
| 13 |
IWCompListbox, IWBaseComponent, IWBaseHTMLComponent, IWBaseHTML40Component, |
IWCompListbox, IWBaseComponent, IWBaseHTMLComponent, IWBaseHTML40Component, |
| 14 |
IWCompMenu, Vcl.Menus, System.Variants, Unit8, Vcl.Dialogs; |
IWCompMenu, Vcl.Menus, System.Variants, Vcl.Dialogs, System.UITypes, Unit8; |
| 15 |
|
|
| 16 |
type |
type |
| 17 |
TIWForm1 = class(TIWAppForm) |
TIWForm1 = class(TIWAppForm) |
|
IWFrame1: TIWFrame1; |
|
| 18 |
IWTemplateProcessorHTML1: TIWTemplateProcessorHTML; |
IWTemplateProcessorHTML1: TIWTemplateProcessorHTML; |
| 19 |
IWLabel1: TIWLabel; |
IWLabel1: TIWLabel; |
| 20 |
IWDBLabel1: TIWDBLabel; |
IWDBLabel1: TIWDBLabel; |
| 45 |
IWList3: TIWList; |
IWList3: TIWList; |
| 46 |
IWImage1: TIWImage; |
IWImage1: TIWImage; |
| 47 |
IWFrame8: TIWFrame8; |
IWFrame8: TIWFrame8; |
|
IWLink3: TIWLink; |
|
| 48 |
IWLink4: TIWLink; |
IWLink4: TIWLink; |
| 49 |
|
IWLink3: TIWLink; |
| 50 |
|
IWLink5: TIWLink; |
| 51 |
|
IWFrame1: TIWFrame1; |
| 52 |
|
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); |
| 59 |
procedure IWGrid1CellClick(ASender: TObject; const ARow, AColumn: Integer); |
procedure IWGrid1CellClick(ASender: TObject; const ARow, AColumn: Integer); |
| 60 |
procedure IWFrame8IWButton1Click(Sender: TObject); |
procedure IWFrame8IWButton1Click(Sender: TObject); |
| 61 |
procedure IWFrame8IWLink1Click(Sender: TObject); |
procedure IWFrame8IWLink1Click(Sender: TObject); |
|
procedure IWLink3Click(Sender: TObject); |
|
| 62 |
procedure IWLink4Click(Sender: TObject); |
procedure IWLink4Click(Sender: TObject); |
| 63 |
|
procedure IWLink3Click(Sender: TObject); |
| 64 |
|
procedure IWLink5Click(Sender: TObject); |
| 65 |
|
procedure IWLink6Click(Sender: TObject); |
| 66 |
private |
private |
| 67 |
Filter: Boolean; |
Filter: Boolean; |
| 68 |
function GetPage: TPage; |
function GetPage: Boolean; |
| 69 |
procedure SetPage(const Value: TPage); |
procedure SetPage(const Value: Boolean); |
| 70 |
procedure LoadImage; |
procedure LoadImage; |
| 71 |
procedure ClearImage; |
procedure ClearImage; |
| 72 |
|
function GetThumbnail: Boolean; |
| 73 |
|
procedure CallBack(EventParams: TStringList); |
| 74 |
|
procedure SetThumbnail(const Value: Boolean); |
| 75 |
public |
public |
| 76 |
property Page: TPage read GetPage write SetPage; |
property Page: Boolean read GetPage write SetPage; |
| 77 |
|
property Thumbnail: Boolean read GetThumbnail write SetThumbnail; |
| 78 |
end; |
end; |
| 79 |
|
|
| 80 |
|
var |
| 81 |
|
IWForm1: TIWForm1; |
| 82 |
|
|
| 83 |
implementation |
implementation |
| 84 |
|
|
| 85 |
{$R *.dfm} |
{$R *.dfm} |
| 86 |
|
|
| 87 |
uses Unit3, ServerController, Unit6, Unit4; |
uses Unit3, ServerController, Unit6, Unit4, Unit9, Unit10, Unit5, Unit11; |
| 88 |
|
|
| 89 |
|
procedure TIWForm1.CallBack(EventParams: TStringList); |
| 90 |
|
begin |
| 91 |
|
if SameText(EventParams.Values['RetValue'], 'true') = true then |
| 92 |
|
TCartForm.Create(WebApplication).Show; |
| 93 |
|
IWFrame8.IWEdit1.Text := '0'; |
| 94 |
|
end; |
| 95 |
|
|
| 96 |
procedure TIWForm1.ClearImage; |
procedure TIWForm1.ClearImage; |
| 97 |
var |
var |
| 104 |
IWGrid1.RowCount := 0; |
IWGrid1.RowCount := 0; |
| 105 |
end; |
end; |
| 106 |
|
|
| 107 |
function TIWForm1.GetPage: TPage; |
function TIWForm1.GetPage: Boolean; |
| 108 |
begin |
begin |
| 109 |
result := UserSession.FPage; |
result := UserSession.FPage; |
| 110 |
end; |
end; |
| 111 |
|
|
| 112 |
|
function TIWForm1.GetThumbnail: Boolean; |
| 113 |
|
begin |
| 114 |
|
result := UserSession.FThumbnail; |
| 115 |
|
end; |
| 116 |
|
|
| 117 |
procedure TIWForm1.IWAppFormCreate(Sender: TObject); |
procedure TIWForm1.IWAppFormCreate(Sender: TObject); |
| 118 |
const |
const |
| 119 |
i = 120; |
i = 120; |
| 120 |
var |
var |
| 121 |
s: Integer; |
s: Integer; |
| 122 |
begin |
begin |
| 123 |
|
IWForm1 := Self; |
| 124 |
Page := UserSession.FPage; |
Page := UserSession.FPage; |
| 125 |
|
Thumbnail := UserSession.FThumbnail; |
| 126 |
s := DM.FDTable3.FieldByName('BGCOLOR').AsInteger; |
s := DM.FDTable3.FieldByName('BGCOLOR').AsInteger; |
| 127 |
IWLabel2.BGColor := s; |
IWLabel2.BGColor := s; |
| 128 |
IWLabel3.BGColor := s; |
IWLabel3.BGColor := s; |
| 135 |
IWRegion5.Width := i; |
IWRegion5.Width := i; |
| 136 |
IWRegion6.Width := i; |
IWRegion6.Width := i; |
| 137 |
IWRegion7.Width := i; |
IWRegion7.Width := i; |
| 138 |
|
WebApplication.RegisterCallBack('callback', CallBack); |
| 139 |
end; |
end; |
| 140 |
|
|
| 141 |
procedure TIWForm1.IWAppFormRender(Sender: TObject); |
procedure TIWForm1.IWAppFormRender(Sender: TObject); |
| 196 |
IWList1.Items[i] := IWList1.Items.Names[i] + '(' + s + ')'; |
IWList1.Items[i] := IWList1.Items.Names[i] + '(' + s + ')'; |
| 197 |
end; |
end; |
| 198 |
IWList2.Items.Clear; |
IWList2.Items.Clear; |
| 199 |
if Page = TPage.Info then |
with DM.FDQuery1 do |
| 200 |
begin |
begin |
| 201 |
with DM.FDQuery1 do |
SQL.Clear; |
| 202 |
|
SQL.Add('select volume,name,price from cart_data,item_data'); |
| 203 |
|
SQL.Add(' where cart_data.serial = item_data.serial'); |
| 204 |
|
SQL.Add(' and number = :num;'); |
| 205 |
|
ParamByName('num').AsInteger := UserSession.user_number; |
| 206 |
|
Open; |
| 207 |
|
First; |
| 208 |
|
i := 0; |
| 209 |
|
while Eof = false do |
| 210 |
begin |
begin |
| 211 |
SQL.Clear; |
s := Fields.Fields[0].AsString + 'x' + Fields.Fields[1].AsString; |
| 212 |
SQL.Add('select volume,name,price from cart_data join item_data'); |
i := i + Fields.Fields[0].AsInteger * Fields.Fields[2].AsInteger; |
| 213 |
SQL.Add(' on (cart_data.serial = item_data.serial)'); |
IWList2.Items.Add(s); |
| 214 |
SQL.Add(' where number = :num;'); |
Next; |
|
Params.ParamByName('num').AsInteger := UserSession.user_number; |
|
|
Open; |
|
|
First; |
|
|
i := 0; |
|
|
while Eof = false do |
|
|
begin |
|
|
s := Fields.Fields[0].AsString + 'x' + Fields.Fields[1].AsString; |
|
|
i := i + Fields.Fields[0].AsInteger * Fields.Fields[2].AsInteger; |
|
|
IWList2.Items.Add(s); |
|
|
Next; |
|
|
end; |
|
|
IWList2.Items.Add(i.ToString + '円'); |
|
|
Close; |
|
|
IWList3.Items.Clear; |
|
|
SQL.Clear; |
|
|
SQL.Add('select name from recent_data join item_data'); |
|
|
SQL.Add(' on (recent_data.serial = item_data.serial)'); |
|
|
SQL.Add(' where number = :num;'); |
|
|
Params.ParamByName('num').AsInteger := UserSession.user_number; |
|
|
Open; |
|
|
First; |
|
|
while Eof = false do |
|
|
begin |
|
|
IWList3.Items.Add(Fields.Fields[0].AsString); |
|
|
Next; |
|
|
end; |
|
|
Close; |
|
| 215 |
end; |
end; |
| 216 |
|
IWList2.Items.Add(i.ToString + '円'); |
| 217 |
|
Close; |
| 218 |
|
IWList3.Items.Clear; |
| 219 |
|
SQL.Clear; |
| 220 |
|
SQL.Add('select name from recent_data,item_data'); |
| 221 |
|
SQL.Add(' where recent_data.serial = item_data.serial'); |
| 222 |
|
SQL.Add(' and number = :num;'); |
| 223 |
|
ParamByName('num').AsInteger := UserSession.user_number; |
| 224 |
|
Open; |
| 225 |
|
First; |
| 226 |
|
while Eof = false do |
| 227 |
|
begin |
| 228 |
|
IWList3.Items.Add(Fields.Fields[0].AsString); |
| 229 |
|
Next; |
| 230 |
|
end; |
| 231 |
|
Close; |
| 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); |
| 261 |
|
|
| 262 |
procedure TIWForm1.IWFrame8IWButton1Click(Sender: TObject); |
procedure TIWForm1.IWFrame8IWButton1Click(Sender: TObject); |
| 263 |
var |
var |
| 264 |
i: Integer; |
i, j: Integer; |
| 265 |
|
s: string; |
| 266 |
begin |
begin |
| 267 |
if TryStrToInt(IWFrame8.IWEdit1.Text, i) = false then |
if TryStrToInt(IWFrame8.IWEdit1.Text, i) = false then |
| 268 |
begin |
begin |
| 274 |
WebApplication.ShowMessage('1個以上のご注文が必要です'); |
WebApplication.ShowMessage('1個以上のご注文が必要です'); |
| 275 |
Exit; |
Exit; |
| 276 |
end; |
end; |
| 277 |
|
s := WebApplication.Request.CookieFields.Values['user_cookie']; |
| 278 |
|
if s = '' then |
| 279 |
|
begin |
| 280 |
|
DM.FDTable1.Last; |
| 281 |
|
j := DM.FDTable1.FieldByName('NUMBER').AsInteger + 1; |
| 282 |
|
while DM.FDTable1.Lookup('NUMBER', j, 'NUMBER') = j do |
| 283 |
|
inc(j); |
| 284 |
|
UserSession.user_number := j; |
| 285 |
|
DM.FDTable1.AppendRecord([nil, nil, nil, nil, nil, nil, |
| 286 |
|
UserSession.user_number, Date]); |
| 287 |
|
WebApplication.Response.Cookies.AddCookie('user_cookie', |
| 288 |
|
UserSession.user_number.ToString, '/', Date + 10); |
| 289 |
|
end; |
| 290 |
with DM.FDQuery1 do |
with DM.FDQuery1 do |
| 291 |
begin |
begin |
| 292 |
SQL.Clear; |
Open('select * from cart_data;'); |
|
SQL.Add('select * from cart_data;'); |
|
|
Open; |
|
| 293 |
if Locate('NUMBER;SERIAL', VarArrayOf([UserSession.user_number, |
if Locate('NUMBER;SERIAL', VarArrayOf([UserSession.user_number, |
| 294 |
UserSession.Serial]), []) = true then |
UserSession.Serial]), []) = true then |
| 295 |
begin |
begin |
| 300 |
else |
else |
| 301 |
AppendRecord([nil, i, UserSession.user_number, UserSession.Serial]); |
AppendRecord([nil, i, UserSession.user_number, UserSession.Serial]); |
| 302 |
end; |
end; |
| 303 |
IWFrame8.IWEdit1.Text := '0'; |
WebApplication.ShowConfirm('カートに移動しますか', 'callback', '移動', 'はい', 'いいえ'); |
|
if MessageDlg('カートに移動しますか', mtConfirmation, [mbYes, mbNo], 0) = mrYes then |
|
|
TCartForm.Create(WebApplication).Show; |
|
| 304 |
end; |
end; |
| 305 |
|
|
| 306 |
procedure TIWForm1.IWFrame8IWLink1Click(Sender: TObject); |
procedure TIWForm1.IWFrame8IWLink1Click(Sender: TObject); |
| 307 |
begin |
begin |
| 308 |
UserSession.Thumbnail := true; |
Thumbnail := true; |
|
IWFrame8.Visible := false; |
|
|
IWGrid1.Visible := true; |
|
| 309 |
end; |
end; |
| 310 |
|
|
| 311 |
procedure TIWForm1.IWGrid1CellClick(ASender: TObject; |
procedure TIWForm1.IWGrid1CellClick(ASender: TObject; |
| 312 |
const ARow, AColumn: Integer); |
const ARow, AColumn: Integer); |
| 313 |
begin |
begin |
| 314 |
UserSession.Thumbnail := false; |
Thumbnail := false; |
|
IWFrame8.Visible := true; |
|
|
IWFrame8.IWEdit1.Text := '1'; |
|
|
IWLabel6.Visible := false; |
|
|
IWGrid1.Visible := false; |
|
| 315 |
UserSession.Serial := Integer(IWGrid1.Cell[ARow, AColumn].Tag); |
UserSession.Serial := Integer(IWGrid1.Cell[ARow, AColumn].Tag); |
| 316 |
end; |
end; |
| 317 |
|
|
| 318 |
procedure TIWForm1.IWLink1Click(Sender: TObject); |
procedure TIWForm1.IWLink1Click(Sender: TObject); |
| 319 |
begin |
begin |
| 320 |
with TUserForm.Create(WebApplication) do |
TUserForm.Create(WebApplication).Show; |
|
begin |
|
|
Form := Self; |
|
|
Show; |
|
|
end; |
|
| 321 |
end; |
end; |
| 322 |
|
|
| 323 |
procedure TIWForm1.IWLink2Click(Sender: TObject); |
procedure TIWForm1.IWLink2Click(Sender: TObject); |
| 324 |
|
var |
| 325 |
|
i: Integer; |
| 326 |
begin |
begin |
| 327 |
case Page of |
if Page = true then |
| 328 |
Main: |
begin |
| 329 |
|
i := UserSession.user_number; |
| 330 |
|
if (DM.FDTable1.Locate('EMAIL;PASSWORD', |
| 331 |
|
VarArrayOf([IWEdit2.Text, UserSession.hash(IWEdit3.Text)]), |
| 332 |
|
[loCaseInsensitive]) = true) and |
| 333 |
|
(DM.FDTable1.FieldByName('EMAIL').AsString <> '') then |
| 334 |
|
begin |
| 335 |
|
IWEdit2.Text := ''; |
| 336 |
|
UserSession.user_number := DM.FDTable1.FieldByName('NUMBER').AsInteger; |
| 337 |
|
if i <> 0 then |
| 338 |
begin |
begin |
| 339 |
if DM.FDTable1.Locate('EMAIL;PASSWORD', |
with DM.FDQuery1 do |
|
VarArrayOf([IWEdit2.Text, IWEdit3.Text]), [loCaseInsensitive]) = true |
|
|
then |
|
| 340 |
begin |
begin |
| 341 |
Page := Info; |
Open('select * from user_data where number = :num', [i]); |
| 342 |
UserSession.user_number := DM.FDTable1.FieldByName('NUMBER') |
Delete; |
| 343 |
.AsInteger; |
Open('select number from cart_data where number = :num;', [i]); |
| 344 |
IWEdit2.Text := ''; |
First; |
| 345 |
|
while Eof = false do |
| 346 |
|
begin |
| 347 |
|
Edit; |
| 348 |
|
FieldByName('number').AsInteger := UserSession.user_number; |
| 349 |
|
Next; |
| 350 |
|
end; |
| 351 |
end; |
end; |
|
IWEdit3.Text := ''; |
|
|
end; |
|
|
Info: |
|
|
begin |
|
|
DM.FDTable1.Filtered := false; |
|
|
Page := Main; |
|
|
UserSession.user_number := 0; |
|
| 352 |
end; |
end; |
| 353 |
end; |
Page := false; |
| 354 |
|
end; |
| 355 |
|
IWEdit3.Text := ''; |
| 356 |
|
end |
| 357 |
|
else |
| 358 |
|
Page := true; |
| 359 |
end; |
end; |
| 360 |
|
|
| 361 |
procedure TIWForm1.IWLink3Click(Sender: TObject); |
procedure TIWForm1.IWLink3Click(Sender: TObject); |
| 362 |
begin |
begin |
| 363 |
WebApplication.ShowMessage('OKをクリックすると退会します'); |
with TMyPage.Create(WebApplication) do |
| 364 |
Page := Main; |
begin |
| 365 |
DM.FDTable1.Delete; |
Form := Self; |
| 366 |
|
Show; |
| 367 |
|
end; |
| 368 |
end; |
end; |
| 369 |
|
|
| 370 |
procedure TIWForm1.IWLink4Click(Sender: TObject); |
procedure TIWForm1.IWLink4Click(Sender: TObject); |
| 372 |
TCartForm.Create(WebApplication).Show; |
TCartForm.Create(WebApplication).Show; |
| 373 |
end; |
end; |
| 374 |
|
|
| 375 |
|
procedure TIWForm1.IWLink5Click(Sender: TObject); |
| 376 |
|
begin |
| 377 |
|
TIWForm10.Create(WebApplication).Show; |
| 378 |
|
end; |
| 379 |
|
|
| 380 |
|
procedure TIWForm1.IWLink6Click(Sender: TObject); |
| 381 |
|
begin |
| 382 |
|
Page := true; |
| 383 |
|
if Sender = IWLink6 then |
| 384 |
|
TAdminPage.Create(WebApplication).Show |
| 385 |
|
else |
| 386 |
|
TAdminFile.Create(WebApplication).Show; |
| 387 |
|
end; |
| 388 |
|
|
| 389 |
procedure TIWForm1.LoadImage; |
procedure TIWForm1.LoadImage; |
| 390 |
var |
var |
| 391 |
s: TStream; |
s: TStream; |
| 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 |
| 399 |
ClearImage; |
ClearImage; |
| 400 |
png := TPngImage.Create; |
png := TPngImage.Create; |
| 401 |
try |
try |
| 402 |
if UserSession.Thumbnail = true then |
if Thumbnail = true then |
| 403 |
begin |
begin |
| 404 |
i := DM.FDTable2.RecordCount div IWGrid1.ColumnCount; |
i := DM.FDTable2.RecordCount div IWGrid1.ColumnCount; |
| 405 |
if DM.FDTable2.RecordCount mod IWGrid1.ColumnCount > 0 then |
if DM.FDTable2.RecordCount mod IWGrid1.ColumnCount > 0 then |
| 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 |
|
DM.FDTableView.First; |
| 470 |
|
DM.FDTableView.MoveBy(Random(DM.FDTableView.RecordCount)); |
| 471 |
|
if DM.FDTableView.FieldByName('THUMBNAIL').IsNull = false then |
| 472 |
begin |
begin |
| 473 |
x := true; |
s := DM.FDTableView.CreateBlobStream |
| 474 |
DM.FDTable2.Filtered := false; |
(DM.FDTableView.FieldByName('THUMBNAIL'), bmRead); |
|
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 |
|
|
begin |
|
|
s := DM.FDTable2.CreateBlobStream |
|
|
(DM.FDTable2.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: TPage); |
procedure TIWForm1.SetPage(const Value: Boolean); |
|
var |
|
|
x: Boolean; |
|
| 488 |
begin |
begin |
| 489 |
UserSession.FPage := Value; |
UserSession.FPage := Value; |
| 490 |
x := Value = Info; |
IWRegion7.Visible := not Value; |
| 491 |
IWRegion7.Visible := x; |
IWDBLabel1.Visible := not Value; |
| 492 |
IWDBLabel1.Visible := x; |
IWLink3.Visible := not Value; |
| 493 |
IWLink3.Visible := x; |
IWLink1.Visible := Value; |
| 494 |
IWLink1.Visible := not x; |
IWText1.Visible := Value; |
| 495 |
IWText1.Visible := not x; |
if Value = false then |
|
if x = true then |
|
| 496 |
begin |
begin |
| 497 |
IWLabel1.Caption := 'ようこそ'; |
IWLabel1.Caption := 'ようこそ'; |
| 498 |
IWLink2.Caption := 'ログアウト'; |
IWLink2.Caption := 'ログアウト'; |
| 499 |
|
WebApplication.Response.Cookies.AddCookie('user_cookie', |
| 500 |
|
UserSession.user_number.ToString, '/', Date + 10); |
| 501 |
end |
end |
| 502 |
else |
else |
| 503 |
begin |
begin |
| 504 |
IWLabel1.Caption := 'ようこそゲスト様'; |
IWLabel1.Caption := 'ようこそゲスト様'; |
| 505 |
IWLink2.Caption := 'ログイン'; |
IWLink2.Caption := 'ログイン'; |
| 506 |
|
Thumbnail := true; |
| 507 |
|
IWText1.Text := ''; |
| 508 |
|
DM.FDTable2.Filtered := false; |
| 509 |
|
Filter := false; |
| 510 |
|
if DM.FDTable1.FieldByName('EMAIL').AsString <> '' then |
| 511 |
|
begin |
| 512 |
|
WebApplication.Response.Cookies.AddCookie('user_cookie', '0', '/', |
| 513 |
|
Date - 1); |
| 514 |
|
UserSession.user_number := 0; |
| 515 |
|
end; |
| 516 |
end; |
end; |
| 517 |
end; |
end; |
| 518 |
|
|
| 519 |
|
procedure TIWForm1.SetThumbnail(const Value: Boolean); |
| 520 |
|
begin |
| 521 |
|
UserSession.FThumbnail := Value; |
| 522 |
|
IWGrid1.Visible := Value; |
| 523 |
|
IWFrame8.Visible := not Value; |
| 524 |
|
end; |
| 525 |
|
|
| 526 |
initialization |
initialization |
| 527 |
|
|
| 528 |
TIWForm1.SetAsMainForm; |
TIWForm1.SetAsMainForm; |