Questo è il mio codice attuale:
codice:
<%@LANGUAGE="VBSCRIPT"%>
<%' Controllo se l'utente si è logato
If Session("status") <> "login" Then
response.redirect "software.asp"
Response.expires = 0
Response.expiresabsolute = Now() - 1
Response.addHeader "pragma", "no-cache"
Response.addHeader "cache-control", "private"
Response.CacheControl = "no-cache"
End If
%>
<HTML>
<HEAD>
<title>TEAM-GEST: SOFTWARE PROFESSIONALE PER GESTIRE IL TUO TEAM</title>
<link href="stile.css" rel="stylesheet" type="text/css" />
<link rel="icon" href="/images/logo1.ico" />
<script type="text/javascript" src="Chart.js"></script>
<%
session("StagioneAttuale")
Categoria = request.form("Categoria")
' stringa di conn
Set Conn = Server.CreateObject("ADODB.Connection")
Connect = "Driver={Microsoft Access Driver (*.mdb)};DBQ=" & Server.MapPath(""& session("MM_Percorso") &"")
Conn.Open Connect
Set rs = Server.CreateObject("adodb.recordset")
rs.Open "SELECT * FROM T_Presenze_Assenze"&session("StagioneAttuale")&" where Categoria='" & Categoria & "'", Conn,3,3
if not rs.eof then
Set rsAssenti = Server.CreateObject("adodb.recordset")
rsAssenti.Open "SELECT DISTINCT count([T_Presenze_Assenze"&session("StagioneAttuale")&"].Motivo) as ConteggioMotivo, DataInsert FROM T_Presenze_Assenze"&session("StagioneAttuale")&" where Motivo <= '5' and Categoria='" & Categoria & "' group by DataInsert", Conn,3,3
rsAssenti.movefirst
'TotaleAssenti = ValoreAssenti
'TotaleGiocatori = rs.recordcount
'PercentualeAssenti = Round((TotaleAssenti * 100)/TotaleGiocatori,0)
%>
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
<script type="text/javascript">
google.charts.load('current', {'packages':['corechart']});
google.charts.setOnLoadCallback(drawChart);
function drawChart() {
var data = google.visualization.DataTable();
data.addColumn('data', 'Data');
data.addColumn('number', 'Valori');
<%while not rsAssenti.eof
ValoreAssenti = rsAssenti("ConteggioMotivo")
DataAssenti = rsAssenti("DataInsert")%>
data.addRows([
[<%=DataAssenti%>,<%=ValoreAssenti%>]
<%
rsAssenti.movenext
wend
%>
]);
// Set chart options
var options = {
title: 'Prova',
curveType: 'function',
legend: { position: 'bottom' }
};
var chart = new google.visualization.LineChart(document.getElementById('chart_div'));
chart.draw(data, options);
}
</script>
</HEAD>
<body bgcolor="#7A8996">
<div id="chart_div" style="width: 800px; height: 410px;"></div>
<%else%>
<script type="text/javascript">
<!--window.close()-->
</script>
<%end if%>
</body>
</html>