<% @LCID = 1034 %> <% ' Declaration variable dim FS, objFile dim curPath, tmpPath dim msg dim UserID, UserPWD, FIRTextData dim fUserID, fFIRSize, fFIRTextData dim payload, objNBioBSP validpwd = true userid = Request.Form("UserID") FIRTextData = Request.Form("FIRTextData") '*************************************** '*************************************** ' Get current path 'tmpPath = Request.ServerVariables("PATH_TRANSLATED") 'curPath = left(tmpPath, InStrRev(tmpPath, "\")) & "db\" 'SET FS = Server.CreateObject("Scripting.FileSystemObject") ' Check file exist ' aqui hay que hacer la consulta de los datos haber si existe el id Set conn = Server.CreateObject("ADODB.Connection") conn.open xDb_Conn_Str 'sql="Select * from [personal] where [bdno] = " & userid 'sql = "Select p.bdfir,r.bdajustechecada,p.bdno from [personal] p inner join razon r on p.bdplan=r.bdplan where [bdstat]=1 AND (isnull(r.LetraID,' ') + isnull(p.ConsecutivoID,0) ='" & userid & "' OR [bdno] = " & userid & ")" sql = "Select p.bdfir,r.bdajustechecada,p.bdno from [personal] p inner join razon r on p.bdplan=r.bdplan where [bdstat]=1 AND (isnull(r.LetraID,' ') + isnull(convert(nvarchar(10),p.ConsecutivoID),'0') =UPPER('" & userid & "') OR convert(nvarchar(10),[bdno]) = UPPER('" & userid & "'))" 'sql = "Select p.bdfir,r.bdajustechecada,p.bdno from [personal] p inner join razon r on p.bdplan=r.bdplan where [bdstat]=1 AND [bdno] = " & userid Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sql,conn,1,2 if rs.eof then 'if not ( FS.FileExists(curPath & UserID & ".fir") ) then ' File not found error msg = "ID DE EMPLEADO NO ENCONTRADO O DADO DE BAJA" validpwd = false else ' Read fir data form file 'SET objFile = FS.OpenTextFile(curPath & UserID & ".fir", 1) ' Read user id and fir data form file ' aqui hay que poner los datos del recordset 'fUserID = objFile.ReadLine 'fFIRSize = objFile.ReadLine userid = rs("bdno") fFIRTextData = rs("bdfir") AjusteChecada = cint(rs("bdAjusteChecada")) 'objFile.Close ' Match captured fir data with stored fir data ' Set NBioBSP object Set objNBioBSP = Server.CreateObject("NBioBSPCOM.NBioBSP") Set objMatching = objNBioBSP.Matching ' Verify Match ' storedTextFIR1 is Caputured FIR ' storedTextFIR2 is FIR from file call objMatching.VerifyMatch(CStr(FIRTextData), CStr(fFIRTextData)) if objMatching.ErrorCode = 0 then ' Matching failed. [0:FALSE,Others:TRUE] if objMatching.MatchingResult = 0 then ' Matching failed. [0:FALSE,Others:TRUE] msg = msg + "LECTURA NO COINCIDE CON REGISTRO" validpwd = false else ' Matching success msg = "REGISTRO CORRECTO" validpwd = true end if else validpwd = false msg = objMatching.ErrorCode end if ' Release NBioBSP object Set objMatching = nothing Set objNBioBSP = nothing If validpwd Then Set conn = Server.CreateObject("ADODB.Connection") conn.open xDb_Conn_Str ' checar si es entrada o salida 'sql = "select * from [asist2004per] where [bdno]=" & userid & " order by bdfecha desc, bdhora desc" sql = "select top 1 * from [asist2004per] where [bdno]=" & userid & " order by bdfecha desc, bdhora desc" 'Set rst = Server.CreateObject("ADODB.Recordset") Set rst = conn.Execute(sql) 'rst.CursorLocation=adUseClient 'rst.Open sql, conn If rst.EOF Then num = 0 mensaje = "ENTRADA" Else 'rst.MoveLast num = rst.Fields("detipo") If num = 0 Then num = 1 mensaje = "SALIDA" Else num = 0 mensaje = "ENTRADA" End If End If 'insert into ahora = Now() FechaAux=FormatDateTime(date(),2) 'FechaAux = right("0000"&year(date()),4)&"/"&right("00"&month(date()),2)&"/"&right("00"&day(date()),2) ValorAjuste= 0.00069444444444444444444444444444444 * abs(AjusteChecada) if AjusteChecada >=0 then HoraAux=FormatDateTime(ahora + ValorAjuste,3) else HoraAux=FormatDateTime(ahora - ValorAjuste,3) end if 'FechaAux = right("0000"&year(date()),4)&"/"&right("00"&month(date()),2)&"/"&right("00"&day(date()),2) 'HoraAux=time() + (0.00069444444444444444444444444444444 * AjusteChecada) 'HoraAux=time() 'if cint(hour(time()))>=12 then 'HoraAux=right("00"&hour(time()),2)&":"&right("00"&minute(time()),2) 'else 'HoraAux=right("00"&hour(time()),2)&":"&right("00"&minute(time()),2)&" AM" 'end if 'Response.Write FechaAux 'Response.Write HoraAux cad1 = "Insert Into [asist2004per] values(" & userid & ",'" & FechaAux & "','" & HoraAux & "'," & num & "," & userid & ")" 'cad1 = "Insert Into [asist2004per](bdno,bdfecha,detipo,bdusua) values(" & userid & ",'" & FechaAux & "'," & num & "," & userid & ")" 'cad1 = "Insert Into [asist2004per](bdno,bdhora,detipo,bdusua) values(" & userid & ",'" & HoraAux & "'," & num & "," & userid & ")" 'conn.Execute("SET DATEFORMAT ymd") conn.Execute(cad1) 'mensaje de ok valid = true 'Session("status") = "login" 'response.redirect "default.asp" rst.Close Set rst=Nothing conn.Close Set conn=Nothing End If end if SET FS = nothing %>

REGISTRO DE HUELLA DEL PERSONAL

Verificasion


User ID : <%= UserID %>

<%= msg %>


<% If not validpwd and ((Request.Form("userid") <> "" and userid<>"0") and (Request.Form("passwd") <> "" and passwd<>"0")) Then %>

CLAVE O HUELLA DIGITAL INCORRECTA FAVOR INTENTAR DE NUEVO

<% End If %> <% If valid Then %>

ASISTENCIA DE <%Response.Write userid %> COMO <% Response.Write mensaje %> A LAS <% Response.Write HoraAux %> OK

<% End If %>


ir a INICIO.




WebMaster: L.S.C.A. Cesar Manuel Martínez Villanueva
Correo Electrónico: cesarmmv@hotmail.com
Copyright © 2005 - 2006. Todos los derechos reservados.