1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93
| <?php require_once('../../../Connections/paiefonc.php');
mysql_select_db($database_paiefonc, $paiefonc);
$query_toto5 = "TRUNCATE `ref_chorus`.`requete_top5`";
$toto5 = mysql_query($query_toto5, $paiefonc) or die(mysql_error());
mysql_select_db($database_paiefonc, $paiefonc);
$query_toto5 = "insert into `ref_chorus`.`requete_top5` SELECT page as date,sum(nombre) as SG FROM requetechorus where left(date,4)='2011' group by page order by SG DESC limit 0,5";
$toto5 = mysql_query($query_toto5, $paiefonc) or die(mysql_error());
mysql_select_db($database_paiefonc, $paiefonc);
$query_toto5 = "SELECT page,SG FROM `requete_top5` order by SG asc limit 2,2";
$toto5 = mysql_query($query_toto5, $paiefonc) or die(mysql_error());
//$values5 = 150;
$tableau=array();
$i=0;
while($data5=mysql_fetch_array($toto5)) {
$tableau = array();
$tableau[0]=$data5['page'];
$tableau[1]=$data5['SG'];
$values24 = $data5['page'] ;
$values25 = $tableau[1];
$values26 = $tableau[0];
//echo $values26.'. '.$values25;
//echo $values25;
//}
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Nombre de connexions sur Référentiel Chorus</title>
<link rel="stylesheet" href="style.css" type="text/css">
<script src="../../amcharts/javascript/amcharts.js" type="text/javascript"></script>
<script src="../../amcharts/javascript/raphael.js" type="text/javascript"></script>
<script type="text/javascript">
// var chartData = [{year:"Janvier",income:50}];
//var tableau_js = new Array();
var tableau_js = '<?php echo json_encode($tableau[0]); ?>';
var tableau_js1 = '<?php echo json_encode($tableau[1]); ?>';
alert(tableau_js);
//alert(tableau_js1);
// ligne dessous fonctionne
var donnee = [{year:'<?php echo $tableau[0] ?>' , income:'<?php echo $tableau[1] ?>'}];
window.onload = function()
{
chart = new AmCharts.AmSerialChart();
chart.pathToImages = "../../amcharts/javascript/images/";
chart.dataProvider = donnee;
chart.marginTop = 15;
chart.marginRight = 20;
// $values24 = $data5['SG'] concatn avec $data5['xx']; pour avoir le nombre de fois / formulaire
// year permet d'avoir les annes en bas donc avoir nom du formulaire
chart.categoryField = "year";
chart.angle = 30;
chart.depth3D = 30;
var legend = new AmCharts.AmLegend();
legend.textClickEnabled = false;
chart.addLegend(legend);
var graph1 = new AmCharts.AmGraph();
graph1.title = "Anne 2010 en milliers";
graph1.valueField = "income";
graph1.type = "column";
graph1.lineAlpha = 0;
graph1.fillAlphas = 1;
graph1.bullet = "round";
chart.addGraph(graph1);
chart.categoryAxis.gridPosition = "start";
chart.write("chartdiv");
}
</script>
<?php
}
?>
</head>
<body>
<div id="chartdiv" style="width:800px; height:500px;"></div>
</body>
</html> |
Partager