Z
zz770813
Unregistered / Unconfirmed
GUEST, unregistred user!
gdtime:='';
kqsj:='07:30:0006006011:30:0006003013:30:0006006017:30:00060120';
len:=length(trim(kqsj)) div 14;
for i:=1 to len do
begin
stard:=strtoint(copy(kqsj,9+14*(i-1),3));
endd:=strtoint(copy(kqsj,12+14*(i-1),3));
gdtimed:=strtotime(copy(kqsj,1+(i-1)*14,8));
ttt:=time;
if i mod 2=1 then
begin
if (ttt>=(gdtimed-stard/60)) and (ttt<=gdtimed) then
begin
gdtime:=copy(kqsj,1+(i-1)*14,8);
jg:='合格';
break;
end;
if (ttt>gdtimed) and (ttt<=(gdtimed+endd/60)) then
begin
gdtime:=copy(kqsj,1+(i-1)*14,8);
jg:='迟到';
break;
end;
end
else
begin
if (ttt>=(gdtimed-stard/60))and(ttt<gdtimed) then
begin
gdtime:=copy(kqsj,1+(i-1)*14,8);
jg:='早退';
break;
end;
if (ttt>=gdtimed)and(ttt<=(gdtimed+endd/60)) then
begin
gdtime:=copy(kqsj,1+(i-1)*14,8);
jg:='合格';
break;
end;
end;
end;
不管什么时间刷卡都执行迟到的if语句入库jg为迟到
kqsj:='07:30:0006006011:30:0006003013:30:0006006017:30:00060120';
len:=length(trim(kqsj)) div 14;
for i:=1 to len do
begin
stard:=strtoint(copy(kqsj,9+14*(i-1),3));
endd:=strtoint(copy(kqsj,12+14*(i-1),3));
gdtimed:=strtotime(copy(kqsj,1+(i-1)*14,8));
ttt:=time;
if i mod 2=1 then
begin
if (ttt>=(gdtimed-stard/60)) and (ttt<=gdtimed) then
begin
gdtime:=copy(kqsj,1+(i-1)*14,8);
jg:='合格';
break;
end;
if (ttt>gdtimed) and (ttt<=(gdtimed+endd/60)) then
begin
gdtime:=copy(kqsj,1+(i-1)*14,8);
jg:='迟到';
break;
end;
end
else
begin
if (ttt>=(gdtimed-stard/60))and(ttt<gdtimed) then
begin
gdtime:=copy(kqsj,1+(i-1)*14,8);
jg:='早退';
break;
end;
if (ttt>=gdtimed)and(ttt<=(gdtimed+endd/60)) then
begin
gdtime:=copy(kqsj,1+(i-1)*14,8);
jg:='合格';
break;
end;
end;
end;
不管什么时间刷卡都执行迟到的if语句入库jg为迟到