<!--
METADATA
TYPE="typelib"
UUID="CD000000-8B95-11D1-82DB-00C04FB1625D"
NAME="CDO for Windows 2000 Library"
-->
<%@ LANGUAGE = "VBScript" %>
<!-- #include file="dbsinil2018.inc" -->
<!-- #include file="config.inc" -->
<!-- #include file="functions.inc" -->
<% 
on error resume next
%>
<%
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")
cmes=Request.Form("cmes")
canno=Request.Form("canno")
'if cmes="" then
' cmes=month(date)
' canno=year(date)
'end if

lspace=" "
 apostrofe="'"
if Date_ini="" or Date_ini=null then
 Date_ini=date()-(day(date()))+1
 Date_end=date()
end if

'''''''''''calcula
 layer=weekday(date()-1)
 'hractual=hour(Now)
 'minactual=minute(now)
 minactual="52"
 hractual="06"


 If layer = 1 Then
  Date_ini=date()-3
  Date_end=date()-3
 else
  if layer=7 then 
   Date_ini=date()-2
   Date_end=date()-2
  else
   Date_ini=date()-1
   Date_end=date()-1
  end if
 end if
  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

  Dim objCDO
 Dim Conf
 Dim Fields

set Rsfore0=cnn.execute("SELECT * FROM forecast WHERE id=49")
 '************** Transfer  111
 xday2 = Right("00" & Rsfore0("month"), 2)
 xmonth2 = Right("00" & Rsfore0("forecast"), 2)
 xyear2 = Right("00" & Rsfore0("year"), 4)
 xdate2=xyear2&xmonth2&xday2 

correo="ilkim@shinwoousa.com;inwans@shinwoousa.com"
''''''''''''''''''''''''''''''''''''''
If xdate>xdate2 Then
  response.write (ErrorNo1)
  mensaje=ErrorNo1
  
'''''''''''
 Set cdoConfig = CreateObject("CDO.Configuration")

 With cdoConfig.Fields
  .Item(cdoSendUsingMethod) = 2
  .Item(cdoSMTPServer) = "mail.shinwoousa.com"
  '"64.87.26.218"
  .Item(cdoSMTPauthenticate)=1
  .Item(cdoSendUsername)="sechevarria@shinwoousa.com"
   .Item(cdoSendPassword)="Sheko*2019*"
  .Item(cdoSMTPServerport)=587
  .Update
 End With

  Set cdoMessage = CreateObject("CDO.Message")
  'Set Fields = Nothing
 'Set objCDO = Nothing
 'Set Conf = Nothing
  With cdoMessage
    Set .Configuration = cdoConfig
    .From = "sechevarria@shinwoousa.com"
    .To = correo
    .cc = "avaldez@shinwoousa.com;jmontano@shinwoousa.com;sgallegos@shinwoousa.com;ysalazar@shinwoousa.com;yvizcarra@shinwoousa.com;jamesoh@shinwoousa.com;jmedina@shinwoousa.com;dvilchis@shinwoousa.com;jguzman@shinwoousa.com;mahernandez@shinwoousa.com;ehernandez@shinwoousa.com;abecerra@shinwoousa.com;ikejung@shinwoousa.com;vincent.shin@shinwoousa.com"
    .bcc = "sistemas@shinwoousa.com"
      .Subject = "sending Automatic - HOURLY TRANSFER AND CORRUGATOR CC"
    '.TextBody = "Esta es una Prueba de envio automatico ASECO-Sergio"
    .HTMLBody= mensaje
    '.AddAttachment (archivopdf)
    '.AddAttachment (archivoxml)
    .Send
  End With
   
  Set cdoMessage = Nothing
  Set cdoConfig = Nothing
  
 else
  strday = Right("00" & Day(date), 2)

  strmonth = Right("00" & Month(date), 2)
  stryear = Right("00" & Year(date), 4)
  strday2 = Right("00" & Day(date+1), 2)
  strmonth2 = Right("00" & Month(date)+1, 2)
  stryear2 = Right("00" & Year(date+1), 4)

  lmonth = Month(Date)-1
  'lmonth =4
  If lmonth = 1 Or lmonth = 3 Or lmonth = 5 Or lmonth = 7 Or lmonth = 8 Or lmonth = 10 Or lmonth = 0 Then
   ldiasmes = 31
  End If
  If lmonth = 2 Then
   ldiasmes = 29
  End If
  If lmonth = 4 Or lmonth = 6 Or lmonth = 9 Or lmonth = 11 Then
   ldiasmes = 30
  End If
  lmonth1 = Month(Date)
  'lmonth1 = 5
  If lmonth1 = 1 Or lmonth1 = 3 Or lmonth1 = 5 Or lmonth1 = 7 Or lmonth1 = 8 Or lmonth1 = 10 Or lmonth1 = 12 Then
   ldiasmes1 = 31
  End If
  If lmonth1 = 2 Then
   ldiasmes1 = 29
  End If
  If lmonth1 = 4 Or lmonth1 = 6 Or lmonth1 = 9 Or lmonth1 = 11 Then
   ldiasmes1 = 30
  End If
  
  strmesini = Right("00" & lmonth, 2)
  strday2 = Right("00" & ldiasmes, 2)  

 if cmes="" then    'mes1
   cmes=right("00"&month(date),2)
   canno=right("0000"&year(date),4)
   lhora=right("00"&hour(time),2)
   lmin=right("00"&minute(time),2)
   ltime=lhora&lmin
   if ltime<"0659" then
    cmesx=right("00"&month(date-1),2)
    cannox=right("0000"&year(date-1),4)
    lfecinicio= CStr(cannox & cmesx & right("00"&day(date-1),2))
    ldaterep= Cstr(cmesx & "/" & right("00"&day(date-1),2) & "/" & cannox)
    lfecfinal= CStr(cannox & cmesx & right("00"&day(date-1),2))
    
   else
    lfecinicio= CStr(canno & cmes & right("00"&day(date),2))
    lfecfinal= CStr(canno & cmes & right("00"&day(date),2))
    ldaterep= Cstr(cmes & "/" & right("00"&day(date),2) & "/" & canno)
    
   end if
   'lfecinicial=CStr(right("00"&year(date),4)+right("00"&month(date),2) + "01")
   'lfecinicio="20161031"
   'lfecfinal="20161031"
 else
   lmonth = cmes
  'lmonth =4
   If lmonth = 1 Or lmonth = 3 Or lmonth = 5 Or lmonth = 7 Or lmonth = 8 Or lmonth = 10 Or lmonth = 0 Then
    ldiasmes = 31
   End If
   If lmonth = 2 Then
    ldiasmes = 29
   End If
   If lmonth = 4 Or lmonth = 6 Or lmonth = 9 Or lmonth = 11 Then
    ldiasmes = 30
   End If
   cmes2=right("00"&cmes,2)
   canno=right("0000"&year(date),4)
   lfecinicio= CStr(canno & cmes2 & "01")
   lfecfinal= CStr(canno & cmes2 & ldiasmes)
   lfecinicial=CStr(right("00"&year(date),4)+right("00"&month(date),2) + "01")
 end if    'mes1
 'lfecinicio
 'lfecfinal


 'Set rsvende = Server.CreateObject("ADODB.RecordSet")
 xtipo="VENDEDOR"
 'rsvende.CursorType = adOpenDynamic
 'set rsvende=dbsql.execute("SELECT major_cd, minor_cd, code_nm FROM sta010t WHERE (((major_cd)='9001')) ORDER BY minor_cd")

%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html lang="es">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Report Hourly</title>
<meta name="author" content="<%= Developer%>"> 
<link href="css/style.css" rel="stylesheet" media="screen">

<meta charset="utf-8">
  <link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
  <script src="//code.jquery.com/jquery-1.10.2.js"></script>
  <script src="//code.jquery.com/ui/1.11.4/jquery-ui.js"></script>

<script type="text/javascript">
$(document).ready(function() {
   $("#datepicker").datepicker();
   $("#datepicker2").datepicker();
});
</script>

<style type="text/css">
<!--
.style1 {
	font-size: x-large;
	font-weight: bold;
}
.style2 {color: #008000}
.style3 {color: #F07800}
.style4 {color: #133D88}
.style5 {font-size: 10}
-->
</style>
<style type="text/css">
.th2 {     font-size: 14px;     font-weight: bold;     padding: 1px;     background: #3399FF;
     border-top: 1px solid #aabcfe;    border-bottom: 1px solid #fff; color: #fff; }
.td1 {    padding: 1px;     background: #AADFFF;     border-bottom: 1px solid #fff;
     color: #669;    border-top: 1px solid transparent; }
.td2 {    padding: 1px;     background: #84D1FF;     border-bottom: 1px solid #fff;
     color: #000;    border-top: 1px solid transparent; }
.td3 {    padding: 1px;     background: #0033cc;     border-bottom: 1px solid #fff;
     color: #fff;    border-top: 1px solid transparent; }

.style6 {color: #0000FF}
</style>
</head>
<body>

<%
 header
 response.write(now)
 if busca="" or busca=null then
  origen=doc
 end if
 if minactual>49 and minactual<55 then                    '       ********** minuto 50
  d="/"    
  ctipomov1="FACTURA"
  ctipomov2="REMISION"
  sla="/"    
  cero1="00"
  cero2="0000"

  'lfecinicio= "20180910"
  'lfecfinal=  "20180910"
  'lfecinicial="20180906"
  '''''''''''''''''''''''  Todas las fechas IGUAL
 lfecinicio= "20200908"
 lfecfinal=  "20200908"
 lfecinicial="20200908"
 ldaterep="09/08/2020"
  response.write("FROM: "&lfecinicio&" ")
  'response.write(lfecinicio&" ")
  response.write("TO: "&lfecfinal&"<br>")
 
  ReDim TransDias(7,105)
  ReDim Trucking(7,5)
  Dim Rstrans
  Dim sqltrans
  ReDim Transxhora(24,10)

  set Rstrans=dbsql.execute("select b.local_cd, (select code_nm from sta010t(nolock) where major_cd = '9016' and minor_cd = b.local_cd) local_nm, a.trans_date trans_date1, right(a.real_trans  ,6) trans_date,b.cust_cd, (select cust_nm from stb010t(nolock) where cust_cd = b.cust_cd) cust_nm, b.item, b.ord_no,     a.pallet_cnt,       b.qty prod_qty,       b.price,       c.mae_m2,       round(b.qty * b.price,3) prod_amt,   round(c.mae_m2 * b.qty,0) prod_m2,       (select code_nm from sta010t(nolock) where major_cd = '2004' and minor_cd = a.trans_class) work_gubun, case isnull(b.loc_no,'') when '' then '' else (select code_nm from sta010t(nolock) where major_cd = '9160' and minor_cd = b.loc_no) end loc_no, a.trans_time, right(a.prt_date,6) prt_day,d.item_class,   1 cnt, d.proc_cd1, d.good_type  from bar_code a(nolock), inout_table b(nolock), boa010t c(nolock), stb040t d(nolock) where a.bar_code   = b.bar_code   and b.class  = '1'   and a.chk_bit = '1'   and a.crp_id  = '10'   and b.local_cd  like '%'   and a.goods_class = c.goods_class   and a.ord_date = c.ord_date   and a.ord_seq = c.ord_seq   and c.cust_cd = d.cust_cd    and c.good_cd = d.good_cd   and a.real_trans between '" & lfecinicio & "'  and '" & lfecfinal & "'   and b.cust_cd like '%'  and b.item like '%'   and a.trans_class   like '%'   and b.loc_no like '%'   and d.item_class    like '%' and b.local_cd= (case when a.loc_no='TR' then '1' else '3' end) order by a.real_trans, a.trans_date, a.trans_time, b.cust_cd, b.item, b.ord_no,b.local_cd,  a.trans_class, case when a.trans_date <> a.real_trans then '1' else '0' end , a.pallet_cnt")
'and b.prod_flag = '1'   

   If Rstrans.EOF And Rstrans.BOF Then  '2
    'response.write("No existen datos")
    ExisteUsuario = False   
    Msg = "No records exist for this date."
    Style = vbDefaultButton2
    Title = "Msg from System"
    Help = ""
    ctxt = 1000
    'Response = MsgBox(Msg, Style, Title, Help, ctxt)
   Else
    lsamsungqty=0
    lsamq1=0
    lsamq2=0
    lsammt1=0
    lsammt2=0
    lsama1=0
    lsama2=0
    lsamsungqty1s=0
    lsamsungqty2s=0
    lsamsungqty3s=0
    lsamsungqty4s=0
    lsamsungm2=0
    lsamsungm21s=0
    lsamsungm22s=0
    lsamsungm23s=0
    lsamsungm24s=0
	   
    lsamsungamt=0
    lotherqty=0
    lotherm2=0
    lotheramt=0
    lotherqtysh=0
    lotherm2sh=0
    lotheramtsh=0
    lTotalQty = 0 
    lTotalM2 = 0
    lTotalAmt =0
    lOBxQty=0
    lOBxM2=0
    lOBxAmt=0
    lqty12=0
    lqty2s=0
    lqty3s=0
    lm21s=0
    lm22s=0
    lm23s=0
    lsamvb=0
    lOTsamsungqty=0
    lOBxqty1s=0
    lOBxqty2s=0
    lOBxqty3s=0

    lOBxM2B11s=0
    lOBxM2B12s=0
    lOBxM2B13s=0
    lOBxAMTB11s=0
    lOBxAMTB12s=0
    lOBxAMTB13s=0

    lOBxqtybd3s1=0
    lOBxqtybd3s2=0
    lOBxqtybd3s3=0
    lOBxM2bd3s1=0
    lOBxM2bd3s2=0
    lOBxM2bd3s3=0
    lOBxAMTbd3s1=0
    lOBxAMTbd3s2=0
    lOBxAMTbd3s3=0

    Rstrans.MoveFirst
      ltransdate1=Rstrans("trans_date")
	  ldaytrans=Rstrans("trans_date")
	  ltranstime1=Rstrans("trans_time")
	  lcte=0
	'response.write("hora: "&Rstrans("trans_time"))

   Do While Not Rstrans.EOF   '2

 	  ltranstime=Rstrans("trans_time")
      localm2=cdbl(Rstrans("prod_m2"))
      lTotalQty = lTotalQty+ cdbl(Rstrans("prod_qty"))
      lTotalM2 = lTotalM2 + cdbl(localm2)
      lTotalAmt = lTotalAmt+ cdbl(Rstrans("prod_amt"))
	  litemclass="00"

      litemclass=Rstrans("item_class")

      'if ltranstime>"064959" and ltranstime<"152000" then
	  if Rstrans("work_gubun")="1S" then
       lqty1s=lqty1s+ cdbl(Rstrans("prod_qty"))
	   lm21s= lm21s+ cdbl(localm2)
	   
       if Rstrans("local_nm")="WH1" then
         lqty1sbd1=lqty1sbd1+ cdbl(Rstrans("prod_qty"))
         lm21sbd1= lm21sbd1+ cdbl(localm2)
		 lamtb1s1= lamtb1s1+ cdbl(Rstrans("prod_amt"))
		 if Rstrans("proc_cd1")="11A" or Rstrans("proc_cd1")="22A" then
	      lotherqtysh11= lotherqtysh11 + cdbl(Rstrans("prod_qty"))
          lotherm2sh11= lotherm2sh11 + cdbl(localm2)
          lotheramtsh11= lotheramtsh11 + cdbl(Rstrans("prod_amt"))
	     end if
       else
         lqty1sbd3=lqty1sbd3+ cdbl(Rstrans("prod_qty"))
         lm21sbd3= lm21sbd3+ cdbl(localm2)
		 lamtb3s1= lamtb3s1+ cdbl(Rstrans("prod_amt"))
		 if Rstrans("proc_cd1")="11A" or Rstrans("proc_cd1")="22A" then
	      lotherqtysh21= lotherqtysh21 + cdbl(Rstrans("prod_qty"))
          lotherm2sh21= lotherm2sh21 + cdbl(localm2)
          lotheramtsh21= lotheramtsh21 + cdbl(Rstrans("prod_amt"))
	     end if
       end if
	  end if
	  'if ltranstime>"151959" and ltranstime<"232001" then
	  if Rstrans("work_gubun")="2S" then
       lqty2s=lqty2s+ cdbl(Rstrans("prod_qty"))
	   lm22s= lm22s+ cdbl(localm2)
       if Rstrans("local_nm")="WH1" then
         lqty2sbd1=lqty2sbd1+ cdbl(Rstrans("prod_qty"))
         lm22sbd1= lm22sbd1+ cdbl(localm2)
		 lamtb1s2= lamtb1s2+ cdbl(Rstrans("prod_amt"))
		if Rstrans("proc_cd1")="11A" or Rstrans("proc_cd1")="22A" then
	      lotherqtysh12= lotherqtysh12 + cdbl(Rstrans("prod_qty"))
          lotherm2sh12= lotherm2sh12 + cdbl(localm2)
          lotheramtsh12= lotheramtsh12 + cdbl(Rstrans("prod_amt"))
	     end if
       else
         lqty2sbd3=lqty2sbd3+ cdbl(Rstrans("prod_qty"))
         lm22sbd3= lm22sbd3+ cdbl(localm2)
         lamtb3s2= lamtb3s2+ cdbl(Rstrans("prod_amt"))
		 if Rstrans("proc_cd1")="11A" or Rstrans("proc_cd1")="22A" then
	      lotherqtysh22= lotherqtysh22 + cdbl(Rstrans("prod_qty"))
          lotherm2sh22= lotherm2sh22 + cdbl(localm2)
          lotheramtsh22= lotheramtsh22 + cdbl(Rstrans("prod_amt"))
	     end if
       end if
	  end if
	  'if ltranstime>"231959" then
	  if Rstrans("work_gubun")="3S" then
       lqty4s=lqty4s+ cdbl(Rstrans("prod_qty"))
	   lm24s= lm24s+ cdbl(localm2)
	   lshift=4
        if Rstrans("local_nm")="WH1" then
         lqty3sbd1=lqty3sbd1+ cdbl(Rstrans("prod_qty"))
         lm23sbd1= lm23sbd1+ cdbl(localm2)
		 lamtb1s3= lamtb1s3+ cdbl(Rstrans("prod_amt"))
		 if Rstrans("proc_cd1")="11A" or Rstrans("proc_cd1")="22A" then
	      lotherqtysh13= lotherqtysh13 + cdbl(Rstrans("prod_qty"))
          lotherm2sh13= lotherm2sh13 + cdbl(localm2)
          lotheramtsh13= lotheramtsh13 + cdbl(Rstrans("prod_amt"))
	     end if
       else
         lqty3sbd3=lqty3sbd3+ cdbl(Rstrans("prod_qty"))
         lm23sbd3= lm23sbd3+ cdbl(localm2)
         lamtb3s3= lamtb3s3+ cdbl(Rstrans("prod_amt"))
		 if Rstrans("proc_cd1")="11A" or Rstrans("proc_cd1")="22A" then
	      lotherqtysh23= lotherqtysh23 + cdbl(Rstrans("prod_qty"))
          lotherm2sh23= lotherm2sh23 + cdbl(localm2)
          lotheramtsh23= lotheramtsh23 + cdbl(Rstrans("prod_amt"))
	     end if
       end if
	  end if

     if Rstrans("cust_cd")="20001" then     'CTE
       lcte=1
	   lsamsungqty=lsamsungqty+ cdbl(Rstrans("prod_qty"))
       lsamsungm2= lsamsungm2+ cdbl(localm2)
       lsamsungamt= lsamsungamt+ cdbl(Rstrans("prod_amt"))
	   if litemclass="03" then
	     'lsamq1=lsamq1+ cdbl(Rstrans("prod_qty"))
         'lsammt1= lsammt1+ cdbl(localm2)
         'lsama1= lsama1+ cdbl(Rstrans("prod_amt"))
         lsamvb=lsamvb+ cdbl(Rstrans("prod_qty"))
	   else 
''''''''''''''''''''********* O/B SAMSUNG
        set Rsinven2=cnn.execute("select * from SamsungItems where good_nm='" & Rstrans("item") & "'")
       if not Rsinven2.eof then    'RS
          rsinven2.movefirst
	      ltypeBox=rsinven2("Note_4")
	      ltypeBox2=rsinven2("Note_5")
	     
	      if rsinven2("Note_5")= "INBOX / PAD" then
	        lOTSamsungqty = lOTSamsungqty + cdbl(Rstrans("prod_qty"))
            litemx=rsinven2("Note_5")&"ot"
		  end if
		  if rsinven2("Note_5")= "NA" and rsinven2("Note_4")<> "FULL LITHO" and rsinven2("Note_4")<> "PRINTING" and rsinven2("Note_4")<> "SPOT" then  'PAD
	        lOTSamsungqty = lOTSamsungqty + cdbl(Rstrans("prod_qty"))
            litemx=rsinven2("Note_5")&"ot"
		  end if	
''''''''''''
          qtytrans1=0
		  qtytrans3=0
         if rsinven2("Note_5")= "FULL LITHO" OR rsinven2("Note_5")= "PRINTING" OR rsinven2("Note_5")= "SPOT" OR rsinven2("Note_4")= "FULL LITHO" OR rsinven2("Note_4")= "PRINTING" OR rsinven2("Note_4")="SPOT" then  'PAD

	         if Rstrans("local_nm")="WH1" then
			   qtytrans1=cdbl(Rstrans("prod_qty"))
	           lOBxqty = lOBxqty + cdbl(Rstrans("prod_qty"))
               'if ltranstime>"064959" and ltranstime<"152000" then
			   if Rstrans("work_gubun")="1S" then
                 lOBxqty1s = lOBxqty1s + cdbl(Rstrans("prod_qty"))
				 lOBxM2B11s=lOBxM2B11s+ cdbl(localm2)
	             lOBxAMTB11s =lOBxAMTB11s + cdbl(Rstrans("prod_amt"))
				 
               end if
	           'if ltranstime>"151959" and ltranstime<"232000" then
			   if Rstrans("work_gubun")="2S" then
                 lOBxqty2s = lOBxqty2s + cdbl(Rstrans("prod_qty"))
				 lOBxM2B12s=lOBxM2B12s+ cdbl(localm2)
	             lOBxAMTB12s =lOBxAMTB12s + cdbl(Rstrans("prod_amt"))
				 
               end if
               'if ltranstime>"231959" or ltranstime<"065000" then
			   if Rstrans("work_gubun")="3S" then
                 lOBxqty3s = lOBxqty3s + cdbl(Rstrans("prod_qty"))
				 lOBxM2B13s=lOBxM2B13s+ cdbl(localm2)
	             lOBxAMTB13s =lOBxAMTB13s + cdbl(Rstrans("prod_amt"))
				 
               end if

             else
               qtytrans3=cdbl(Rstrans("prod_qty"))
               lOBxqtybd3 = lOBxqtybd3 + cdbl(Rstrans("prod_qty"))
               'if ltranstime>"064959" and ltranstime<"152000" then
			   if Rstrans("work_gubun")="1S" then
                 lOBxqtybd3s1 = lOBxqtybd3s1 + cdbl(Rstrans("prod_qty"))
				 lOBxM2BD3s1=lOBxM2BD3s1 + cdbl(localm2)
	             lOBxAMTBD3s1 =lOBxAMTBD3s1 + cdbl(Rstrans("prod_amt"))
				 
               end if
               'if ltranstime>"151959" and ltranstime<"232000" then
			   if Rstrans("work_gubun")="2S" then
                 lOBxqtybd3s2 = lOBxqtybd3s2 + cdbl(Rstrans("prod_qty"))
				 lOBxM2BD3s2=lOBxM2BD3s2 + cdbl(localm2)
	             lOBxAMTBD3s2 =lOBxAMTBD3s2 + cdbl(Rstrans("prod_amt"))
				 
               end if
               'if ltranstime>"231959" or ltranstime<"065000" then
			   if Rstrans("work_gubun")="3S" then
                 lOBxqtybd3s3 = lOBxqtybd3s3 + cdbl(Rstrans("prod_qty"))
				 lOBxM2BD3s3=lOBxM2BD3s3 + cdbl(localm2)
	             lOBxAMTBD3s3 =lOBxAMTBD3s3 + cdbl(Rstrans("prod_amt"))
				 
               end if

             end if
             lOBxM2 = lOBxM2 + cdbl(localm2)
	         lOBxAmt =lOBxAmt + cdbl(Rstrans("prod_amt"))
             
             litemx=rsinven2("Note_5")

          ''''''''''''''''''''' por hora
		  if ltranstime>"064959" and ltranstime<"075000" then
		    Transxhora(1,1)=ltransdate1
			Transxhora(1,2)=ltranstime
			Transxhora(1,3)=cdbl(Transxhora(1,3)) + cdbl(qtytrans1)
			Transxhora(1,6)=cdbl(Transxhora(1,6)) + cdbl(qtytrans3)
			llines=1
		  end if
		  if ltranstime>"074959" and ltranstime<"085000" then
		    Transxhora(2,1)=ltransdate1
			Transxhora(2,2)=ltranstime
			Transxhora(2,3)=cdbl(Transxhora(2,3)) + cdbl(qtytrans1)
			Transxhora(2,6)=cdbl(Transxhora(2,6)) + cdbl(qtytrans3)
			llines=2
		  end if
		  if ltranstime>"084959" and ltranstime<"095000" then
		    Transxhora(3,1)=ltransdate1
			Transxhora(3,2)=ltranstime
			Transxhora(3,3)=cdbl(Transxhora(3,3)) + cdbl(qtytrans1)
			Transxhora(3,6)=cdbl(Transxhora(3,6)) + cdbl(qtytrans3)
			llines=3
		  end if
		  if ltranstime>"094959" and ltranstime<"105000" then
		    Transxhora(4,1)=ltransdate1
			Transxhora(4,2)=ltranstime
			Transxhora(4,3)=cdbl(Transxhora(4,3)) + cdbl(qtytrans1)
			Transxhora(4,6)=cdbl(Transxhora(4,6)) + cdbl(qtytrans3)
			llines=4
		  end if
		  if ltranstime>"104959" and ltranstime<"115000" then
		    Transxhora(5,1)=ltransdate1
			Transxhora(5,2)=ltranstime
			Transxhora(5,3)=cdbl(Transxhora(5,3)) + cdbl(qtytrans1)
			Transxhora(5,6)=cdbl(Transxhora(5,6)) + cdbl(qtytrans3)
			llines=5
		  end if
		  if ltranstime>"114959" and ltranstime<"125000" then
		    Transxhora(6,1)=ltransdate1
			Transxhora(6,2)=ltranstime
			Transxhora(6,3)=cdbl(Transxhora(6,3)) + cdbl(qtytrans1)
			Transxhora(6,6)=cdbl(Transxhora(6,6)) + cdbl(qtytrans3)
			llines=6
		  end if
		  if ltranstime>"124959" and ltranstime<"135000" then
		    Transxhora(7,1)=ltransdate1
			Transxhora(7,2)=ltranstime
			Transxhora(7,3)=cdbl(Transxhora(7,3)) + cdbl(qtytrans1)
			Transxhora(7,6)=cdbl(Transxhora(7,6)) + cdbl(qtytrans3)
			llines=7
		  end if
		  if ltranstime>"134959" and ltranstime<"145000" then
		    Transxhora(8,1)=ltransdate1
			Transxhora(8,2)=ltranstime
			Transxhora(8,3)=cdbl(Transxhora(8,3)) + cdbl(qtytrans1)
			Transxhora(8,6)=cdbl(Transxhora(8,6)) + cdbl(qtytrans3)
			llines=8
		  end if
		  if ltranstime>"144959" and ltranstime<"155000" then
		    Transxhora(9,1)=ltransdate1
			Transxhora(9,2)=ltranstime
			Transxhora(9,3)=cdbl(Transxhora(9,3)) + cdbl(qtytrans1)
			Transxhora(9,6)=cdbl(Transxhora(9,6)) + cdbl(qtytrans3)
			llines=9
		  end if
		  
		  if ltranstime>"154959" and ltranstime<"165000" then
		    Transxhora(10,1)=ltransdate1
			Transxhora(10,2)=ltranstime
			Transxhora(10,4)=cdbl(Transxhora(10,4)) + cdbl(qtytrans1)
			Transxhora(10,7)=cdbl(Transxhora(10,7)) + cdbl(qtytrans3)
			llines=10
		  end if
		  if ltranstime>"164959" and ltranstime<"175000" then
		    Transxhora(11,1)=ltransdate1
			Transxhora(11,2)=ltranstime
			Transxhora(11,4)=cdbl(Transxhora(11,4)) + cdbl(qtytrans1)
			Transxhora(11,7)=cdbl(Transxhora(11,7)) + cdbl(qtytrans3)
			llines=11
		  end if
		  if ltranstime>"174959" and ltranstime<"185000" then
		    Transxhora(12,1)=ltransdate1
			Transxhora(12,2)=ltranstime
			Transxhora(12,4)=cdbl(Transxhora(12,4)) + cdbl(qtytrans1)
			Transxhora(12,7)=cdbl(Transxhora(12,7)) + cdbl(qtytrans3)
			llines=12
		  end if
		  if ltranstime>"184959" and ltranstime<"195000" then
		    Transxhora(13,1)=ltransdate1
			Transxhora(13,2)=ltranstime
			Transxhora(13,4)=cdbl(Transxhora(13,4)) + cdbl(qtytrans1)
			Transxhora(13,7)=cdbl(Transxhora(13,7)) + cdbl(qtytrans3)
			llines=13
		  end if
		  if ltranstime>"194959" and ltranstime<"205000" then
		    Transxhora(14,1)=ltransdate1
			Transxhora(14,2)=ltranstime
			Transxhora(14,4)=cdbl(Transxhora(14,4)) + cdbl(qtytrans1)
			Transxhora(14,7)=cdbl(Transxhora(14,7)) + cdbl(qtytrans3)
			llines=14
		  end if
		  if ltranstime>"204959" and ltranstime<"215000" then
		    Transxhora(15,1)=ltransdate1
			Transxhora(15,2)=ltranstime
			Transxhora(15,4)=cdbl(Transxhora(15,4)) + cdbl(qtytrans1)
			Transxhora(15,7)=cdbl(Transxhora(15,7)) + cdbl(qtytrans3)
			llines=15
		  end if
		  if ltranstime>"214959" and ltranstime<"225000" then
		    Transxhora(16,1)=ltransdate1
			Transxhora(16,2)=ltranstime
			Transxhora(16,4)=cdbl(Transxhora(16,4)) + cdbl(qtytrans1)
			Transxhora(16,7)=cdbl(Transxhora(16,7)) + cdbl(qtytrans3)
			llines=16
		  end if
		  if ltranstime>"224959" and ltranstime<"235000" then
		    Transxhora(17,1)=ltransdate1
			Transxhora(17,2)=ltranstime
			Transxhora(17,4)=cdbl(Transxhora(17,4)) + cdbl(qtytrans1)
			Transxhora(17,7)=cdbl(Transxhora(17,7)) + cdbl(qtytrans3)
			llines=17
		  end if
		  if ltranstime>"234959" or ltranstime<"005000" then
		    Transxhora(18,1)=ltransdate1
			Transxhora(18,2)=ltranstime
			Transxhora(18,5)=cdbl(Transxhora(18,5)) + cdbl(qtytrans1)
			Transxhora(18,8)=cdbl(Transxhora(18,8)) + cdbl(qtytrans3)
			llines=18
		  end if
		  if ltranstime>"004959" and ltranstime<"015000" then
		    Transxhora(19,1)=ltransdate1
			Transxhora(19,2)=ltranstime
			Transxhora(19,5)=cdbl(Transxhora(19,5)) + cdbl(qtytrans1)
			Transxhora(19,8)=cdbl(Transxhora(19,8)) + cdbl(qtytrans3)
			llines=19
		  end if
		  if ltranstime>"014959" and ltranstime<"025000" then
		    Transxhora(20,1)=ltransdate1
			Transxhora(20,2)=ltranstime
			Transxhora(20,5)=cdbl(Transxhora(20,5)) + cdbl(qtytrans1)
			Transxhora(20,8)=cdbl(Transxhora(20,8)) + cdbl(qtytrans3)
			llines=20
		  end if
		  if ltranstime>"024959" and ltranstime<"035000" then
		    Transxhora(21,1)=ltransdate1
			Transxhora(21,2)=ltranstime
			Transxhora(21,5)=cdbl(Transxhora(21,5)) + cdbl(qtytrans1)
			Transxhora(21,8)=cdbl(Transxhora(21,8)) + cdbl(qtytrans3)
			llines=21
		  end if
		  if ltranstime>"034959" and ltranstime<"045000" then
		    Transxhora(22,1)=ltransdate1
			Transxhora(22,2)=ltranstime
			Transxhora(22,5)=cdbl(Transxhora(22,5)) + cdbl(qtytrans1)
			Transxhora(22,8)=cdbl(Transxhora(22,8)) + cdbl(qtytrans3)
			llines=22
		  end if
		  if ltranstime>"044959" and ltranstime<"055000" then
		    Transxhora(23,1)=ltransdate1
			Transxhora(23,2)=ltranstime
			Transxhora(23,5)=cdbl(Transxhora(23,5)) + cdbl(qtytrans1)
			Transxhora(23,8)=cdbl(Transxhora(23,8)) + cdbl(qtytrans3)
			llines=23
		  end if
		  if ltranstime>"054959" and ltranstime<"065000" then
		    Transxhora(24,1)=ltransdate1
			Transxhora(24,2)=ltranstime
			Transxhora(24,5)=cdbl(Transxhora(24,5)) + cdbl(qtytrans1)
			Transxhora(24,8)=cdbl(Transxhora(24,8)) + cdbl(qtytrans3)
			llines=24
		  end if
		  xmin=int(mid(ltranstime,3,2))
		  xhr=int(mid(ltranstime,1,2))
		  if (xhr=hractual and xmin>49) then
		    llines=(llines-1)
		  end if
		  if hractual=7 then
		   llines=1
		  end if
		  if hractual=8 then
		   llines=2
		  end if
		  if hractual=9 then
		   llines=3
		  end if
		  if hractual=10 then
		   llines=4
		  end if
		  if hractual=11 then
		   llines=5
		  end if
		  if hractual=12 then
		   llines=6
		  end if
		  if hractual=13 then
		   llines=7
		  end if
		  if hractual=14 then
		   llines=8
		  end if
		  if hractual=15 then
		   llines=9
		  end if
		  if hractual=16 then
		   llines=10
		  end if
		  if hractual=17 then
		   llines=11
		  end if
		  if hractual=18 then
		   llines=12
		  end if
		  if hractual=19 then
		   llines=13
		  end if
		  if hractual=20 then
		   llines=14
		  end if
		  if hractual=21 then
		   llines=15
		  end if
		  if hractual=22 then
		   llines=16
		  end if
		  if hractual=23 then
		   llines=17
		  end if
		  if hractual=0 then
		   llines=18
		  end if
		  if hractual=1 then
		   llines=19
		  end if
		  if hractual=2 then
		   llines=20
		  end if
		  if hractual=3 then
		   llines=21
		  end if
		  if hractual=4 then
		   llines=22
		  end if
		  if hractual=5 then
		   llines=23
		  end if
		  if hractual=6 then
		   llines=24
		  end if
   
		  
		  ''''''''''''''''''''' por hora fin
		 
	     end if     'PAD
'''''''''''''''
       else
	       lOTSamsungqty = lOTSamsungqty + cdbl(Rstrans("prod_qty"))
           'lOTsamsungM2 = lOTsamsungM2 + localm2
	       'lOTsamsungamt =lOTsamsungamt+ cdbl(Rstrans("prod_amt"))
            litemx="no"
      end if  'RS

       Rsinven2.Close
       Set Rsinven2 = Nothing

'''''''''''''''''''''*********O/B SAMSUNG
         
'''''''''''''''''''''*********O/B SAMSUNG

      end if
     else
	   lotherqty= lotherqty+ cdbl(Rstrans("prod_qty"))
       lotherm2= lotherm2+ cdbl(localm2)
       lotheramt= lotheramt+ cdbl(Rstrans("prod_amt"))
       litemx="No samsung"
	   if Rstrans("proc_cd1")="11A" or Rstrans("proc_cd1")="22A" then
	    lotherqtysh= lotherqtysh + cdbl(Rstrans("prod_qty"))
        lotherm2sh= lotherm2sh + cdbl(localm2)
        lotheramtsh= lotheramtsh + cdbl(Rstrans("prod_amt"))
	   end if
     end if     'CTE
 
     Rstrans.MoveNext
     if not Rstrans.eof then
      ltransdate2=Rstrans("trans_date")
	  ltranstime2=Rstrans("trans_time")
	  ltranshr2=Rstrans("trans_time")
	 end if
	 
	 if (ltransdate1<>ltransdate2 ) or Rstrans.eof then
	 
	   'xdia=int(right(ltransdate1,2))
       x=3
	   TransDias(xdia,0)=xdia
	   TransDias(xdia,1)=lsamsungqty
	   TransDias(xdia,2)=lsamsungm2
	   TransDias(xdia,3)=lsamsungamt
	   TransDias(xdia,4)=lotherqty
	   TransDias(xdia,5)=lotherm2
	   TransDias(xdia,6)=lotheramt
	   TransDias(xdia,7)=lTotalQty
	   TransDias(xdia,8)=lTotalM2
	   TransDias(xdia,9)=lTotalAmt
	   TransDias(xdia,10)=lqty1s
	   TransDias(xdia,11)=lqty2s
	   TransDias(xdia,12)=lqty3s+lqty4s
	   TransDias(xdia,13)=lm21s
	   TransDias(xdia,14)=lm22s
	   TransDias(xdia,15)=lm23s+lm24s
	   TransDias(xdia,21)=lsamvb
	   TransDias(xdia,22)=lOTsamsungqty
	   TransDias(xdia,23)=lsama1
       TransDias(xdia,24)=lOBxqty

       TransDias(xdia,25)=lOBxM2
       TransDias(xdia,26)=lOBxAmt
	   TransDias(xdia,27)=lOBxqtybd3
       TransDias(xdia,28)=lOBxprodbd1
       TransDias(xdia,29)=lOBxprodbd3
	   
	   TransDias(xdia,61)=lOBxM2B11S
	   TransDias(xdia,62)=lOBxM2B12S
	   TransDias(xdia,63)=lOBxM2B13S
	   TransDias(xdia,64)=lOBxAMTB11S
	   TransDias(xdia,65)=lOBxAMTB12S
	   TransDias(xdia,66)=lOBxAMTB13S
	   
	   TransDias(xdia,67)=lOBxM2bd3s1
	   TransDias(xdia,68)=lOBxM2bd3s2
	   TransDias(xdia,69)=lOBxM2bd3s3
	   TransDias(xdia,70)=lOBxAMTbd3s1
	   TransDias(xdia,71)=lOBxAMTbd3s2
	   TransDias(xdia,72)=lOBxAMTbd3s3
	   
       TransDias(xdia,36)=lOBxqty1s
       TransDias(xdia,37)=lOBxqty2s
       TransDias(xdia,38)=lOBxqty3s
       TransDias(xdia,39)=lOBxqtybd3s1
       TransDias(xdia,40)=lOBxqtybd3s2
       TransDias(xdia,41)=lOBxqtybd3s3
      
       TransDias(xdia,42)=lqty1sbd1
       TransDias(xdia,43)=lqty2sbd1
       TransDias(xdia,44)=lqty3sbd1
       TransDias(xdia,45)=lm21sbd1
       TransDias(xdia,46)=lm22sbd1
       TransDias(xdia,47)=lm23sbd1
       TransDias(xdia,48)=lqty1sbd3
       TransDias(xdia,49)=lqty2sbd3
       TransDias(xdia,50)=lqty3sbd3
       TransDias(xdia,51)=lm21sbd3
       TransDias(xdia,52)=lm22sbd3
       TransDias(xdia,53)=lm23sbd3

       TransDias(xdia,73)=lamtb1s1
	   TransDias(xdia,74)=lamtb1s2
	   TransDias(xdia,75)=lamtb1s3
	   TransDias(xdia,76)=lamtb3s1
	   TransDias(xdia,77)=lamtb3s2
	   TransDias(xdia,78)=lamtb3s3
	   
	   TransDias(xdia,79)=lotherqtysh
	   TransDias(xdia,80)=lotherm2sh
	   TransDias(xdia,81)=lotheramtsh
	   TransDias(xdia,82)=lotherqtysh11
	   TransDias(xdia,83)=lotherm2sh11
	   TransDias(xdia,84)=lotheramtsh11
	   TransDias(xdia,85)=lotherqtysh12
	   TransDias(xdia,86)=lotherm2sh12
	   TransDias(xdia,87)=lotheramtsh12
	   TransDias(xdia,88)=lotherqtysh13
	   TransDias(xdia,89)=lotherm2sh13
	   TransDias(xdia,90)=lotheramtsh13
	   TransDias(xdia,91)=lotherqtysh21
	   TransDias(xdia,92)=lotherm2sh21
	   TransDias(xdia,93)=lotheramtsh21
	   TransDias(xdia,94)=lotherqtysh22
	   TransDias(xdia,95)=lotherm2sh22
	   TransDias(xdia,96)=lotheramtsh22
	   TransDias(xdia,97)=lotherqtysh23
	   TransDias(xdia,98)=lotherm2sh23	
	   TransDias(xdia,99)=lotheramtsh23
	   
       lsamsungqty=0
       lsamsungm2=0
       lsamsungamt=0

       lqty1s=0
       lqty2s=0
       lqty3s=0
	   lqty4s=0
       lm2=0
       lm21s=0
       lm22s=0
       lm23s=0
	   lm24s=0
       lgamt=0
       lotherqty=0
       lotherm2=0
       lotheramt=0
	   
       lTotalQty = 0 
       lTotalM2 = 0
       lTotalAmt =0
	   ltransdate1=ltransdate2
	   lsamvb=0
       lOTsamsungqty=0
       lsamq2=0
       lsammt1=0
       lsammt2=0
       lsama1=0
       lsama2=0
        lOBxqty=0
        lOBxM2=0
        lOBxAmt=0
        lOBxqtybd3=0
        lOBxprodbd1=0
        lOBxprodbd3=0
        lOBxqty1s=0
        lOBxqty2s=0
        lOBxqty3s=0
        lOBxM2B11s=0
        lOBxM2B12s=0
        lOBxM2B13s=0
        lOBxAMTB11s=0
        lOBxAMTB12s=0
        lOBxAMTB13s=0 
        lOBxqtybd3s1=0
        lOBxqtybd3s2=0
        lOBxqtybd3s3=0
        lOBxM2bd3s1=0
        lOBxM2bd3s2=0
        lOBxM2bd3s3=0
        lOBxAMTbd3s1=0
        lOBxAMTbd3s2=0
        lOBxAMTbd3s3=0

        lqty1sbd1=0
        lqty2sbd1=0
        lqty3sbd1=0
        lm21sbd1=0
        lm22sbd1=0
        lm23sbd1=0
        lqty1sbd3=0
        lqty2sbd3=0
        lqty3sbd3=0
        lm21sbd3=0
        lm22sbd3=0
        lm23sbd3=0
	   
	    lamtb1s1=0
	    lamtb1s2=0
	    lamtb1s3=0
	    lamtb3s1=0
	    lamtb3s2=0
	    lamtb3s3=0
	    lotherqtysh=0
        lotherm2sh=0
        lotheramtsh=0
	    lotherqtysh11=0
        lotherm2sh11=0
        lotheramtsh11=0
	    lotherqtysh12=0
        lotherm2sh12=0
        lotheramtsh12=0
	    lotherqtysh13=0
        lotherm2sh13=0
        lotheramtsh13=0
	    lotherqtysh21=0
        lotherm2sh21=0
        lotheramtsh21=0
	    lotherqtysh22=0
        lotherm2sh22=0
        lotheramtsh22=0
	    lotherqtysh23=0
        lotherm2sh23=0
        lotheramtsh23=0
	 else
	  
	 end if
   'end if

   Loop    '2
  End If   '2
  Rstrans.Close
  Set Rstrans = Nothing
  lxx=0
  'if lxx=1 then
  lfecini2=lfecinicio
  'lfecini2= Right("00" & year(Date()-1), 4)&Right("00" & month(Date()-1), 2)&Right("00" & Day(Date()-1), 2)
  lfecfin2=lfecinicio
  'lfecfin2= Right("00" & year(Date()-1), 4)&Right("00" & month(Date()-1), 2)&Right("00" & Day(Date()-1), 2)
  'response.write("fecha fin "&lfecfin2)
  do while lfecini2 <= lfecfinal  '3
    'response.write(" fecha ini "&lfecini2)
    'response.write(" fecha fin "&lfecfin2)
    set Rsprod=dbsql.execute("select a.prod_date, right(a.prod_date,6) prod_day, case a.proc_cd1 when '' then case a.proc_cd2 when '' then a.proc_cd3 else a.proc_cd2 end else a.proc_cd1 end proc_cd, a.work_gubun, case a.work_gubun when '0' then '1S' when '1' then '2S' when '2' then '3S' end as wrok_gubun_nm,b.cust_cd, b.good_nm, b.ord_qty, c.plan_qty, a.real_prod_qty, round(a.real_prod_qty * b.mae_m2 , 0) as prod_m2,a.bad_qty, a.extra_qty, isnull(a1.inv_qty,0) as inv_qty from bob030t a(nolock) left outer join ( select crp_id, goods_class, ord_date, ord_seq, plan_date, plan_seq, sum(plan_qty) plan_qty from bob010t(nolock) group by crp_id, goods_class, ord_date, ord_seq, plan_date, plan_seq) c  on a.crp_id = c.crp_id and a.goods_class = c.goods_class and a.ord_date = c.ord_date and a.ord_seq = c.ord_seq and  a.plan_date = c.plan_date and a.plan_seq = c.plan_seq left outer join ( select a.crp_id, a.ord_no, sum(a.qty) inv_qty   from inout_table a(nolock), bar_code b(nolock) where a.ord_no = 'B1' + substring(b.ord_date,3,6) + '-' + right('0000' + convert(varchar(4), b.ord_seq), 4) and b.chk_bit = '1' and b.bar_code = a.bar_code and b.trans_date = a.job_date and a.class = '1' group by a.crp_id, a.ord_no) a1 on a.crp_id = a1.crp_id and 'B1' + substring(a.ord_date,3,6) + '-' + right('0000' + convert(varchar(4), a.ord_seq), 4) = a1.ord_no, boa010t b(nolock) where a.crp_id = b.crp_id and b.cust_cd='20001' and a.goods_class = b.goods_class and a.ord_date = b.ord_date and a.ord_seq = b.ord_seq and b.del_yn = '0' and a.crp_id = '10' and (a.prod_date) between '" & lfecini2 & "' and '" & lfecfin2 & "' order by a.prod_date, b.good_nm, case a.proc_cd1 when '' then case a.proc_cd2 when '' then a.proc_cd3  else a.proc_cd2 end  else a.proc_cd1 end, a.ord_date, a.ord_seq")

  If Rsprod.EOF And Rsprod.BOF Then   '4
    'response.write("No existen datos. Prod")
  
  Else
      lOBxprodbd1=0
      lOBxprodbd3=0
      lOBxprodbd1lam=0
      lOBxprodbd3lam=0
      Rsprod.MoveFirst
      TransDias(0,28)=lOBxprodbd1
      TransDias(0,29)=lOBxprodbd3
      TransDias(0,30)=lOBxprodbd1lam
      TransDias(0,31)=lOBxprodbd3lam
      lproddate1=Rsprod("prod_date")
	  lcte=0
  Do While Not Rsprod.EOF     '4
 	  if Rsprod("cust_cd")="20001" then     'CTE
       lcte=1
	''''''''''''''''''''********* O/B SAMSUNG
        set Rsinven2=cnn.execute("select * from SamsungItems where good_nm='" & Rsprod("good_nm") & "'")
        if not Rsinven2.eof then    'RS
          rsinven2.movefirst
	    
	      if rsinven2("Note_5")= "INBOX / PAD" or rsinven2("Note_5")= "NA" then  'PAD
	
	      else
            if rsinven2("Note_5")= "FULL LITHO" or rsinven2("Note_5")= "PRINTING" or rsinven2("Note_5")= "SPOT" then
	         if Rsprod("proc_cd")=551 or Rsprod("proc_cd")=501 then
               if Rsprod("proc_cd")=551 then
                 lOBxprodBD3 = lOBxprodBD3 + cdbl(Rsprod("real_prod_qty"))
                else
	             lOBxprodBD3lam = lOBxprodBD3lam + cdbl(Rsprod("real_prod_qty"))
	            end if
                lOBxprodBD3lam = lOBxprodBD3lam + cdbl(Rsprod("real_prod_qty"))
             else
                 
               if (Rsprod("proc_cd")>230 and Rsprod("proc_cd")<241) or  Rsprod("proc_cd")=246 or  Rsprod("proc_cd")=247 then
                lOBxprodbd1 = lOBxprodbd1 + cdbl(Rsprod("real_prod_qty"))
               else
                 lOBxprodbd1lam = lOBxprodbd1lam + cdbl(Rsprod("real_prod_qty"))
               end if
			   
             end if
			 
  	        ELSE
            END IF
	     end if     'PAD
       else
	       'lOTSamsungqty = lOTSamsungqty + cdbl(Rsprod("real_prod_qty"))
           ' litemx="no"
      end if  'RS
       Rsinven2.Close
       Set Rsinven2 = Nothing
'''''''''''''''''''''*********O/B SAMSUNG
     else
	   'lotherqty= lotherqty+ cdbl(Rsprod("real_prod_qty"))
       'lotherm2= lotherm2+ cdbl(localm2)
       'litemx="No samsung"
     end if     'CTE
 
     Rsprod.MoveNext
     if not Rsprod.eof then
      lproddate2=Rsprod("prod_date")
	 end if
	 
	 if (lproddate1<>lproddate2 ) or Rsprod.eof then
	   'xdia=int(right(lproddate1,2))
       xdia=3
	   TransDias(xdia,28)=lOBxprodbd1
       TransDias(xdia,29)=lOBxprodbd3
       TransDias(xdia,30)=lOBxprodbd1lam
       TransDias(xdia,31)=lOBxprodbd3lam

	   lOBxprodbd1=0
       lOBxprodbd3=0
       lOBxprodbd1lam=0
       lOBxprodbd3lam=0
	 else
	  
	 end if
    Loop   '4
   End If  '4
    lfecini3=int(lfecini2)+1
    lfecini2=cstr(lfecini3)
    lfecfin2=cstr(lfecini3)
  loop   '3

 
Rsprod.Close
 Set Rsprod = Nothing
dbsql.Close
Set dbsql = Nothing 
dbsql2.Close
Set dbsql2 = Nothing 

%>

<div align="center"><center>
 
<span class="style1 style6"> TRANSFER (by day) </span>
<%=formatnumber(TransDias(i,29),0)%>
<table border="2">
  <tr bgcolor="#C1FFC1">
    <th colspan="2" bgcolor="#FF8000" scope="col"><%=MonthName(Month(Date), False) %>&nbsp;Generated: <%=time%></th>
    <% 
xnumerodias=0
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th width="101" scope="col" bgcolor="#C1FFC1"><div align="center"><%=TransDias(i,0)%></div></th>
    <th width="101" scope="col" bgcolor="#FFD2D2">M2</th>
    <th width="101" scope="col" bgcolor="#FFD2D2">AMT</th>
    <% 
 if TransDias(i,0)>0 then
  xnumerodias=xnumerodias+1
 end if
next
xnumerodias=1
%>
    <th width="101" bgcolor="#C1FFC1"  scope="col"><div align="center">TOTAL</div></th>
    <th width="67" bgcolor="#C1FFC1"  scope="col"><div align="center">AVG</div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#FFFFB0" align="right">Samsung VB</th>
    <th scope="col" bgcolor="#FFFFB0">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFB0"><div align="right"><%=formatnumber(TransDias(i,21),0)%></div></th>
    <th width="101" scope="col" bgcolor="#FFD2D2"></th>
    <th width="101" scope="col" bgcolor="#FFD2D2"></th>
    <%
  xtotalsamq1=xtotalsamq1+TransDias(i,21)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamq1,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamq1/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#FFFFB0" align="right">Samsung Others </th>
    <th scope="col" bgcolor="#FFFFB0">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFB0"><div align="right"><%=formatnumber(TransDias(i,22),0)%></div></th>
    <th width="101" scope="col" bgcolor="#FFD2D2">.</th>
    <th width="101" scope="col" bgcolor="#FFD2D2">.</th>
    <%
  xstotalsamq1=xstotalsamq1+TransDias(i,22)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xstotalsamq1,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xstotalsamq1/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th valign="middle" rowspan="18" width="94" scope="col" bgcolor="#FFB7B7">Samsung O/B QTY</th>
    <th valign="middle" bgcolor="#FFB7B7" scope="col">BD 1 Prod F </th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
 if TransDias(i,1)>0 then%>
    <th width="101" scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(TransDias(i,28),0)%></div></th>
    <th width="101" scope="col" bgcolor="#FFD2D2">.</th>
    <th width="101" scope="col" bgcolor="#FFD2D2">.</th>
    <%else%>
    <th width="101" scope="col" bgcolor="#FFD2D2"><div align="right"> <%=formatnumber(TransDias(i,28),0)%></div></th>
    <%
end if
  xOBbd1f=xOBbd1f+TransDias(i,28)
 
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xOBbd1f,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xOBbd1f/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th valign="middle" bgcolor="#FFB7B7" scope="col">BD 1 Prod L</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
 if TransDias(i,1)>0 then%>
    <th width="101" scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(TransDias(i,30),0)%></div></th>
    <th width="101" scope="col" bgcolor="#FFD2D2">.</th>
    <th width="101" scope="col" bgcolor="#FFD2D2">.</th>
    <%else%>
    <th width="101" scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(TransDias(i,30),0)%></div></th>
    <%
end if
  xOBbd1l=xOBbd1l+TransDias(i,30)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xOBbd1l,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xOBbd1l/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th bgcolor="#CCFFE6" scope="col"><div align="right">T 1S</div></th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,36),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,61),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,64),0)%></div></th>
    <%else%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,36),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,61),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,64),0)%></div></th>
    <%

end if
  xtotalsamqtyOB1s=xtotalsamqtyOB1s+TransDias(i,36)
  xtotalsamM2OB1s=xtotalsamM2OB1s+TransDias(i,61)
  xtotalsamAMTOB1s=xtotalsamAMTOB1s+TransDias(i,64)
next

%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOB1s,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOB1s/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#CCFFE6"><div align="right">T 2S</div></th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,37),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,62),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,65),0)%></div></th>
    <%else%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,37),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,62),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,65),0)%></div></th>
    <%
end if
  xtotalsamqtyOB2s=xtotalsamqtyOB2s+TransDias(i,37)
  xtotalsamM2OB2s=xtotalsamM2OB2s+TransDias(i,62)
  xtotalsamAMTOB2s=xtotalsamAMTOB2s+TransDias(i,65)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOB2s,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOB2s/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#CCFFE6"><div align="right">T 3S</div></th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,38),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,63),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,66),0)%></div></th>
    <%else%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,38),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,63),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,66),0)%></div></th>
    <%
end if
  xtotalsamqtyOB3s=xtotalsamqtyOB3s+TransDias(i,38)
  xtotalsamM2OB3s=xtotalsamM2OB3s+TransDias(i,63)
  xtotalsamAMTOB3s=xtotalsamAMTOB3s+TransDias(i,66)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOB3s,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOB3s/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th width="73" scope="col" bgcolor="#CCFFE6">BD 1 Trans </th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,24),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,61)+TransDias(i,62)+TransDias(i,63),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,64)+TransDias(i,65)+TransDias(i,66),0)%></div></th>
    <%else%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,24),0)%></div></th>
    <%
end if
  xtotalsamqtyOB=xtotalsamqtyOB+TransDias(i,24)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOB,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOB/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#FFB7B7">BD 3 Prod F</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th width="101" scope="col" bgcolor="#FFD2D2"><div align="right"></div></th>
    <%else%>
    <th width="101" scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(TransDias(i,29),0)%></div></th>
    <%
end if
  xOBbd3f=xOBbd3f+TransDias(i,29)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xOBbd3f,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xOBbd3f/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#FFB7B7">BD 3 Prod L </th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th width="101" scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(TransDias(i,31),0)%></div></th>
    <%else%>
    <th width="101" scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(TransDias(i,31),0)%></div></th>
    <%
end if
  xOBbd3l=xOBbd3l+TransDias(i,31)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xOBbd3l,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xOBbd3l/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#CCFFE6"><div align="right">1S</div></th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,39),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,67),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,70),0)%></div></th>
    <%else%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,39),0)%></div></th>
    <%
end if
  xtotalsamqtyOBbd31s=xtotalsamqtyOBbd31s+TransDias(i,39)
  xtotalsamM2OBbd31s=xtotalsamM2OBbd31s+TransDias(i,67)
  xtotalsamAMTOBbd31s=xtotalsamAMTOBbd31s+TransDias(i,70)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOBbd31s,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOBbd31s/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#CCFFE6"><div align="right">2S</div></th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,40),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,68),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,71),0)%></div></th>
    <%else%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,40),0)%></div></th>
    <%
end if
  xtotalsamqtyOBbd32s=xtotalsamqtyOBbd32s+TransDias(i,40)
  xtotalsamM2OBbd32s=xtotalsamM2OBbd32s+TransDias(i,68)
  xtotalsamAMTOBbd32s=xtotalsamAMTOBbd32s+TransDias(i,71)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOBbd32s,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOBbd32s/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#CCFFE6"><div align="right">3S</div></th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,41),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,69),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,72),0)%></div></th>
    <%else%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,41),0)%></div></th>
    <%
end if
  xtotalsamqtyOBbd33s=xtotalsamqtyOBbd33s+TransDias(i,41)
  xtotalsamM2OBbd33s=xtotalsamM2OBbd33s+TransDias(i,69)
  xtotalsamAMTOBbd33s=xtotalsamAMTOBbd33s+TransDias(i,72)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOBbd33s,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOBbd33s/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th width="73" scope="col" bgcolor="#CCFFE6">BD 3 Trans </th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,27),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,67)+TransDias(i,68)+TransDias(i,69),0)%></div></th>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,70)+TransDias(i,71)+TransDias(i,72),0)%></div></th>
    <%else%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,27),0)%></div></th>
    <%
end if
  xtotalsamqtyOBbd3=xtotalsamqtyOBbd3+TransDias(i,27)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOBbd3,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOBbd3/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th valign="middle" rowspan="2" bgcolor="#FFB7B7" scope="col">Total Prod </th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(TransDias(i,28)+TransDias(i,29),0)%></div></th>
    <%else%>
    <th scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(TransDias(i,28)+TransDias(i,29),0)%></div></th>
    <%
end if
  xtotf=xtotf+TransDias(i,28)+TransDias(i,29)
next
%>
    <th scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(xtotf,0)%></div></th>
    <th scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(xtotf/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(TransDias(i,30)+TransDias(i,31),0)%></div></th>
    <%else%>
    <th scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(TransDias(i,30)+TransDias(i,31),0)%></div></th>
    <%
end if

  xtotl=xtotl+TransDias(i,30)+TransDias(i,31)
next
%>
    <th scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(xtotl,0)%></div></th>
    <th scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(xtotl/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#CCFFE6"><div align="right">1s:</div></th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,36)+TransDias(i,39),0)%></div></th>
    <%else%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,36)+TransDias(i,39),0)%></div></th>
    <%
end if
  xtotalsamqtyOBbd31=xtotalsamqtyOBbd31+TransDias(i,36)+TransDias(i,39)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOBbd31,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOBbd31/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#CCFFE6"><div align="right">2s:</div></th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,37)+TransDias(i,40),0)%></div></th>
    <%else%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,37)+TransDias(i,40),0)%></div></th>
    <%
end if
  xtotalsamqtyOBbd32=xtotalsamqtyOBbd32+TransDias(i,37)+TransDias(i,40)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOBbd32,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOBbd32/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#CCFFE6"><div align="right">3s:</div></th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,38)+TransDias(i,41),0)%></div></th>
    <%else%>
    <th width="101" scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,38)+TransDias(i,41),0)%></div></th>
    <%
end if
  xtotalsamqtyOBbd33=xtotalsamqtyOBbd33+TransDias(i,38)+TransDias(i,41)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOBbd33,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqtyOBbd33/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#CCFFE6">Total Trans</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
if TransDias(i,1)>0 then%>
    <th scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,24)+TransDias(i,27),0)%></div></th>
    <%else%>
    <th scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(TransDias(i,24)+TransDias(i,27),0)%></div></th>
    <%
end if
  xtott=xtott+TransDias(i,24)+TransDias(i,27)
next
%>
    <th scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(xtott,0)%></div></th>
    <th scope="col" bgcolor="#CCFFE6"><div align="right"><%=formatnumber(xtott/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th width="94" scope="col" bgcolor="#FFB7B7">Samsung O/B M2</th>
    <th width="73" scope="col" bgcolor="#FFB7B7">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th width="101" scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(TransDias(i,25),0)%></div></th>
    <%
  xtotalsamm2OB=xtotalsamm2OB+TransDias(i,25)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamm2OB,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamm2OB/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th width="94" scope="col" bgcolor="#FFB7B7">Samsung O/B AMT</th>
    <th width="73" scope="col" bgcolor="#FFB7B7">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th width="101" scope="col" bgcolor="#FFD2D2"><div align="right"><%=formatnumber(TransDias(i,26),0)%></div></th>
    <%
  xtotalsamamtOB=xtotalsamamtOB+TransDias(i,26)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamamtOB,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamamtOB/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th width="94" scope="col" bgcolor="#82CDFF">Samsung QTY</th>
    <th width="73" scope="col" bgcolor="#82CDFF">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th width="101" scope="col" bgcolor="#82CDFF"><div align="right"><%=formatnumber(TransDias(i,1),0)%></div></th>
    <%
  xtotalsamqty=xtotalsamqty+TransDias(i,1)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqty,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqty/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th width="94" scope="col" bgcolor="#82CDFF">Samsung M2</th>
    <th width="73" scope="col" bgcolor="#82CDFF">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th width="101" scope="col" bgcolor="#82CDFF"><div align="right"><%=formatnumber(TransDias(i,2),0)%></div></th>
    <%
  xtotalsamm2=xtotalsamm2+TransDias(i,2)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamm2,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamm2/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th width="94" scope="col" bgcolor="#82CDFF">Samsung AMT</th>
    <th width="73" scope="col" bgcolor="#82CDFF">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th width="101" scope="col" bgcolor="#82CDFF"><div align="right"><%=formatnumber(TransDias(i,3),0)%></div></th>
    <%
  xtotalsamamt=xtotalsamamt+TransDias(i,3)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamamt,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamamt/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th width="94" scope="col" bgcolor="#FFE6E6">Others QTY</th>
    <th width="73" scope="col" bgcolor="#FFE6E6">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th width="101" scope="col" bgcolor="#FFE6E6"><div align="right"><%=formatnumber(TransDias(i,4),0)%></div></th>
    <%
  xtotalothqty=xtotalothqty+TransDias(i,4)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalothqty,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalothqty/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th width="94" scope="col" bgcolor="#FFE6E6">Others M2</th>
    <th width="73" scope="col" bgcolor="#FFE6E6">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th width="101" scope="col" bgcolor="#FFE6E6"><div align="right"><%=formatnumber(TransDias(i,5),0)%></div></th>
    <%
  xtotalothm2=xtotalothm2+TransDias(i,5)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalothm2,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalothm2/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th width="94" scope="col" bgcolor="#FFE6E6">Others AMT</th>
    <th width="73" scope="col" bgcolor="#FFE6E6">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th width="101" scope="col" bgcolor="#FFE6E6"><div align="right"><%=formatnumber(TransDias(i,6),0)%></div></th>
    <%
  xtotalothamt=xtotalothamt+TransDias(i,6)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalothamt,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalothamt/xnumerodias,0)%></div></th>
  </tr>
  <%  ''''' qty bd1 %>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#F0E1FF" align="right">Qty 1S BD1</th>
    <th scope="col" bgcolor="#FFFFFF" align="right">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFFF" align="right"><%=formatnumber(TransDias(i,42),0)%></th>
    <%
  xqty1sbd1=xqty1sbd1+TransDias(i,42)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xqty1sbd1,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xqty1sbd1/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#F0E1FF" align="right">Qty 2S BD1</th>
    <th scope="col" bgcolor="#FFFFFF" align="right">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFFF" align="right"><%=formatnumber(TransDias(i,43),0)%></th>
    <%
  xqty2sbd1=xqty2sbd1+TransDias(i,43)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xqty2sbd1,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xqty2sbd1/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#F0E1FF" align="right">Qty 3S BD1</th>
    <th scope="col" bgcolor="#FFFFFF" align="right">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFFF" align="right"><%=formatnumber(TransDias(i,44),0)%></th>
    <%
  xqty3sbd1=xqty3sbd1+TransDias(i,44)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xqty3sbd1,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xqty3sbd1/xnumerodias,0)%></div></th>
  </tr>
  <% ''''' qty bd1 end %>
  <%  ''''' qty bd3 %>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#F0E1FF" align="right">Qty 1S BD3</th>
    <th scope="col" bgcolor="#FFFFFF" align="right">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFFF" align="right"><%=formatnumber(TransDias(i,48),0)%></th>
    <%
  xqty1sbd3=xqty1sbd3+TransDias(i,48)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xqty1sbd3,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xqty1sbd3/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#F0E1FF" align="right">Qty 2S BD3</th>
    <th scope="col" bgcolor="#FFFFFF" align="right">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFFF" align="right"><%=formatnumber(TransDias(i,49),0)%></th>
    <%
  xqty2sbd3=xqty2sbd3+TransDias(i,49)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xqty2sbd3,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xqty2sbd3/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#F0E1FF" align="right">Qty 3S BD3</th>
    <th scope="col" bgcolor="#FFFFFF" align="right">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFFF" align="right"><%=formatnumber(TransDias(i,50),0)%></th>
    <%
  xqty3sbd3=xqty3sbd3+TransDias(i,50)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xqty3sbd3,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xqty3sbd3/xnumerodias,0)%></div></th>
  </tr>
  <% ''''' qty bd3 end %>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#F0E1FF" align="right">Qty 1S</th>
    <th scope="col" bgcolor="#FFFFFF" align="right">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFFF" align="right"><%=formatnumber(TransDias(i,10),0)%></th>
    <%
  xtotalsamqty1s=xtotalsamqty1s+TransDias(i,10)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqty1s,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqty1s/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#F0E1FF" align="right">Qty 2S</th>
    <th scope="col" bgcolor="#FFFFFF" align="right">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFFF" align="right"><%=formatnumber(TransDias(i,11),0)%></th>
    <%
  xtotalsamqty2s=xtotalsamqty2s+TransDias(i,11)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqty2s,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqty2s/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#F0E1FF" align="right">Qty 3S</th>
    <th scope="col" bgcolor="#FFFFFF" align="right">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFFF" align="right"><%=formatnumber(TransDias(i,12),0)%></th>
    <%
  xtotalsamqty3s=xtotalsamqty3s+TransDias(i,12)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqty3s,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamqty3s/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th width="94" scope="col" bgcolor="#F0E1FF">Total QTY</th>
    <th width="73" scope="col" bgcolor="#F0E1FF">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th width="101" scope="col" bgcolor="#F0E1FF"><div align="right"><%=formatnumber(TransDias(i,7),0)%></div></th>
    <%
  xtotalqty=xtotalqty+TransDias(i,7)
  
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalqty,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalqty/xnumerodias,0)%></div></th>
  </tr>
  <%  ''''' qty bd1 %>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#F0E1FF" align="right">M2 1S BD1</th>
    <th scope="col" bgcolor="#FFFFFF" align="right">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFFF" align="right"><%=formatnumber(TransDias(i,45),0)%></th>
    <%
  xm21sbd1=xm21sbd1+TransDias(i,45)
  xamt1sbd1=xamt1sbd1+TransDias(i,73)
  xamt2sbd1=xamt2sbd1+TransDias(i,74)
  xamt3sbd1=xamt3sbd1+TransDias(i,75)
  xamt1sbd3=xamt1sbd3+TransDias(i,76)
  xamt2sbd3=xamt2sbd3+TransDias(i,77)
  xamt3sbd3=xamt3sbd3+TransDias(i,78)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xM21sbd1,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xM21sbd1/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#F0E1FF" align="right">M2 2S BD1</th>
    <th scope="col" bgcolor="#FFFFFF" align="right">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFFF" align="right"><%=formatnumber(TransDias(i,46),0)%></th>
    <%
  xM22sbd1=xM22sbd1+TransDias(i,46)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xM22sbd1,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xM22sbd1/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#F0E1FF" align="right">M2 3S BD1</th>
    <th scope="col" bgcolor="#FFFFFF" align="right">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFFF" align="right"><%=formatnumber(TransDias(i,47),0)%></th>
    <%
  xM23sbd1=xM23sbd1+TransDias(i,47)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xM23sbd1,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xM23sbd1/xnumerodias,0)%></div></th>
  </tr>
  <% ''''' M2 bd1 end %>
  <%  ''''' M2 bd3 %>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#F0E1FF" align="right">M2 1S BD3</th>
    <th scope="col" bgcolor="#FFFFFF" align="right">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFFF" align="right"><%=formatnumber(TransDias(i,51),0)%></th>
    <%
  xM21sbd3=xM21sbd3+TransDias(i,51)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xM21sbd3,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xM21sbd3/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#F0E1FF" align="right">M2 2S BD3</th>
    <th scope="col" bgcolor="#FFFFFF" align="right">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFFF" align="right"><%=formatnumber(TransDias(i,52),0)%></th>
    <%
  xM22sbd3=xM22sbd3+TransDias(i,52)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xM22sbd3,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xM22sbd3/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th scope="col" bgcolor="#F0E1FF" align="right">M2 3S BD3</th>
    <th scope="col" bgcolor="#FFFFFF" align="right">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th scope="col" bgcolor="#FFFFFF" align="right"><%=formatnumber(TransDias(i,53),0)%></th>
    <%
  xM23sbd3=xM23sbd3+TransDias(i,53)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xM23sbd3,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xM23sbd3/xnumerodias,0)%></div></th>
  </tr>
  <% ''''' M2 bd3 end %>
  <% m2=0
if m2=1 then
%>
  <tr bgcolor="#C1FFC1">
    <th width="94" scope="col" bgcolor="#82CDFF" align="right">M2 1S</th>
    <th width="73" scope="col" bgcolor="#FFFFFF">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th width="101" scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(TransDias(i,13),0)%></div></th>
    <%
  xtotalsamm21s=xtotalsamm21s+TransDias(i,13)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamm21s,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamm21s/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th width="94" scope="col" bgcolor="#82CDFF" align="right">M2 2S</th>
    <th width="73" scope="col" bgcolor="#FFFFFF">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th width="101" scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(TransDias(i,14),0)%></div></th>
    <%
  xtotalsamm22s=xtotalsamm22s+TransDias(i,14)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamm22s,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamm22s/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th width="94" scope="col" bgcolor="#82CDFF" align="right">M2 3S</th>
    <th width="73" scope="col" bgcolor="#FFFFFF">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th width="101" scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(TransDias(i,15),0)%></div></th>
    <%
  xtotalsamm23s=xtotalsamm23s+TransDias(i,15)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamm23s,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalsamm23s/xnumerodias,0)%></div></th>
  </tr>
  <%
end if
%>
  <tr bgcolor="#C1FFC1">
    <th width="94" scope="col" bgcolor="#F0E1FF">Total M2</th>
    <th width="73" scope="col" bgcolor="#FFFFFF">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th width="101" scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(TransDias(i,8),0)%></div></th>
    <%
  xtotalm2=xtotalm2+TransDias(i,8)
next
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalm2,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalm2/xnumerodias,0)%></div></th>
  </tr>
  <tr bgcolor="#C1FFC1">
    <th width="94" scope="col" bgcolor="#F0E1FF">Total AMT</th>
    <th width="73" scope="col" bgcolor="#FFFFFF">&nbsp;</th>
    <% 
for i=lbound(TransDias) to ubound(TransDias)
%>
    <th width="101" scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(TransDias(i,9),0)%></div></th>
    <%
  xtotalamt=xtotalamt+TransDias(i,9)
next
ltarget=40000
'lprogre=(ltarget/24)
lweekday=Weekday(date)
If lweekday = 1 then
 lprogre=16
else
 lprogre=24
end if
lprogre=24
%>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalamt,0)%></div></th>
    <th scope="col" bgcolor="#FFFFFF"><div align="right"><%=formatnumber(xtotalamt/xnumerodias,0)%></div></th>
  </tr>
</table>
<p>&nbsp;</p>
<%
mensaje2=" <strong>HOURLY TRANSFER PERFORMANCE (Samsung OB)</strong>"

mensaje2=mensaje2&"<table border='1'>"

ldaytrans2=mid(ldaytrans,3,2)&"/"&mid(ldaytrans,5,2)&"/"&mid(ldaytrans,1,2)
mensaje2=mensaje2&"  <tr> "
mensaje2=mensaje2&"    <th  scope='col'>"&ldaytrans2&"</th>"
mensaje2=mensaje2&"    <th  colspan='3' scope='col' align='center'>BD1</th>"
mensaje2=mensaje2&"    <th  colspan='3' scope='col' align='center'>BD3</th>"
mensaje2=mensaje2&"    <th  colspan='4' scope='col' align='center'>Tot Shift</th>"
mensaje2=mensaje2&"  </tr>"
mensaje2=mensaje2&"  <tr>"
mensaje2=mensaje2&"    <th align='center' scope='row'>&nbsp;&nbsp;Time:&nbsp;</th>"
mensaje2=mensaje2&"    <td align='center' >&nbsp;Sh1&nbsp;</td>"
mensaje2=mensaje2&"    <td align='center'>&nbsp;Sh2&nbsp;</td>"
mensaje2=mensaje2&"    <td align='center' >&nbsp;Sh3&nbsp;</td>"
mensaje2=mensaje2&"    <td align='center' >&nbsp;Sh1&nbsp;</td>"
mensaje2=mensaje2&"    <td align='center'>&nbsp;Sh2&nbsp;</td>"
mensaje2=mensaje2&"    <td align='center' >&nbsp;Sh3&nbsp;</td>"
mensaje2=mensaje2&"    <td align='center' >&nbsp;QTY&nbsp;</td>"
mensaje2=mensaje2&"    <td align='center' >Prod</td>"
mensaje2=mensaje2&"    <td align='center' >Logro</td>"
mensaje2=mensaje2&"    <td align='center' >Target</td>"
mensaje2=mensaje2&"  </tr>"
mensaje2=mensaje2&"  <tr>"
mensaje2=mensaje2&"    <th align='center' scope='row'>7:50</th>"
mensaje2=mensaje2&"    <td align='right' bgcolor='#F2DDDC'>"&Transxhora(1,3)&"</td>"
mensaje2=mensaje2&"    <td align='right'>"&Transxhora(1,4)&"</td>"
mensaje2=mensaje2&"   <td align='right'>"&Transxhora(1,5)&"</td>"
mensaje2=mensaje2&"    <td align='right' bgcolor='#F2DDDC'>"&Transxhora(1,6)&"</td>"
mensaje2=mensaje2&"   <td align='right'>"&Transxhora(1,7)&"</td>"
mensaje2=mensaje2&"    <td align='right'>"&Transxhora(1,8)&"</td>"
mensaje2=mensaje2&"    <td align='right'>"&Transxhora(1,3)+Transxhora(1,4)+Transxhora(1,5)+Transxhora(1,6)+Transxhora(1,7)+Transxhora(1,8)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(1,3)+Transxhora(1,6)&"</td>"
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((Transxhora(1,3)+Transxhora(1,4)+Transxhora(1,5)+Transxhora(1,6)+Transxhora(1,7)+Transxhora(1,8))/ltarget)*100,1)&"%</td>"
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((1/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "

  h1=Transxhora(1,3)+Transxhora(1,4)+Transxhora(1,5)+Transxhora(1,6)+Transxhora(1,7)+Transxhora(1,8)
  h2=Transxhora(2,3)+Transxhora(2,4)+Transxhora(2,5)+Transxhora(2,6)+Transxhora(2,7)+Transxhora(2,8)
  h3=Transxhora(3,3)+Transxhora(3,4)+Transxhora(3,5)+Transxhora(3,6)+Transxhora(3,7)+Transxhora(3,8)
  h4=Transxhora(4,3)+Transxhora(4,4)+Transxhora(4,5)+Transxhora(4,6)+Transxhora(4,7)+Transxhora(4,8)
  h5=Transxhora(5,3)+Transxhora(5,4)+Transxhora(5,5)+Transxhora(5,6)+Transxhora(5,7)+Transxhora(5,8)
  h6=Transxhora(6,3)+Transxhora(6,4)+Transxhora(6,5)+Transxhora(6,6)+Transxhora(6,7)+Transxhora(6,8)
  h7=Transxhora(7,3)+Transxhora(7,4)+Transxhora(7,5)+Transxhora(7,6)+Transxhora(7,7)+Transxhora(7,8)
  h8=Transxhora(8,3)+Transxhora(8,4)+Transxhora(8,5)+Transxhora(8,6)+Transxhora(8,7)+Transxhora(8,8)
  h9=Transxhora(9,3)+Transxhora(9,4)+Transxhora(9,5)+Transxhora(9,6)+Transxhora(9,7)+Transxhora(9,8)
  h10=Transxhora(10,3)+Transxhora(10,4)+Transxhora(10,5)+Transxhora(10,6)+Transxhora(10,7)+Transxhora(10,8)
  h11=Transxhora(11,3)+Transxhora(11,4)+Transxhora(11,5)+Transxhora(11,6)+Transxhora(11,7)+Transxhora(11,8)
  h12=Transxhora(12,3)+Transxhora(12,4)+Transxhora(12,5)+Transxhora(12,6)+Transxhora(12,7)+Transxhora(12,8)
  h13=Transxhora(13,3)+Transxhora(13,4)+Transxhora(13,5)+Transxhora(13,6)+Transxhora(13,7)+Transxhora(13,8)
  h14=Transxhora(14,3)+Transxhora(14,4)+Transxhora(14,5)+Transxhora(14,6)+Transxhora(14,7)+Transxhora(14,8)
  h15=Transxhora(15,3)+Transxhora(15,4)+Transxhora(15,5)+Transxhora(15,6)+Transxhora(15,7)+Transxhora(15,8)
  h16=Transxhora(16,3)+Transxhora(16,4)+Transxhora(16,5)+Transxhora(16,6)+Transxhora(16,7)+Transxhora(16,8)
  h17=Transxhora(17,3)+Transxhora(17,4)+Transxhora(17,5)+Transxhora(17,6)+Transxhora(17,7)+Transxhora(17,8)
  h18=Transxhora(18,3)+Transxhora(18,4)+Transxhora(18,5)+Transxhora(18,6)+Transxhora(18,7)+Transxhora(18,8)
  h19=Transxhora(19,3)+Transxhora(19,4)+Transxhora(19,5)+Transxhora(19,6)+Transxhora(19,7)+Transxhora(19,8)
  h20=Transxhora(20,3)+Transxhora(20,4)+Transxhora(20,5)+Transxhora(20,6)+Transxhora(20,7)+Transxhora(20,8)
  h21=Transxhora(21,3)+Transxhora(21,4)+Transxhora(21,5)+Transxhora(21,6)+Transxhora(21,7)+Transxhora(21,8)
  h22=Transxhora(22,3)+Transxhora(22,4)+Transxhora(22,5)+Transxhora(22,6)+Transxhora(22,7)+Transxhora(22,8)
  h23=Transxhora(23,3)+Transxhora(23,4)+Transxhora(23,5)+Transxhora(23,6)+Transxhora(23,7)+Transxhora(23,8)
  h24=Transxhora(24,3)+Transxhora(24,4)+Transxhora(24,5)+Transxhora(24,6)+Transxhora(24,7)+Transxhora(24,8)

  if llines>1 then
   Mensaje2=mensaje2&"<tr>"
     Mensaje2=mensaje2&"<th align='center' scope='row'>8:50</th>"
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(2,3)+Transxhora(1,3)&"  </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(2,4)+Transxhora(1,4)&"  </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(2,5)+Transxhora(1,5)&"  </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(2,6)+Transxhora(1,6)&" </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(2,7)+Transxhora(1,7)&"  </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(2,8)+Transxhora(1,8)&"   </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+Transxhora(2,3)+Transxhora(2,4)+Transxhora(2,5)+Transxhora(2,6)+Transxhora(2,7)+Transxhora(2,8))&"  </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(2,3)+Transxhora(2,6)&"   </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+Transxhora(2,3)+Transxhora(2,4)+Transxhora(2,5)+Transxhora(2,6)+Transxhora(2,7)+Transxhora(2,8))/ltarget)*100,1)&"%   </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((2/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
    if llines>2 then
  Mensaje2=mensaje2&"<tr>"
    Mensaje2=mensaje2&"<th align='center' scope='row'>9:50</th>"
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"   </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"  </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"  </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"   </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&" </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"  </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+Transxhora(3,3)+Transxhora(3,4)+Transxhora(3,5)+Transxhora(3,6)+Transxhora(3,7)+Transxhora(3,8))&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h3)&"   </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+Transxhora(3,3)+Transxhora(3,4)+Transxhora(3,5)+Transxhora(3,6)+Transxhora(3,7)+Transxhora(3,8))/ltarget)*100,1)&"%   </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((3/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
    if llines>3 then
  Mensaje2=mensaje2&"<tr>"
    Mensaje2=mensaje2&" <th align='center' scope='row'>10:50</th>"
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&" </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"  </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&" </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&" </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&" </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+Transxhora(4,3)+Transxhora(4,4)+Transxhora(4,5)+Transxhora(4,6)+Transxhora(4,7)+Transxhora(4,8))&"  </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h4)&"  </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+Transxhora(4,3)+Transxhora(4,4)+Transxhora(4,5)+Transxhora(4,6)+Transxhora(4,7)+Transxhora(4,8))/ltarget)*100,1)&"%  </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((4/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
   if llines>4 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&" <th align='center' scope='row'>11:50</th>"
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"   </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&" </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&" </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"     </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+Transxhora(5,3)+Transxhora(5,4)+Transxhora(5,5)+Transxhora(5,6)+Transxhora(5,7)+Transxhora(5,8))&"   </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h5)&"   </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+Transxhora(5,3)+Transxhora(5,4)+Transxhora(5,5)+Transxhora(5,6)+Transxhora(5,7)+Transxhora(5,8))/ltarget)*100,1)&"%  </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((5/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>5 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>12:50</th>"
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"  </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"   </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+Transxhora(6,3)+Transxhora(6,4)+Transxhora(6,5)+Transxhora(6,6)+Transxhora(6,7)+Transxhora(6,8))&"  </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h6)&" </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+Transxhora(6,3)+Transxhora(6,4)+Transxhora(6,5)+Transxhora(6,6)+Transxhora(6,7)+Transxhora(6,8))/ltarget)*100,1)&"%    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((6/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>6 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>13:50</th>"
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+Transxhora(7,3)+Transxhora(7,4)+Transxhora(7,5)+Transxhora(7,6)+Transxhora(7,7)+Transxhora(7,8))&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h7)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+Transxhora(7,3)+Transxhora(7,4)+Transxhora(7,5)+Transxhora(7,6)+Transxhora(7,7)+Transxhora(7,8))/ltarget)*100,1)&"%    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((7/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>7 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>14:50</th>"
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+Transxhora(8,3)+Transxhora(8,4)+Transxhora(8,5)+Transxhora(8,6)+Transxhora(8,7)+Transxhora(8,8))&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h8)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+Transxhora(8,3)+Transxhora(8,4)+Transxhora(8,5)+Transxhora(8,6)+Transxhora(8,7)+Transxhora(8,8))/ltarget)*100,1)&"%    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((8/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>8 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>15:50</th>"
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+Transxhora(9,3)+Transxhora(9,4)+Transxhora(9,5)+Transxhora(9,6)+Transxhora(9,7)+Transxhora(9,8))&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h9)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+Transxhora(9,3)+Transxhora(9,4)+Transxhora(9,5)+Transxhora(9,6)+Transxhora(9,7)+Transxhora(9,8))/ltarget)*100,1)&"%    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((9/lprogre)*100,1)&"%</td>"
 Mensaje2=mensaje2&" </tr> "
 end if
 
 if llines>9 then
 Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>16:50</th>"
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(10,3)+Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(10,4)+Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(10,5)+Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(10,6)+Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(10,7)+Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(10,8)+Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+h9+Transxhora(10,3)+Transxhora(10,4)+Transxhora(10,5)+Transxhora(10,6)+Transxhora(10,7)+Transxhora(10,8))&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h10)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+h9+Transxhora(10,3)+Transxhora(10,4)+Transxhora(10,5)+Transxhora(10,6)+Transxhora(10,7)+Transxhora(10,8))/ltarget)*100,1)&"%    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((10)/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>10 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>17:50</th>"
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(11,3)+Transxhora(10,3)+Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(11,4)+Transxhora(10,4)+Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&" </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(11,5)+Transxhora(10,5)+Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(11,6)+Transxhora(10,6)+Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"  </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(11,7)+Transxhora(10,7)+Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(11,8)+Transxhora(10,8)+Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"   </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+Transxhora(11,3)+Transxhora(11,4)+Transxhora(11,5)+Transxhora(11,6)+Transxhora(11,7)+Transxhora(11,8))&"  </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h11)&"  </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+Transxhora(11,3)+Transxhora(11,4)+Transxhora(11,5)+Transxhora(11,6)+Transxhora(11,7)+Transxhora(11,8))/ltarget)*100,1)&"%    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((11/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>11 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>18:50</th>"
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(12,3)+Transxhora(11,3)+Transxhora(10,3)+Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(12,4)+Transxhora(11,4)+Transxhora(10,4)+Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(12,5)+Transxhora(11,5)+Transxhora(10,5)+Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(12,6)+Transxhora(11,6)+Transxhora(10,6)+Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(12,7)+Transxhora(11,7)+Transxhora(10,7)+Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(12,8)+Transxhora(11,8)+Transxhora(10,8)+Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+Transxhora(12,3)+Transxhora(12,4)+Transxhora(12,5)+Transxhora(12,6)+Transxhora(12,7)+Transxhora(12,8))&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h12)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+Transxhora(12,3)+Transxhora(12,4)+Transxhora(12,5)+Transxhora(12,6)+Transxhora(12,7)+Transxhora(12,8))/ltarget)*100,1)&"%    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((12/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>12 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>19:50</th>"
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(13,3)+Transxhora(12,3)+Transxhora(11,3)+Transxhora(10,3)+Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(13,4)+Transxhora(12,4)+Transxhora(11,4)+Transxhora(10,4)+Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(13,5)+Transxhora(12,5)+Transxhora(11,5)+Transxhora(10,5)+Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(13,6)+Transxhora(12,6)+Transxhora(11,6)+Transxhora(10,6)+Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(13,7)+Transxhora(12,7)+Transxhora(11,7)+Transxhora(10,7)+Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(13,8)+Transxhora(12,8)+Transxhora(11,8)+Transxhora(10,8)+Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h13)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13)/ltarget)*100,1)&"%    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((13/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>13 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>20:50</th>"
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(14,3)+Transxhora(13,3)+Transxhora(12,3)+Transxhora(11,3)+Transxhora(10,3)+Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(14,4)+Transxhora(13,4)+Transxhora(12,4)+Transxhora(11,4)+Transxhora(10,4)+Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(14,5)+Transxhora(13,5)+Transxhora(12,5)+Transxhora(11,5)+Transxhora(10,5)+Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(14,6)+Transxhora(13,6)+Transxhora(12,6)+Transxhora(11,6)+Transxhora(10,6)+Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(14,7)+Transxhora(13,7)+Transxhora(12,7)+Transxhora(11,7)+Transxhora(10,7)+Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(14,8)+Transxhora(13,8)+Transxhora(12,8)+Transxhora(11,8)+Transxhora(10,8)+Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h14)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14)/ltarget)*100,1)&"%    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((14/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>14 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>21:50</th>"
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(15,3)+Transxhora(14,3)+Transxhora(13,3)+Transxhora(12,3)+Transxhora(11,3)+Transxhora(10,3)+Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(15,4)+Transxhora(14,4)+Transxhora(13,4)+Transxhora(12,4)+Transxhora(11,4)+Transxhora(10,4)+Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(15,5)+Transxhora(14,5)+Transxhora(13,5)+Transxhora(12,5)+Transxhora(11,5)+Transxhora(10,5)+Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(15,6)+Transxhora(14,6)+Transxhora(13,6)+Transxhora(12,6)+Transxhora(11,6)+Transxhora(10,6)+Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(15,7)+Transxhora(14,7)+Transxhora(13,7)+Transxhora(12,7)+Transxhora(11,7)+Transxhora(10,7)+Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(15,8)+Transxhora(14,8)+Transxhora(13,8)+Transxhora(12,8)+Transxhora(11,8)+Transxhora(10,8)+Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h15)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15)/ltarget)*100,1)&"%    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((15/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>15 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>22:50</th>"
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(16,3)+Transxhora(15,3)+Transxhora(14,3)+Transxhora(13,3)+Transxhora(12,3)+Transxhora(11,3)+Transxhora(10,3)+Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(16,4)+Transxhora(15,4)+Transxhora(14,4)+Transxhora(13,4)+Transxhora(12,4)+Transxhora(11,4)+Transxhora(10,4)+Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(16,5)+Transxhora(15,5)+Transxhora(14,5)+Transxhora(13,5)+Transxhora(12,5)+Transxhora(11,5)+Transxhora(10,5)+Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(16,6)+Transxhora(15,6)+Transxhora(14,6)+Transxhora(13,6)+Transxhora(12,6)+Transxhora(11,6)+Transxhora(10,6)+Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(16,7)+Transxhora(15,7)+Transxhora(14,7)+Transxhora(13,7)+Transxhora(12,7)+Transxhora(11,7)+Transxhora(10,7)+Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(16,8)+Transxhora(15,8)+Transxhora(14,8)+Transxhora(13,8)+Transxhora(12,8)+Transxhora(11,8)+Transxhora(10,8)+Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h16)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16)/ltarget)*100,1)&"%    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((16/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>16 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>23:50</th>"
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(17,3)+Transxhora(16,3)+Transxhora(15,3)+Transxhora(14,3)+Transxhora(13,3)+Transxhora(12,3)+Transxhora(11,3)+Transxhora(10,3)+Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(17,4)+Transxhora(16,4)+Transxhora(15,4)+Transxhora(14,4)+Transxhora(13,4)+Transxhora(12,4)+Transxhora(11,4)+Transxhora(10,4)+Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&" </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(17,5)+Transxhora(16,5)+Transxhora(15,5)+Transxhora(14,5)+Transxhora(13,5)+Transxhora(12,5)+Transxhora(11,5)+Transxhora(10,5)+Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&" </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(17,6)+Transxhora(16,6)+Transxhora(15,6)+Transxhora(14,6)+Transxhora(13,6)+Transxhora(12,6)+Transxhora(11,6)+Transxhora(10,6)+Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"    </td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(17,7)+Transxhora(16,7)+Transxhora(15,7)+Transxhora(14,7)+Transxhora(13,7)+Transxhora(12,7)+Transxhora(11,7)+Transxhora(10,7)+Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(17,8)+Transxhora(16,8)+Transxhora(15,8)+Transxhora(14,8)+Transxhora(13,8)+Transxhora(12,8)+Transxhora(11,8)+Transxhora(10,8)+Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&(h17)&"    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17)/ltarget)*100,1)&"%    </td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((17/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>17 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>0:50</th>"
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(18,3)+Transxhora(17,3)+Transxhora(16,3)+Transxhora(15,3)+Transxhora(14,3)+Transxhora(13,3)+Transxhora(12,3)+Transxhora(11,3)+Transxhora(10,3)+Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(18,4)+Transxhora(17,4)+Transxhora(16,4)+Transxhora(15,4)+Transxhora(14,4)+Transxhora(13,4)+Transxhora(12,4)+Transxhora(11,4)+Transxhora(10,4)+Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"</td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(18,5)+Transxhora(17,5)+Transxhora(16,5)+Transxhora(15,5)+Transxhora(14,5)+Transxhora(13,5)+Transxhora(12,5)+Transxhora(11,5)+Transxhora(10,5)+Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(18,6)+Transxhora(17,6)+Transxhora(16,6)+Transxhora(15,6)+Transxhora(14,6)+Transxhora(13,6)+Transxhora(12,6)+Transxhora(11,6)+Transxhora(10,6)+Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(18,7)+Transxhora(17,7)+Transxhora(16,7)+Transxhora(15,7)+Transxhora(14,7)+Transxhora(13,7)+Transxhora(12,7)+Transxhora(11,7)+Transxhora(10,7)+Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"</td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(18,8)+Transxhora(17,8)+Transxhora(16,8)+Transxhora(15,8)+Transxhora(14,8)+Transxhora(13,8)+Transxhora(12,8)+Transxhora(11,8)+Transxhora(10,8)+Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17+h18)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&(h18)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17+h18)/ltarget)*100,1)&"%</td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((18/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>18 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>01:50</th>"
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(19,3)+Transxhora(18,3)+Transxhora(17,3)+Transxhora(16,3)+Transxhora(15,3)+Transxhora(14,3)+Transxhora(13,3)+Transxhora(12,3)+Transxhora(11,3)+Transxhora(10,3)+Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(19,4)+Transxhora(18,4)+Transxhora(17,4)+Transxhora(16,4)+Transxhora(15,4)+Transxhora(14,4)+Transxhora(13,4)+Transxhora(12,4)+Transxhora(11,4)+Transxhora(10,4)+Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"</td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(19,5)+Transxhora(18,5)+Transxhora(17,5)+Transxhora(16,5)+Transxhora(15,5)+Transxhora(14,5)+Transxhora(13,5)+Transxhora(12,5)+Transxhora(11,5)+Transxhora(10,5)+Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(19,6)+Transxhora(18,6)+Transxhora(17,6)+Transxhora(16,6)+Transxhora(15,6)+Transxhora(14,6)+Transxhora(13,6)+Transxhora(12,6)+Transxhora(11,6)+Transxhora(10,6)+Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(19,7)+Transxhora(18,7)+Transxhora(17,7)+Transxhora(16,7)+Transxhora(15,7)+Transxhora(14,7)+Transxhora(13,7)+Transxhora(12,7)+Transxhora(11,7)+Transxhora(10,7)+Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"</td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(19,8)+Transxhora(18,8)+Transxhora(17,8)+Transxhora(16,8)+Transxhora(15,8)+Transxhora(14,8)+Transxhora(13,8)+Transxhora(12,8)+Transxhora(11,8)+Transxhora(10,8)+Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17+h18+h19)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&(h19)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17+h18+h19)/ltarget)*100,1)&"%</td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((19/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>19 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>02:50</th> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(20,3)+Transxhora(19,3)+Transxhora(18,3)+Transxhora(17,3)+Transxhora(16,3)+Transxhora(15,3)+Transxhora(14,3)+Transxhora(13,3)+Transxhora(12,3)+Transxhora(11,3)+Transxhora(10,3)+Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(20,4)+Transxhora(19,4)+Transxhora(18,4)+Transxhora(17,4)+Transxhora(16,4)+Transxhora(15,4)+Transxhora(14,4)+Transxhora(13,4)+Transxhora(12,4)+Transxhora(11,4)+Transxhora(10,4)+Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"</td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(20,5)+Transxhora(19,5)+Transxhora(18,5)+Transxhora(17,5)+Transxhora(16,5)+Transxhora(15,5)+Transxhora(14,5)+Transxhora(13,5)+Transxhora(12,5)+Transxhora(11,5)+Transxhora(10,5)+Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(20,6)+Transxhora(19,6)+Transxhora(18,6)+Transxhora(17,6)+Transxhora(16,6)+Transxhora(15,6)+Transxhora(14,6)+Transxhora(13,6)+Transxhora(12,6)+Transxhora(11,6)+Transxhora(10,6)+Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(20,7)+Transxhora(19,7)+Transxhora(18,7)+Transxhora(17,7)+Transxhora(16,7)+Transxhora(15,7)+Transxhora(14,7)+Transxhora(13,7)+Transxhora(12,7)+Transxhora(11,7)+Transxhora(10,7)+Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"</td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(20,8)+Transxhora(19,8)+Transxhora(18,8)+Transxhora(17,8)+Transxhora(16,8)+Transxhora(15,8)+Transxhora(14,8)+Transxhora(13,8)+Transxhora(12,8)+Transxhora(11,8)+Transxhora(10,8)+Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17+h18+h19+h20)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&(h20)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17+h18+h19+h20)/ltarget)*100,1)&"%</td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((20/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>20 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>03:50</th>"
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(21,3)+Transxhora(20,3)+Transxhora(19,3)+Transxhora(18,3)+Transxhora(17,3)+Transxhora(16,3)+Transxhora(15,3)+Transxhora(14,3)+Transxhora(13,3)+Transxhora(12,3)+Transxhora(11,3)+Transxhora(10,3)+Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(21,4)+Transxhora(20,4)+Transxhora(19,4)+Transxhora(18,4)+Transxhora(17,4)+Transxhora(16,4)+Transxhora(15,4)+Transxhora(14,4)+Transxhora(13,4)+Transxhora(12,4)+Transxhora(11,4)+Transxhora(10,4)+Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"</td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(21,5)+Transxhora(20,5)+Transxhora(19,5)+Transxhora(18,5)+Transxhora(17,5)+Transxhora(16,5)+Transxhora(15,5)+Transxhora(14,5)+Transxhora(13,5)+Transxhora(12,5)+Transxhora(11,5)+Transxhora(10,5)+Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(21,6)+Transxhora(20,6)+Transxhora(19,6)+Transxhora(18,6)+Transxhora(17,6)+Transxhora(16,6)+Transxhora(15,6)+Transxhora(14,6)+Transxhora(13,6)+Transxhora(12,6)+Transxhora(11,6)+Transxhora(10,6)+Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(21,7)+Transxhora(20,7)+Transxhora(19,7)+Transxhora(18,7)+Transxhora(17,7)+Transxhora(16,7)+Transxhora(15,7)+Transxhora(14,7)+Transxhora(13,7)+Transxhora(12,7)+Transxhora(11,7)+Transxhora(10,7)+Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"</td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(21,8)+Transxhora(20,8)+Transxhora(19,8)+Transxhora(18,8)+Transxhora(17,8)+Transxhora(16,8)+Transxhora(15,8)+Transxhora(14,8)+Transxhora(13,8)+Transxhora(12,8)+Transxhora(11,8)+Transxhora(10,8)+Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17+h18+h19+h20+h21)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&(h21)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17+h18+h19+h20+h21)/ltarget)*100,1)&"%</td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((21/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>21 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>04:50</th>"
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(22,3)+Transxhora(21,3)+Transxhora(20,3)+Transxhora(19,3)+Transxhora(18,3)+Transxhora(17,3)+Transxhora(16,3)+Transxhora(15,3)+Transxhora(14,3)+Transxhora(13,3)+Transxhora(12,3)+Transxhora(11,3)+Transxhora(10,3)+Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(22,4)+Transxhora(21,4)+Transxhora(20,4)+Transxhora(19,4)+Transxhora(18,4)+Transxhora(17,4)+Transxhora(16,4)+Transxhora(15,4)+Transxhora(14,4)+Transxhora(13,4)+Transxhora(12,4)+Transxhora(11,4)+Transxhora(10,4)+Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"</td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(22,5)+Transxhora(21,5)+Transxhora(20,5)+Transxhora(19,5)+Transxhora(18,5)+Transxhora(17,5)+Transxhora(16,5)+Transxhora(15,5)+Transxhora(14,5)+Transxhora(13,5)+Transxhora(12,5)+Transxhora(11,5)+Transxhora(10,5)+Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(22,6)+Transxhora(21,6)+Transxhora(20,6)+Transxhora(19,6)+Transxhora(18,6)+Transxhora(17,6)+Transxhora(16,6)+Transxhora(15,6)+Transxhora(14,6)+Transxhora(13,6)+Transxhora(12,6)+Transxhora(11,6)+Transxhora(10,6)+Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(22,7)+Transxhora(21,7)+Transxhora(20,7)+Transxhora(19,7)+Transxhora(18,7)+Transxhora(17,7)+Transxhora(16,7)+Transxhora(15,7)+Transxhora(14,7)+Transxhora(13,7)+Transxhora(12,7)+Transxhora(11,7)+Transxhora(10,7)+Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"</td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(22,8)+Transxhora(21,8)+Transxhora(20,8)+Transxhora(19,8)+Transxhora(18,8)+Transxhora(17,8)+Transxhora(16,8)+Transxhora(15,8)+Transxhora(14,8)+Transxhora(13,8)+Transxhora(12,8)+Transxhora(11,8)+Transxhora(10,8)+Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17+h18+h19+h20+h21+h22)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&(h22)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17+h18+h19+h20+h21+h22)/ltarget)*100,1)&"%</td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((22/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>22 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>05:50</th>"
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(23,3)+Transxhora(22,3)+Transxhora(21,3)+Transxhora(20,3)+Transxhora(19,3)+Transxhora(18,3)+Transxhora(17,3)+Transxhora(16,3)+Transxhora(15,3)+Transxhora(14,3)+Transxhora(13,3)+Transxhora(12,3)+Transxhora(11,3)+Transxhora(10,3)+Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(23,4)+Transxhora(22,4)+Transxhora(21,4)+Transxhora(20,4)+Transxhora(19,4)+Transxhora(18,4)+Transxhora(17,4)+Transxhora(16,4)+Transxhora(15,4)+Transxhora(14,4)+Transxhora(13,4)+Transxhora(12,4)+Transxhora(11,4)+Transxhora(10,4)+Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"</td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(23,5)+Transxhora(22,5)+Transxhora(21,5)+Transxhora(20,5)+Transxhora(19,5)+Transxhora(18,5)+Transxhora(17,5)+Transxhora(16,5)+Transxhora(15,5)+Transxhora(14,5)+Transxhora(13,5)+Transxhora(12,5)+Transxhora(11,5)+Transxhora(10,5)+Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(23,6)+Transxhora(22,6)+Transxhora(21,6)+Transxhora(20,6)+Transxhora(19,6)+Transxhora(18,6)+Transxhora(17,6)+Transxhora(16,6)+Transxhora(15,6)+Transxhora(14,6)+Transxhora(13,6)+Transxhora(12,6)+Transxhora(11,6)+Transxhora(10,6)+Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(23,7)+Transxhora(22,7)+Transxhora(21,7)+Transxhora(20,7)+Transxhora(19,7)+Transxhora(18,7)+Transxhora(17,7)+Transxhora(16,7)+Transxhora(15,7)+Transxhora(14,7)+Transxhora(13,7)+Transxhora(12,7)+Transxhora(11,7)+Transxhora(10,7)+Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"</td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(23,8)+Transxhora(22,8)+Transxhora(21,8)+Transxhora(20,8)+Transxhora(19,8)+Transxhora(18,8)+Transxhora(17,8)+Transxhora(16,8)+Transxhora(15,8)+Transxhora(14,8)+Transxhora(13,8)+Transxhora(12,8)+Transxhora(11,8)+Transxhora(10,8)+Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17+h18+h19+h20+h21+h22+h23)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&(h23)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17+h18+h19+h20+h21+h22+h23)/ltarget)*100,1)&"%</td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((23/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
  if llines>23 then
  Mensaje2=mensaje2&" <tr> "
    Mensaje2=mensaje2&"<th align='center' scope='row'>06:50</th>"
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(24,3)+Transxhora(23,3)+Transxhora(22,3)+Transxhora(21,3)+Transxhora(20,3)+Transxhora(19,3)+Transxhora(18,3)+Transxhora(17,3)+Transxhora(16,3)+Transxhora(15,3)+Transxhora(14,3)+Transxhora(13,3)+Transxhora(12,3)+Transxhora(11,3)+Transxhora(10,3)+Transxhora(9,3)+Transxhora(8,3)+Transxhora(7,3)+Transxhora(6,3)+Transxhora(5,3)+Transxhora(4,3)+Transxhora(3,3)+Transxhora(2,3)+Transxhora(1,3)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(24,4)+Transxhora(23,4)+Transxhora(22,4)+Transxhora(21,4)+Transxhora(20,4)+Transxhora(19,4)+Transxhora(18,4)+Transxhora(17,4)+Transxhora(16,4)+Transxhora(15,4)+Transxhora(14,4)+Transxhora(13,4)+Transxhora(12,4)+Transxhora(11,4)+Transxhora(10,4)+Transxhora(9,4)+Transxhora(8,4)+Transxhora(7,4)+Transxhora(6,4)+Transxhora(5,4)+Transxhora(4,4)+Transxhora(3,4)+Transxhora(2,4)+Transxhora(1,4)&"</td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(24,5)+Transxhora(23,5)+Transxhora(22,5)+Transxhora(21,5)+Transxhora(20,5)+Transxhora(19,5)+Transxhora(18,5)+Transxhora(17,5)+Transxhora(16,5)+Transxhora(15,5)+Transxhora(14,5)+Transxhora(13,5)+Transxhora(12,5)+Transxhora(11,5)+Transxhora(10,5)+Transxhora(9,5)+Transxhora(8,5)+Transxhora(7,5)+Transxhora(6,5)+Transxhora(5,5)+Transxhora(4,5)+Transxhora(3,5)+Transxhora(2,5)+Transxhora(1,5)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(24,6)+Transxhora(23,6)+Transxhora(22,6)+Transxhora(21,6)+Transxhora(20,6)+Transxhora(19,6)+Transxhora(18,6)+Transxhora(17,6)+Transxhora(16,6)+Transxhora(15,6)+Transxhora(14,6)+Transxhora(13,6)+Transxhora(12,6)+Transxhora(11,6)+Transxhora(10,6)+Transxhora(9,6)+Transxhora(8,6)+Transxhora(7,6)+Transxhora(6,6)+Transxhora(5,6)+Transxhora(4,6)+Transxhora(3,6)+Transxhora(2,6)+Transxhora(1,6)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&Transxhora(24,7)+Transxhora(23,7)+Transxhora(22,7)+Transxhora(21,7)+Transxhora(20,7)+Transxhora(19,7)+Transxhora(18,7)+Transxhora(17,7)+Transxhora(16,7)+Transxhora(15,7)+Transxhora(14,7)+Transxhora(13,7)+Transxhora(12,7)+Transxhora(11,7)+Transxhora(10,7)+Transxhora(8,7)+Transxhora(8,7)+Transxhora(7,7)+Transxhora(6,7)+Transxhora(5,7)+Transxhora(4,7)+Transxhora(3,7)+Transxhora(2,7)+Transxhora(1,7)&"</td> "
    mensaje2=mensaje2&" <td align='right' bgcolor='#F2DDDC'>"&Transxhora(24,8)+Transxhora(23,8)+Transxhora(22,8)+Transxhora(21,8)+Transxhora(20,8)+Transxhora(19,8)+Transxhora(18,8)+Transxhora(17,8)+Transxhora(16,8)+Transxhora(15,8)+Transxhora(14,8)+Transxhora(13,8)+Transxhora(12,8)+Transxhora(11,8)+Transxhora(10,8)+Transxhora(8,8)+Transxhora(8,8)+Transxhora(7,8)+Transxhora(6,8)+Transxhora(5,8)+Transxhora(4,8)+Transxhora(3,8)+Transxhora(2,8)+Transxhora(1,8)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&(h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17+h18+h19+h20+h21+h22+h23+h24)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&(h24)&"</td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber(((h1+h2+h3+h4+h5+h6+h7+h8+h9+h10+h11+h12+h13+h14+h15+h16+h17+h18+h19+h20+h21+h22+h23+h24)/ltarget)*100,1)&"%</td> "
    mensaje2=mensaje2&" <td align='right'>"&formatnumber((24/lprogre)*100,1)&"%</td>"
  Mensaje2=mensaje2&" </tr> "
  end if
  
Mensaje2=mensaje2&"</table>"

correo="ilkim@shinwoousa.com;inwans@shinwoousa.com"
'correo=request.QueryString("correo")
'
val1=xtotalsamqtyOB1s
val2=xtotalsamqtyOB2s
val3=xtotalsamqtyOB3s
val4=xtotalsamqtyOB
val5=xtotalsamqtyOBbd31s
val6=xtotalsamqtyOBbd32s
val7=xtotalsamqtyOBbd33s
val8=xtotalsamqtyOBbd3
val9=xtotalsamqtyOBbd31
val10=xtotalsamqtyOBbd32
val11=xtotalsamqtyOBbd33
val12=xtott
val61=xtotalsamM2OB1s
val62=xtotalsamM2OB2s
val63=xtotalsamM2OB3s
val64=xtotalsamAMTOB1s
val65=xtotalsamAMTOB2s
val66=xtotalsamAMTOB3s
val67=xtotalsamM2OBbd31s
val68=xtotalsamM2OBbd32s
val69=xtotalsamM2OBbd33s
val70=xtotalsamAMTOBbd31s
val71=xtotalsamAMTOBbd32s
val72=xtotalsamAMTOBbd33s

for i=lbound(TransDias) to ubound(TransDias)
  xtotalqtysh=xtotalqtysh+TransDias(i,79)
  xtotalm2sh=xtotalm2sh+TransDias(i,80)
  xtotalamtsh=xtotalamtsh+TransDias(i,81)
  
  'xm21sbd1sh=xm21sbd1sh+TransDias(i,45)
  xqty1sbd1sh=xqty1sbd1sh+TransDias(i,82)
  xqty2sbd1sh=xqty2sbd1sh+TransDias(i,85)
  xqty3sbd1sh=xqty3sbd1sh+TransDias(i,88)
  xqty1sbd3sh=xqty1sbd3sh+TransDias(i,91)
  xqty2sbd3sh=xqty2sbd3sh+TransDias(i,94)
  xqty3sbd3sh=xqty3sbd3sh+TransDias(i,97)
  
  xm21sbd1sh=xm21sbd1sh+TransDias(i,83)
  xm22sbd1sh=xm22sbd1sh+TransDias(i,86)
  xm23sbd1sh=xm23sbd1sh+TransDias(i,89)
  xm21sbd3sh=xm21sbd3sh+TransDias(i,92)
  xm22sbd3sh=xm22sbd3sh+TransDias(i,95)
  xm23sbd3sh=xm23sbd3sh+TransDias(i,98)
  
  xamt1sbd1sh=xamt1sbd1sh+TransDias(i,84)
  xamt2sbd1sh=xamt2sbd1sh+TransDias(i,87)
  xamt3sbd1sh=xamt3sbd1sh+TransDias(i,90)
  xamt1sbd3sh=xamt1sbd3sh+TransDias(i,93)
  xamt2sbd3sh=xamt2sbd3sh+TransDias(i,96)
  xamt3sbd3sh=xamt3sbd3sh+TransDias(i,99)
  
next
  'xm21sbd1=xm21sbd1-xm21sbd1sh
  'xamt1sbd1=xamt1sbd1-xamt1sbd1sh
  'xamt2sbd1=xamt2sbd1-xamt2sbd1sh
  'xamt3sbd1=xamt3sbd1-xamt3sbd1sh
  'xamt1sbd3=xamt1sbd3-xamt1sbd3sh
  'xamt2sbd3=xamt2sbd3xamt2sbd3sh
  'xamt3sbd3=xamt3sbd3xamt3sbd3sh


val21=0

 if correo="" or correo=null then
  
   response.Write("No hay correo")
 else
   response.Write("Enviando.... "&correo)
   Dim aencab
   aencab = Session("encuesta1")
   session("encuesta1") = null

'******************************************************
   xlbd1qtys1=0
   xlbd1m2s1=0
   xlbd1amts1=0
   xlbd1qtys2=0
   xlbd1m2s2=0
   xlbd1amts2=0
   xlbd1qtys3=0
   xlbd1m2s3=0
   xlbd1amts3=0
   xlbd3qtys1=0
   xlbd3m2s1=0
   xlbd3amts1=0
   xlbd3qtys2=0
   xlbd3m2s2=0
   xlbd3amts2=0
   xlbd3qtys3=0
   xlbd3m2s3=0
   xlbd3amts3=0
   set Rstransfer=cnn.execute("select * from transfer")
   if not rstransfer.eof then
    ltransdate=rstransfer("transdate")
    xlbd1qtys1=cdbl(rstransfer("tbd1qtys1"))
    xlbd1m2s1=cdbl(rstransfer("tbd1m2s1"))
    xlbd1amts1=cdbl(rstransfer("tbd1amts1"))
    xlbd1qtys2=cdbl(rstransfer("tbd1qtys2"))
    xlbd1m2s2=cdbl(rstransfer("tbd1m2s2"))
    xlbd1amts2=cdbl(rstransfer("tbd1amts2"))
    xlbd1qtys3=cdbl(rstransfer("tbd1qtys3"))
    xlbd1m2s3=cdbl(rstransfer("tbd1m2s3"))
    xlbd1amts3=cdbl(rstransfer("tbd1amts3"))
    xlbd3qtys1=cdbl(rstransfer("tbd3qtys1"))
    xlbd3m2s1=cdbl(rstransfer("tbd3m2s1"))
    xlbd3amts1=cdbl(rstransfer("tbd3amts1"))
    xlbd3qtys2=cdbl(rstransfer("tbd3qtys2"))
    xlbd3m2s2=cdbl(rstransfer("tbd3m2s2"))
    xlbd3amts2=cdbl(rstransfer("tbd3amts2"))
    xlbd3qtys3=cdbl(rstransfer("tbd3qtys3"))
    xlbd3m2s3=cdbl(rstransfer("tbd3m2s3"))
    xlbd3amts3=cdbl(rstransfer("tbd3amts3"))
    xlbd1qty=cdbl(rstransfer("tbd1qty"))
    xlbd1m2=cdbl(rstransfer("tbd1m2"))
    xlbd1amt=cdbl(rstransfer("tbd1amt"))
    xlbd3qty=cdbl(rstransfer("tbd3qty"))
    xlbd3m2=cdbl(rstransfer("tbd3m2"))
    xlbd3amt=cdbl(rstransfer("tbd3amt"))
   
   end if
'******************************** FIN TRANSFER
'******************** INICIO CORRUGATORS

 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
  xday = Right("00" & Day(Date), 2)
  xmonth = Right("00" & Month(Date), 2)
  xyear = Right("00" & Year(Date), 4)
  Date_ini=date()
  Date_end=date()
  'lhora=right("00"&hour(time),2)
  'lmin=right("00"&minute(time),2)
  lhora="06"
  lmin="52"
  ltime=lhora&lmin
  
  if ltime<"0659" then
   Date_ini=date()-1
   Date_end=date()-1
  end if
'end if

 layer=weekday(date()-1)
 'hractual=hour(Now)
 'minactual=minute(now)
 hractual=6
 minactual=52
''''''''''''''''''''''''''''''''''''''
'''''''''''calcula
 strday = Right("00" & Day(Date_ini), 2)
 strmonth = Right("00" & Month(Date_ini), 2)
 stryear = Right("00" & Year(Date_ini), 4)
 strday2 = Right("00" & Day(Date_end), 2)
 strmonth2 = Right("00" & Month(Date_end), 2)
 stryear2 = Right("00" & Year(Date_end), 4)
 fechainicial = CStr(stryear + strmonth + strday)
 fechafinal = CStr(stryear2 + strmonth2 + strday2)
 'fechainicial= "20200829"
 'fechafinal=  "20200829"
 'lfecinicial="20200829"
 ldaterep="09/08/2020"

 'response.write(fechainicial)&" FI "
 ' response.write(fechafinal)&" Ff "
ReDim Corr1(24,12)
%>
<center>
<span class="style8">Production Corrugator Machine</span><br>
<span class="style8">Date: <%=Date_ini%> To: <%=Date_end%> Generated: <%=time%></span>
</center>
<%    

'************** 

'lturno=0
Dim Rsinven1, Rsinven2, rswip, Rsmachine
Dim Sqlinven1, sqlinven2, sqlwip

'''''''''''''''''''''''''''''''''''''''
set Rscorr=dbsqlcorr.execute("select GOL,JIJG,JANG,WPOK,QTY,PQTY,SUJUNO,JOBYMD,CUST,BOX_NM,eqty,jtime,dtime,JOBJO,STIME,Etime from SHPSOUT(nolock) where jobymd between '" & fechainicial & "' and '" & fechafinal & "' order by JOBYMD,JOBJO")

 
  lturno1="1"
  lturno2="1"
  ldaytrans2=mid(fechainicial,5,2)&"/"&mid(fechainicial,7,2)&"/"&mid(fechainicial,3,2)
  mensaje2=mensaje2&"<br><br><strong>HOURLY CORRUGATOR PERFORMANCE </strong>"
  mensaje2=mensaje2&"<table border='1'>"
  mensaje2=mensaje2&"  <tr align='center'>"
  mensaje2=mensaje2&"    <th scope='col'>"&ldaytrans2&"</th>"
  mensaje2=mensaje2&"    <th colspan='2' scope='col'>C1</th>"
  mensaje2=mensaje2&"    <th colspan='2' scope='col'>C2</th>"
  mensaje2=mensaje2&"    <th colspan='3' scope='col'>Total</th>"
  mensaje2=mensaje2&"    <th colspan='3' scope='col'>Progress(%)</th>"
  mensaje2=mensaje2&"  </tr>"
  mensaje2=mensaje2&"  <tr align='center'>"
  mensaje2=mensaje2&"    <th scope='row'>Time:</th>"
  mensaje2=mensaje2&"    <td>M</td>"
  mensaje2=mensaje2&"    <td>M2</td>"
  mensaje2=mensaje2&"    <td>M</td>"
  mensaje2=mensaje2&"    <td>M2</td>"
  mensaje2=mensaje2&"    <td>Qty</td>"
  mensaje2=mensaje2&"    <td>M</td>"
  mensaje2=mensaje2&"    <td>M2</td>"
  mensaje2=mensaje2&"    <td>C1</td>"
  mensaje2=mensaje2&"    <td>C2</td>"
  mensaje2=mensaje2&"    <td>Target</td>"
  mensaje2=mensaje2&"  </tr>" 




 If Rscorr.EOF And Rscorr.BOF Then
   response.Write("No records exist for corr. this date.")
 Else
  

'   mensaje2=" <strong> TRANSFER (Samsung OB)</strong> <br><br>"
 

  TOTML=0
  TOTM2=0
  Rscorr.movefirst
  Do While Not Rscorr.EOF
      lstime=Rscorr("STIME")

     if left(Rscorr("JOBJO"),1)="A" then
	  if Rscorr("jtime")>25000 then
	   lstime="06:50:00"
       ehora1=int(mid(Rscorr("ETIME"),1,2))*3600
	   ehora2=int(mid(Rscorr("ETIME"),4,2))*60
	   ehora3=int(mid(Rscorr("ETIME"),7,2))
	   hend=ehora1+ehora2+ehora3
	   Tiempo2=hend-24600
      else
       Tiempo2 = Rscorr("jtime")
      end if	
	  'response.write(" 1 ")
	 else
	   lstime=Rscorr("STIME")
	   Tiempo2 = Rscorr("jtime")
	   	  'response.write(" 2 ")
	 end if
    'lturno1=Rscorr("JOBJO")

     '"15:10:57"
          ''''''''''''''''''''' por hora
		    hrfin=mid(Rscorr("ETIME"),1,2)&mid(Rscorr("ETIME"),4,2)&mid(Rscorr("ETIME"),7,2)

		  if hrfin>"064959" and hrfin<"075000" then
            Corr1(1,3)=Corr1(1,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(1,4)=Corr1(1,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(1,7)=Corr1(1,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"074959" and hrfin<"085000" then
            Corr1(2,3)=Corr1(2,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(2,4)=Corr1(2,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(2,7)=Corr1(2,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"084959" and hrfin<"095000" then
            Corr1(3,3)=Corr1(3,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(3,4)=Corr1(3,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(3,7)=Corr1(3,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"094959" and hrfin<"105000" then
            Corr1(4,3)=Corr1(4,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(4,4)=Corr1(4,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(4,7)=Corr1(4,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"104959" and hrfin<"115000" then
            Corr1(5,3)=Corr1(5,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(5,4)=Corr1(5,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(5,7)=Corr1(5,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"114959" and hrfin<"125000" then
            Corr1(6,3)=Corr1(6,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(6,4)=Corr1(6,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(6,7)=Corr1(6,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"124959" and hrfin<"135000" then
            Corr1(7,3)=Corr1(7,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(7,4)=Corr1(7,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(7,7)=Corr1(7,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"134959" and hrfin<"145000" then
            Corr1(8,3)=Corr1(8,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(8,4)=Corr1(8,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(8,7)=Corr1(8,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"144959" and hrfin<"155000" then
            Corr1(9,3)=Corr1(9,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(9,4)=Corr1(9,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(9,7)=Corr1(9,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"154959" and hrfin<"165000" then
            Corr1(10,3)=Corr1(10,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(10,4)=Corr1(10,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(10,7)=Corr1(10,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"164959" and hrfin<"175000" then
            Corr1(11,3)=Corr1(11,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(11,4)=Corr1(11,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(11,7)=Corr1(11,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"174959" and hrfin<"185000" then
            Corr1(12,3)=Corr1(12,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(12,4)=Corr1(12,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(12,7)=Corr1(12,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"184959" and hrfin<"195000" then
            Corr1(13,3)=Corr1(13,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(13,4)=Corr1(13,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(13,7)=Corr1(13,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"194959" and hrfin<"205000" then
            Corr1(14,3)=Corr1(14,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(14,4)=Corr1(14,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(14,7)=Corr1(14,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"204959" and hrfin<"215000" then
            Corr1(15,3)=Corr1(15,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(15,4)=Corr1(15,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(15,7)=Corr1(15,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"214959" and hrfin<"225000" then
            Corr1(16,3)=Corr1(16,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(16,4)=Corr1(16,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(16,7)=Corr1(16,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"224959" and hrfin<"235000" then
            Corr1(17,3)=Corr1(17,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(17,4)=Corr1(17,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(17,7)=Corr1(17,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"234959" and hrfin<"005000" then
            Corr1(18,3)=Corr1(18,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(18,4)=Corr1(18,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(18,7)=Corr1(18,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"004959" and hrfin<"015000" then
            Corr1(19,3)=Corr1(19,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(19,4)=Corr1(19,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(19,7)=Corr1(19,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"014959" and hrfin<"025000" then
            Corr1(20,3)=Corr1(20,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(20,4)=Corr1(20,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(20,7)=Corr1(20,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"024959" and hrfin<"035000" then
            Corr1(21,3)=Corr1(21,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(21,4)=Corr1(21,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(21,7)=Corr1(21,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"034959" and hrfin<"045000" then
            Corr1(22,3)=Corr1(22,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(22,4)=Corr1(22,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(22,7)=Corr1(22,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"044959" and hrfin<"055000" then
            Corr1(23,3)=Corr1(23,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(23,4)=Corr1(23,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(23,7)=Corr1(23,7)+int(Rscorr("PQTY"))
		  end if
		  if hrfin>"054959" and hrfin<"065000" then
            Corr1(24,3)=Corr1(24,3)+int((Rscorr("JANG")*Rscorr("PQTY")/1000))
            Corr1(24,4)=Corr1(24,4)+int((Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000))
			Corr1(24,7)=Corr1(24,7)+int(Rscorr("PQTY"))
		  end if
		 
		  
	
	   'TOTTARGET2=TOTTARGET2+cdbl(Rscorr("QTY"))
       'TOTPROD2=TOTPROD2+cdbl(Rscorr("PQTY"))
       TOTML2=TOTML2+(Rscorr("JANG")*Rscorr("PQTY")/1000)
       TOTM22=TOTM22+(Rscorr("JANG")*Rscorr("WPOK")*Rscorr("PQTY")/1000000)
	   'TOTbad2=TOTbad2+cdbl(Rscorr("eQTY"))
	   'TOTjtime2=TOTjtime2+cdbl(Tiempo2)
       'TOTdtime2=TOTdtime2+cdbl(Rscorr("dtime"))
	
  RsCORR.MoveNext
	
	
 LOOP
END IF
rscorr.close
'''''''''''''''''''''''   Corr 2
Date_ini=Request.Form("Date_ini")
Date_end=Request.Form("Date_end")
hractual=6
	  if hractual<7 then
        Date_ini=date()-1
        Date_end=date()-1
	  end if

Date_end2=cdate(Date_end)+1

 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_end2), 2)
 strmonth2 = Right("00" & Month(Date_end2), 2)
 stryear2 = Right("0000" & Year(Date_end2), 4)
 
 fechainicial = CStr(stryear & strmonth & strday)
 fechafinal2 = CStr(stryear2 & strmonth2 & strday2)
 'fechainicial ="20200829"
 'fechafinal2 ="20200830"
response.write(fechainicial&" ")
response.write("FF "&fechafinal2)

set strConexao = CreateObject("ADODB.Connection") ' setear la conexion

strConexao.Open("DRIVER=Firebird/InterBase(r) driver;UID=SYSDBA;PWD=molra; DBNAME=192.168.0.201:C:\PAUL\data\CARDBOARD20.FDB")

 If Err.Number <> 0 then

 else
'abrir la base
  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 left(STAT,1)='T'  order by STIME,etime")

  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="1"
   Do While Not corr2.EOF
     'response.write(mid(Corr2("STIME"),1,8)&" - ")
     if left(Corr2("stat"),1)="T" then
      'response.write(" ESTATUS ")
     end if
     Echeck=left(Corr2("Extracheck"),1)
     'if Corr2("CUST")<>"                                      " THEN
	 lestado=0
   
     'if Echeck="A" THEN
     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)
     fecha1= mid(Corr2("STIME"),1,8)
	
      if (mid(Corr2("STIME"),1,8)=fechainicial and (shora<"065000" and Ehora<"065001")) then
       'CORR2.MoveNext
 	   lestado=0
  	   'response.write(" if 1 ")
      end if
      Sec1=0
	  Sec2=0
	  
      if (shora<"065000") and (Ehora>"064959") then
 	    shora1=int(mid(Corr2("STIME"),10,2))*3600
	    shora2=int(mid(Corr2("STIME"),13,2))*60
	    shora3=int(mid(Corr2("STIME"),16,2))
	   hstart=shora1+shora2+shora3
	    ehora1=int(mid(Corr2("ETIME"),10,2))*3600
	    ehora2=int(mid(Corr2("ETIME"),13,2))*60
	    ehora3=int(mid(Corr2("ETIME"),16,2))
	   hend=ehora1+ehora2+ehora3
	    Shift1=24600
	    Sec1=int(Shift1-hstart)
	    Sec2=int(hend-Shift1)
		'response.write(" if 2 ")
      end if
      if (mid(Corr2("STIME"),1,8)=fechainicial) then
	    'response.write(" if 3 ")
	   if Sec1>Sec2 then
 	    'CORR2.MoveNext
	    lestado=0
	    'response.write(" if 4 ")
	   else
        if Sec1<Sec2 then
	      'response.write(" if 5 ")
	      lestado=1
	      xTurno="1" 
	    end if
	   end if
	  end if

	  if mid(Corr2("STIME"),1,8)=fechainicial and shora>"064959" then
	    'response.write(" if 6 ")
        lestado=1
		Sec12=0
		Sec13=0
		Sec22=0
		Sec23=0
		if shora<"152000" and Ehora>"151959" then
 	     shora1=int(mid(Corr2("STIME"),10,2))*3600
	     shora2=int(mid(Corr2("STIME"),13,2))*60
	     shora3=int(mid(Corr2("STIME"),16,2))
	     hstart2=shora1+shora2+shora3
	     ehora1=int(mid(Corr2("ETIME"),10,2))*3600
	     ehora2=int(mid(Corr2("ETIME"),13,2))*60
	     ehora3=int(mid(Corr2("ETIME"),16,2))
	     hend2=ehora1+ehora2+ehora3
	     Shift2=55200
	     Sec12=int(Shift2-hstart2)
	     Sec22=int(hend2-Shift2)
        end if
		if shora<"232000" and Ehora>"231959" then
 	     shora1=int(mid(Corr2("STIME"),10,2))*3600
	     shora2=int(mid(Corr2("STIME"),13,2))*60
	     shora3=int(mid(Corr2("STIME"),16,2))
	     hstart3=shora1+shora2+shora3
	     ehora1=int(mid(Corr2("ETIME"),10,2))*3600
	     ehora2=int(mid(Corr2("ETIME"),13,2))*60
	     ehora3=int(mid(Corr2("ETIME"),16,2))
	     hend3=ehora1+ehora2+ehora3
	     Shift3=84000
	     Sec13=int(Shift3-hstart3)
	     Sec23=int(hend3-Shift3)
        end if
		
	   	if shora>"064959" and shora<"151959" then
	     xTurno="1"
	    end if
	    if (shora>"151959" and shora<"232000") or Sec22>Sec12 then
	     xTurno="2"
	    end if
		if Sec22>Sec12 then
		 xTurno="2"
		end if
	    if shora>"231959" or shora<"064959" or Sec23>Sec13 then
	     xTurno="3"
	    end if
	  end if
	  
      if (mid(Corr2("STIME"),1,8)=fechafinal2) then
	    if (shora>"064959") then
         'CORR2.MoveNext
	     lestado=0
	    else
	     if Sec1<Sec2 then
	 	  'CORR2.MoveNext
	       lestado=0
	     else
	  	   lestado=1
	       xTurno="3"
         end if
	    end if
	  end if
	  
	  if mid(Corr2("STIME"),1,8)>fechainicial and mid(Corr2("STIME"),1,8)<fechafinal2 then
	    lestado=1
		Sec12=0
		Sec13=0
		Sec22=0
		Sec23=0
		if shora<"152000" and Ehora>"151959" then
 	     shora1=int(mid(Corr2("STIME"),10,2))*3600
	     shora2=int(mid(Corr2("STIME"),13,2))*60
	     shora3=int(mid(Corr2("STIME"),16,2))
	     hstart2=shora1+shora2+shora3
	     ehora1=int(mid(Corr2("ETIME"),10,2))*3600
	     ehora2=int(mid(Corr2("ETIME"),13,2))*60
	     ehora3=int(mid(Corr2("ETIME"),16,2))
	     hend2=ehora1+ehora2+ehora3
	     Shift2=55200
	     Sec12=int(Shift2-hstart2)
	     Sec22=int(hend2-Shift2)
        end if
		if shora<"232000" and Ehora>"231959" then
 	     shora1=int(mid(Corr2("STIME"),10,2))*3600
	     shora2=int(mid(Corr2("STIME"),13,2))*60
	     shora3=int(mid(Corr2("STIME"),16,2))
	     hstart3=shora1+shora2+shora3
	     ehora1=int(mid(Corr2("ETIME"),10,2))*3600
	     ehora2=int(mid(Corr2("ETIME"),13,2))*60
	     ehora3=int(mid(Corr2("ETIME"),16,2))
	     hend3=ehora1+ehora2+ehora3
	     Shift3=84000
	     Sec13=int(Shift3-hstart3)
	     Sec23=int(hend3-Shift3)
        end if
		
	   	if shora>"064959" and shora<"151959" then
	     xTurno="1"
	    end if
	    if (shora>"151959" and shora<"232000") or Sec22>Sec12 then
	     xTurno="2"
	    end if
		if Sec22>Sec12 then
		 xTurno="2"
		end if
	    if shora>"231959" or shora<"064959" or Sec23>Sec13 then
	     xTurno="3"
	    end if
	  end if
	  
	 if lestado=0 then
	  CORR2.MoveNext
	 end if
	 
     if lestado=1 then
       lm=int(cdbl(Corr2("Jang"))*(cdbl(Corr2("PQTY"))-cdbl(Corr2("PREPQTY")))/1000)
       lm2=int((cdbl(Corr2("Jang"))*cdbl(Corr2("WPOK")))*(cdbl(Corr2("PQTY"))-cdbl(Corr2("PREPQTY")))/1000000)

       TOTPROD=TOTPROD+cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY"))
       TOTML=TOTML+lm       '(corr2("JANG")*corr2("PQTY")/1000)
       TOTM2=TOTM2+lm2      '(corr2("JANG")*corr2("WPOK")*corr2("PQTY")/1000000)
       
	   
          ''''''''''''''''''''' por hora
		    'hrfin=mid(Rscorr("ETIME"),1,2)&":"&mid(Rscorr("ETIME"),4,2)&":"&mid(Rscorr("ETIME"),7,2)
            Ehoraf = mid(Corr2("ETIME"),10,2)&mid(Corr2("ETIME"),13,2)&mid(Corr2("ETIME"),16,2)
response.write(" HF "&Ehoraf)
		  if Ehoraf>"064959" and Ehoraf<"075000" then
            Corr1(1,5)=Corr1(1,5)+lm
            Corr1(1,6)=Corr1(1,6)+lm2
			Corr1(1,7)=Corr1(1,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"074959" and Ehoraf<"085000" then
            Corr1(2,5)=Corr1(2,5)+lm
            Corr1(2,6)=Corr1(2,6)+lm2
			Corr1(2,7)=Corr1(2,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"084959" and Ehoraf<"095000" then
            Corr1(3,5)=Corr1(3,5)+lm
            Corr1(3,6)=Corr1(3,6)+lm2
			Corr1(3,7)=Corr1(3,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"094959" and Ehoraf<"105000" then
            Corr1(4,5)=Corr1(4,5)+lm
            Corr1(4,6)=Corr1(4,6)+lm2
			Corr1(4,7)=Corr1(4,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"104959" and Ehoraf<"115000" then
            Corr1(5,5)=Corr1(5,5)+lm
            Corr1(5,6)=Corr1(5,6)+lm2
			Corr1(5,7)=Corr1(5,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"114959" and Ehoraf<"125000" then
            Corr1(6,5)=Corr1(6,5)+lm
            Corr1(6,6)=Corr1(6,6)+lm2
			Corr1(6,7)=Corr1(6,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"124959" and Ehoraf<"135000" then
            Corr1(7,5)=Corr1(7,5)+lm
            Corr1(7,6)=Corr1(7,6)+lm2
			Corr1(7,7)=Corr1(7,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"134959" and Ehoraf<"145000" then
            Corr1(8,5)=Corr1(8,5)+lm
            Corr1(8,6)=Corr1(8,6)+lm2
			Corr1(8,7)=Corr1(8,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"144959" and Ehoraf<"155000" then
            Corr1(9,5)=Corr1(9,5)+lm
            Corr1(9,6)=Corr1(9,6)+lm2
			Corr1(9,7)=Corr1(9,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"154959" and Ehoraf<"165000" then
            Corr1(10,5)=Corr1(10,5)+lm
            Corr1(10,6)=Corr1(10,6)+lm2
			Corr1(10,7)=Corr1(10,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"164959" and Ehoraf<"175000" then
            Corr1(11,5)=Corr1(11,5)+lm
            Corr1(11,6)=Corr1(11,6)+lm2
			Corr1(11,7)=Corr1(11,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"174959" and Ehoraf<"185000" then
            Corr1(12,5)=Corr1(12,5)+lm
            Corr1(12,6)=Corr1(12,6)+lm2
			Corr1(12,7)=Corr1(12,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"184959" and Ehoraf<"195000" then
            Corr1(13,5)=Corr1(13,5)+lm
            Corr1(13,6)=Corr1(13,6)+lm2
			Corr1(13,7)=Corr1(13,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"194959" and Ehoraf<"205000" then
            Corr1(14,5)=Corr1(14,5)+lm
            Corr1(14,6)=Corr1(14,6)+lm2
			Corr1(14,7)=Corr1(14,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"204959" and Ehoraf<"215000" then
            Corr1(15,5)=Corr1(15,5)+lm
            Corr1(15,6)=Corr1(15,6)+lm2
			Corr1(15,7)=Corr1(15,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"214959" and Ehoraf<"225000" then
            Corr1(16,5)=Corr1(16,5)+lm
            Corr1(16,6)=Corr1(16,6)+lm2
			Corr1(16,7)=Corr1(16,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"224959" and Ehoraf<"235000" then
            Corr1(17,5)=Corr1(17,5)+lm
            Corr1(17,6)=Corr1(17,6)+lm2
			Corr1(17,7)=Corr1(17,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"234959" and Ehoraf<"005000" then
            Corr1(18,5)=Corr1(18,5)+lm
            Corr1(18,6)=Corr1(18,6)+lm2
			Corr1(18,7)=Corr1(18,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"004959" and Ehoraf<"015000" then
            Corr1(19,5)=Corr1(19,5)+lm
            Corr1(19,6)=Corr1(19,6)+lm2
			Corr1(19,7)=Corr1(19,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"014959" and Ehoraf<"025000" then
            Corr1(20,5)=Corr1(20,5)+lm
            Corr1(20,6)=Corr1(20,6)+lm2
			Corr1(20,7)=Corr1(20,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"024959" and Ehoraf<"035000" then
            Corr1(21,5)=Corr1(21,5)+lm
            Corr1(21,6)=Corr1(21,6)+lm2
			Corr1(21,7)=Corr1(21,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"034959" and Ehoraf<"045000" then
            Corr1(22,5)=Corr1(22,5)+lm
            Corr1(22,6)=Corr1(22,6)+lm2
			Corr1(22,7)=Corr1(22,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"044959" and Ehoraf<"055000" then
            Corr1(23,5)=Corr1(23,5)+lm
            Corr1(23,6)=Corr1(23,6)+lm2
			Corr1(23,7)=Corr1(23,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
		  if Ehoraf>"054959" and Ehoraf<"065000" then
            Corr1(24,5)=Corr1(24,5)+lm
            Corr1(24,6)=Corr1(24,6)+lm2
			Corr1(24,7)=Corr1(24,7)+int(cdbl(corr2("PQTY"))-cdbl(Corr2("PREPQTY")))
		  end if
	
       CORR2.MoveNext
     end if 
   LOOP
   corr2.close
  end if  'Error
 end if


''''''''''''''''''''''''
		  hractual=hour(Now)
		  hractual=6
		  if hractual=7 then
		   llines=1
		  end if
		  if hractual=8 then
		   llines=2
		  end if
		  if hractual=9 then
		   llines=3
		  end if
		  if hractual=10 then
		   llines=4
		  end if
		  if hractual=11 then
		   llines=5
		  end if
		  if hractual=12 then
		   llines=6
		  end if
		  if hractual=13 then
		   llines=7
		  end if
		  if hractual=14 then
		   llines=8
		  end if
		  if hractual=15 then
		   llines=9
		  end if
		  if hractual=16 then
		   llines=10
		  end if
		  if hractual=17 then
		   llines=11
		  end if
		  if hractual=18 then
		   llines=12
		  end if
		  if hractual=19 then
		   llines=13
		  end if
		  if hractual=20 then
		   llines=14
		  end if
		  if hractual=21 then
		   llines=15
		  end if
		  if hractual=22 then
		   llines=16
		  end if
		  if hractual=23 then
		   llines=17
		  end if
		  if hractual=0 then
		   llines=18
		  end if
		  if hractual=1 then
		   llines=19
		  end if
		  if hractual=2 then
		   llines=20
		  end if
		  if hractual=3 then
		   llines=21
		  end if
		  if hractual=4 then
		   llines=22
		  end if
		  if hractual=5 then
		   llines=23
		  end if
		  if hractual=6 then
		   llines=24
		  end if
   


lweekday=Weekday(date)
If lweekday = 1 then
 lhtc1=12
 lhtc2=8
 lhrwrk=12
else
 lhtc1=24
 lhtc2=24
 lhrwrk=24
end if

 lhtc1=24
 lhtc2=24
 lhrwrk=24

ltarget1=5000*lhtc1
ltarget2=5000*lhtc2
      Mensaje2=mensaje2&"  <tr>"
      Mensaje2=mensaje2&"    <th align='center' scope='row'>7:50</th>"
      Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(1,3)&"</td>"
      Mensaje2=mensaje2&"    <td align='right'>"&Corr1(1,4)&"</td>"
      Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(1,5)&"</td>"
      Mensaje2=mensaje2&"    <td align='right'>"&Corr1(1,6)&"</td>"
      Mensaje2=mensaje2&"    <td align='right'>"&Corr1(1,7)&"</td>"
      Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(Corr1(1,3)+Corr1(1,5))&"</td>"
      Mensaje2=mensaje2&"    <td align='right'>"&(Corr1(1,4)+Corr1(1,6))&"</td>"
      Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((Corr1(1,3)/ltarget1)*100,1)&"%</td>"
      Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((Corr1(1,5)/ltarget2)*100,1)&"%</td>"
      Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((1/lhrwrk)*100,1)&"%</td>"
      Mensaje2=mensaje2&"  </tr>"
	  
	  h1m=Corr1(1,3)+Corr1(1,5)
	  h1m2=Corr1(1,4)+Corr1(1,6)
	  h2m=Corr1(2,3)+Corr1(2,5)
	  h2m2=Corr1(2,4)+Corr1(2,6)
	  h3m=Corr1(3,3)+Corr1(3,5)
	  h3m2=Corr1(3,4)+Corr1(3,6)
	  h4m=Corr1(4,3)+Corr1(4,5)
	  h4m2=Corr1(4,4)+Corr1(4,6)
	  h5m=Corr1(5,3)+Corr1(5,5)
	  h5m2=Corr1(5,4)+Corr1(5,6)
	  h6m=Corr1(6,3)+Corr1(6,5)
	  h6m2=Corr1(6,4)+Corr1(6,6)
	  h7m=Corr1(7,3)+Corr1(7,5)
	  h7m2=Corr1(7,4)+Corr1(7,6)
	  h8m=Corr1(8,3)+Corr1(8,5)
	  h8m2=Corr1(8,4)+Corr1(8,6)
	  h9m=Corr1(9,3)+Corr1(9,5)
	  h9m2=Corr1(9,4)+Corr1(9,6)
	  h10m=Corr1(10,3)+Corr1(10,5)
	  h10m2=Corr1(10,4)+Corr1(10,6)
	  h11m=Corr1(11,3)+Corr1(11,5)
	  h11m2=Corr1(11,4)+Corr1(11,6)
	  h12m=Corr1(12,3)+Corr1(12,5)
	  h12m2=Corr1(12,4)+Corr1(12,6)
	  h13m=Corr1(13,3)+Corr1(13,5)
	  h13m2=Corr1(13,4)+Corr1(13,6)
	  h14m=Corr1(14,3)+Corr1(14,5)
	  h14m2=Corr1(14,4)+Corr1(14,6)
	  h15m=Corr1(15,3)+Corr1(15,5)
	  h15m2=Corr1(15,4)+Corr1(15,6)
	  h16m=Corr1(16,3)+Corr1(16,5)
	  h16m2=Corr1(16,4)+Corr1(16,6)
	  h17m=Corr1(17,3)+Corr1(17,5)
	  h17m2=Corr1(17,4)+Corr1(17,6)
	  h18m=Corr1(18,3)+Corr1(18,5)
	  h18m2=Corr1(18,4)+Corr1(18,6)
	  h19m=Corr1(19,3)+Corr1(19,5)
	  h19m2=Corr1(19,4)+Corr1(19,6)
	  h20m=Corr1(20,3)+Corr1(20,5)
	  h20m2=Corr1(20,4)+Corr1(20,6)
	  h21m=Corr1(21,3)+Corr1(21,5)
	  h21m2=Corr1(21,4)+Corr1(21,6)
	  h22m=Corr1(22,3)+Corr1(22,5)
	  h22m2=Corr1(22,4)+Corr1(22,6)
	  h23m=Corr1(23,3)+Corr1(23,5)
	  h23m2=Corr1(23,4)+Corr1(23,6)
	  h24m=Corr1(24,3)+Corr1(24,5)
	  h24m2=Corr1(24,4)+Corr1(24,6)
	  
      if llines>1 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>8:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((2/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>2 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>9:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((3/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>3 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>10:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((4/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>4 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>11:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((5/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>5 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>12:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((6/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>6 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>13:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((7/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>7 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>14:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((8/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>8 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>15:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((9/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>9 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>16:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(10,4)+Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(10,6)+Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(10,7)+Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h10m+h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h10m2+h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((10/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>10 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>17:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(11,4)+Corr1(10,4)+Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(11,6)+Corr1(10,6)+Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(11,7)+Corr1(10,7)+Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h11m+h10m+h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h11m2+h10m2+h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((11/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>11 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>18:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(12,4)+Corr1(11,4)+Corr1(10,4)+Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(12,6)+Corr1(11,6)+Corr1(10,6)+Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(12,7)+Corr1(11,7)+Corr1(10,7)+Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h12m+h11m+h10m+h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h12m2+h11m2+h10m2+h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((12/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>12 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>19:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(13,4)+Corr1(12,4)+Corr1(11,4)+Corr1(10,4)+Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(13,6)+Corr1(12,6)+Corr1(11,6)+Corr1(10,6)+Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(13,7)+Corr1(12,7)+Corr1(11,7)+Corr1(10,7)+Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h13m+h12m+h11m+h10m+h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h13m2+h12m2+h11m2+h10m2+h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((13/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>13 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>20:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(14,4)+Corr1(13,4)+Corr1(12,4)+Corr1(11,4)+Corr1(10,4)+Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(14,6)+Corr1(13,6)+Corr1(12,6)+Corr1(11,6)+Corr1(10,6)+Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(14,7)+Corr1(13,7)+Corr1(12,7)+Corr1(11,7)+Corr1(10,7)+Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h14m+h13m+h12m+h11m+h10m+h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h14m2+h13m2+h12m2+h11m2+h10m2+h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((14/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>14 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>21:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(15,4)+Corr1(14,4)+Corr1(13,4)+Corr1(12,4)+Corr1(11,4)+Corr1(10,4)+Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(15,6)+Corr1(14,6)+Corr1(13,6)+Corr1(12,6)+Corr1(11,6)+Corr1(10,6)+Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(15,7)+Corr1(14,7)+Corr1(13,7)+Corr1(12,7)+Corr1(11,7)+Corr1(10,7)+Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h15m+h14m+h13m+h12m+h11m+h10m+h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h15m2+h14m2+h13m2+h12m2+h11m2+h10m2+h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((15/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>15 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>22:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(16,4)+Corr1(15,4)+Corr1(14,4)+Corr1(13,4)+Corr1(12,4)+Corr1(11,4)+Corr1(10,4)+Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(16,6)+Corr1(15,6)+Corr1(14,6)+Corr1(13,6)+Corr1(12,6)+Corr1(11,6)+Corr1(10,6)+Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(16,7)+Corr1(15,7)+Corr1(14,7)+Corr1(13,7)+Corr1(12,7)+Corr1(11,7)+Corr1(10,7)+Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h16m+h15m+h14m+h13m+h12m+h11m+h10m+h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h16m2+h15m2+h14m2+h13m2+h12m2+h11m2+h10m2+h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((16/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>16 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>23:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(17,4)+Corr1(16,4)+Corr1(15,4)+Corr1(14,4)+Corr1(13,4)+Corr1(12,4)+Corr1(11,4)+Corr1(10,4)+Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(17,6)+Corr1(16,6)+Corr1(15,6)+Corr1(14,6)+Corr1(13,6)+Corr1(12,6)+Corr1(11,6)+Corr1(10,6)+Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(17,7)+Corr1(16,7)+Corr1(15,7)+Corr1(14,7)+Corr1(13,7)+Corr1(12,7)+Corr1(11,7)+Corr1(10,7)+Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h17m+h16m+h15m+h14m+h13m+h12m+h11m+h10m+h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h17m2+h16m2+h15m2+h14m2+h13m2+h12m2+h11m2+h10m2+h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((17/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>17 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>00:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(18,3)+Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(18,4)+Corr1(17,4)+Corr1(16,4)+Corr1(15,4)+Corr1(14,4)+Corr1(13,4)+Corr1(12,4)+Corr1(11,4)+Corr1(10,4)+Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(18,5)+Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(18,6)+Corr1(17,6)+Corr1(16,6)+Corr1(15,6)+Corr1(14,6)+Corr1(13,6)+Corr1(12,6)+Corr1(11,6)+Corr1(10,6)+Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(18,7)+Corr1(17,7)+Corr1(16,7)+Corr1(15,7)+Corr1(14,7)+Corr1(13,7)+Corr1(12,7)+Corr1(11,7)+Corr1(10,7)+Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h18m+h17m+h16m+h15m+h14m+h13m+h12m+h11m+h10m+h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h18m2+h17m2+h16m2+h15m2+h14m2+h13m2+h12m2+h11m2+h10m2+h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(18,3)+Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(18,5)+Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((18/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>18 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>01:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(19,3)+Corr1(18,3)+Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(19,4)+Corr1(18,4)+Corr1(17,4)+Corr1(16,4)+Corr1(15,4)+Corr1(14,4)+Corr1(13,4)+Corr1(12,4)+Corr1(11,4)+Corr1(10,4)+Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(19,5)+Corr1(18,5)+Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(19,6)+Corr1(18,6)+Corr1(17,6)+Corr1(16,6)+Corr1(15,6)+Corr1(14,6)+Corr1(13,6)+Corr1(12,6)+Corr1(11,6)+Corr1(10,6)+Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(19,7)+Corr1(18,7)+Corr1(17,7)+Corr1(16,7)+Corr1(15,7)+Corr1(14,7)+Corr1(13,7)+Corr1(12,7)+Corr1(11,7)+Corr1(10,7)+Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h19m+h18m+h17m+h16m+h15m+h14m+h13m+h12m+h11m+h10m+h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h19m2+h18m2+h17m2+h16m2+h15m2+h14m2+h13m2+h12m2+h11m2+h10m2+h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(19,3)+Corr1(18,3)+Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(19,5)+Corr1(18,5)+Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((19/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>19 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>02:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(20,3)+Corr1(19,3)+Corr1(18,3)+Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(20,4)+Corr1(19,4)+Corr1(18,4)+Corr1(17,4)+Corr1(16,4)+Corr1(15,4)+Corr1(14,4)+Corr1(13,4)+Corr1(12,4)+Corr1(11,4)+Corr1(10,4)+Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(20,5)+Corr1(19,5)+Corr1(18,5)+Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(20,6)+Corr1(19,6)+Corr1(18,6)+Corr1(17,6)+Corr1(16,6)+Corr1(15,6)+Corr1(14,6)+Corr1(13,6)+Corr1(12,6)+Corr1(11,6)+Corr1(10,6)+Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(20,7)+Corr1(19,7)+Corr1(18,7)+Corr1(17,7)+Corr1(16,7)+Corr1(15,7)+Corr1(14,7)+Corr1(13,7)+Corr1(12,7)+Corr1(11,7)+Corr1(10,7)+Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h20m+h19m+h18m+h17m+h16m+h15m+h14m+h13m+h12m+h11m+h10m+h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h20m2+h19m2+h18m2+h17m2+h16m2+h15m2+h14m2+h13m2+h12m2+h11m2+h10m2+h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(20,3)+Corr1(19,3)+Corr1(18,3)+Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(20,5)+Corr1(19,5)+Corr1(18,5)+Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((20/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>20 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>03:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(21,3)+Corr1(20,3)+Corr1(19,3)+Corr1(18,3)+Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(21,4)+Corr1(20,4)+Corr1(19,4)+Corr1(18,4)+Corr1(17,4)+Corr1(16,4)+Corr1(15,4)+Corr1(14,4)+Corr1(13,4)+Corr1(12,4)+Corr1(11,4)+Corr1(10,4)+Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(21,5)+Corr1(20,5)+Corr1(19,5)+Corr1(18,5)+Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(21,5)+Corr1(20,6)+Corr1(19,6)+Corr1(18,6)+Corr1(17,6)+Corr1(16,6)+Corr1(15,6)+Corr1(14,6)+Corr1(13,6)+Corr1(12,6)+Corr1(11,6)+Corr1(10,6)+Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(21,6)+Corr1(20,7)+Corr1(19,7)+Corr1(18,7)+Corr1(17,7)+Corr1(16,7)+Corr1(15,7)+Corr1(14,7)+Corr1(13,7)+Corr1(12,7)+Corr1(11,7)+Corr1(10,7)+Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h21m+h20m+h19m+h18m+h17m+h16m+h15m+h14m+h13m+h12m+h11m+h10m+h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h21m2+h20m2+h19m2+h18m2+h17m2+h16m2+h15m2+h14m2+h13m2+h12m2+h11m2+h10m2+h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(21,3)+Corr1(20,3)+Corr1(19,3)+Corr1(18,3)+Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(21,5)+Corr1(20,5)+Corr1(19,5)+Corr1(18,5)+Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((21/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>21 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>04:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(22,3)+Corr1(21,3)+Corr1(20,3)+Corr1(19,3)+Corr1(18,3)+Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(22,4)+Corr1(21,4)+Corr1(20,4)+Corr1(19,4)+Corr1(18,4)+Corr1(17,4)+Corr1(16,4)+Corr1(15,4)+Corr1(14,4)+Corr1(13,4)+Corr1(12,4)+Corr1(11,4)+Corr1(10,4)+Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(22,5)+Corr1(21,5)+Corr1(20,5)+Corr1(19,5)+Corr1(18,5)+Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(22,6)+Corr1(21,5)+Corr1(20,6)+Corr1(19,6)+Corr1(18,6)+Corr1(17,6)+Corr1(16,6)+Corr1(15,6)+Corr1(14,6)+Corr1(13,6)+Corr1(12,6)+Corr1(11,6)+Corr1(10,6)+Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(22,7)+Corr1(21,6)+Corr1(20,7)+Corr1(19,7)+Corr1(18,7)+Corr1(17,7)+Corr1(16,7)+Corr1(15,7)+Corr1(14,7)+Corr1(13,7)+Corr1(12,7)+Corr1(11,7)+Corr1(10,7)+Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h22m+h21m+h20m+h19m+h18m+h17m+h16m+h15m+h14m+h13m+h12m+h11m+h10m+h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h22m2+h21m2+h20m2+h19m2+h18m2+h17m2+h16m2+h15m2+h14m2+h13m2+h12m2+h11m2+h10m2+h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(22,3)+Corr1(21,3)+Corr1(20,3)+Corr1(19,3)+Corr1(18,3)+Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(22,5)+Corr1(21,5)+Corr1(20,5)+Corr1(19,5)+Corr1(18,5)+Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((22/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>22 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>05:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(23,3)+Corr1(22,3)+Corr1(21,3)+Corr1(20,3)+Corr1(19,3)+Corr1(18,3)+Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(23,4)+Corr1(22,4)+Corr1(21,4)+Corr1(20,4)+Corr1(19,4)+Corr1(18,4)+Corr1(17,4)+Corr1(16,4)+Corr1(15,4)+Corr1(14,4)+Corr1(13,4)+Corr1(12,4)+Corr1(11,4)+Corr1(10,4)+Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(23,5)+Corr1(22,5)+Corr1(21,5)+Corr1(20,5)+Corr1(19,5)+Corr1(18,5)+Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(23,6)+Corr1(22,6)+Corr1(21,5)+Corr1(20,6)+Corr1(19,6)+Corr1(18,6)+Corr1(17,6)+Corr1(16,6)+Corr1(15,6)+Corr1(14,6)+Corr1(13,6)+Corr1(12,6)+Corr1(11,6)+Corr1(10,6)+Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(23,7)+Corr1(22,7)+Corr1(21,6)+Corr1(20,7)+Corr1(19,7)+Corr1(18,7)+Corr1(17,7)+Corr1(16,7)+Corr1(15,7)+Corr1(14,7)+Corr1(13,7)+Corr1(12,7)+Corr1(11,7)+Corr1(10,7)+Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h23m+h22m+h21m+h20m+h19m+h18m+h17m+h16m+h15m+h14m+h13m+h12m+h11m+h10m+h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h23m2+h22m2+h21m2+h20m2+h19m2+h18m2+h17m2+h16m2+h15m2+h14m2+h13m2+h12m2+h11m2+h10m2+h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(23,3)+Corr1(22,3)+Corr1(21,3)+Corr1(20,3)+Corr1(19,3)+Corr1(18,3)+Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(23,5)+Corr1(22,5)+Corr1(21,5)+Corr1(20,5)+Corr1(19,5)+Corr1(18,5)+Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((23/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

      if llines>23 then
       Mensaje2=mensaje2&"  <tr>"
       Mensaje2=mensaje2&"    <th align='center' scope='row'>06:50</th>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(24,3)+Corr1(23,3)+Corr1(22,3)+Corr1(21,3)+Corr1(20,3)+Corr1(19,3)+Corr1(18,3)+Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(24,4)+Corr1(23,4)+Corr1(22,4)+Corr1(21,4)+Corr1(20,4)+Corr1(19,4)+Corr1(18,4)+Corr1(17,4)+Corr1(16,4)+Corr1(15,4)+Corr1(14,4)+Corr1(13,4)+Corr1(12,4)+Corr1(11,4)+Corr1(10,4)+Corr1(9,4)+Corr1(8,4)+Corr1(7,4)+Corr1(6,4)+Corr1(5,4)+Corr1(4,4)+Corr1(3,4)+Corr1(2,4)+Corr1(1,4)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&Corr1(24,5)+Corr1(23,5)+Corr1(22,5)+Corr1(21,5)+Corr1(20,5)+Corr1(19,5)+Corr1(18,5)+Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(24,6)+Corr1(23,6)+Corr1(22,6)+Corr1(21,5)+Corr1(20,6)+Corr1(19,6)+Corr1(18,6)+Corr1(17,6)+Corr1(16,6)+Corr1(15,6)+Corr1(14,6)+Corr1(13,6)+Corr1(12,6)+Corr1(11,6)+Corr1(10,6)+Corr1(9,6)+Corr1(8,6)+Corr1(7,6)+Corr1(6,6)+Corr1(5,6)+Corr1(4,6)+Corr1(3,6)+Corr1(2,6)+Corr1(1,6)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&Corr1(24,7)+Corr1(23,7)+Corr1(22,7)+Corr1(21,6)+Corr1(20,7)+Corr1(19,7)+Corr1(18,7)+Corr1(17,7)+Corr1(16,7)+Corr1(15,7)+Corr1(14,7)+Corr1(13,7)+Corr1(12,7)+Corr1(11,7)+Corr1(10,7)+Corr1(9,7)+Corr1(8,7)+Corr1(7,7)+Corr1(6,7)+Corr1(5,7)+Corr1(4,7)+Corr1(3,7)+Corr1(2,7)+Corr1(1,7)&"</td>"
       Mensaje2=mensaje2&"    <td bgcolor='#F2DDDC' align='right'>"&(h24m+h23m+h22m+h21m+h20m+h19m+h18m+h17m+h16m+h15m+h14m+h13m+h12m+h11m+h10m+h9m+h8m+h7m+h6m+h5m+h4m+h3m+h2m+h1m)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&(h24m2+h23m2+h22m2+h21m2+h20m2+h19m2+h18m2+h17m2+h16m2+h15m2+h14m2+h13m2+h12m2+h11m2+h10m2+h9m2+h8m2+h7m2+h6m2+h5m2+h4m2+h3m2+h2m2+h1m2)&"</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(24,3)+Corr1(23,3)+Corr1(22,3)+Corr1(21,3)+Corr1(20,3)+Corr1(19,3)+Corr1(18,3)+Corr1(17,3)+Corr1(16,3)+Corr1(15,3)+Corr1(14,3)+Corr1(13,3)+Corr1(12,3)+Corr1(11,3)+Corr1(10,3)+Corr1(9,3)+Corr1(8,3)+Corr1(7,3)+Corr1(6,3)+Corr1(5,3)+Corr1(4,3)+Corr1(3,3)+Corr1(2,3)+Corr1(1,3))/ltarget1)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber(((Corr1(24,5)+Corr1(23,5)+Corr1(22,5)+Corr1(21,5)+Corr1(20,5)+Corr1(19,5)+Corr1(18,5)+Corr1(17,5)+Corr1(16,5)+Corr1(15,5)+Corr1(14,5)+Corr1(13,5)+Corr1(12,5)+Corr1(11,5)+Corr1(10,5)+Corr1(9,5)+Corr1(8,5)+Corr1(7,5)+Corr1(6,5)+Corr1(5,5)+Corr1(4,5)+Corr1(3,5)+Corr1(2,5)+Corr1(1,5))/ltarget2)*100,1)&"%</td>"
       Mensaje2=mensaje2&"    <td align='right'>"&formatnumber((24/lhrwrk)*100,1)&"%</td>"
       Mensaje2=mensaje2&"  </tr>"
	  end if

       Mensaje2=mensaje2&"</table>"
''''''''''''''''''************************************ Performance by Machine
'Date_ini=Request.Form("Date_ini")
'Date_end=Request.Form("Date_end")
 'Date_ini=date()-(day(date()))+1
 Date_ini=date()
 Date_end=date()

dia1=right("00"&day(Date_ini),2)
mes1=right("00"&month(Date_ini),2)
anno1=right("00"&year(Date_ini),4)
cfechai=cdbl(anno1+mes1+dia1)
dia2=right("00"&day(Date_end),2)
mes2=right("00"&month(Date_end),2)
anno2=right("00"&year(Date_end),4)
cfechaf=cdbl(anno2+mes2+dia2)

 layer=weekday(date()-1)
 hractual=hour(Now)
 minactual=minute(now)
      if hractual<7 then
        Date_ini=date()-1
        Date_end=date()-1
	  end if
''''''''''''''''''''''''''''''' inicio maquinas
 Session("turno")=null
 
 Dim aturno
 aturno = Session("turno")
 If isArray(aturno)=false Then
    ReDim aturno(60,20)
	for xx=1 to 60
	 aturno(xx,1)=""
	next
    aturno(0,1)="SUPER JUMBO"
    aturno(1,1)="JUMBO FLEXO"
    aturno(2,1)="MARTIN-1"
    aturno(3,1)="MARTIN-2"
    aturno(4,1)="WARD"
    aturno(5,1)="ISOWA"
    aturno(6,1)="ICHIKAWA"
    aturno(7,1)="LANGSTON"
    aturno(8,1)="McKinley"
    aturno(9,1)="MARTIN 3"
    aturno(10,1)="AIFEIER"
    aturno(11,1)="MARTIN 4"
	aturno(12,1)="RAPIDEX 2"
	
    aturno(13,1)="PIEMME"
	aturno(14,1)="ISHIKAWA"
	aturno(15,1)="MITSUBISHI"
	aturno(16,1)="ISOWA 2"
	aturno(17,1)="RAPIDEX 1"
	
    aturno(18,1)="AUTOMAX 1"
    aturno(19,1)="AUTOMAX 2"
    aturno(20,1)="AUTOMAX 3"
    aturno(21,1)="LABEL(STOCK)"
    aturno(22,1)="Stock II"
    aturno(23,1)="LABEL(MANUAL)"
    aturno(24,1)="GLUING"
    aturno(25,1)="FOSHAN DUPLEX GLUER"
    aturno(26,1)="SLITTER"
    aturno(27,1)="STITCHING"
    aturno(28,1)="PALLETIZE / STACK"
    aturno(29,1)="V BOARDER 1"
    aturno(30,1)="V BOARDER 2"
    aturno(31,1)="V BOARDER 3"
	
	aturno(0,19)="FLEXO"
    aturno(1,19)="FLEXO"
    aturno(2,19)="FLEXO"
    aturno(3,19)="FLEXO"
    aturno(4,19)="FLEXO"
    aturno(5,19)="FLEXO"
    aturno(6,19)="FLEXO"
    aturno(7,19)="FLEXO"
    aturno(8,19)="FLEXO"
    aturno(9,19)="FLEXO"
    aturno(10,19)="FLEXO"
    aturno(11,19)="FLEXO"
    
	aturno(12,19)="FLEXO"
	aturno(13,19)="FLEXO"
	aturno(14,19)="FLEXO"
	aturno(15,19)="FLEXO"
	aturno(16,19)="FLEXO"
	aturno(17,19)="FLEXO"
	
    aturno(23,19)="LABEL"
    aturno(24,19)="LABEL"
    aturno(25,19)="LABEL"
    aturno(26,19)="LABEL"
    aturno(27,19)="LABEL"
    aturno(28,19)="LABEL"
    aturno(29,19)="OTHER"
    aturno(30,19)="OTHER"
    aturno(31,19)="OTHER"
    aturno(32,19)="OTHER"
    aturno(33,19)="OTHER"
    aturno(34,19)="OTHER"
    aturno(35,19)="OTHER"
    aturno(36,19)="OTHER"
    
	session("turno") = aturno
 end if
 aturno = Session("turno")
 ''''''''''''''''''''''''''''''''''''  fin maquinas 
 
  lturno1t=1
  lturno2t=1
  lturno3t=1
  lturnotot=3

  lturno1m=34
  lturno2m=24
  lturno3m=8
  ltotmach=66
  lturno1a=14
  lturno2a=5
  lturno3a=7
  ltotaut=26
 ''''''''*******
'''''''''''calcula
 strday = Right("00" & Day(Date_ini), 2)
 strmonth = Right("00" & Month(Date_ini), 2)
 stryear = Right("00" & Year(Date_ini), 4)
 strday2 = Right("00" & Day(Date_end), 2)
 strmonth2 = Right("00" & Month(Date_end), 2)
 stryear2 = Right("00" & Year(Date_end), 4)
 'fechainicial = CStr(stryear & strmonth & strday)
 'fechafinal = CStr(stryear2 & strmonth2 & strday2)
 fechainicial ="20200908"
 fechafinal ="20200908"

 'response.write(fechainicial)&" FI "
 ' response.write(fechafinal)&" Ff "

 set Rsheadc=cnn.execute("select * from headcount where (convert(nvarchar(4),anno)+right('0'+convert(nvarchar(2),mes),2)+right('0'+convert(nvarchar(2),dia),2))>= '" & fechainicial & "' and (convert(nvarchar(4),anno)+right('0'+convert(nvarchar(2),mes),2)+right('0'+convert(nvarchar(2),dia),2))<= '" & fechafinal & "'")
 response.write(day(Date_ini)&" "&month(Date_ini)&" "&year(Date_ini))
  If Rsheadc.EOF And Rsheadc.BOF Then
  '
  else 
   lturno1t=0
   lturno2t=0
   lturno3t=0
   lturnotot=0
   Rsheadc.movefirst
   Do While Not Rsheadc.EOF
   
     if Rsheadc("planta")=1 or Rsheadc("planta")=3 then
	  if Rsheadc("turno")=1 then
	  lturno1t=lturno1t+cdbl(Rsheadc("directo"))+cdbl(Rsheadc("indirecto"))
	  end if
	  if Rsheadc("turno")=2 then
	  lturno2t=lturno2t+cdbl(Rsheadc("directo"))+cdbl(Rsheadc("indirecto"))
	  end if
	  if Rsheadc("turno")=3 then
	  lturno3t=lturno3t+cdbl(Rsheadc("directo"))+cdbl(Rsheadc("indirecto"))	  	
	    end if
      lturnotot=lturnotot+cdbl(Rsheadc("directo"))+cdbl(Rsheadc("indirecto"))
	  
     end if
    Rsheadc.MoveNext
   Loop
  end if
  Rsheadc.close
  set Rsheadc=nothing
  if lturno1t=0 then
   lturno1t=1
  end if
  if lturno2t=0 then
   lturno2t=1
  end if
  if lturno3t=0 then
   lturno3t=1
  end if
  if lturnotot=0 then
   lturnotot=1
  end if
  
%>
<center>
<span class="style12">SINIL INDUSTRY</span><br>
<span class="style8">Production By Machine - Shift</span><br>
<span class="style8">Date: <%=fechainicial%> to <%=fechafinal%> Generated: <%=time%></span>
</center>
<%    
'************** Performance
'lturno=0


set Rsmachine=dbsqlm.execute("select a.prod_date, right(a.prod_date,6) prod_day, case a.proc_cd1 when '' then case a.proc_cd2 when '' then a.proc_cd3 else a.proc_cd2 end else a.proc_cd1 end proc_cd,(select proc_nm from stb160t(nolock) where proc_cd = (case a.proc_cd1 when '' then case a.proc_cd2 when '' then a.proc_cd3 else a.proc_cd2 end else a.proc_cd1 end) ) as proc_nm, a.work_gubun, case a.work_gubun when '0' then '1S' when '1' then '2S' when '2' then '3S' end as wrok_gubun_nm, dbo.usf_no('B', '1', a.ord_date, a.ord_seq, 4, '-') as ord_no, b.cust_cd, (select cust_nm from stb010t(nolock) where cust_cd = b.cust_cd) as cust_nm, b.good_nm, b.ord_qty, c.plan_qty, a.real_prod_qty, round(a.real_prod_qty * b.mae_m2 , 0) as prod_m2, a.bad_qty, a.extra_qty, isnull(a1.inv_qty,0) as inv_qty " & _
"from bob030t a(nolock) left outer join ( select crp_id, goods_class, ord_date, ord_seq, plan_date, plan_seq, sum(plan_qty) plan_qty from bob010t(nolock) group by crp_id, goods_class, ord_date, ord_seq, plan_date, plan_seq) c on a.crp_id = c.crp_id and a.goods_class = c.goods_class and a.ord_date = c.ord_date and a.ord_seq = c.ord_seq and a.plan_date = c.plan_date and a.plan_seq = c.plan_seq left outer join ( select a.crp_id, a.ord_no, sum(a.qty) inv_qty from inout_table a(nolock), bar_code b(nolock) where a.ord_no = 'B1' + substring(b.ord_date,3,6) + '-' + right('0000' + convert(varchar(4), b.ord_seq), 4) and b.chk_bit = '1' and b.bar_code = a.bar_code and b.trans_date = a.job_date and a.class = '1' group by a.crp_id, a.ord_no) a1 on a.crp_id = a1.crp_id and 'B1' + substring(a.ord_date,3,6) + '-' + right('0000' + convert(varchar(4), a.ord_seq), 4) = a1.ord_no , boa010t b(nolock) " & _
"where a.crp_id = b.crp_id and a.goods_class = b.goods_class and a.ord_date = b.ord_date and a.ord_seq = b.ord_seq and b.del_yn = '0' and a.crp_id = '10' and (a.prod_date) >= '" & fechainicial & "' and (a.prod_date) <= '" & fechafinal & "' order by a.prod_date, a.work_gubun, case a.proc_cd1 when '' then case a.proc_cd2 when '' then a.proc_cd3  else a.proc_cd2 end else a.proc_cd1 end, a.ord_date, a.ord_seq")

'xquery="select a.prod_date, right(a.prod_date,6) prod_day, case a.proc_cd1 when '' then case a.proc_cd2 when '' then a.proc_cd3 else a.proc_cd2 end else a.proc_cd1 end proc_cd,(select proc_nm from stb160t(nolock) where proc_cd = (case a.proc_cd1 when '' then case a.proc_cd2 when '' then a.proc_cd3 else a.proc_cd2 end else a.proc_cd1 end) ) as proc_nm, a.work_gubun, case a.work_gubun when '0' then '1S' when '1' then '2S' when '2' then '3S' end as wrok_gubun_nm, dbo.usf_no('B', '1', a.ord_date, a.ord_seq, 4, '-') as ord_no, b.cust_cd, (select cust_nm from stb010t(nolock) where cust_cd = b.cust_cd) as cust_nm, b.good_nm, b.ord_qty, c.plan_qty, a.real_prod_qty, round(a.real_prod_qty * b.mae_m2 , 0) as prod_m2, a.bad_qty, a.extra_qty, isnull(a1.inv_qty,0) as inv_qty from bob030t a(nolock) left outer join ( select crp_id, goods_class, ord_date, ord_seq, plan_date, plan_seq, sum(plan_qty) plan_qty from bob010t(nolock) group by crp_id, goods_class, ord_date, ord_seq, plan_date, plan_seq) c on a.crp_id = c.crp_id and a.goods_class = c.goods_class and a.ord_date = c.ord_date and a.ord_seq = c.ord_seq and a.plan_date = c.plan_date and a.plan_seq = c.plan_seq left outer join ( select a.crp_id, a.ord_no, sum(a.qty) inv_qty from inout_table a(nolock), bar_code b(nolock) where a.ord_no = 'B1' + substring(b.ord_date,3,6) + '-' + right('0000' + convert(varchar(4), b.ord_seq), 4) and b.chk_bit = '1' and b.bar_code = a.bar_code and b.trans_date = a.job_date and a.class = '1' group by a.crp_id, a.ord_no) a1 on a.crp_id = a1.crp_id and 'B1' + substring(a.ord_date,3,6) + '-' + right('0000' + convert(varchar(4), a.ord_seq), 4) = a1.ord_no , boa010t b(nolock) where a.crp_id = b.crp_id and a.goods_class = b.goods_class and a.ord_date = b.ord_date and a.ord_seq = b.ord_seq and b.del_yn = '0' and a.crp_id = '10' and (a.prod_date) >= '" & fechainicial & "' and (a.prod_date) <= '" & fechafinal & "' order by a.prod_date, a.work_gubun, case a.proc_cd1 when '' then case a.proc_cd2 when '' then a.proc_cd3  else a.proc_cd2 end else a.proc_cd1 end, a.ord_date, a.ord_seq"
 'response.write("  "&xquery&"   ")
 
 If Rsmachine.EOF Then
  ExisteUsuario = False
  Msg = "No records exist for this date. (Machines)"
   Style = vbDefaultButton2
   Title = "Msg from System"
   Help = ""
   ctxt = 1000
   'Response = MsgBox(Msg, Style, Title, Help, ctxt)
   response.Write("No records exist for this date. (Machines)")
 Else
  
   %>

<center>
   

<%
  'Rsmachine.MoveFirst
   nmachine=1
   lworkorder1="a"
   lworkorder2="b"
   lmaquina1="a"
   lmaquina2="b"
  Rsmachine.movefirst
  Do While Not Rsmachine.EOF
   if not isnull(Rsmachine("real_prod_qty")) and not isnull(Rsmachine("plan_qty")) then
    Porclogro=cdbl(Rsmachine("real_prod_qty"))/cdbl(Rsmachine("plan_qty"))*100
   else
    Porclogro=0
   end if
   lturno1=Rsmachine("wrok_gubun_nm")
   lmaquina1=Rsmachine("proc_nm")
   Posicion= Instr(Rsmachine("good_nm"),"/")
  %>

 <%
    lprodqty=lprodqty+cdbl(Rsmachine("real_prod_qty"))
	lprodm2=lprodm2+cdbl(Rsmachine("prod_m2"))
	lbadqty=lbadqty+cdbl(Rsmachine("bad_qty"))
	xturno=Rsmachine("wrok_gubun_nm")
	if not isnull(Rsmachine("plan_qty")) then
	 xplanqty=cdbl(Rsmachine("plan_qty"))
	else
	 xplanqty=cdbl(Rsmachine("real_prod_qty"))
	end if
	
    lprodqtym=lprodqtym+cdbl(Rsmachine("real_prod_qty"))
	lprodm2m=lprodm2m+cdbl(Rsmachine("prod_m2"))
	lbadqtym=lbadqtym+cdbl(Rsmachine("bad_qty"))
	
    Rsmachine.MoveNext
   if not Rsmachine.eof then
      'if  lworkorder1<>lworkorder2 then
       
	  'end if
	 lturno2=Rsmachine("wrok_gubun_nm")
	 lmaquina2=Rsmachine("proc_nm")
	 lworkorder2=Rsmachine("ord_no")
	  if xplanqty>0 and ((lworkorder1<>lworkorder2) or (lmaquina1<>lmaquina2)) then
	   lplanqty=lplanqty+xplanqty
	  end if
	  if xplanqty>0 and ((lworkorder1<>lworkorder2) or (lmaquina1<>lmaquina2)) then
	   lplanqtym=lplanqtym+xplanqty
	  end if
	  
	 lworkorder1=lworkorder2
	 
     if lturno1<>lturno2 or lmaquina1<>lmaquina2 then
      if lmaquina1<>lmaquina2 then
	    if lprodqtym>0 and lplanqtym>0 then
	     lcumplimiento2=(lprodqtym/lplanqtym)*100
		else
		 if lprodqtym>0 and lplanqtym=0 then
		  lplanqtym=lprodqtym
		  lcumplimiento2=(lprodqtym/lplanqtym)*100
		 else
           lcumplimiento2=0
		 end if
		end if
	   
	   incart=false
       'Dim aturno
	    'aturno = Session("turno")
        If isArray(aturno)=false Then
          ReDim aturno(60,18)
            aturno(1,1)=lmaquina1
 	 	   if lturno1="1S" then
             aturno(1,2)=aturno(1,2)+lprodqtym
 	         aturno(1,3)=aturno(1,3)+lprodm2m
			 aturno(1,8)=aturno(1,8)+lplanqtym
			 aturno(1,9)=aturno(1,9)+lbadqtym
			 aturno(1,10)=aturno(1,10)+lcumplimiento2
			 aturno(1,18)=aturno(1,18)+1
 		   end if
 		   if lturno1="2S" then
            aturno(1,4)=aturno(1,4)+lprodqtym
 	        aturno(1,5)=aturno(1,5)+lprodm2m
			aturno(1,11)=aturno(1,11)+lplanqtym
			 aturno(1,12)=aturno(1,12)+lbadqtym
			 aturno(1,13)=aturno(1,13)+lcumplimiento2
			 aturno(1,18)=aturno(1,18)+1
 		   end if
 		   if lturno1="3S" then
             aturno(1,6)=aturno(1,6)+lprodqtym
 	         aturno(1,7)=aturno(1,7)+lprodm2m
			 aturno(1,14)=aturno(1,14)+lplanqtym
			 aturno(1,15)=aturno(1,15)+lbadqtym
			 aturno(1,16)=aturno(1,16)+lcumplimiento2
			 aturno(1,18)=aturno(1,18)+1
 		   end if
           session("turno") = aturno
        else
          numprod=0
          for i=lbound(aturno) to ubound(aturno)
           if aturno(i,1)=lmaquina1 then
            if lturno1="1S" then
             aturno(i,2)=aturno(i,2)+lprodqtym
 	         aturno(i,3)=aturno(i,3)+lprodm2m
			 aturno(i,8)=aturno(i,8)+lplanqtym
			 aturno(i,9)=aturno(i,9)+lbadqtym
			 aturno(i,10)=aturno(i,10)+lcumplimiento2
			 aturno(i,18)=aturno(i,18)+1
 		    end if
 		    if lturno1="2S" then
             aturno(i,4)=aturno(i,4)+lprodqtym
 	         aturno(i,5)=aturno(i,5)+lprodm2m
		 	 aturno(i,11)=aturno(i,11)+lplanqtym
			 aturno(i,12)=aturno(i,12)+lbadqtym
			 aturno(i,13)=aturno(i,13)+lcumplimiento2
			 aturno(i,18)=aturno(i,18)+1
 		    end if
 		    if lturno1="3S" then
             aturno(i,6)=aturno(i,6)+lprodqtym
 	         aturno(i,7)=aturno(i,7)+lprodm2m
			 aturno(i,14)=aturno(i,14)+lplanqtym
			 aturno(i,15)=aturno(i,15)+lbadqtym
			 aturno(i,16)=aturno(i,16)+lcumplimiento2
			 aturno(i,18)=aturno(i,18)+1
 	 	    end if
             incart=true
 	 	   else
 	 	    if aturno(i,1)="" and not(incart) then
 	 	     aturno(i,1)=lmaquina1
               if lturno1="1S" then
                aturno(i,2)=aturno(i,2)+lprodqtym
 	            aturno(i,3)=aturno(i,3)+lprodm2m
			    aturno(i,8)=aturno(i,8)+lplanqtym
			    aturno(i,9)=aturno(i,9)+lbadqtym
			    aturno(i,10)=aturno(i,10)+lcumplimiento2
				aturno(i,18)=aturno(i,18)+1
 		       end if
 		       if lturno1="2S" then
                aturno(i,4)=aturno(i,4)+lprodqtym
 	            aturno(i,5)=aturno(i,5)+lprodm2m
		        aturno(i,11)=aturno(i,11)+lplanqtym
		 	    aturno(i,12)=aturno(i,12)+lbadqtym
		 	    aturno(i,13)=aturno(i,13)+lcumplimiento2
				aturno(i,18)=aturno(i,18)+1
 		       end if
 		       if lturno1="3S" then
                aturno(i,6)=aturno(i,6)+lprodqtym
 	            aturno(i,7)=aturno(i,7)+lprodm2m
			    aturno(i,14)=aturno(i,14)+lplanqtym
			    aturno(i,15)=aturno(i,15)+lbadqtym
			    aturno(i,16)=aturno(i,16)+lcumplimiento2
				aturno(i,18)=aturno(i,18)+1
  		       end if
  		      incart=true
  		     end if
            end if
             numprod=numprod+1
           next
  	      session("turno")=aturno
         end if   'is array
 	  
  	  %>
        <%
	     lmaquina1=lmaquina2
	     lprodqtym=0
	     lprodm2m=0
	     lbadqtym=0
	     lplanqtym=0
	     nmachine=nmachine+1
	   end if  'si maquina
       if lturno1<>lturno2 then
        lcumplimiento=100
        if lprodqty>0 and lplanqty>0 then
	     lcumplimiento=(lprodqty/lplanqty)*100
        end if
	   %>
        <%
	    lturno1=lturno2
	    gtot1=gtot1+lplanqty
	    gtot2=gtot2+lprodqty
	    gtot3=gtot3+lprodm2
	    gtot4=gtot4+lbadqty
		
	    lprodqty=0
	    lprodm2=0
	    lbadqty=0
	    lplanqty=0
		
       end if    'turno  
      end if   'si maquina o turno
   else       'si eof
   
     if xplanqty>0 then
	   lplanqty=lplanqty+xplanqty
	  end if
	  if xplanqty>0 then
	   lplanqtym=lplanqtym+xplanqty
	  end if
	  
	  lcumplimiento=(lprodqty/lplanqty)*100
	   if lprodqtym>0 and lplanqtym>0 then
	     lcumplimiento2=(lprodqtym/lplanqtym)*100
		else
		 if lprodqtym>0 and lplanqtym=0 then
		  lplanqtym=lprodqtym
		  lcumplimiento2=(lprodqtym/lplanqtym)*100
		 else
           lcumplimiento2=0
		 end if
		end if
	  
	  incart=false
       'Dim aturno
	    'aturno = Session("turno")
        If isArray(aturno)=false Then 
		  ReDim aturno(60,20)
          aturno(1,1)=lmaquina1
			if lturno1="1S" then
             aturno(1,2)=aturno(1,2)+lprodqtym
 	         aturno(1,3)=aturno(1,3)+lprodm2m
			 aturno(1,8)=aturno(1,8)+lplanqtym
			 aturno(1,9)=aturno(1,9)+lbadqtym
			 aturno(1,10)=aturno(1,10)+lcumplimiento2
			 aturno(1,18)=aturno(1,18)+1
 		   end if
 		   if lturno1="2S" then
            aturno(1,4)=aturno(1,4)+lprodqtym
 	        aturno(1,5)=aturno(1,5)+lprodm2m
			aturno(1,11)=aturno(1,11)+lplanqtym
			 aturno(1,12)=aturno(1,12)+lbadqtym
			 aturno(1,13)=aturno(1,13)+lcumplimiento2
			 aturno(1,18)=aturno(1,18)+1
 		   end if
 		   if lturno1="3S" then
             aturno(1,6)=aturno(1,6)+lprodqtym
 	         aturno(1,7)=aturno(1,7)+lprodm2m
			 aturno(1,14)=aturno(1,14)+lplanqtym
			 aturno(1,15)=aturno(1,15)+lbadqtym
			 aturno(1,16)=aturno(1,16)+lcumplimiento2
			 aturno(1,18)=aturno(1,18)+1
	 	   end if
          session("turno") = aturno
        else
         numprod=0
         for i=lbound(aturno) to ubound(aturno)
          if aturno(i,1)=lmaquina1 then
           if lturno1="1S" then
                aturno(i,2)=aturno(i,2)+lprodqtym
 	            aturno(i,3)=aturno(i,3)+lprodm2m
			    aturno(i,8)=aturno(i,8)+lplanqtym
			    aturno(i,9)=aturno(i,9)+lbadqtym
			    aturno(i,10)=aturno(i,10)+lcumplimiento2
				aturno(i,18)=aturno(i,18)+1
 		       end if
 		       if lturno1="2S" then
                aturno(i,4)=aturno(i,4)+lprodqtym
 	            aturno(i,5)=aturno(i,5)+lprodm2m
		        aturno(i,11)=aturno(i,11)+lplanqtym
		 	    aturno(i,12)=aturno(i,12)+lbadqtym
		 	    aturno(i,13)=aturno(i,13)+lcumplimiento2
				aturno(i,18)=aturno(i,18)+1
 		       end if
 		       if lturno1="3S" then
                aturno(i,6)=aturno(i,6)+lprodqtym
 	            aturno(i,7)=aturno(i,7)+lprodm2m
			    aturno(i,14)=aturno(i,14)+lplanqtym
			    aturno(i,15)=aturno(i,15)+lbadqtym
			    aturno(i,16)=aturno(i,16)+lcumplimiento2
				aturno(i,18)=aturno(i,18)+1
		   end if
           incart=true
		  else
		   if aturno(i,1)="" and not(incart) then
		    aturno(i,1)=lmaquina1
               if lturno1="1S" then
                aturno(i,2)=aturno(i,2)+lprodqtym
 	            aturno(i,3)=aturno(i,3)+lprodm2m
			    aturno(i,8)=aturno(i,8)+lplanqtym
			    aturno(i,9)=aturno(i,9)+lbadqtym
			    aturno(i,10)=aturno(i,10)+lcumplimiento2
				aturno(i,18)=aturno(i,18)+1
 		       end if
 		       if lturno1="2S" then
                aturno(i,4)=aturno(i,4)+lprodqtym
 	            aturno(i,5)=aturno(i,5)+lprodm2m
		        aturno(i,11)=aturno(i,11)+lplanqtym
		 	    aturno(i,12)=aturno(i,12)+lbadqtym
		 	    aturno(i,13)=aturno(i,13)+lcumplimiento2
				aturno(i,18)=aturno(i,18)+1
 		       end if
 		       if lturno1="3S" then
                aturno(i,6)=aturno(i,6)+lprodqtym
 	            aturno(i,7)=aturno(i,7)+lprodm2m
			    aturno(i,14)=aturno(i,14)+lplanqtym
			    aturno(i,15)=aturno(i,15)+lbadqtym
			    aturno(i,16)=aturno(i,16)+lcumplimiento2
				aturno(i,18)=aturno(i,18)+1
		       end if
		     incart=true
		   end if
          end if
          numprod=numprod+1
         next
	     session("turno")=aturno
        end if     ' is array
	  %>
      <%
	    gtot1=gtot1+lplanqty
	    gtot2=gtot2+lprodqty
	    gtot3=gtot3+lprodm2
	    gtot4=gtot4+lbadqty
	  
	  if gtot2>0 and gtot1>0 then
		  'lplanqtym=lprodqtym
		  lcumplimiento3=(gtot2/gtot1)*100
		 else
           lcumplimiento3=0
		 end if
	  'gtot5=gtot5+lplanqty
   end if
  Loop
  Rsmachine.Close
  Set Rsmachine = Nothing
  %>

<%
 End If
 
'''''''''''''''''''''************************  Tabla de maquinas
  %>
<br>
 Production Summary by Machine /Shift
 (<%=Date_ini%> to <%=Date_end%>)
 <%=fechainicial%> to <%=fechafinal%> 
<table border='1' width='90%'>
 
  <tr>
    <td><span class='style14'>Generated: </span></td>
    <td colspan='2' bgcolor='#A7B6FC'><div align='center' class='style14'>1S</div></td>
    <td colspan='2' bgcolor='#A7B6FC'><div align='center' class='style14'>2S</div></td>
    <td colspan='2' bgcolor='#A7B6FC'><div align='center' class='style14'>3S</div></td>
    <td colspan='3' bgcolor='#A7B6FC'><div align='center' class='style14'>Total</div></td>
  </tr>
   <tr>
    <td><span class='style14'></span></td>
    <td colspan='2' bgcolor='#B7E0FF'><div align='center' class='style14'><%=lturno1t%></div></td>
    <td colspan='2' bgcolor='#B7E0FF'><div align='center' class='style14'><%=lturno2t%></div></td>
    <td colspan='2' bgcolor='#B7E0FF'><div align='center' class='style14'><%=lturno3t%></div></td>
    <td colspan='3' bgcolor='#B7E0FF'><div align='center' class='style14'><%=lturnotot%></div></td>
  </tr>	
  <tr bgcolor='#C9C9C9'>
    <td width='12%'><span class='style14'><%=time%></span></td>
    <td width='8%'><span class='style14'>Qty</span></td>
    <td width='8%'><span class='style14'>M2</span></td>
    <td width='8%'><span class='style14'>Qty</span></td>
    <td width='8%'><span class='style14'>M2</span></td>
    <td width='8%'><span class='style14'>Qty</span></td>
    <td width='8%'><span class='style14'>M2</span></td>
    <td width='10%'><span class='style14'>Qty</span></td>
    <td width='10%'><span class='style14'>M2</span></td>
    
  <td width='8%'>Shift Qty&nbsp;</td>
  </tr>
  <%
  'If isArray(aturno) Then
  mensaje2=mensaje2+"<br><br> <strong>HOURLY PERFORMANCE BY MACHINE</strong>"

mensaje2=mensaje2&"<table border='1'>"
mensaje2=mensaje2+"  <tr bgcolor='#C9C9C9'>"
mensaje2=mensaje2+"    <th align='center' scope='row'>"& Date_ini &" </th>"
mensaje2=mensaje2+"    <td align='center' colspan='2' bgcolor='#C9C9C9'>1S</td>"
mensaje2=mensaje2+"    <td align='center' colspan='2' bgcolor='#C9C9C9'>2S</td>"
mensaje2=mensaje2+"    <td align='center' colspan='2' bgcolor='#C9C9C9'>3S</td>"
mensaje2=mensaje2+"    <td align='center' colspan='3' bgcolor='#C9C9C9'>Total</td>"
mensaje2=mensaje2+"  </tr>"
mensaje2=mensaje2+"  <tr bgcolor='#C9C9C9'>"
mensaje2=mensaje2+"    <th align='center' scope='row'>"& time &"</th>"
mensaje2=mensaje2+"    <td align='center' bgcolor='#C9C9C9'>Qty</td>"
mensaje2=mensaje2+"    <td align='center' bgcolor='#C9C9C9'>M2</td>"
mensaje2=mensaje2+"    <td align='center' bgcolor='#C9C9C9'>Qty</td>"
mensaje2=mensaje2+"    <td align='center' bgcolor='#C9C9C9'>M2</td>"
mensaje2=mensaje2+"    <td align='center' bgcolor='#C9C9C9'>Qty</td>"
mensaje2=mensaje2+"    <td align='center' bgcolor='#C9C9C9'>M2</td>"
mensaje2=mensaje2+"    <td align='center' bgcolor='#C9C9C9'>Qty</td>"
mensaje2=mensaje2+"    <td align='center' bgcolor='#C9C9C9'>M2</td>"
mensaje2=mensaje2+"    <td align='center' bgcolor='#C9C9C9'>Logro M2</td>"
mensaje2=mensaje2+"  </tr>"

'buscar producto duplicado
   for i=lbound(aturno) to ubound(aturno) 
    if aturno(i,1)<>"" and (aturno(i,2)>0 or aturno(i,4)>0 or aturno(i,6)>0)then
      
     if aturno(i,1)="V BOARDER 1" or aturno(i,1)="V BOARDER 2" or aturno(i,1)="V BOARDER 3" then
      lstotqtymvb=ltotqtymvb+aturno(i,2)+aturno(i,4)+aturno(i,6)
	  lstotm2mvb=ltotm2mvb+aturno(i,3)+aturno(i,5)+aturno(i,7)
      lstotqtys1vb=lstotqtys1vb+aturno(i,2)
	  lstotqtys2vb=lstotqtys2vb+aturno(i,4)
	  lstotqtys3vb=lstotqtys3vb+aturno(i,6)
	  lstotm2s1vb=lstotm2s1vb+aturno(i,3)
	  lstotm2s2vb=lstotm2s2vb+aturno(i,5)
	  lstotm2s3vb=lstotm2s3vb+aturno(i,7)
	  lstotbads1vb=lstotbads1vb+aturno(i,9)
	  lstotbads2vb=lstotbads2vb+aturno(i,12)
	  lstotbads3vb=lstotbads3vb+aturno(i,15)
     end if
 %>
    <tr>
      <td><span class='style14'><strong><%=aturno(i,1)%></strong></span></td>
      <td><div align='right' class='style14'><%=aturno(i,2)%></div></td>
      <td><div align='right' class='style14'><%=aturno(i,3)%></div></td>
	  <td><div align='right' class='style14'><%=aturno(i,4)%></div></td>
      <td><div align='right' class='style14'><%=aturno(i,5)%></div></td>
      <td><div align='right' class='style14'><%=aturno(i,6)%></div></td>
      <td><div align='right' class='style14'><%=aturno(i,7)%></div></td>
	  <%
mensaje2=mensaje2+"	      <tr>"
mensaje2=mensaje2+"      <td><span class='style14'><strong>"& aturno(i,1) &"</strong></span></td>"
mensaje2=mensaje2+"      <td align='right'>"& aturno(i,2) &"</td>"
mensaje2=mensaje2+"      <td align='right'>"&aturno(i,3) &"</td>"
mensaje2=mensaje2+"	     <td align='right'>"&aturno(i,4) &"</td>"
mensaje2=mensaje2+"      <td align='right'>"&aturno(i,5) &"</td>"
mensaje2=mensaje2+"      <td align='right'>"&aturno(i,6) &"</td>"
mensaje2=mensaje2+"      <td align='right'>"&aturno(i,7) &"</td>"

	  ltotqtym=aturno(i,2)+aturno(i,4)+aturno(i,6)
	  ltotm2m=aturno(i,3)+aturno(i,5)+aturno(i,7)
	  %>
	  <td><div align='right' class='style14'><%=ltotqtym%></div></td>
      <td><div align='right' class='style14'><%=ltotm2m%></div></td>
    <td><div align='center'><%=aturno(i,18)%>&nbsp;</div></td>
    </tr>
  <%
     ltarget=0
     set Rstarget=dbsql3.execute("select * from target3 where machine='" & aturno(i,1) & "'")
	 if not Rstarget.eof then
	 	lm21s=Rstarget("m21s")
		lm22s=Rstarget("m22s")
		lm23s=Rstarget("m23s")
	  else
	    lm21s=0
		lm22s=0
		lm23s=0
	  end if
	 if aturno(i,2)>0 then
      'llogro=(ltotm2m/lm21s)*100
      ltarget=lm21s
	  if aturno(i,4)>0 then
       ltarget=lm21s+lm22s
	   if aturno(i,6)>0 then
        ltarget=lm21s+lm22s+lm23s
	   end if
	  else
	    if aturno(i,6)>0 then
          ltarget=lm21s+lm23s
	     end if
	  end if
	 else
	  if aturno(i,4)>0 then
	   ltarget=lm22s
	   if aturno(i,6)>0 then
        ltarget=lm22s+lm23s
	   end if
	  else
	   if aturno(i,6)>0 then
        ltarget=lm23s
	   end if
	  end if
	 end if
	 
	 
mensaje2=mensaje2+"  	 <td align='right'>"& ltotqtym &"</td>"
mensaje2=mensaje2+"      <td align='right'>"& ltotm2m &"</td>"
	 if ltotm2m>0 and ltarget>0 then 
	  llogro=(ltotm2m/ltarget)*100
mensaje2=mensaje2+"    <td align='right'>"& formatnumber(llogro,1) &"%</td>"
	 else
mensaje2=mensaje2+"    <td align='right'>%</td>"
	 end if


mensaje2=mensaje2+"    </tr>"

  
     'end if
	  ltotbadm=aturno(i,9)+aturno(i,12)+aturno(i,15)
	  lstotqtys1=lstotqtys1+aturno(i,2)
	  lstotqtys2=lstotqtys2+aturno(i,4)
	  lstotqtys3=lstotqtys3+aturno(i,6)
	  lstotm2s1=lstotm2s1+aturno(i,3)
	  lstotm2s2=lstotm2s2+aturno(i,5)
	  lstotm2s3=lstotm2s3+aturno(i,7)
	  lstotbads1=lstotbads1+aturno(i,9)
	  lstotbads2=lstotbads2+aturno(i,12)
	  lstotbads3=lstotbads3+aturno(i,15)
      
      ltotqtys1=ltotqtys1+aturno(i,2)
	  ltotqtys2=ltotqtys2+aturno(i,4)
	  ltotqtys3=ltotqtys3+aturno(i,6)
	  ltotm2s1=ltotm2s1+aturno(i,3)
	  ltotm2s2=ltotm2s2+aturno(i,5)
	  ltotm2s3=ltotm2s3+aturno(i,7)
	  ltotbads1=ltotbads1+aturno(i,9)
	  ltotbads2=ltotbads2+aturno(i,12)
	  ltotbads3=ltotbads3+aturno(i,15)

	end if
	if aturno(i,1)="RAPIDEX 1" then
	%>
	<tr>
      <td align='right'><span class='orderListSpan style15'>SubTotal</span></td>
      <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys1,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s1,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys2,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s2,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys3,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s3,0)%></div></td>
	  <%
	  
	  lstotqtyday=lstotqtys1+lstotqtys2+lstotqtys3
	  lstotm2day=lstotm2s1+lstotm2s2+lstotm2s3
	 
	  %>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtyday,0)%></div></td>
      <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2day,0)%></div></td>
      
	<td bgcolor='#cccccc'>&nbsp;</td>
	</tr>
	<tr>
      <td align='right'><span class='orderListSpan style15'>AVG </span></td>
      <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys1/lturno1t,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s1/lturno1t,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys2/lturno2t,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s2/lturno2t,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys3/lturno3t,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s3/lturno3t,0)%></div></td>
	  <%
	  
	  lstotqtyday=lstotqtys1+lstotqtys2+lstotqtys3
	  lstotm2day=lstotm2s1+lstotm2s2+lstotm2s3
	  lflexoqtys1=lstotqtys1
	  lflexom2s1=lstotm2s1
	  lflexoqtys2=lstotqtys2
	  lflexom2s2=lstotm2s2
	  lflexoqtys3=lstotqtys3
	  lflexom2s3=lstotm2s3
	  %>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtyday/lturnotot,0)%></div></td>
      <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2day/lturnotot,0)%></div></td>
      
	<td bgcolor='#cccccc'>&nbsp;</td>
	</tr>
	<%
	  lstotqtys1=0
	  lstotqtys2=0
	  lstotqtys3=0
	  lstotm2s1=0
	  lstotm2s2=0
	  lstotm2s3=0
	  lstotbads1=0
	  lstotbads2=0
	  lstotbads3=0
	  lstotqtyday=0
	  lstotm2day=0
	end if
	if aturno(i,1)="V BOARDER 3"  then
	%>
	<tr>
      <td align='right'><span class='orderListSpan style15'>Total VBOARD</span></td>
      <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys1vb,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s1vb,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys2vb,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s2vb,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys3vb,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s3vb,0)%></div></td>
	  <%
	  lstotqtydayvb=lstotqtys1vb+lstotqtys2vb+lstotqtys3vb
	  lstotm2dayvb=lstotm2s1vb+lstotm2s2vb+lstotm2s3vb
	 
	  %>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtydayvb,0)%></div></td>
      <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2dayvb,0)%></div></td>
      
	<td bgcolor='#cccccc'>&nbsp;</td>
	</tr>
	
	<%
	  lstotqtys1vb=0
	  lstotqtys2vb=0
	  lstotqtys3vb=0
	  lstotm2s1vb=0
	  lstotm2s2vb=0
	  lstotm2s3vb=0
	  lstotbads1vb=0
	  lstotbads2vb=0
	  lstotbads3vb=0
	  lstotqtydayvb=0
	  lstotm2dayvb=0
	end if
	if aturno(i,1)="LABEL(MANUAL)" then
	%>
	<tr>
      <td align='right'><span class='orderListSpan style15'>SubTotal</span></td>
      <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys1,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s1,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys2,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s2,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys3,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s3,0)%></div></td>
	  <%
	  lstotqtyday=lstotqtys1+lstotqtys2+lstotqtys3
	  lstotm2day=lstotm2s1+lstotm2s2+lstotm2s3
	 
	  %>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtyday,0)%></div></td>
      <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2day,0)%></div></td>
      
	<td bgcolor='#cccccc'>&nbsp;</td>
	</tr>
	<tr>
      <td align='right'><span class='orderListSpan style15'>AVG</span></td>
      <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys1/lturno1t,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s1/lturno1t,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys2/lturno2t,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s2/lturno2t,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys3/lturno3t,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s3/lturno3t,0)%></div></td>
	  <%
	  lstotqtyday=lstotqtys1+lstotqtys2+lstotqtys3
	  lstotm2day=lstotm2s1+lstotm2s2+lstotm2s3
	  lflexoqtys1=lflexoqtys1+lstotqtys1
	  lflexom2s1=lflexom2s1+lstotm2s1
	  lflexoqtys2=lflexoqtys2+lstotqtys2
	  lflexom2s2=lflexom2s2+lstotm2s2
	  lflexoqtys3=lflexoqtys3+lstotqtys3
	  lflexom2s3=lflexom2s3+lstotm2s3
	 
	  %>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtyday/lturnotot,0)%></div></td>
      <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2day/lturnotot,0)%></div></td>
      
	<td bgcolor='#cccccc'>&nbsp;</td>
	</tr>
	<%
	  lstotqtys1=0
	  lstotqtys2=0
	  lstotqtys3=0
	  lstotm2s1=0
	  lstotm2s2=0
	  lstotm2s3=0
	  lstotbads1=0
	  lstotbads2=0
	  lstotbads3=0
	  lstotqtyday=0
	  lstotm2day=0
	end if
	
	
	
   next
  'else
  ' ReDim aturno(60,9)
  'end if
  if ubound(aturno) then
	%>
	<tr>
      <td align='right'><span class='orderListSpan style15'>SubTotal Others</span></td>
      <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys1,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s1,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys2,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s2,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys3,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s3,0)%></div></td>
	  <%
	  lstotqtyday=lstotqtys1+lstotqtys2+lstotqtys3
	  lstotm2day=lstotm2s1+lstotm2s2+lstotm2s3
	 
	  %>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtyday,0)%></div></td>
      <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2day,0)%></div></td>
      
	<td bgcolor='#cccccc'>&nbsp;</td>
	</tr>
	<tr>
      <td align='right'><span class='orderListSpan style15'>AVG</span></td>
      <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys1/lturno1t,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s1/lturno1t,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys2/lturno2t,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s2/lturno2t,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtys3/lturno3t,0)%></div></td>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2s3/lturno3t,0)%></div></td>
	  <%
	  lstotqtyday=lstotqtys1+lstotqtys2+lstotqtys3
	  lstotm2day=lstotm2s1+lstotm2s2+lstotm2s3
	  lflexoqtys1=lflexoqtys1+lstotqtys1
	  lflexom2s1=lflexom2s1+lstotm2s1
	  lflexoqtys2=lflexoqtys2+lstotqtys2
	  lflexom2s2=lflexom2s2+lstotm2s2
	  lflexoqtys3=lflexoqtys3+lstotqtys3
	  lflexom2s3=lflexom2s3+lstotm2s3
	 
	  %>
	  <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotqtyday/lturnotot,0)%></div></td>
      <td bgcolor='#cccccc'><div align='right' class='orderListSpan style15'><%=formatnumber(lstotm2day/lturnotot,0)%></div></td>
      
	<td bgcolor='#cccccc'>&nbsp;</td>
	</tr>
	<%
	  lstotqtys1=0
	  lstotqtys2=0
	  lstotqtys3=0
	  lstotm2s1=0
	  lstotm2s2=0
	  lstotm2s3=0
	  lstotbads1=0
	  lstotbads2=0
	  lstotbads3=0
	  lstotqtyday=0
	  lstotm2day=0
	end if
  %>
   <tr>
      <td><span class='orderListSpan'>Total Shift</span></td>
      <td bgcolor='#CCCCCC'><div align='right' class='style15'><strong><%=formatnumber(ltotqtys1,0)%></strong></div></td>
	  <td bgcolor='#CCCCCC'><div align='right' class='style15'><strong><%=formatnumber(ltotm2s1,0)%></strong></div></td>
	  <td bgcolor='#CCCCCC'><div align='right' class='style15'><strong><%=formatnumber(ltotqtys2,0)%></strong></div></td>
	  <td bgcolor='#CCCCCC'><div align='right' class='style15'><strong><%=formatnumber(ltotm2s2,0)%></strong></div></td>
	  <td bgcolor='#CCCCCC'><div align='right' class='style15'><strong><%=formatnumber(ltotqtys3,0)%></strong></div></td>
	  <td bgcolor='#CCCCCC'><div align='right' class='style15'><strong><%=formatnumber(ltotm2s3,0)%></strong></div></td>
	  <%
	  
	  ltotqtyday=ltotqtys1+ltotqtys2+ltotqtys3
	  ltotm2day=ltotm2s1+ltotm2s2+ltotm2s3
	 
	  %>
	  <td bgcolor='#CCCCCC'><div align='right' class='style15'><strong><%=formatnumber(ltotqtyday,0)%></strong></div></td>
      <td bgcolor='#CCCCCC'><div align='right' class='style15'><strong><%=formatnumber(ltotm2day,0)%></strong></div></td>
   <td bgcolor='#CCCCCC'>&nbsp;</td>
   </tr>
   <tr>
      <td align='right'><span class='orderListSpan style15'>AVG</span></td>
      <td bgcolor='#E8D6BB'><div align='right' class='orderListSpan style15'><%=formatnumber(lflexoqtys1/lturno1t,0)%></div></td>
	  <td bgcolor='#E8D6BB'><div align='right' class='orderListSpan style15'><%=formatnumber(lflexom2s1/lturno1t,0)%></div></td>
	  <td bgcolor='#E8D6BB'><div align='right' class='orderListSpan style15'><%=formatnumber(lflexoqtys2/lturno2t,0)%></div></td>
	  <td bgcolor='#E8D6BB'><div align='right' class='orderListSpan style15'><%=formatnumber(lflexom2s2/lturno2t,0)%></div></td>
	  <td bgcolor='#E8D6BB'><div align='right' class='orderListSpan style15'><%=formatnumber(lflexoqtys3/lturno3t,0)%></div></td>
	  <td bgcolor='#E8D6BB'><div align='right' class='orderListSpan style15'><%=formatnumber(lflexom2s3/lturno3t,0)%></div></td>
	  <%

	  lstotqtyday=lstotqtys1+lstotqtys2+lstotqtys3
	  lstotm2day=lstotm2s1+lstotm2s2+lstotm2s3
	  lflexoqtytot=lflexoqtys1+lflexoqtys2+lflexoqtys3
	  lflexom2tot=lflexom2s1+lflexom2s2+lflexom2s3
	  
	  %>
	  <td bgcolor='#E8D6BB'><div align='right' class='orderListSpan style15'><%=formatnumber(lflexoqtytot/lturnotot,0)%></div></td>
      <td bgcolor='#E8D6BB'><div align='right' class='orderListSpan style15'><%=formatnumber(lflexom2tot/lturnotot,0)%></div></td>
      
	<td bgcolor='#E8D6BB'>&nbsp;</td>
   </tr>
</table>
<br>
<%
mensaje2=mensaje2+"</table>"



''''''''''''''''''''''*******************************



'*********************    
   acthora=int(hour(time()))

   If Err.Number <> 0 then
    HandleError Err.Description
   End If 

   Sub HandleError
    response.write("CII No connection")
   End Sub

'*********************

  'Dim objCDO
  'Dim Conf
  'Dim Fields
  'correo="sistemas@shinwoousa.com"
  'correo="ikejung@shinwoousa.com"
''''''''''';
  Set cdoConfig = CreateObject("CDO.Configuration")

  With cdoConfig.Fields
   .Item(cdoSendUsingMethod) = 2
   .Item(cdoSMTPServer) = "mail.shinwoousa.com"
   '"64.87.26.218"
   .Item(cdoSMTPauthenticate)=1
   .Item(cdoSendUsername)="sechevarria@shinwoousa.com"
    .Item(cdoSendPassword)="Sheko*2019*"
   .Item(cdoSMTPServerport)=587
   .Update
  End With 

  Set cdoMessage = CreateObject("CDO.Message")
  Set Fields = Nothing
  Set objCDO = Nothing
  Set Conf = Nothing
   With cdoMessage
      Set .Configuration = cdoConfig
      .From = "sechevarria@shinwoousa.com"
     '.To = correo
     '.cc = "avaldez@shinwoousa.com;jmontano@shinwoousa.com;sgallegos@shinwoousa.com;ysalazar@shinwoousa.com;yvizcarra@shinwoousa.com;jamesoh@shinwoousa.com;jmedina@shinwoousa.com;dvilchis@shinwoousa.com;jguzman@shinwoousa.com;mahernandez@shinwoousa.com;ehernandez@shinwoousa.com;ikejung@shinwoousa.com;jsyc300@shinwoousa.com;vincent.shin@shinwoousa.com;abecerra@shinwoousa.com"
     .bcc = "sistemas@shinwoousa.com"
       .Subject = "sending Automatic - HOURLY PERFORMANCE CC"
       '.TextBody = "Esta es una Prueba de envio automatico ASECO-Sergio"
      .HTMLBody= mensaje2
    '.AddAttachment (archivopdf)
    '.AddAttachment (archivoxml)
     .Send
   End With
   
    Set cdoMessage = Nothing
    Set cdoConfig = Nothing
    ''termina envio de correo
 end if
'response.Redirect("reportdailytransfer.asp?msg=enviado!")
%>

</center>
</div>
</body>
</html>
<%
end if  'minutos
End If  'licencia expirada
cnn.Close
Set cnn = Nothing 
'Rsfore0.Close
Set Rsfore0 = Nothing
'''''''''''''

%>
