codice:
<%@language=vbscript%>
<head>
<link rel="stylesheet" href="CSS/stampe.css" type="text/css" id="fogliodistile">
</head>
<%
vc_userconn =session("vc_userprop")
if vc_userconn ="" then
response.redirect "timeoutt.asp"
end if
vn_codibollavvi = Request.QueryString("vn_codibollavvi")
Set con = Server.CreateObject("ADODB.Connection")
con.Open application("ConnDB")
con.CommandTimeout = 8000
Server.ScriptTimeout = 9000
%>
<div id="splash" style="position:absolute; top:25%; z-index:1">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
<tr>
<td align="center">
Caricamento in corso...</p>
Attendere, prego...</p>
</td>
</tr>
</table>
</div>
<% Response.Flush %>
<%
' Estrazione path assoluto dove scrivere i file pdf
' Nota: non presenta la parte bollavvifile e bollprogfile
sqlpathasso= "select DESC_PATH_ASSO_AVVI "_
& "from anagclie "_
& "where rownum=1 ;"
Set rspathasso = con.Execute(sqlpathasso)
'response.write sqlpathasso
vc_descpathassoavvi = rspathasso("DESC_PATH_ASSO_AVVI")
rspathasso.Close
Set rspathasso = Nothing
%>
<% ' Verifica se bollettino già elaborato
sqlprodbolleseg="SELECT to_char(DATA_PROD_FILE,'dd/mm/YYYY') DATA_PROD_FILE_VISU "_
&" FROM STORBOLLAVVIAZIE "_
&" WHERE CODI_BOLL_AVVI=" & vn_codibollavvi &" "_
&" AND DATA_SPED_FILE is null and rownum=1;"
'response.write sqlprodbolleseg
Set rsprodbolleseg = con.Execute(sqlprodbolleseg)
if not rsprodbolleseg.EOF then
%>
<%
'response.write vc_dataprodfile
iStoredProc = 4
set command = Server.CreateObject("ADODB.Command")
command.ActiveConnection = con
command.CommandText = "PR_MODISTORBOLLAVVIAZIE"
command.CommandType = iStoredProc
'PAREMETRI INPUT
set objParameter = command.CreateParameter ("VN_CODIBOLLAVVI",200,1,10,vn_codibollavvi)
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("VC_ROWID",200,1,10,"")
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("VN_CODIAZIE",200,1,200,"")
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("VC_PATHFILE",200,1,200,"")
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("VC_NOMEFILE",200,1,2000,"")
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("VC_NOMEFILEASPP",200,1,2000,"")
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("VC_USERPROC",200,1,50,vc_userconn)
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("VC_CODITIPOOPER",200,1,2,"D")
command.Parameters.Append objParameter
'PAREMETRI OUTPUT
set objParameter = command.CreateParameter ("vc_codierro",200,2,16)
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("vc_descerro",200,2,200)
command.Parameters.Append objParameter
command.Execute , , adExecuteNoRecords
' VERIFICO EVENTUALI ERRORI
vc_risuinse = command.Parameters("vc_descerro")
vc_codirisuinse = command.Parameters("vc_codierro")
end if
rsprodbolleseg.Close
Set rsprodbolleseg = Nothing
%>
<table border="0" width="100%">
<tr>
<th class=testolabel ></th>
<th class=testolabel >File dei Bollettini Avvisi prodotti</th>
<th class=testolabel ></th>
</tr>
</table>
<table border="1" width="100%">
<tr>
<th class=testolabel >Cliente Destinatario</th>
<th class=testolabel >Bollettino N.</th>
<th class=testolabel >Nome File Prodotto</th>
</tr>
<% ' Estrazione CodiAzie da RelaServAzie
' passato da Relaservazie a anaguten-anagazie
selectrelaservazie = "select CODI_AZIE "_
&" from V_ASP_ANAGUTENAZIE "_
&" where CODI_TIPO_UTEN in (9,7,2,5) and rownum < 5 "_
&" and DESC_INDI_EMAI is not null "_
&" ORDER BY CODI_AZIE; "
'response.write selectrelaservazie
Set rsrelaservazie = con.Execute(selectrelaservazie)
if not rsrelaservazie.EOF then
Do While Not rsrelaservazie.EOF
iprinci=0
vc_listcodiavvi=""
vc_listcodiavviapici=""
vn_codiazie = rsrelaservazie("CODI_AZIE").Value
selectprinci= " SELECT X.CODI_AVVI,X.NUME_AVVI, x.ordi_unio "_
.....
.....
&" order by x.ordi_unio; "
' &" order by x.ordi_unio; "
'response.write selectprinci %> <%
Set rsprinci2 = con.Execute(selectprinci)
if not rsprinci2.EOF then
Do While Not rsprinci2.EOF
iprinci=iprinci+1
if (iprinci = 1) then
' Insert in StorBollavvi
vc_pathfile = "bollavvifile\"
vc_nomefile = rsrelaservazie("CODI_AZIE").Value &"_"&vn_codibollavvi &".asp"
vc_nomefilepdf = rsrelaservazie("CODI_AZIE").Value &"_"&vn_codibollavvi&".pdf"
vc_nomefilepdfasso=vc_descpathassoavvi&"\"&vc_nomefilepdf
'response.write vc_descpathassoavvi
'response.write vc_nomefilepdf
'response.write vc_nomefilepdfasso
iStoredProc = 4
set command = Server.CreateObject("ADODB.Command")
command.ActiveConnection = con
command.CommandText = "PR_MODISTORBOLLAVVIAZIE"
command.CommandType = iStoredProc
'PAREMETRI INPUT
set objParameter = command.CreateParameter ("VN_CODIBOLLAVVI",200,1,10,vn_codibollavvi)
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("VC_ROWID",200,1,10,"")
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("VN_CODIAZIE",200,1,200,vn_codiazie)
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("VC_PATHFILE",200,1,200,vc_pathfile)
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("VC_NOMEFILE",200,1,2000,vc_nomefilepdf)
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("VC_NOMEFILEASPP",200,1,2000,vc_nomefile)
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("VC_USERPROC",200,1,50,vc_userconn)
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("VC_CODITIPOOPER",200,1,2,"I")
command.Parameters.Append objParameter
'PAREMETRI OUTPUT
set objParameter = command.CreateParameter ("vc_codierro",200,2,16)
command.Parameters.Append objParameter
set objParameter = command.CreateParameter ("vc_descerro",200,2,200)
command.Parameters.Append objParameter
command.Execute , , adExecuteNoRecords
' VERIFICO EVENTUALI ERRORI
vc_risuinse = command.Parameters("vc_descerro")
vc_codirisuinse = command.Parameters("vc_codierro")
' Al primo giro valorizzo listcodiavvi
vc_listcodiavvi=rsprinci2("CODI_AVVI")
else
vc_listcodiavvi=vc_listcodiavvi&","&rsprinci2("CODI_AVVI").Value
'response.write vc_listcodiavvi
end if
rsprinci2.MoveNext
Loop
end if
' Prossimo cliente
rsrelaservazie.MoveNext
if iprinci <> 0 then
' response.write "CODIAVVI - " & vc_listcodiavvi %>
<%
end if
Loop
end if
' rsprinci2.Close
' Set rsprinci2 = Nothing
rsrelaservazie.Close
Set rsrelaservazie = Nothing
' Cursore separato per lancio scrittura file .pdf
selectfilepdf = "select NUME_BOLL,DESC_DENO_AZIE,PATH_FILE, NOME_FILE, NOME_FILE_ASPP "_
&" from v_asp_storbollavviazieemai "_
&" WHERE CODI_BOLL_AVVI= " & vn_codibollavvi &" "_
&" and DESC_INDI_EMAI is not NULL "_
&" ORDER BY DESC_DENO_AZIE, NUME_BOLL, NOME_FILE;"
' response.write selectfilepdf
Set rsfilepdf = con.Execute(selectfilepdf)
if not rsfilepdf.EOF then
Do While Not rsfilepdf.EOF
%>
<tr >
<td valign="top" class=testolabel><%=rsfilepdf("DESC_DENO_AZIE").Value%></td>
<td valign="top" class=testolabel><%=rsfilepdf("NUME_BOLL").Value%></td>
<td valign="top" class=testolabel><%=rsfilepdf("PATH_FILE").Value%><%=rsfilepdf("NOME_FILE").Value%></td>
</tr>
<%
rsfilepdf.MoveNext
Loop
else
%>
</table>
<p class="errori" ><center>
Non esistono file da produrre per il bollettino richiesto</p></center>
<%
end if
rsfilepdf.Close
Set rsfilepdf = Nothing
%>
<%
con.Close
Set con = Nothing
%>
<script language="JavaScript">
document.getElementById('splash').style.visibility = "hidden";
</script>