<P>此方案很非常非常适用工厂哦。
需求:1、上班时间不可以随意外出厂门,如在上班时间出厂,出厂门打卡时,将报警提示(卡钟外接一个报警灯,亮红灯给厂保安看)
2、员工有请假和休息时间可以外出,出厂门打卡时,将报警提示亮绿灯。
下面采用实时卡钟。</P>
<P>员工打卡时,卡钟发送数据到服务器。如:
<a href="http://192.168.0.1/kaoq/kcardsea.asp?jihao=12345&cardid=88888888" target="_blank" >http://192.168.0.1/kaoq/kcardsea.asp?jihao=12345&cardid=88888888</A>
说明:
192.168.0.1:这是服务器的IP地址,在卡钟设置已经好服务IP地址,每打一张卡就会自动向服务器传送。
jihao=12345:这是代表卡钟的号器号。
cardid=88888888 :代码ID/IC卡的卡号。
服务收到上面的数据后就会运行下面的代码,然后会发送指令到卡钟上。如:
<FONT color=#f05731>Systemswww.ricom.com.hk"&"count=1&"&"gzbh="&gzbh&"&"&"xm="&xm&"随时出入&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
</FONT>Systemswww.ricom.com.hk"&"count=1 代表服务器向卡钟发送成功接收到数据了,count=1代表接成功并且会给一个开的信号。(如报警灯亮绿灯) count=0表示亮红灯。
卡钟将会显示: 工号+姓名+随时出入 并且会亮绿灯。</P>
<P><!--#include file="conn.asp"-->
<%
if request("CardId")="" or request("jihao")="" then
Response.Write "Ricom Systemswww.ricom.com.hk"&"count=0&"&"gzbh=&"&"xm="&"TransErr"&"&bmbh=&"&"ksbh=1"&"&"&"ly="
response.end
else
dim jobb,dtime,ddate,skkhtemp,doorflag,defaultmoney,maxdate,bmbh,dateweek,lastbc,bc,maxlastdate,jihao
dim jobb1,nowtime,beforetime,aftertime,jobb31,countcc,dccc,lastcc,cc,gzbh,gzbhid,xm,sbtimes,xbtimes,place
ddate=year(now)&"-"&month(now)&"-"&day(now)
if hour(now)<10 then
dtime="0"&hour(now)
else
dtime=hour(now)
end if
if minute(now)<10 then
dtime=dtime&":"&"0"&minute(now)
else
dtime=dtime&":"&minute(now)
end if
if second(now)<10 then
dtime=dtime&":"&"0"&second(now)
else
dtime=dtime&":"&second(now)
end if
nowtime=ddate&" "&dtime
dateweek=getweek(ddate)
'nowtime='2003-05-01 10:00:00'
skkhtemp=Right("0000000000"&trim(request("CardId")),8)
jihao=clng(trim(request("jihao")))
end if </P>
<P>
'这台机器无设置
rs.open "select doorflag,intervall,place from kq_hardware_parameter where coding="&clng(trim(request("jihao"))),,1,3
if rs.eof then
Response.Write "Ricom Systemswww.ricom.com.hkcount=0&gzbh=&"&"xm=机器设置错误&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
rs.close
conn.close
response.end
else
doorflag=rs("doorflag")
beforetime=rs("intervall")
place=rs("place")
rs.close
end if
'是否在厂员工
rs.open "select KQ_CS_GZB.xm,KQ_CS_GZB.gzbh,KQ_CS_GZB.gzbhid,KQ_CS_GZB.bmbh from KQ_CS_GZB,KQ_CS_SKKHDJ where KQ_CS_SKKHDJ.SKKH ='"&skkhtemp&"' and KQ_CS_GZB.gzbhid=KQ_CS_SKKHDJ.gzbhid and KQ_CS_SKKHDJ.KHNUMBER=1 and (KQ_CS_GZB.outf is null or KQ_CS_GZB.outf>'"&ddate&"')",,1,3
if rs.eof then
Response.Write "Ricom Systemswww.ricom.com.hkcount=0&gzbh=&"&"xm=无效卡&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
rs.close
conn.close
response.end
else
xm=rs("xm")
gzbh=rs("gzbh")
gzbhid=rs("gzbhid")
bmbh=rs("bmbh")
rs.close
end if
'doorflag=M 门禁出入
if doorflag="M" or doorflag="m" then
rs.open"Select max(qsrq) as maxdate From KQ_RECORD_DBDJ Where ( gzbhid ="&gzbhid&" ) AND ( qsrq <='"&ddate&"')",,1,3
if rs.eof then
rs.close
'没倒班安排,可以随时出入
Response.Write "Ricom Systemswww.ricom.com.hk"&"count=1&"&"gzbh="&gzbh&"&"&"xm="&xm&"随时出入&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
conn.execute "insert into KQ_HARDWARE_ATTCARDINFO_DOOR(Gzbh,AttCard,DevID,Dates,doorflag,Bz,Place)values('"&gzbh&"','"&skkhtemp&"',"&clng(trim(request("jihao")))&",'"&nowtime&"','T','随时出入','"&place&"')"
else
maxdate=rs("maxdate")
lastdate=DateAdd("d",-1,maxdate)
'response.write(lastdate)
rs.close
'厂休
rs.open"SELECT * FROM KQ_CS_FDJR WHERE (bmbh like '%"&bmbh&"%')and ((date1<='"&ddate&"' and date2>='"&ddate&"') or week="&dateweek&")",,1,3
if rs.eof then
rs.close
'查找今天的班次
rs.open"SELECT bc FROM KQ_RECORD_DBDJ WHERE ( gzbhid = "&gzbhid&" ) AND ( qsrq ='"&maxdate&"')",,1,3
bc=cstr(rs("bc"))
rs.close
'查找昨天的的班次
rs.open"Select max(qsrq) as maxlastdate From KQ_RECORD_DBDJ Where ( gzbhid ="&gzbhid&" ) AND ( qsrq <='"&lastdate&"')",,1,3
if isnull(rs("maxlastdate")) then
maxlastdate=maxdate
else
maxlastdate=rs("maxlastdate")
end if
rs.close
rs.open"SELECT bc FROM KQ_RECORD_DBDJ WHERE ( gzbhid = "&gzbhid&" ) AND ( qsrq ='"&maxlastdate&"')",,1,3
lastbc=cstr(rs("bc"))
'Response.Write (maxlastdate)
rs.close
'查找请假登记
rs.open"SELECT * FROM KQ_RECORD_CCQJDJ WHERE (( gzbhid= "&gzbhid&" ) AND (date1<='"&nowtime&"' and date2>='"&nowtime&"')) or ((Convert(char(10),date1,120)<='"&ddate&"' and Convert(char(10),date2,120)>='"&ddate&"') and (Convert(char(10),date1,108)=(Convert(char(10),date2,108)) ))",,1,3
if rs.eof then
rs.close
'跨天班和跨班次已经考虑到,昨天和今天都班次都考虑了。
'Response.Write (bc)
'Response.Write(lastbc)
'Response.end
rs.open"SELECT * FROM KQ_CS_TIME_LIST WHERE (left(bc,2)='"&bc&"' AND ((sbtimes<='"&dtime&"' and xbtimes>='"&dtime&"' and sbflag='F' and xbflag='F') or (xbflag='T' and sbtimes<='"&dtime&"' and sbflag='F'))) or (left(bc,2)='"&lastbc&"' and ((sbtimes<='"&dtime&"' and xbtimes>='"&dtime&"' and sbflag='T' and xbflag='T') or (xbflag='T' and xbtimes>='"&dtime&"' and sbflag='F')) )",,1,3
if rs.eof then
rs.close
Response.Write "Ricom Systemswww.ricom.com.hk"&"count=1&"&"gzbh="&gzbh&"&"&"xm="&xm&"正常出入&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
conn.execute "insert into KQ_HARDWARE_ATTCARDINFO_DOOR(Gzbh,AttCard,DevID,Dates,doorflag,Bz,place)values('"&gzbh&"','"&skkhtemp&"',"&clng(trim(request("jihao")))&",'"&nowtime&"','T','正常出入','"&place&"')"
else
rs.close
Response.Write "Ricom Systemswww.ricom.com.hkcount=0&gzbh=&"&"xm=上班时间内&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
conn.execute "insert into KQ_HARDWARE_ATTCARDINFO_DOOR(Gzbh,AttCard,DevID,Dates,doorflag,Bz,place)values('"&gzbh&"','"&skkhtemp&"',"&clng(trim(request("jihao")))&",'"&nowtime&"','T','上班时间内','"&place&"')"
end if
else
rs.close
'有加班登记可以出入,直接亮绿灯
Response.Write "Ricom Systemswww.ricom.com.hk"&"count=1&"&"gzbh="&gzbh&"&"&"xm="&xm&"请假出入"&"&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
conn.execute "insert into KQ_HARDWARE_ATTCARDINFO_DOOR(Gzbh,AttCard,DevID,Dates,doorflag,Bz,place)values('"&gzbh&"','"&skkhtemp&"',"&clng(trim(request("jihao")))&",'"&nowtime&"','T','请假出入','"&place&"')"
end if
else
rs.close
'有厂休登记可以出入,直接亮绿灯
Response.Write "Ricom Systemswww.ricom.com.hk"&"count=1&"&"gzbh="&gzbh&"&"&"xm="&xm&"厂休出入"&"&"&"bmbh=&"&"ksbh=1"&"&"&"ly="
conn.execute "insert into KQ_HARDWARE_ATTCARDINFO_DOOR(Gzbh,AttCard,DevID,Dates,doorflag,Bz,place)values('"&gzbh&"','"&skkhtemp&"',"&clng(trim(request("jihao")))&",'"&nowtime&"','T','厂休出入','"&place&"')"
end if
end if
end if </P>
<P>国海实时一卡通
曹望君 QQ:17571611
TEL:0769-2062459 13713313384 FAX:0769-2314127
EMAIL:CWJJACK@163.COM
<a href="http://www.dgguohai.com" target="_blank" >http://www.dgguohai.com</A>
实时TCP/IP考勤、门禁、消费机
只做TCP/IP实时系列一卡通,和OEM产品。</P>
|
|