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 149 150 151 152 153
|
$requete="SELECT participant ,
(SELECT count(*) from msgindex m where msgtype='1' and m.participant=ms.participant),
(SELECT count(*) from msgindex m where msgtype='2' and m.participant=ms.participant ),
(SELECT count(*) from msgindex m where msgtype='3' and m.participant=ms.participant),
(SELECT count(*) from msgindex m where msgtype='4' and m.participant=ms.participant),
(SELECT count(*) from msgindex m where m.participant=ms.participant )
from msgindex ms group by participant";
$Filexml="<chart>
<axis_category shadow='low' />
<axis_value shadow='low' min='0' size='10' alpha='50' steps='4' />
<chart_border color='000000' top_thickness='1' bottom_thickness='2' left_thickness='0' right_thickness='0' />
<chart_data>
<row>
<null/>
<string >Préavis</string>
<string >Manimp</string>
<string >Alerte déchets</string>
<string >Manexp</string>
</row>
";
$rs = pg_query($_hDB,$requete);
while ($field = pg_fetch_array($rs)) {
$Filexml.="<row>
<string>".$field[0]."</string>" ;
for($i=1;$i<5;$i++)
{
$recArray[$row][$i]=$field[$i];
if($field[$i]!=0){
$Filexml.="<number bevel='gray' shadow='low'>".$field[$i]."</number>";
}
}
$row++;
$Filexml.="</row>";
}
$Filexml.="</chart_data>
<chart_grid_h alpha='10' thickness='1' type='dashed' />
<chart_label color='ddffff' alpha='90' size='10' position='middle' />
<chart_note type='arrow' size='13' color='ddffff' alpha='75' x='-10' y='-30' background_color='FF4400' background_alpha='75' shadow='low' />
<chart_rect bevel='bg' shadow='high' x='65' y='70' width='370' height='200' positive_color='eeeeff' negative_color='dddddd' positive_alpha='100' negative_alpha='100' corner_tl='0' corner_tr='0' corner_br='20' corner_bl='20' />
<chart_transition type='scale' delay='.5' duration='0.5' order='series' />
<draw>
<text shadow='high' color='000000' alpha='50' rotation='-90' size='12' x='7' y='310' width='300' height='50' h_align='center'>Notifications Envoyés par les participants</text>
</draw>
<filter>
<shadow id='high' distance='5' angle='45' alpha='35' blurX='10' blurY='10' />
<shadow id='low' distance='2' angle='45' alpha='35' blurX='5' blurY='5' />
<bevel id='bg' angle='45' blurX='50' blurY='50' distance='10' highlightAlpha='50' highlightColor='ffffff' shadowAlpha='10' inner='true' />
<bevel id='blue' angle='-80' blurX='0' blurY='30' distance='20' highlightColor='ffffff' highlightAlpha='50' shadowColor='000088' shadowAlpha='25' inner='true' />
<bevel id='gray' angle='-80' blurX='0' blurY='30' distance='20' highlightColor='ffffff' highlightAlpha='25' shadowColor='000000' shadowAlpha='20' inner='true' />
</filter>
<legend shadow='low' x='105' y='27' width='280' height='20' margin='5' fill_color='000066' fill_alpha='8' line_alpha='0' line_thickness='0' size='12' color='333355' alpha='90' />
<series_color>
<color>999797</color>
<color>20a54c</color>
</series_color>
<series set_gap='40' bar_gap='-15' />
</chart>
";
$filename="sample.xml";
$fp = fopen("$filename","wb");
fwrite($fp,$Filexml);
fclose($fp);
echo "<script language='javascript'>AC_FL_RunContent = 0;</script>
<script language='javascript'> DetectFlashVer = 0; </script>
<script src='AC_RunActiveContent.js' language='javascript'></script>
<script language='JavaScript' type='text/javascript'>
var requiredMajorVersion = 9;
var requiredMinorVersion = 0;
var requiredRevision = 45;
</script>";
echo "<BODY bgcolor='#FFFFFF'>";
echo "<script language='JavaScript' type='text/javascript'>
<!--
if (AC_FL_RunContent == 0 || DetectFlashVer == 0) {
alert('This page requires AC_RunActiveContent.js.');
} else {
var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision);
if(hasRightVersion) {
AC_FL_RunContent(
'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,45,0',
'width', '600',
'height', '350',
'scale', 'noscale',
'salign', 'TL',
'bgcolor', '#ffffff',
'wmode', 'opaque',
'movie', 'charts',
'src', 'charts',
'FlashVars', 'library_path=charts_library&xml_source=sample.xml',
'id', 'my_chart',
'name', 'my_chart',
'menu', 'true',
'allowFullScreen', 'true',
'allowScriptAccess','sameDomain',
'quality', 'high',
'align', 'middle',
'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
'play', 'true',
'devicefont', 'false'
);
} else {
var alternateContent = 'This content requires the Adobe Flash Player. '
+ '<u><a href=http://www.macromedia.com/go/getflash/>Get Flash</a></u>.';
document.write(alternateContent);
}
}
// -->
</script>";
echo "</BODY>"; |
Partager