<%if session("USER")<>"joaoalberto@pc" and session("USER")<>"pedromatos@AM098" and session("FUNCTION")<>"RH" then response.Redirect("main.asp")%> <% if request.form("DATE")="" then data=CDate("1/"&month(date)&"/"&year(date)) else data=CDate("1/"&request.form("DATE")) end if department=request.Form("WorkerFunction") local=request.Form("WorkerLocal") function VacationInformationList() mes=1 'é necessário a variavel mes para a função dos dias do mes 'data = CDate("1/11/2015")'dd/mm/yyyy response.Write "
" response.Write "
" response.Write "
Seg
" response.Write "
Ter
" response.Write "
Qua
" response.Write "
Qui
" response.Write "
Sex
" response.Write "
Sab
" response.Write "
Dom
" 'divs pretos ate data backCell=2 if WeekDay(data)<>2 then do while backCell <> WeekDay(data) response.Write "
" 'backCell = backCell + 1 if backCell=7 then backCell=1 else backCell=backCell+1 end if loop End if for diaData=1 to diasMes(Month(data),year(data)) if WeekDay(data) = 1 or WeekDay(data) = 7 Then response.Write "
"&day(data)&"
" if WeekDay(data) = 1 Then response.Write "
" else response.Write "
"&day(data)&"" sSql = "SELECT * FROM USERS WHERE COLABORADOR=TRUE AND ACT='1' " if request.Form("WorkerLocal")<>"" then sSql=sSql&" AND CONCESSAO='"&request.Form("WorkerLocal")&"' " else sSql=sSql&" AND CONCESSAO='Escritorio' " if request.Form("WorkerFunction")<>"" then sSql=sSql&" AND FUNCAO='"&request.Form("WorkerFunction")&"' " 'else sSql=sSql&" AND FUNCAO='Administrativo' " Set rs = Conn.Execute(sSql) CountUserDay=1 while not rs.eof workerName=rs("NAME") sSql = "SELECT * FROM FERIAS WHERE COLABORADOR='"&rs("USERNAME")&"' AND DATA_FERIAS=#"&month(data)&"-"&day(data)&"-"&year(data)&"#" Set rs1 = Conn.Execute(sSql) if rs1.EOF and rs1.BOF then else if CountUserDay<6 then if rs1("PERIODO")="Dia" then period="" else period=left(rs1("PERIODO"),1) end if if data>=date then if rs1("ESTADO")=FALSE and rs1("DATA_ESTADO")<>"" then 'BEFOR TODAY RED response.Write "
" response.Write "
" response.Write" " response.Write" " response.Write"" response.Write "
" response.Write ""&period&" " response.Write "
" else 'BEFOR TODAY GREEN 'response.Write "
"&left(workerName,12)&".."&period&" 
" response.Write "
" response.Write "
" response.Write" " response.Write" " response.Write"" response.Write "
" response.Write ""&period&" " response.Write "
" end if else 'AFTER TODAY response.Write "
" response.Write "
" response.Write" " response.Write" " response.Write"" ' response.Write "
" response.Write ""&period&" " response.Write "
" end if CountUserDay=CountUserDay+1 'exit while end if end if rs.movenext wend response.Write "
" end if data = data + 1 next response.Write "
" response.Write "
" 'background-color:#F60;color:#FFF; <-- laranja 'background-color:#ffb27f;color:#FFF; <-- laranja esvanescido 'background-color:#060;color:#FFF; <-- verde '#F00 <-- vermelho end function Function StickyNoteJavaVacationAnalytics() dateMonth=data for monthDays=1 to 32 response.Write"var mysticky"&replace(dateMonth,"/","")&"=new stickynote({ " response.Write"content:{divid:'stickynote"&replace(dateMonth,"/","")&"', source:'inline'}, " response.Write"hidebox:0, " response.Write"showfrequency:'never' " response.Write"}); " if dateMonth=cDate(diasMes(Month(dateMonth),year(dateMonth))&"/"&month(dateMonth)&"/"&year(dateMonth)) then exit for else dateMonth=dateAdd("d",1,dateMonth) end if next End function Function StickyNoteWindowsVacationAnalytics() dateMonth=dateAdd("m",-1,data) sSql = "SELECT * FROM USERS WHERE COLABORADOR=TRUE AND ACT='1' AND CHEFIA='"&SESSION("USER")&"' " sSql = "SELECT * FROM USERS WHERE COLABORADOR=TRUE AND ACT='1' " if request.Form("WorkerLocal")<>"" then sSql=sSql&" AND CONCESSAO='"&request.Form("WorkerLocal")&"' " else sSql=sSql&" AND CONCESSAO='Escritorio' " if request.Form("WorkerFunction")<>"" then sSql=sSql&" AND FUNCAO='"&request.Form("WorkerFunction")&"' " 'else sSql=sSql&" AND FUNCAO='Administrativo' " Set rs = Conn.Execute(sSql) while not rs.eof sSqlAdd = sSqlAdd &" COLABORADOR='"&rs("USERNAME")&"' " rs.movenext if not rs.EOF then sSqlAdd = sSqlAdd &" or " wend 'response.Write sSqlAdd&"
" for monthDays=1 to 32 sSql = "SELECT * FROM FERIAS WHERE DATA_FERIAS=#"&month(dateMonth)&"-"&day(dateMonth)&"-"&year(dateMonth)&"# AND ("&sSqlAdd&")" Set rs = Conn.Execute(sSql) response.Write "
" response.Write "
" response.Write "" response.Write "
" response.Write"
Dia "&day(dateMonth)&"
" response.Write"
" response.Write "
" response.Write "
NOME
" response.Write "
MARCAÇÃO
" response.Write "
PERIODO
" response.Write "
" while not rs.eof response.Write "
" sSql = "SELECT NAME FROM USERS WHERE USERNAME='"&rs("COLABORADOR")&"'" Set rs1 = Conn.Execute(sSql) response.Write "
"&rs1("NAME")&"
" response.Write "
"& left(rs("DATA_MARCACAO"),10)&"
" response.Write "
"&rs("PERIODO")&"
" response.Write "
" response.Write "" response.Write "" response.Write "
" response.Write "
" rs.movenext wend response.Write"
" if dateMonth=cDate(diasMes(Month(dateMonth),year(dateMonth))&"/"&month(dateMonth)&"/"&year(dateMonth)) then exit for else dateMonth=dateAdd("d",1,dateMonth) end if next End function %>
<%=VacationInformationList()%>
INFORMAÇÃO DE FÉRIAS
DATA
PERIODO
MACAÇÃO
<%=StickyNoteWindowsVacationAnalytics()%>