<% @LCID = 1034 %> <% dim ahora dim pwd validpwd = true If request.form("submit") <> "" Then ' setup variables userid = Request.Form("userid") passwd = Request.Form("passwd") Set conn = Server.CreateObject("ADODB.Connection") conn.open xDb_Conn_Str 'sql="Select * from [personal] where [bdno] = " & userid 'sql = "Select p.bdplan,r.bdajustechecada from [personal] p inner join razon r on p.bdplan=r.bdplan where [bdstat]=1 AND [bdno] = " & userid sql = "Select p.bdplan,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 & "'))" Set rs = Server.CreateObject("ADODB.Recordset") rs.Open sql,conn,1,2 'AjusteChecada=0.0 if not rs.eof then userid = rs("bdno") AjusteChecada = cint(rs("bdAjusteChecada")) plantel=cint(rs("bdplan")) ' select directora con plantel 'sql="Select * from [personal] where [bdstat] = 1 and [bdpues] = 2 and [bdplan] = " & plantel 'solo oficinas, consultar con la contraseņa de oficinas sql="Select * from [personal] where [bdstat] = 1 and ([bdpues] = 900 or (bdplan=14)) and bdcont='" & passwd & "'" 'Set rs2 = conn.Execute(sql) Set rs2 = Server.CreateObject("ADODB.Recordset") rs2.Open sql,conn,1,2 If not rs2.eof then 'pwd = rs2("bdcont") ''pwd2=rs2("bdcont2") 'If pwd = passwd Then ' validpwd = true ' pw=1 'Else 'if pwd2 = passwd then validpwd = true ' pw=2 'else ' validpwd = false 'end if 'End If Else validpwd = false end if else validpwd = false end if rs.Close Set rs=Nothing 'rs2.Close 'Set rs2=Nothing conn.Close Set conn=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" '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 'HoraAux=cdate(HoraAux) + (0.00069444444444444444444444444444444 * AjusteChecada) 'HoraAux=FormatDateTime(time() + (0.00069444444444444444444444444444444 * AjusteChecada),3) '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 %> REGISTRO DE ASISTENCIA NEW FASHION

Registro por Clave

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

CLAVE O CONTRASEŅA 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 %> <% If userid="0" and passwd="0" Then %>

LA HORA DEL SERVIDOR ES: <% Response.Write Time() %> OK

<% End If %>

 

CLAVE DEL PERSONAL
CONTRASEŅA DE DIRECCION