View difference between Paste ID: 5P3j2Wys and rZdXveFk
SHOW: | | - or go back to the newest paste.
1
function IsBanned:Boolean;
2
var
3
  tmpIntBan: Integer;
4
begin
5
     StartWorkWithDB();
6
     Form1.query.SQL.Text:='select ban from users where id = :id;';
7
     Form1.query.ParamByName('id').AsInteger:=MyLogin;
8
     BDWork();
9
     tmpIntBan := Form1.query.FieldByName('ban').AsInteger;
10
     EndWorkWithDB();
11
     if (tmpIntBan = 1) then Result := True
12
     else Result := False;
13
end;
14
15
function LastLoginNotToday:boolean;
16
var
17
  tmpInt: Integer;
18
  begin
19-
       Form1.query.SQL.Text:='select (select date_format((current_date),''%'+'m''))-(select date_format((select time_start from time_used where user_id = :id),''%'+'m''))+(select date_format((current_date),''%'+'d''))-(select date_format((select time_start from time_used where user_id = :id),''%'+'d'')) as yn;';
19+
       Form1.query.SQL.Text:='select (select date_format((current_date),''%m''))-(select date_format((select time_start from time_used where user_id = :id),''%m''))+(select date_format((current_date),''%d''))-(select date_format((select time_start from time_used where user_id = :id),''%d'')) as yn;';
20
       Form1.query.ParamByName('id').AsInteger:=MyLogin;
21
       BDWork();
22
       tmpInt:= Form1.query.FieldByName('yn').AsInteger;
23
       EndWorkWithDB();
24
       if (tmpInt > 0 ) then Result := True
25
       else
26
       Result := False;
27
  end;