<%if session("CHEFE")="FALSE" then response.Redirect("main.asp")%> <% function diasMes(strMonth,strYear) dim strDays Select Case cint(strMonth) Case 1,3,5,7,8,10,12: strDays = 31 Case 4,6,9,11: strDays = 30 Case 2: if ((cint(strYear) mod 4 = 0 and _ cint(strYear) mod 100 <> 0) _ or ( cint(strYear) mod 400 = 0) ) then strDays = 29 else strDays = 28 end if End Select diasMes = strDays end function if request.Form("worker")="" then VacationInformationWorker=session("USER") else VacationInformationWorker=request.form("worker") if request.form("date")="" then vacationYear=year(date) else vacationYear=request.form("date") function vacationInformationWorkerList() data = CDate("1/1/"&vacationYear)'dd/mm/yyyy for mes=1 to 12 response.Write "
"&MonthName(mes)&"" response.Write "
" response.Write "
S
" response.Write "
T
" response.Write "
Q
" response.Write "
Q
" response.Write "
S
" response.Write "
S
" response.Write "
D
" 'divs pretos ate data
backCell=2 if WeekDay(data)<>2 then do while backCell <> WeekDay(data) response.Write "
" if backCell=7 then backCell=1 else backCell=backCell+1 end if loop End if for diaData=1 to diasMes(Month(data),vacationYear) if WeekDay(data) = 1 or WeekDay(data) = 7 Then response.Write "
"&day(data)&"
" else sSql = "SELECT * FROM FERIAS WHERE COLABORADOR='"&VacationInformationWorker&"' AND DATA_FERIAS=#"&month(data)&"-"&day(data)&"-"&year(data)&"#" Set rs = Conn.Execute(sSql) if rs.EOF and rs.BOF then response.Write "
" else if rs("ESTADO")=TRUE or rs("ESTADO")=FALSE and IsNull(rs("DATA_ESTADO")) then if rs("PERIODO")="Dia" then response.Write "
" else if rs("PERIODO")="Dia" then response.Write "
" else response.Write "
" end if end if end if if rs("ESTADO")=FALSE and rs("DATA_ESTADO")<>"" then response.Write "
" end if end if data = data + 1 next response.Write "
" response.Write "
" next end function function vacationInformationWorkerDays() sSql = "SELECT * FROM FERIAS WHERE COLABORADOR='"&VacationInformationWorker&"' AND YEAR(DATA_FERIAS)="&vacationYear&" ORDER BY DATA_FERIAS DESC" Set rs = Conn.Execute(sSql) while not rs.EOF response.Write "
" response.Write "
"&rs("DATA_FERIAS")&"
" response.Write "
"&rs("PERIODO")&"
" response.Write "
"& left(rs("DATA_MARCACAO"),10)&"
" response.Write "
" rs.moveNext wend end function %>
<%=vacationInformationWorkerList()%> <% sSql = "SELECT VACATION_LAST_YEAR, VACATION_THIS_YEAR FROM USERS WHERE USERNAME='"&VacationInformationWorker&"'" Set rs = Conn.Execute(sSql) VACATION_LAST_YEAR=rs("VACATION_LAST_YEAR") VACATION_THIS_YEAR=rs("VACATION_THIS_YEAR") %>
dias disponiveis
 <%=year(dateadd("yyyy",-1,date))%>: <%=VACATION_LAST_YEAR%> 
 <%=year(date)%>: <%=VACATION_THIS_YEAR%> 
INFORMAÇÃO DE FÉRIAS
DATA
PERIODO
MACAÇÃO
<%=vacationInformationWorkerDays()%>