<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<%
'If Session("IDUtente")="" Then
' Response.Redirect("login.asp")
'Else
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<link rel="stylesheet" href="2col_rightNav.css" type="text/css" />
<style type="text/css">
.Stile2 {font-size: 36px}
.Stile5 {color: #334d55; font-weight: bold; }
.Stile6 {color: #FF0000; font-weight: bold; }
</style>
<SCRIPT LANGUAGE="JavaScript">
function link() {
var lArea='<%=Session("Area")%>';
var lSegnalazione='<%Session ("Segnalazione")%>';
var lCarico='<%Session ("Carico")%>';
var lDataSegn='<%Session ("DataSegn")%>';
var lNrSegn='<%Session ("NrSegn")%>';
var lDescrSegn='<%Session ("DescrSegn")%>';
window.location.href="InsSegn.asp?LA='"+lArea+"'&L S='"+lSegnalazione+"'&LC='"+lCarico+"'&LD='"+lData Segn+"'&LN='"+lNrSegn+"'&LD='"+lDescrSegn+"'"
}
</SCRIPT>
</head>
<body>
<%
%>
<table>
<tr>
<td valign="top" width="800">
<%
Session ("Area")=request.form("Farea")
Session ("Segnalazione")=request.form("FcodSegn")
Session ("Carico")=request.Form("FCarico")
Session ("DataSegn")=request.Form("FDataSegn")
Session ("NrSegn")=request.Form("FNrSegn")
Session ("DescrSegn")=request.Form("FDescrSegn")
'Stringa per la connessione
cString = "DRIVER={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath("\NCB\prova.mdb")
'set connession to database
Set objConn=Server.CreateObject("ADODB.Connection")
'open connession to database
objConn.Open cString
Set rs = Server.CreateObject("ADODB.Recordset")
%>
<form name="tabella1" method="post">
<div align="center">
Categoria:
<select name="Farea" title="Categoria:" onChange="submit();">
<option value="0" selected>Scegli una categoria</option>
<%
sql = "SELECT DISTINCT Area FROM NCS WHERE TIPO<>'NC' AND Disattiva=0 ORDER BY Area"
rs.open sql, objconn
if not rs.eof then
do until rs.eof
%>
<option value="<%=rs.Fields(0).Value%>" <% if rs.Fields(0).Value=Session("Area") then %> selected <% end if %>>
<%= RS.Fields(0).Value%></option>
<%
rs.movenext
loop
end if
rs.close
set rs = nothing
%>
</select>
</div>
<%
if Session ("Area")<>"0" then
Set RS1 = Server.CreateObject("ADODB.Recordset")
sql1 = "SELECT IdCodice, Descrizione from NCS WHERE Area='"&Session("Area")&"'"
'response.write sql1:response.end
rs1.open sql1, objconn
if not rs1.eof then
%>
<div align="center">
Segnalazione:
<select name="FcodSegn" onChange="submit();">
<option value="0">Scegli una segnalazione</option>
<%
Do while Not RS1.EOF
%>
<option value="<%=RS1.Fields(1).Value%>" <% if RS1.Fields(1).Value=Session("FSegnalazione") then %> selected <% end if %>>
<%= RS1.Fields(1).Value%></option>
<%
RS1.Movenext
LooP
end if
rs1.close
set rs1 = nothing
end if
%>
</select>
</div>
<%
if Session ("Segnalazione")<>"0" then
Set RS2 = Server.CreateObject("ADODB.Recordset")
sql2 = "SELECT DISTINCT Unita.Descrizione FROM (Unita INNER JOIN RiceventiSegn ON Unita.IdUnita = RiceventiSegn.IdUnita) INNER JOIN NCS ON RiceventiSegn.IdCodice = NCS.IdCodice WHERE (((NCS.Descrizione)='"&Session ("Segnalazione")&"'));"
RS2.open sql2, objconn
if not RS2.eof then
%>
<div align="center">
A carico di:
<select name="FCarico" onChange="submit();">
<option value="0">Indica a chi è in carico</option>
<%
Do while Not RS2.EOF
%>
<option value="<%=RS2.Fields(0).Value%>">
<%= RS2.Fields(0).Value%></option>
<%
RS2.Movenext
LooP
end if
RS2.close
set RS2 = nothing
end if
%>
</select>
</div>
<div align="center">Data: <input name="FDataSegn" type="text" maxlength="10" onChange="submit();"/>
(gg/mm/aaaa)</div>
<div align="center">Nr di segnalazioni riscontrate: <input name="FNrSegn" type="text" maxlength="10" onChange="submit();"/></div>
<div align="center">Descrizione: <input name="FDescrSegn" size="100" height="60" type="text" maxlength="255" onChange="submit();"/></div>
<div align="center">
<input type="button" value="invia dati" onClick="javascipt:link()"/>
<input type="reset" value="annulla"/>
</div>
</form>
<%
objconn.close
set objconn = nothing
%>
</td>
</tr>
</table>
</body>
</html>
<%
'end if
%>