<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%> <% Session.Timeout = 120 Server.ScriptTimeout = 5000 busca=request.QueryString("busca") doc=request.QueryString("doc") origen=request.QueryString("origen") Date_ini=Request.Form("Date_ini") Date_end=Request.Form("Date_end") lvende=Request.Form("cvende") criterio22=Request.Form("criterio22") if criterio22="" then xcriterio22=" Todos " end if if Date_ini="" or Date_ini=null then Date_ini=date()-1 Date_end=date()-1 end if Date_end2=cdate(Date_end)+1 turno1="065000" turno2="152000" turno3="232000" '''''''''''calcula strday = Right("00" & Day(Date_ini), 2) strmonth = Right("00" & Month(Date_ini), 2) stryear = Right("0000" & Year(Date_ini), 4) strday2 = Right("00" & Day(Date_end3), 2) strmonth2 = Right("00" & Month(Date_end3), 2) stryear2 = Right("0000" & Year(Date_end3), 4) fechainicial = CStr(stryear & strmonth & strday) fechafinal2 = CStr(stryear2 & strmonth2 & strday2) response.write(fechainicial&" ") response.write("FF "&fechafinal2) strday2 = Right("00" & Day(Date_end), 2) strmonth2 = Right("00" & Month(Date_end), 2) stryear2 = Right("00" & Year(Date_end), 4) fechafinal = CStr(stryear2 + strmonth2 + strday2) set strConexao = CreateObject("ADODB.Connection") ' seteas la conexion 'strConexao.Open("DRIVER=Firebird/InterBase� driver; UID=SYSDBA;PWD=MOLRA; DBNAME=\\desktop-6psmf8k\firebird_db\CARDBOARD20.fdb") strConexao.Open("DRIVER=Firebird/InterBase(r) driver;UID=SYSDBA;PWD=molra; DBNAME=192.168.0.201:C:\PAUL\data\CARDBOARD20.FDB") 'abrir la base, fijate que esta en el directorio que la tienes ... Set Corr2 = Server.CreateObject("ADODB.Recordset") ' seteas el recordset 'Set Corr2 = strConexao.Execute("SELECT * FROM PCSIN where LEFT(STIME,8) between '" & fechainicial & "' and '" & fechafinal2 & "' and STAT='T' order by STIME") ' lo ejecutas Set Corr2 = strConexao.Execute("SELECT * FROM PCSIN where JOBYMD between '" & fechainicial & "' and '" & fechafinal & "' and STAT='T' order by JOBYMD,JOBJO,STIME") 'JOBJO,JOBYMD, JOBSEQ xday = Right("00" & Day(Date), 2) xmonth = Right("00" & Month(Date), 2) xyear = Right("00" & Year(Date), 4) xdate=xyear&xmonth&xday Dim Rsfore0 Dim Sqlfore0 set Rsfore0=dbsql3.execute("SELECT * FROM forecast WHERE id=49") 'Set Rsfore = CurrentDb.OpenRecordset(Sqlfore) xday2 = Right("00" & Rsfore0("month"), 2) xmonth2 = Right("00" & Rsfore0("forecast"), 2) xyear2 = Right("00" & Rsfore0("year"), 4) xdate2=xyear2&xmonth2&xday2 If xdate>xdate2 Then response.write (ErrorNo1) else %> Report Corrugator II datepicker demo
       
Period:  
         
<% header %> <% if Not corr2.EOF and Not corr2.BOF then TOTML=0 TOTM2=0 TOTTARGET=0 TOTPROD=0 TOTML=0 '(corr2("JANG")*corr2("PQTY")/1000) TOTM2=0 TOTTARGET2=0 TOTPROD2=0 TOTML2=0 TOTM22=0 TOTbad2=0 TOTjtime2=0 TOTdtime2=0 TOTITEMS=0 corr2.movefirst 'lturno1=Corr2("JOBJO") lturno1="1" lturno2="1st" Do While Not corr2.EOF shora=mid(Corr2("STIME"),10,2)&mid(Corr2("STIME"),13,2)&mid(Corr2("STIME"),16,2) Ehora=mid(Corr2("ETIME"),10,2)&mid(Corr2("ETIME"),13,2)&mid(Corr2("ETIME"),16,2) if (mid(Corr2("STIME"),1,8)=fechainicial and shora<"065000" and Ehora<"065001") then CORR2.MoveNext else if shora<"065000" and Ehora>"064959" then shora2=mid(Corr2("STIME"),10,8) Ehora2=mid(Corr2("ETIME"),10,8) Shift1="06:50:00" segundosonline1 = DateDiff("s", Shora2, Shift1) segundosonline2 = DateDiff("s", Shift1, Ehora2) end if if (mid(Corr2("STIME"),1,8)=fechainicial and segundosonline1>segundosonline2) then CORR2.MoveNext ELSE if (mid(Corr2("STIME"),1,8)=fechafinal2 and segundosonline1fechafinal2) and shora>"065000") then CORR2.MoveNext else lm=int(cdbl(Corr2("Jang"))*cdbl(Corr2("PQTY")))/1000 lm2=int((cdbl(Corr2("Jang"))*cdbl(Corr2("WPOK")))*cdbl(Corr2("PQTY")))/1000000 totalTiempo = cdbl(corr2("dtime")) hores = int((totalTiempo/3600)) aux = int(totalTiempo-(3600*hores)) minuts = int(aux/60) segons = totalTiempo-hores*3600-minuts*60 Downtime = hores&":"&right("00"&minuts,2)&":"&right("00"&segons,2) Tiempo2 = cdbl(corr2("jtime")) hores2 = int((Tiempo2/3600)) aux2 = int(Tiempo2-(3600*hores2)) minuts2 = int(aux2/60) segons2 = Tiempo2-hores2*3600-minuts2*60 Worktime = hores2&":"&right("00"&minuts2,2)&":"&right("00"&segons2,2) lstime=mid(Corr2("stime"),10,8) letime=mid(Corr2("etime"),10,8) 'if shora>"065000" and shora<"151959" then ' xTurno="1st" ' end if ' if shora>"152000" and shora<"231959" then ' xTurno="2nd" ' end if ' if shora>"232000" or shora<"064959" then ' xTurno="3rd" ' end if if Corr2("JOBJO")="A" then lTurno1="1" end if if Corr2("JOBJO")="B" then lTurno1="2" end if if Corr2("JOBJO")="C" then lTurno1="3" end if %> <% TOTTARGET=TOTTARGET+cdbl(corr2("QTY")) TOTPROD=TOTPROD+cdbl(corr2("PQTY")) TOTML=TOTML+lm '(corr2("JANG")*corr2("PQTY")/1000) TOTM2=TOTM2+lm2 '(corr2("JANG")*corr2("WPOK")*corr2("PQTY")/1000000) TOTbad=TOTbad+cdbl(corr2("eQTY")) TOTjtime=TOTjtime+cdbl(corr2("jtime")) TOTdtime=TOTdtime+cdbl(corr2("dtime")) TOTTARGET2=TOTTARGET2+cdbl(corr2("QTY")) TOTPROD2=TOTPROD2+cdbl(corr2("PQTY")) TOTML2=TOTML2+lm '(corr2("JANG")*corr2("PQTY")/1000) TOTM22=TOTM22+lm2 '(corr2("JANG")*corr2("WPOK")*corr2("PQTY")/1000000) TOTbad2=TOTbad2+cdbl(corr2("eQTY")) TOTjtime2=TOTjtime2+cdbl(corr2("jtime")) TOTdtime2=TOTdtime2+cdbl(corr2("dtime")) TOTITEMS=TOTITEMS+1 CORR2.MoveNext if not Corr2.eof then shora2=mid(Corr2("STIME"),10,2)&mid(Corr2("STIME"),13,2)&mid(Corr2("STIME"),16,2) 'if shora2>"064959" and shora2<"152000" then ' lturno2="1st" 'end if 'if shora2>"151959" and shora2<"232000" then ' lturno2="2nd" 'end if 'if shora2>"231959" or shora2<"065000" then ' lturno2="3rd" ' end if if Corr2("JOBJO")="A" then lTurno2="1" end if if Corr2("JOBJO")="B" then lTurno2="2" end if if Corr2("JOBJO")="C" then lTurno2="3" end if 'lturno2=xTurno end if end if End if End if end if if Corr2.eof or lturno1<>lturno2 then if TOTML2>0 and (TOTjtime2+TOTdtime2)>0 then lspeedtot2=int(TOTML2/((TOTjtime2+TOTdtime2)/60)) else lspeedtot2=0 end if 'if lturno1="A" then ' xTurno="1st" 'end if 'if lturno1="B" then ' xTurno="2nd" 'end if 'if lturno1="C" then ' xTurno="3rd" 'end if if TOTTARGET2>0 then %> <% lturno1=lturno2 TOTTARGET2=0 TOTPROD2=0 TOTML2=0 TOTM22=0 TOTbad2=0 TOTjtime2=0 TOTdtime2=0 end if end if ' end if LOOP 'END IF corr2.close end if '''''''''''''''''''''''' if totitems>0 then lspeedtot=int(TOTML/((TOTjtime+TOTdtime)/60)) Tiempod = TOTdtime hores3 = int((Tiempod/3600)) aux3 = int(Tiempod-(3600*hores3)) minuts3 = int(aux3/60) segons3 = Tiempod-hores3*3600-minuts3*60 totdt2 = hores3&":"&right("00"&minuts3,2)&":"&right("00"&segons3,2) Tiempow = totjtime hores4 = int((Tiempow/3600)) aux4 = int(Tiempow-(3600*hores4)) minuts4 = int(aux4/60) segons4 = Tiempow-hores4*3600-minuts4*60 totwt2 = hores4&":"&right("00"&minuts4,2)&":"&right("00"&segons4,2) %> <% end if %>
CORRUGATOR II (Nordika)
Job Date Shift ends Time WO Customer Item Flute Combination Lenght Width TargetQTY Prod QTY M M2 Bad QTY Work Time Delay Time AVG Speed
<%=mid(Corr2("STIME"),1,8)%> <%=corr2("JOBJO")%> <%=lstime%> <%=Corr2("sujuno")%> <%=Corr2("cust")%> <%=Corr2("Boxname")%> <%=Corr2("GOL")%> <%=Corr2("BEHAP")%> <%=Corr2("Jang")%> <%=Corr2("WPOK")%> <%=Corr2("QTY")%> <%=Corr2("PQTY")%> <%=formatnumber(lm,0)%> <%=formatnumber(lm2,0)%> <%=Corr2("EQTY")%> <%=worktime%> <%=downtime%>
    Shift TOTAL               <%=formatnumber(TOTTARGET2,0)%> <%=formatnumber(TOTPROD2,0)%>
<%=formatnumber(TOTML2,0)%> M
<%=formatnumber(TOTM22,0)%> M2
<%=formatnumber(TOTbad2,0)%>
<%=formatnumber(TOTjtime2,0)%>
<%=formatnumber(lspeedtot2,0)%>
    TOTAL       <%=formatnumber(TOTITEMS,0)%>        
<%=formatnumber(TOTTARGET,0)%>
<%=formatnumber(TOTPROD,0)%>
<%=formatnumber(TOTML,0)%> M
<%=formatnumber(TOTM2,0)%> M2
<%=formatnumber(TOTbad,0)%>
<%=totwt2%>
<%=totdt2%>
<%=formatnumber(lspeedtot,0)%>
<% 'Corr2.Close strConexao.Close Set strConexao=Nothing End If Rsfore0.Close Set Rsfore0 = Nothing dbsql3.Close Set dbsql3 = Nothing ''''''''''''' %>