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 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148
|
<?php
require_once('../connexion/connexion.php');
mysql_query("SET NAMES UTF8");
mysql_select_db($database, $bd_inter);
$mois = array(1=>'JAN', 'FEV', 'MAR', 'AVR', 'MAI', 'JUI', 'JUL', 'AOU', 'SEP', 'OCT', 'NOV', 'DEC');
$id = $_GET['annee'];
$type_serie = $_GET['serie'];
if($type_serie=='tous'){
$serie = 'AND (serie="56" OR serie="88")';
}
if($type_serie=='88'){
$serie = 'AND (serie="88")';
}
if($type_serie=='56'){
$serie = 'AND (serie="56")';
}
// **********************************************
// Extraction des données dans la base de données
// *************************************************
$sql = "SELECT
MONTH(date_si) AS MOIS,
COUNT(*) AS NBR
FROM fem
WHERE
YEAR(date_si) = '$id'
AND serie !=''
$serie
GROUP BY MOIS";
$sql4 = "select * from stats where annee='$id' and mois='$mois'";
$req4 = mysql_query($sql4)or die('Erreur SQL !'.$sql4.'<br>'.mysql_error());
while($row4 = mysql_fetch_array($req4))
{
if($type_serie=='tous'){
$km = $row4['56']+$row4['88'];
}
}
//print_r ($mois);
$result= mysql_query($sql)or die("erreur sur requete:" . mysql_error());
while ($row_type_serie = mysql_fetch_array($result)) {
$tab_tous[$row_type_serie['MOIS']-1] = round(($row_type_serie['NBR']/$km)*1000000,2);
}
?>
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8;">
<link rel="stylesheet" type="text/css" href="../css/view.css">
<script type="text/javascript" src="../function/view.js"></script>
<script type="text/javascript" src="../function/ajaxstats.js"></script>
<script type="text/javascript" src="../function/jquery-1.9.1.js"></script>
<script type="text/javascript">
$(function () {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
type: 'column'
},
xAxis: {
categories: [
'Jan',
'Fev',
'Mar',
'Avr',
'Mai',
'Jun',
'Jul',
'Aou',
'Sep',
'Oct',
'Nov',
'Dec'
]
},
yAxis: [{ // Primary yAxis
gridLineWidth: 0,
labels: {
formatter: function() {
return this.value +' E';
},
style: {
color: '#89A54E'
}
},
title: {
text: 'Objectif',
style: {
color: '#89A54E'
}
}
}, { // Secondary yAxis
title: {
text: 'Nbr E',
style: {
color: '#4572A7'
}
},
labels: {
formatter: function() {
return this.value +' E';
},
style: {
color: '#4572A7'
}
},
opposite: true
}],
tooltip: {
formatter: function() {
return ''+
this.x +': '+ this.y +
(this.series.name == 'Nombre d\'E' ? ' OBJ' : ' E');
}
},
legend: {
layout: 'vertical',
backgroundColor: '#FFFFFF',
align: 'left',
verticalAlign: 'top',
x: 100,
y: 30,
floating: true,
shadow: true
},
series: [
{name: 'Objectif',type: 'spline', data: [<?php echo ($obj);?>],marker: {enabled: false},dashStyle: 'shortdot'},
<?php if(join($tab_tous)>0){
?>
{name: '<?php echo $type_serie?>', data: [<?php echo join(',', $tab_tous);?>]}
<?php
}?>
]
});
});
});
</script>
?> |
Partager