"
response.Write"
"
response.Write"
"&rs("LABCOMPANY")&"
"
response.Write"
"&rs("LABPATIENT")&"
"
response.Write"
"&rs("LABMEDIC")&"
"
sSql = "SELECT SUM(LABPRICE) AS WorkPriceTotal FROM LAB WHERE LABWORKCOD="&rs("LABWORKCOD")&" "
Set rs1 = Conn.Execute(sSql)
response.Write"
"&formatCurrency(rs1("WorkPriceTotal"))&"
"
response.Write"
"&day(rs("LABDATESTART"))&"/"&month(rs("LABDATESTART"))&"
"
if rs("LABDATEEND")<>"" then response.Write"
"&day(rs("LABDATEEND"))&"/"&month(rs("LABDATEEND"))&"
"
response.Write"
"
response.Write"
"
rs.movenext
wend
End Function
Function StickyNoteJavaWorksProdutctionLousa()
sSql="SELECT LABWORKCOD, LABCOMPANY, LABPATIENT, LABMEDIC, LABDATESTART, LABDATEUPDATE, LABDATEEND FROM LAB WHERE LABUSER='"&session("USER")&"' AND LABDATEEND IS NULL OR LABUSER='"&session("USER")&"' AND LABDATESTART>#"&month(dateadd("m",-1,date))&"/"&month(dateadd("m",-1,date))&"/"&year(dateadd("m",-1,date))&"# GROUP BY LABWORKCOD, LABCOMPANY, LABPATIENT, LABMEDIC, LABDATESTART, LABDATEUPDATE, LABDATEEND ORDER BY LABDATEEND, LABDATEUPDATE"
if request.Form("date")<>"" then
sSql="SELECT LABWORKCOD, LABCOMPANY, LABPATIENT, LABMEDIC, LABDATESTART, LABDATEUPDATE, LABDATEEND FROM LAB WHERE LABUSER='"&session("USER")&"' AND MONTH(LABDATESTART)="&month(request.Form("date"))&" AND YEAR(LABDATESTART)="&year(request.Form("date"))&" GROUP BY LABWORKCOD, LABCOMPANY, LABPATIENT, LABMEDIC, LABDATESTART, LABDATEUPDATE, LABDATEEND ORDER BY LABDATEEND "
end if
if request.Form("QUICK")<>"" then
sSql="SELECT LABWORKCOD, LABCOMPANY, LABPATIENT, LABMEDIC, LABDATESTART, LABDATEUPDATE, LABDATEEND FROM LAB WHERE LABUSER='"&session("USER")&"' AND LABPATIENT LIKE '%"&replace(request.Form("QUICK")," ","%")&"%' or LABUSER='"&session("USER")&"' AND LABMEDIC LIKE '%"&replace(request.Form("QUICK")," ","%")&"%' GROUP BY LABWORKCOD, LABCOMPANY, LABPATIENT, LABMEDIC, LABDATESTART, LABDATEUPDATE, LABDATEEND ORDER BY LABDATEEND "
end if
Set rs = Conn.Execute(sSql)
while not rs.eof
response.Write"var mysticky"&rs("LABWORKCOD")&"=new stickynote({ "
response.Write"content:{divid:'stickynote"&rs("LABWORKCOD")&"', source:'inline'}, "
response.Write"hidebox:0, "
if ""&request.Form("CODWORK")&""=""&rs("LABWORKCOD")&"" or ""&request.Form("deleteWorkCod")&""=""&rs("LABWORKCOD")&"" then
response.Write"showfrequency:'always' "
else
response.Write"showfrequency:'never' "
end if
response.Write"}); "
rs.movenext
wend
End function
Function StickyNoteWindowsWorksProdutctionLousa()
sSql="SELECT LABWORKCOD, LABCOMPANY, LABPATIENT, LABMEDIC, LABDATESTART, LABDATEUPDATE, LABDATEEND FROM LAB WHERE LABUSER='"&session("USER")&"' AND LABDATEEND IS NULL OR LABUSER='"&session("USER")&"' AND LABDATESTART>#"&month(dateadd("m",-1,date))&"/"&month(dateadd("m",-1,date))&"/"&year(dateadd("m",-1,date))&"# GROUP BY LABWORKCOD, LABCOMPANY, LABPATIENT, LABMEDIC, LABDATESTART, LABDATEUPDATE, LABDATEEND ORDER BY LABDATEEND, LABDATEUPDATE"
if request.Form("date")<>"" then
sSql="SELECT LABWORKCOD, LABCOMPANY, LABPATIENT, LABMEDIC, LABDATESTART, LABDATEUPDATE, LABDATEEND FROM LAB WHERE LABUSER='"&session("USER")&"' AND MONTH(LABDATESTART)="&month(request.Form("date"))&" AND YEAR(LABDATESTART)="&year(request.Form("date"))&" GROUP BY LABWORKCOD, LABCOMPANY, LABPATIENT, LABMEDIC, LABDATESTART, LABDATEUPDATE, LABDATEEND ORDER BY LABDATEEND "
end if
if request.Form("QUICK")<>"" then
sSql="SELECT LABWORKCOD, LABCOMPANY, LABPATIENT, LABMEDIC, LABDATESTART, LABDATEUPDATE, LABDATEEND FROM LAB WHERE LABUSER='"&session("USER")&"' AND LABPATIENT LIKE '%"&replace(request.Form("QUICK")," ","%")&"%' or LABUSER='"&session("USER")&"' AND LABMEDIC LIKE '%"&replace(request.Form("QUICK")," ","%")&"%' GROUP BY LABWORKCOD, LABCOMPANY, LABPATIENT, LABMEDIC, LABDATESTART, LABDATEUPDATE, LABDATEEND ORDER BY LABDATEEND "
end if
Set rs = Conn.Execute(sSql)
while not rs.eof
response.Write""
response.Write"
"
response.Write"
![]()
"
response.Write"
"
response.Write"
"
Set rs1 = Conn.Execute("SELECT ClientCompany, ClientLocal FROM CLIENTS WHERE ClientCompanyShort='"&rs("LABCOMPANY")&"' ")
response.Write"
"
response.Write "
![]()
Clinica "&rs1("ClientCompany")&" "&rs1("ClientLocal")
response.Write"
"
response.Write"
"
response.Write "
![]()
"&rs("LABPATIENT")
response.Write"
"
response.Write"
"
response.Write "
![]()
"&rs("LABMEDIC")
response.Write"
"
response.Write"
"
response.Write "
![]()
"&rs("LABDATESTART")
response.Write"
"
response.Write"
"
response.Write" "
response.Write"
"
TotalWorks=0
sSql = "SELECT * FROM LAB WHERE LABWORKCOD="&rs("LABWORKCOD")&" "
Set rs1 = Conn.Execute(sSql)
while not rs1.eof
dateWork=day(rs1("LABDATEWORK"))&"/"&month(rs1("LABDATEWORK"))&"/"&year(rs1("LABDATEWORK"))
response.Write"
"
response.Write"
"
response.Write "
"&rs1("LABWORK")
response.Write"
"
response.Write"
"&formatCurrency(rs1("LABPRICE"))&"
"
response.Write"
"&dateWork&"
"
if isnull(rs("LABDATEEND")) then
response.Write "
"
response.Write ""
response.Write "
"
end if
response.Write"
"
TotalWorks=TotalWorks+rs1("LABPRICE")
rs1.movenext
wend
response.Write"
"
response.Write"
Total:
"
response.Write""
response.Write"
"&formatCurrency(TotalWorks)&"
"
response.Write"
"
response.Write"
"
if isnull(rs("LABDATEEND")) then
response.Write "
"
end if
if isnull(rs("LABDATEEND")) then
response.Write"
"
'response.Write"
Data Conclusão
"
response.Write "
"
response.Write"
"
end if
response.Write"
"
rs.movenext
wend
End function
if request.Form("INSERT")<>"" then
Set rs = Conn.Execute("SELECT * FROM CLIENTS WHERE ClientID="&request.Form("COMPANY")&" ")
Company=rs("ClientCompanyShort")
CompanyLocal=rs("ClientLocal")
Set rs = Conn.Execute("SELECT LABWORKCOD FROM LAB ORDER BY LABWORKCOD DESC")
WorkCod=rs("LABWORKCOD")+1
sSql = "INSERT INTO LAB ( LABUSER, LABWORKCOD, LABCOMPANY, LABLOCAL, LABPATIENT,LABMEDIC, LABPRICE, LABDATESTART, LABDATEUPDATE)"
sSql = sSql & " VALUES ('"&session("USER")
sSql = sSql & "', "&WorkCod
sSql = sSql & ", '"&Company
sSql = sSql & "', '"&CompanyLocal
sSql = sSql & "', '"&request.Form("NAME")
sSql = sSql & "', '"&request.Form("MEDIC")
sSql = sSql & "', 0"
sSql = sSql & ", '"&request.Form("DATESTART")
sSql = sSql & "', '"&now()
sSql = sSql & "')"
Conn.Execute(sSql)
End if
if request.Form("CODWORK")<>"" then
Set rs = Conn.Execute("SELECT * FROM LAB WHERE LABWORKCOD="&request.Form("CODWORK")&" ")
ClientCompany=rs("LABCOMPANY")
ClientLocal=rs("LABLOCAL")
ClientName=rs("LABPATIENT")
ClientMedic=rs("LABMEDIC")
ClientStart=rs("LABDATESTART")
Set rs = Conn.Execute("SELECT * FROM TabWorks WHERE WorkDesc='"&request.Form("WORK")&"' ")
ClientWorkPrice=rs("WorkPrice")
'ClientWorkPriceWorker=rs("WorkPriceJarbas")
Set rs = Conn.Execute("SELECT COUNT(*) As CONTA FROM LAB WHERE LABWORKCOD="&request.Form("CODWORK")&" AND LABWORK IS NULL ")
'response.write rs("CONTA")&"
Adicionar Trabalho
<%=TableLabWorksProdutctionLousa()%>
<%=StickyNoteWindowsWorksProdutctionLousa()%>