Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <% 'Response.Buffer = false
- Server.ScriptTimeout = 9000
- %>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
- <title>WAS2</title>
- <meta http-equiv="refresh" content="10;url=http://messrv00/Mes/Asp/was2/monitor2.asp">
- </head>
- <body topmargin="0" leftmargin="0" rightmargin="0" bottommargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">
- <table border="0" width="100%" cellspacing="0" cellpadding="0" background="img/topbkg.gif">
- <tr>
- <td width="50%"><img border="0" src="img/img2.png" width="142" height="66"></td>
- <td width="50%">
- <p align="right"><img border="0" src="img/topright.gif" width="327" height="66"></td>
- </tr>
- </table>
- <table border="0" width="100%" cellspacing="0" cellpadding="0" background="img/blackline.gif">
- <!--<tr>
- <td width="100%"><font color="#B8C0F0" face="Arial" size="2"><b>
- <a href="http://messrv00/Mes/Asp/was2/more.htm">Home </a> |<a href="default.htm">Basico General </a> |
- Other Link</b></font></td>
- </tr>-->
- </table>
- <p style="margin-left: 20"><b><font color="#B8C0F0" face="Arial" size="2"> </font></b><font face="Arial" size="2" color="#000000">
- <p align="center"><table border="1" CLASS="sample"><h1>Real Time Monitoring System</h1></p>
- <tr>
- <td><b>Linea</b></td>
- <td><b>Peso</b></td>
- <td><b>Target</b></td>
- <td><b>Marca</b></td>
- <td><b>Vaso</b></td>
- <!--<td><b>Tubo</b></td>-->
- <td><b>Fecha</b></td>
- <td><b>Total de bolsas</b></td>
- <td><b>Promedio</b></td>
- <td><b>OP</b></td>
- <td><b>Saving</b></td>
- </tr>
- <%
- dim conexion,calendar1,calendar2,registros,linea,hora,test
- datetime=date()
- fecha=(year(datetime)&RIGHT("0"&Month(datetime),2)&Day(datetime))
- linea="L17N"
- if Day(datetime) <= 9 then dia = "0" & Day(datetime)
- if Month(datetime) <= 9 then mes= "0" & Month(datetime)
- 'fecha=Year(datetime)& "" & mes & "" & dia
- hora=hour(Now)
- minuto=minute(Now)
- datehoy=date()
- fechahoy=(year(datehoy)&"/"&Month(datehoy)&"/"&Day(datehoy))'fecha para imprimir en la pantalla de fecha
- if minuto<=30 then horamia=(hora&":00"&" - "&hora&":30") else _
- horamia=(hora&":30"&" - "&hora+1&":00")_
- end if
- response.write(horamia)
- Response.Write("<br>")
- if horamia=(hora&":00"&" - "&hora&":30") then
- hora2=(hora-1&":30"&" - "&hora&":00")
- elseif horamia=(hora&":30"&" - "&hora+1&":00") then
- hora2=(hora&":00"&" - "&hora&":30")
- end if
- Response.Write(hora2)
- '########################################## L15 NORTE #######################################################################################
- linea15n="L15N"
- SET conexion15n=Server.CreateObject("ADODB.Connection")
- conexion15n.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros15n=Server.CreateObject("ADODB.RecordSet")
- registros15n.open"EXEC monitor '"&fecha&"','"&linea15n&"','"&horamia&"'",conexion15n
- SET conexionAVG15n=Server.CreateObject("ADODB.Connection")
- conexionAVG15n.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registrosAVG15n= Server.CreateObject("ADODB.RecordSet")
- registrosAVG15n.open"SELECT AVG(PESO)as promedio,o.linea from Optimas as o INNER JOIN pesos as p on o.codigo =p.codoptima WHERE fecha >='"&fecha&"' AND hora='"&horamia&"' AND o.linea='L15N' GROUP BY LINEA",conexionAVG15n
- do while not registrosAVG15n.eof
- promedio=cint(registrosAVG15n.fields("promedio"))
- do while not registros15n.eof
- target=cint(registros15n.fields("target"))'## Definicion de variable Target
- OP=(promedio-target)/target '### Definicion de operacion de la variable OP para ser mostrada en la tabla
- saving=(PROMEDIO-target)*NumBolsas '### Definicion y operacion de la variable SAVING para mostrar en la tabla
- response.write("<tr>")
- response.write("<td>"®istros15n.fields("linea")&"</td>")
- response.write("<td>"®istros15n.fields("peso")&"</td>")
- response.write("<td>"®istros15n.fields("target")&"</td>")
- response.write("<td>"®istros15n.fields("marca")&"</td>")
- response.write("<td>"®istros15n.fields("vaso")&"</td>")
- 'response.write("<td>"®istros6n.fields("fecha")&"</td>")
- response.write("<td>"&fechahoy&" "&hora&":"&minuto&"</td>")
- response.write("<td><h3>"®istros15n.fields("totality")&"</h3></td>")
- response.write("<td>"®istrosAVG15n.fields("promedio")&"</td>")
- if OP<=0 then response.write("<td>"&op&"<img src='http://www.pact-oil.co.uk/images/error.gif'</a></td>") else response.write("<td>"&op&"<img src='http://www.hospitalsierrallana.com/imagenes/gif_ok.gif'</a></td>") end if
- if saving <0 then
- response.write("<td bgcolor= '#FF0000'> "&saving&" KG</td>")
- elseif saving >0 then
- response.write("<td bgcolor='#00FF00'>"&saving&" KG</td>")
- elseif saving=0 then
- response.write("<td>"&saving&" KG</td>")
- end if
- response.write("</tr>")
- registros15n.movenext
- loop
- conexion15n.close
- registrosAVG15n.movenext
- loop
- conexionAVG15n.close
- '########################################## L15 SUR #######################################################################################
- linea15s="L15s"
- SET conexion15s=Server.CreateObject("ADODB.Connection")
- conexion15s.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros15s=Server.CreateObject("ADODB.RecordSet")
- registros15s.open"EXEC monitor '"&fecha&"','"&linea15s&"','"&horamia&"'",conexion15s
- SET conexionAVG15s=Server.CreateObject("ADODB.Connection")
- conexionAVG15s.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registrosAVG15s= Server.CreateObject("ADODB.RecordSet")
- registrosAVG15s.open"SELECT AVG(PESO)as promedio,o.linea from Optimas as o INNER JOIN pesos as p on o.codigo =p.codoptima WHERE fecha >='"&fecha&"' AND hora='"&horamia&"' AND o.linea='L15S' GROUP BY LINEA",conexionAVG15s
- do while not registrosAVG15s.eof
- promedio=cint(registrosAVG15s.fields("promedio"))
- if registros15s.eof then
- conexion15s.close
- SET conexion15s=Server.CreateObject("ADODB.Connection")
- conexion15s.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros15s=Server.CreateObject("ADODB.RecordSet")
- registros15s.open"EXEC monitor '"&fecha&"','"&linea15s&"','"&hora2&"'",conexion15s
- response.write("EXEC monitor '"&fecha&"','"&linea15s&"','"&hora2&"'")
- do while not registros15s.eof
- target=cint(registros15s.fields("target"))'## Definicion de variable Target
- OP=(promedio-target)/target '### Definicion de operacion de la variable OP para ser mostrada en la tabla
- saving=(PROMEDIO-target)*NumBolsas '### Definicion y operacion de la variable SAVING para mostrar en la tabla
- response.write("<tr>")
- response.write("<td>"®istros15s.fields("linea")&"</td>")
- response.write("<td>"®istros15s.fields("peso")&"</td>")
- response.write("<td>"®istros15s.fields("target")&"</td>")
- response.write("<td>"®istros15s.fields("marca")&"</td>")
- response.write("<td>"®istros15s.fields("vaso")&"</td>")
- 'response.write("<td>"®istros6n.fields("fecha")&"</td>")
- response.write("<td>"&fechahoy&" "&hora&":"&minuto&"</td>")
- response.write("<td><h3>"®istros15s.fields("totality")&"</h3></td>")
- response.write("<td>"®istrosAVG15s.fields("promedio")&"</td>")
- if OP<=0 then response.write("<td>"&op&"<img src='http://www.pact-oil.co.uk/images/error.gif'</a></td>") else response.write("<td>"&op&"<img src='http://www.hospitalsierrallana.com/imagenes/gif_ok.gif'</a></td>") end if
- if saving <0 then
- response.write("<td bgcolor= '#FF0000'> "&saving&" KG</td>")
- elseif saving >0 then
- response.write("<td bgcolor='#00FF00'>"&saving&" KG</td>")
- elseif saving=0 then
- response.write("<td>"&saving&" KG</td>")
- end if
- response.write("</tr>")
- registros15s.movenext
- loop
- conexion15s.close
- else
- do while not registros15s.eof
- target=cint(registros15s.fields("target"))'## Definicion de variable Target
- OP=(promedio-target)/target '### Definicion de operacion de la variable OP para ser mostrada en la tabla
- saving=(PROMEDIO-target)*NumBolsas '### Definicion y operacion de la variable SAVING para mostrar en la tabla
- response.write("<tr>")
- response.write("<td>"®istros15s.fields("linea")&"</td>")
- response.write("<td>"®istros15s.fields("peso")&"</td>")
- response.write("<td>"®istros15s.fields("target")&"</td>")
- response.write("<td>"®istros15s.fields("marca")&"</td>")
- response.write("<td>"®istros15s.fields("vaso")&"</td>")
- 'response.write("<td>"®istros6n.fields("fecha")&"</td>")
- response.write("<td>"&fechahoy&" "&hora&":"&minuto&"</td>")
- response.write("<td><h3>"®istros15s.fields("totality")&"</h3></td>")
- response.write("<td>"®istrosAVG15s.fields("promedio")&"</td>")
- if OP<=0 then response.write("<td>"&op&"<img src='http://www.pact-oil.co.uk/images/error.gif'</a></td>") else response.write("<td>"&op&"<img src='http://www.hospitalsierrallana.com/imagenes/gif_ok.gif'</a></td>") end if
- if saving <0 then
- response.write("<td bgcolor= '#FF0000'> "&saving&" KG</td>")
- elseif saving >0 then
- response.write("<td bgcolor='#00FF00'>"&saving&" KG</td>")
- elseif saving=0 then
- response.write("<td>"&saving&" KG</td>")
- end if
- response.write("</tr>")
- registros15s.movenext
- loop
- conexion15s.close
- end if
- registrosAVG15s.movenext
- loop
- conexionAVG15s.close
- '##################################DATOS DE LA LINEA 16 NORTE ###################################################
- linea16="L16N"
- SET conexion3=Server.CreateObject("ADODB.Connection")
- conexion3.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros3=Server.CreateObject("ADODB.RecordSet")
- registros3.open"EXEC monitor '"&fecha&"','"&linea16&"','"&horamia&"'",conexion3
- SET conexion4=Server.CreateObject("ADODB.Connection")
- conexion4.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros4 = Server.CreateObject("ADODB.RecordSet")
- registros4.open"SELECT AVG(PESO)as promedio,o.linea from Optimas as o INNER JOIN pesos as p on o.codigo =p.codoptima WHERE fecha >='"&fecha&"' AND hora='"&horamia&"' AND o.linea='L16N' GROUP BY LINEA",conexion4
- do while not registros4.eof
- promedio=cint(registros4.fields("promedio"))
- do while not registros3.eof
- target=cint(registros3.fields("target"))'## Definicion de variable Target
- OP=(promedio-target)/target '### Definicion de operacion de la variable OP para ser mostrada en la tabla
- saving=(PROMEDIO-target)*NumBolsas '### Definicion y operacion de la variable SAVING para mostrar en la tabla
- response.write("<tr>")
- response.write("<td>"®istros3.fields("linea")&"</td>")
- response.write("<td>"®istros3.fields("peso")&"</td>")
- response.write("<td>"®istros3.fields("target")&"</td>")
- response.write("<td>"®istros3.fields("marca")&"</td>")
- response.write("<td>"®istros3.fields("vaso")&"</td>")
- response.write("<td>"®istros3.fields("fecha")&"</td>")
- response.write("<td><h3>"®istros3.fields("totality")&"</h3></td>")
- response.write("<td>"®istros4.fields("promedio")&"</td>")
- if OP<=0 then response.write("<td><h3>"&op&"</h3><img src='http://www.pact-oil.co.uk/images/error.gif'</a></td>") else response.write("<td>"&op&"<img src='http://www.hospitalsierrallana.com/imagenes/gif_ok.gif'</a></td>") end if
- if saving <0 then
- response.write("<td bgcolor= '#FF0000'> "&saving&" KG</td>")
- elseif saving >0 then
- response.write("<td bgcolor='#00FF00'>"&saving&" KG</td>")
- elseif saving=0 then
- response.write("<td>"&saving&" KG</td>")
- end if
- response.write("</tr>")
- registros3.movenext
- loop
- conexion3.close
- registros4.movenext
- loop
- conexion4.close
- '###########################################* LINEA 17 NORTE *#################################################################################
- SET conexion=Server.CreateObject("ADODB.Connection")
- conexion.CommandTimeout = 0
- conexion.ConnectionTimeout = 0
- conexion.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros=Server.CreateObject("ADODB.RecordSet")
- 'response.write("EXEC monitor '"&fecha&"','"&linea&"','"&horamia&"'")
- registros.open"EXEC monitor '"&fecha&"','"&linea&"','"&horamia&"'",conexion
- SET conexion2=Server.CreateObject("ADODB.Connection")
- conexion2.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros2=Server.CreateObject("ADODB.RecordSet")
- 'response.write("SELECT AVG(PESO)as promedio,o.linea from Optimas as o INNER JOIN pesos as p on o.codigo =p.codoptima WHERE fecha >='"&fecha&"' AND hora='"&horamia&"' AND o.linea='"&linea&"' GROUP BY LINEA")
- registros2.open"SELECT AVG(PESO)as promedio,o.linea from Optimas as o INNER JOIN pesos as p on o.codigo =p.codoptima WHERE fecha >='"&fecha&"' AND hora='"&horamia&"' AND o.linea='"&linea&"' GROUP BY LINEA",conexion2
- do while not registros2.eof
- promedio=cint(registros2.fields("promedio"))
- 'dim a,NumBolsas
- do while not registros.eof 'promedio-target*numero de bolsas
- target=cint(registros.fields("target"))
- NumBolsas=cint(registros.fields("totality"))
- OP=(promedio-target)/target '### Definicion de operacion de la variable OP para ser mostrada en la tabla
- saving=(PROMEDIO-target)*NumBolsas '### Definicion y operacion de la variable SAVING para mostrar en la tabla
- response.write("<tr>")
- response.write("<td>"®istros.fields("linea")&"</td>")
- response.write("<td>"®istros.fields("peso")&"</td>")
- response.write("<td>"®istros.fields("target")&"</td>")
- 'response.write("<td>"&a&"</td>")
- response.write("<td>"®istros.fields("marca")&"</td>")
- response.write("<td>"®istros.fields("vaso")&"</td>")
- 'response.write("<td>"®istros.fields("tubo")&"</td>")
- response.write("<td>"®istros.fields("fecha")&"</td>")
- response.write("<b><td><h3>"®istros.fields("totality")&"</h3></td></b>")
- response.write("<td>"®istros2.fields("promedio")&"</td>")
- if OP<=0 then response.write("<td><h3>"&op&"</h3><img src='http://www.pact-oil.co.uk/images/error.gif'</a></td>") else response.write("<td>"&op&"<img src='http://www.hospitalsierrallana.com/imagenes/gif_ok.gif'</a></td>") end if
- if saving <0 then
- response.write("<td bgcolor= '#FF0000'> "&saving&" KG</td>")
- elseif saving >0 then
- response.write("<td bgcolor='#00FF00'>"&saving&" KG</td>")
- elseif saving=0 then
- response.write("<td>"&saving&" KG</td>")
- end if
- registros.movenext
- loop
- registros2.movenext
- loop
- conexion2.close
- conexion.close
- '################################# DATOS DE LA LINEA 17 SUR #############################################################
- linea17S="L17S"
- SET conexion17s=Server.CreateObject("ADODB.Connection")
- conexion17s.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros17s=Server.CreateObject("ADODB.RecordSet")
- registros17s.open"EXEC monitor '"&fecha&"','"&linea17S&"','"&horamia&"'",conexion17s
- SET conexionAVG17s=Server.CreateObject("ADODB.Connection")
- conexionAVG17s.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registrosAVG17s= Server.CreateObject("ADODB.RecordSet")
- registrosAVG17s.open"SELECT AVG(PESO)as promedio,o.linea from Optimas as o INNER JOIN pesos as p on o.codigo =p.codoptima WHERE fecha >='"&fecha&"' AND hora='"&horamia&"' AND o.linea='L17S' GROUP BY LINEA",conexionAVG17s
- do while not registrosAVG17s.eof
- promedio=cint(registrosAVG17s.fields("promedio"))
- do while not registros17s.eof
- target=cint(registros17s.fields("target"))'## Definicion de variable Target
- OP=(promedio-target)/target '### Definicion de operacion de la variable OP para ser mostrada en la tabla
- saving=(PROMEDIO-target)*NumBolsas '### Definicion y operacion de la variable SAVING para mostrar en la tabla
- response.write("<tr>")
- response.write("<td>"®istros17s.fields("linea")&"</td>")
- response.write("<td>"®istros17s.fields("peso")&"</td>")
- response.write("<td>"®istros17s.fields("target")&"</td>")
- response.write("<td>"®istros17s.fields("marca")&"</td>")
- response.write("<td>"®istros17s.fields("vaso")&"</td>")
- 'response.write("<td>"®istros17s.fields("fecha")&"</td>")
- response.write("<td>"&fechahoy&" "&hora&":"&minuto&"</td>")
- response.write("<td><h3>"®istros17s.fields("totality")&"</h3></td>")
- response.write("<td>"®istrosAVG17s.fields("promedio")&"</td>")
- if OP<=0 then response.write("<td>"&op&"<img src='http://www.pact-oil.co.uk/images/error.gif'</a></td>") else response.write("<td>"&op&"<img src='http://www.hospitalsierrallana.com/imagenes/gif_ok.gif'</a></td>") end if
- if saving <0 then
- response.write("<td bgcolor= '#FF0000'> "&saving&" KG</td>")
- elseif saving >0 then
- response.write("<td bgcolor='#00FF00'>"&saving&" KG</td>")
- elseif saving=0 then
- response.write("<td>"&saving&" KG</td>")
- end if
- response.write("</tr>")
- registros17s.movenext
- loop
- conexion17s.close
- registrosAVG17s.movenext
- loop
- conexionAVG17s.close
- '################################### Datos de la linea 16 SUR ############################################################
- linea16S="L16S"
- SET conexion5=Server.CreateObject("ADODB.Connection")
- conexion5.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros5=Server.CreateObject("ADODB.RecordSet")
- registros5.open"EXEC monitor '"&fecha&"','"&linea16S&"','"&horamia&"'",conexion5
- SET conexion6=Server.CreateObject("ADODB.Connection")
- conexion6.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros6= Server.CreateObject("ADODB.RecordSet")
- registros6.open"SELECT AVG(PESO)as promedio,o.linea from Optimas as o INNER JOIN pesos as p on o.codigo =p.codoptima WHERE fecha >='"&fecha&"' AND hora='"&horamia&"' AND o.linea='L16S' GROUP BY LINEA",conexion6
- do while not registros6.eof
- promedio=cint(registros6.fields("promedio"))
- do while not registros5.eof
- target=cint(registros5.fields("target"))'## Definicion de variable Target
- OP=(promedio-target)/target '### Definicion de operacion de la variable OP para ser mostrada en la tabla
- saving=(PROMEDIO-target)*NumBolsas '### Definicion y operacion de la variable SAVING para mostrar en la tabla
- response.write("<tr>")
- response.write("<td>"®istros5.fields("linea")&"</td>")
- response.write("<td>"®istros5.fields("peso")&"</td>")
- response.write("<td>"®istros5.fields("target")&"</td>")
- response.write("<td>"®istros5.fields("marca")&"</td>")
- response.write("<td>"®istros5.fields("vaso")&"</td>")
- response.write("<td>"®istros5.fields("fecha")&"</td>")
- response.write("<td><h3>"®istros5.fields("totality")&"</h3></td>")
- response.write("<td>"®istros6.fields("promedio")&"</td>")
- if OP<=0 then response.write("<td><h3>"&op&"</h3><img src='http://www.pact-oil.co.uk/images/error.gif'</a></td>") else response.write("<td>"&op&"<img src='http://www.hospitalsierrallana.com/imagenes/gif_ok.gif'</a></td>") end if
- if saving <0 then
- response.write("<td bgcolor= '#FF0000'> "&saving&" KG</td>")
- elseif saving >0 then
- response.write("<td bgcolor='#00FF00'>"&saving&" KG</td>")
- elseif saving=0 then
- response.write("<td>"&saving&" KG</td>")
- end if
- response.write("</tr>")
- registros5.movenext
- loop
- conexion5.close
- registros6.movenext
- loop
- conexion6.close
- '############################# LINEA 06 NORTE ####################################################
- linea06n="L06n"
- SET conexion6n=Server.CreateObject("ADODB.Connection")
- conexion6n.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros6n=Server.CreateObject("ADODB.RecordSet")
- registros6n.open"EXEC monitor '"&fecha&"','"&linea06n&"','"&horamia&"'",conexion6n
- SET conexionAVG6n=Server.CreateObject("ADODB.Connection")
- conexionAVG6n.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registrosAVG6n= Server.CreateObject("ADODB.RecordSet")
- registrosAVG6n.open"SELECT AVG(PESO)as promedio,o.linea from Optimas as o INNER JOIN pesos as p on o.codigo =p.codoptima WHERE fecha >='"&fecha&"' AND hora='"&horamia&"' AND o.linea='L06N' GROUP BY LINEA",conexionAVG6n
- do while not registrosAVG6n.eof
- promedio=cint(registrosAVG6n.fields("promedio"))
- do while not registros6n.eof
- target=cint(registros6n.fields("target"))'## Definicion de variable Target
- OP=(promedio-target)/target '### Definicion de operacion de la variable OP para ser mostrada en la tabla
- saving=(PROMEDIO-target)*NumBolsas '### Definicion y operacion de la variable SAVING para mostrar en la tabla
- response.write("<tr>")
- response.write("<td>"®istros6n.fields("linea")&"</td>")
- response.write("<td>"®istros6n.fields("peso")&"</td>")
- response.write("<td>"®istros6n.fields("target")&"</td>")
- response.write("<td>"®istros6n.fields("marca")&"</td>")
- response.write("<td>"®istros6n.fields("vaso")&"</td>")
- 'response.write("<td>"®istros6n.fields("fecha")&"</td>")
- response.write("<td>"&fechahoy&" "&hora&":"&minuto&"</td>")
- response.write("<td><h3>"®istros6n.fields("totality")&"</h3></td>")
- response.write("<td>"®istrosAVG6n.fields("promedio")&"</td>")
- if OP<=0 then response.write("<td><h3>"&op&"</h3><img src='http://www.pact-oil.co.uk/images/error.gif'</a></td>") else response.write("<td>"&op&"<img src='http://www.hospitalsierrallana.com/imagenes/gif_ok.gif'</a></td>") end if
- if saving <0 then
- response.write("<td bgcolor= '#FF0000'> "&saving&" KG</td>")
- elseif saving >0 then
- response.write("<td bgcolor='#00FF00'>"&saving&" KG</td>")
- elseif saving=0 then
- response.write("<td>"&saving&" KG</td>")
- end if
- response.write("</tr>")
- registros6n.movenext
- loop
- conexion6n.close
- registrosAVG6n.movenext
- loop
- conexionAVG6n.close
- '############################# LINEA 07 NORTE ####################################################
- linea07n="L07N"
- SET conexion7n=Server.CreateObject("ADODB.Connection")
- conexion7n.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros7n=Server.CreateObject("ADODB.RecordSet")
- registros7n.open"EXEC monitor '"&fecha&"','"&linea07n&"','"&horamia&"'",conexion7n
- SET conexionAVG7n=Server.CreateObject("ADODB.Connection")
- conexionAVG7n.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registrosAVG7n= Server.CreateObject("ADODB.RecordSet")
- registrosAVG7n.open"SELECT AVG(PESO)as promedio,o.linea from Optimas as o INNER JOIN pesos as p on o.codigo =p.codoptima WHERE fecha >='"&fecha&"' AND hora='"&horamia&"' AND o.linea='L07N' GROUP BY LINEA",conexionAVG7n
- do while not registrosAVG7n.eof
- promedio=cint(registrosAVG7n.fields("promedio"))
- do while not registros7n.eof
- target=cint(registros7n.fields("target"))'## Definicion de variable Target
- OP=(promedio-target)/target '### Definicion de operacion de la variable OP para ser mostrada en la tabla
- saving=(PROMEDIO-target)*NumBolsas '### Definicion y operacion de la variable SAVING para mostrar en la tabla
- response.write("<tr>")
- response.write("<td>"®istros7n.fields("linea")&"</td>")
- response.write("<td>"®istros7n.fields("peso")&"</td>")
- response.write("<td>"®istros7n.fields("target")&"</td>")
- response.write("<td>"®istros7n.fields("marca")&"</td>")
- response.write("<td>"®istros7n.fields("vaso")&"</td>")
- 'response.write("<td>"®istros6n.fields("fecha")&"</td>")
- response.write("<td>"&fechahoy&" "&hora&":"&minuto&"</td>")
- response.write("<td><h3>"®istros7n.fields("totality")&"</h3></td>")
- response.write("<td>"®istrosAVG7n.fields("promedio")&"</td>")
- if OP<=0 then response.write("<td>"&op&"<img src='http://www.pact-oil.co.uk/images/error.gif'</a></td>") else response.write("<td>"&op&"<img src='http://www.hospitalsierrallana.com/imagenes/gif_ok.gif'</a></td>") end if
- if saving <0 then
- response.write("<td bgcolor= '#FF0000'> "&saving&" KG</td>")
- elseif saving >0 then
- response.write("<td bgcolor='#00FF00'>"&saving&" KG</td>")
- elseif saving=0 then
- response.write("<td>"&saving&" KG</td>")
- end if
- response.write("</tr>")
- registros7n.movenext
- loop
- conexion7n.close
- registrosAVG7n.movenext
- loop
- conexionAVG7n.close
- '############################# LINEA 01 NORTE ####################################################
- linea01n="L01N"
- SET conexion1n=Server.CreateObject("ADODB.Connection")
- conexion1n.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros1n=Server.CreateObject("ADODB.RecordSet")
- registros1n.open"EXEC monitor '"&fecha&"','"&linea01n&"','"&horamia&"'",conexion1n
- SET conexionAVG1n=Server.CreateObject("ADODB.Connection")
- conexionAVG1n.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registrosAVG1n= Server.CreateObject("ADODB.RecordSet")
- registrosAVG1n.open"SELECT AVG(PESO)as promedio,o.linea from Optimas as o INNER JOIN pesos as p on o.codigo =p.codoptima WHERE fecha >='"&fecha&"' AND hora='"&horamia&"' AND o.linea='L01N' GROUP BY LINEA",conexionAVG1n
- do while not registrosAVG1n.eof
- promedio=cint(registrosAVG1n.fields("promedio"))
- do while not registros1n.eof
- target=cint(registros1n.fields("target"))'## Definicion de variable Target
- OP=(promedio-target)/target '### Definicion de operacion de la variable OP para ser mostrada en la tabla
- saving=(PROMEDIO-target)*NumBolsas '### Definicion y operacion de la variable SAVING para mostrar en la tabla
- response.write("<tr>")
- response.write("<td>"®istros1n.fields("linea")&"</td>")
- response.write("<td>"®istros1n.fields("peso")&"</td>")
- response.write("<td>"®istros1n.fields("target")&"</td>")
- response.write("<td>"®istros1n.fields("marca")&"</td>")
- response.write("<td>"®istros1n.fields("vaso")&"</td>")
- 'response.write("<td>"®istros6n.fields("fecha")&"</td>")
- response.write("<td>"&fechahoy&" "&hora&":"&minuto&"</td>")
- response.write("<td><h3>"®istros1n.fields("totality")&"</h3></td>")
- response.write("<td>"®istrosAVG1n.fields("promedio")&"</td>")
- if OP<=0 then response.write("<td>"&op&"<img src='http://www.pact-oil.co.uk/images/error.gif'</a></td>") else response.write("<td>"&op&"<img src='http://www.hospitalsierrallana.com/imagenes/gif_ok.gif'</a></td>") end if
- if saving <0 then
- response.write("<td bgcolor= '#FF0000'> "&saving&" KG</td>")
- elseif saving >0 then
- response.write("<td bgcolor='#00FF00'>"&saving&" KG</td>")
- elseif saving=0 then
- response.write("<td>"&saving&" KG</td>")
- end if
- response.write("</tr>")
- registros1n.movenext
- loop
- conexion1n.close
- registrosAVG1n.movenext
- loop
- conexionAVG1n.close
- '############################## LINEA 01 SUR ####################################################################
- linea01n="L01S"
- SET conexion1s=Server.CreateObject("ADODB.Connection")
- conexion1s.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros1s=Server.CreateObject("ADODB.RecordSet")
- registros1s.open"EXEC monitor '"&fecha&"','"&linea01n&"','"&horamia&"'",conexion1s
- SET conexionAVG1s=Server.CreateObject("ADODB.Connection")
- conexionAVG1s.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registrosAVG1s= Server.CreateObject("ADODB.RecordSet")
- registrosAVG1s.open"SELECT AVG(PESO)as promedio,o.linea from Optimas as o INNER JOIN pesos as p on o.codigo =p.codoptima WHERE fecha >='"&fecha&"' AND hora='"&horamia&"' AND o.linea='L01S' GROUP BY LINEA",conexionAVG1s
- do while not registrosAVG1s.eof
- promedio=cint(registrosAVG1s.fields("promedio"))
- do while not registros1s.eof
- target=cint(registros1s.fields("target"))'## Definicion de variable Target
- OP=(promedio-target)/target '### Definicion de operacion de la variable OP para ser mostrada en la tabla
- saving=(PROMEDIO-target)*NumBolsas '### Definicion y operacion de la variable SAVING para mostrar en la tabla
- response.write("<tr>")
- response.write("<td>"®istros1s.fields("linea")&"</td>")
- response.write("<td>"®istros1s.fields("peso")&"</td>")
- response.write("<td>"®istros1s.fields("target")&"</td>")
- response.write("<td>"®istros1s.fields("marca")&"</td>")
- response.write("<td>"®istros1s.fields("vaso")&"</td>")
- 'response.write("<td>"®istros6n.fields("fecha")&"</td>")
- response.write("<td>"&fechahoy&" "&hora&":"&minuto&"</td>")
- response.write("<td><h3>"®istros1s.fields("totality")&"</h3></td>")
- response.write("<td>"®istrosAVG1s.fields("promedio")&"</td>")
- if OP<=0 then response.write("<td>"&op&"<img src='http://www.pact-oil.co.uk/images/error.gif'</a></td>") else response.write("<td>"&op&"<img src='http://www.hospitalsierrallana.com/imagenes/gif_ok.gif'</a></td>") end if
- if saving <0 then
- response.write("<td bgcolor= '#FF0000'> "&saving&" KG</td>")
- elseif saving >0 then
- response.write("<td bgcolor='#00FF00'>"&saving&" KG</td>")
- elseif saving=0 then
- response.write("<td>"&saving&" KG</td>")
- end if
- response.write("</tr>")
- registros1s.movenext
- loop
- conexion1s.close
- registrosAVG1s.movenext
- loop
- conexionAVG1s.close
- '########################## Datos de la Linea 03 Norte ###############################################################
- linea03n="L03N"
- SET conexion3n=Server.CreateObject("ADODB.Connection")
- conexion3n.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros3n=Server.CreateObject("ADODB.RecordSet")
- registros3n.open"EXEC monitor '"&fecha&"','"&linea03n&"','"&horamia&"'",conexion3n
- SET conexionAVG3n=Server.CreateObject("ADODB.Connection")
- conexionAVG3n.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registrosAVG3n= Server.CreateObject("ADODB.RecordSet")
- registrosAVG3n.open"SELECT AVG(PESO)as promedio,o.linea from Optimas as o INNER JOIN pesos as p on o.codigo =p.codoptima WHERE fecha >='"&fecha&"' AND hora='"&horamia&"' AND o.linea='L03N' GROUP BY LINEA",conexionAVG3n
- do while not registrosAVG3n.eof
- promedio=cint(registrosAVG3n.fields("promedio"))
- do while not registros3n.eof
- target=cint(registros3n.fields("target"))'## Definicion de variable Target
- OP=(promedio-target)/target '### Definicion de operacion de la variable OP para ser mostrada en la tabla
- saving=(PROMEDIO-target)*NumBolsas '### Definicion y operacion de la variable SAVING para mostrar en la tabla
- response.write("<tr>")
- response.write("<td>"®istros3n.fields("linea")&"</td>")
- response.write("<td>"®istros3n.fields("peso")&"</td>")
- response.write("<td>"®istros3n.fields("target")&"</td>")
- response.write("<td>"®istros3n.fields("marca")&"</td>")
- response.write("<td>"®istros3n.fields("vaso")&"</td>")
- 'response.write("<td>"®istros6n.fields("fecha")&"</td>")
- response.write("<td>"&fechahoy&" "&hora&":"&minuto&"</td>")
- response.write("<td><h3>"®istros3n.fields("totality")&"</h3></td>")
- response.write("<td>"®istrosAVG3n.fields("promedio")&"</td>")
- if OP<=0 then response.write("<td> "&op&"<img src='http://www.pact-oil.co.uk/images/error.gif'</a></td>") else response.write("<td>"&op&"<img src='http://www.hospitalsierrallana.com/imagenes/gif_ok.gif'</a></td>") end if
- if saving <0 then
- response.write("<td bgcolor= '#FF0000'> "&saving&" KG</td>")
- elseif saving >0 then
- response.write("<td bgcolor='#00FF00'>"&saving&" KG</td>")
- elseif saving=0 then
- response.write("<td>"&saving&" KG</td>")
- end if
- response.write("</tr>")
- registros3n.movenext
- loop
- conexion3n.close
- registrosAVG3n.movenext
- loop
- conexionAVG3n.close
- '####################### LINEA 09 NORTE #################################################################
- linea09n="L09N"
- SET conexion9n=Server.CreateObject("ADODB.Connection")
- conexion9n.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros9n=Server.CreateObject("ADODB.RecordSet")
- registros9n.open"EXEC monitor '"&fecha&"','"&linea09n&"','"&horamia&"'",conexion9n
- SET conexionAVG9n=Server.CreateObject("ADODB.Connection")
- conexionAVG9n.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registrosAVG9n= Server.CreateObject("ADODB.RecordSet")
- registrosAVG9n.open"SELECT AVG(PESO)as promedio,o.linea from Optimas as o INNER JOIN pesos as p on o.codigo =p.codoptima WHERE fecha >='"&fecha&"' AND hora='"&horamia&"' AND o.linea='L09N' GROUP BY LINEA",conexionAVG9n
- do while not registrosAVG9n.eof
- promedio=cint(registrosAVG9n.fields("promedio"))
- do while not registros9n.eof
- target=cint(registros9n.fields("target"))'## Definicion de variable Target
- OP=(promedio-target)/target '### Definicion de operacion de la variable OP para ser mostrada en la tabla
- saving=(PROMEDIO-target)*NumBolsas '### Definicion y operacion de la variable SAVING para mostrar en la tabla
- response.write("<tr>")
- response.write("<td>"®istros9n.fields("linea")&"</td>")
- response.write("<td>"®istros9n.fields("peso")&"</td>")
- response.write("<td>"®istros9n.fields("target")&"</td>")
- response.write("<td>"®istros9n.fields("marca")&"</td>")
- response.write("<td>"®istros9n.fields("vaso")&"</td>")
- 'response.write("<td>"®istros6n.fields("fecha")&"</td>")
- response.write("<td>"&fechahoy&" "&hora&":"&minuto&"</td>")
- response.write("<td><h3>"®istros9n.fields("totality")&"</h3></td>")
- response.write("<td>"®istrosAVG9n.fields("promedio")&"</td>")
- if OP<=0 then response.write("<td>"&op&"<img src='http://www.pact-oil.co.uk/images/error.gif'</a></td>") else response.write("<td>"&op&"<img src='http://www.hospitalsierrallana.com/imagenes/gif_ok.gif'</a></td>") end if
- if saving <0 then
- response.write("<td bgcolor= '#FF0000'> "&saving&" KG</td>")
- elseif saving >0 then
- response.write("<td bgcolor='#00FF00'>"&saving&" KG</td>")
- elseif saving=0 then
- response.write("<td>"&saving&" KG</td>")
- end if
- response.write("</tr>")
- registros9n.movenext
- loop
- conexion9n.close
- registrosAVG9n.movenext
- loop
- conexionAVG9n.close
- '########################### LINEA 09 SUR ################################################################
- linea09n="L09S"
- SET conexion9S=Server.CreateObject("ADODB.Connection")
- conexion9s.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registros9s=Server.CreateObject("ADODB.RecordSet")
- registros9s.open"EXEC monitor '"&fecha&"','"&linea09s&"','"&horamia&"'",conexion9s
- SET conexionAVG9s=Server.CreateObject("ADODB.Connection")
- conexionAVG9s.Open "PROVIDER=SQLOLEDB; DATA SOURCE=VALP-MESSRV02;UID=sa;PWD=messrv;DATABASE=wasp "
- SET registrosAVG9s= Server.CreateObject("ADODB.RecordSet")
- registrosAVG9s.open"SELECT AVG(PESO)as promedio,o.linea from Optimas as o INNER JOIN pesos as p on o.codigo =p.codoptima WHERE fecha >='"&fecha&"' AND hora='"&horamia&"' AND o.linea='L09S' GROUP BY LINEA",conexionAVG9s
- do while not registrosAVG9s.eof
- promedio=cint(registrosAVG9s.fields("promedio"))
- do while not registros9s.eof
- target=cint(registros9S.fields("target"))'## Definicion de variable Target
- OP=(promedio-target)/target '### Definicion de operacion de la variable OP para ser mostrada en la tabla
- saving=(PROMEDIO-target)*NumBolsas '### Definicion y operacion de la variable SAVING para mostrar en la tabla
- response.write("<tr>")
- response.write("<td>"®istros9S.fields("linea")&"</td>")
- response.write("<td>"®istros9S.fields("peso")&"</td>")
- response.write("<td>"®istros9S.fields("target")&"</td>")
- response.write("<td>"®istros9S.fields("marca")&"</td>")
- response.write("<td>"®istros9S.fields("vaso")&"</td>")
- 'response.write("<td>"®istros6n.fields("fecha")&"</td>")
- response.write("<td>"&fechahoy&" "&hora&":"&minuto&"</td>")
- response.write("<td><h3>"®istros9S.fields("totality")&"</h3></td>")
- response.write("<td>"®istrosAVG9S.fields("promedio")&"</td>")
- if OP<=0 then response.write("<td>"&op&"<img src='http://www.pact-oil.co.uk/images/error.gif'</a></td>") else response.write("<td>"&op&"<img src='http://www.hospitalsierrallana.com/imagenes/gif_ok.gif'</a></td>") end if
- if saving <0 then
- response.write("<td bgcolor= '#FF0000'> "&saving&" KG</td>")
- elseif saving >0 then
- response.write("<td bgcolor='#00FF00'>"&saving&" KG</td>")
- elseif saving=0 then
- response.write("<td>"&saving&" KG</td>")
- end if
- response.write("</tr>")
- registros9S.movenext
- loop
- conexion9S.close
- registrosAVG9S.movenext
- loop
- conexionAVG9S.close
- %>
- </tr>
- </table>
- </table>
- </font></p>
- <p style="margin-left: 20"><font face="Arial" size="2" color="#000000"> </font></p>
- <p style="margin-left: 20"><font face="Arial" size="2" color="#000000"> </font></p>
- <p style="margin-left: 20"><font face="Arial" size="2" color="#000000"> </font></p>
- <p style="margin-left: 20"><font face="Arial" size="2" color="#000000"> </font></p>
- <p style="margin-left: 20"><font face="Arial" size="2" color="#000000"> </font></p>
- <p style="margin-left: 20"><font face="Arial" size="2" color="#000000"> </font></p>
- <p style="margin-left: 20"><font face="Arial" size="2" color="#000000"> </font></p>
- <p style="margin-left: 20"><font face="Arial" size="2" color="#000000"> </font></p>
- <p style="margin-left: 20" align="center"><font face="Arial" color="#000000" size="1">©
- COPYRIGHT 2010 ALL RIGHTS RESERVED PG.COM</font></p>
- <table border="0" width="100%" cellspacing="0" cellpadding="0" background="img/botline.gif">
- <tr>
- <td width="100%"><img border="0" src="img/botline.gif" width="41" height="12"></td>
- </tr>
- </table>
- </body>
- </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement