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 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257
| <?php
// Connexion au serveur de base de données
$link = mysql_connect("127.0.0.1","root","npidb");
if (!$link)
{
die('Connexion impossible : ' . mysql_error());
}
//echo 'Connecté correctement';
// Sélection de la base de données
$db_selected = mysql_select_db('npidb',$link);
if (!$db_selected)
{
die ('Impossible de sélectionner la base de données : ' . mysql_error());
}
// On va chercher les enregistrements disponibles
$sql =
'SELECT
Release_gsm AS "Release_GSM"
,count(*) AS Total
, FORMAT(100*COUNT(*)/(SELECT COUNT(*) FROM customer), 1) AS Pourcentage
, GROUP_CONCAT(DISTINCT Sub_Release_gsm SEPARATOR " - ") AS "Sub releases"
FROM
customer
WHERE
network_status = "active" -- réseau actif
AND NOT Release_gsm = "/"
GROUP BY
Release_gsm'
;
$result = mysql_query($sql) or die('Erreur SQL : <br />'.$sql);
// On affiche le contenu si la table n'est pas vide
if (mysql_num_rows($result) > 0)
{
//echo '<br />';
while ($donnees = mysql_fetch_assoc($result))
{
//echo $donnees['datation'].' '.$donnees['type'].' '.$donnees['valeur'].'<br />';
$data[] = $donnees['Pourcentage'];
//echo $data1y.'<br />';
}
}
// content="text/plain; charset=utf-8"
require_once ('jpgraph.php');
require_once ('jpgraph_pie.php');
require_once ('jpgraph_pie3d.php');
//$gJpgBrandTiming=true;
// Some data
//$data = array(40,21,17,27,23);
// Create the Pie Graph.
$graph = new PieGraph(400,200,'auto');
$graph->SetShadow();
// Set A title for the plot
$graph->title->Set("3D Pie Client side image map");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Create
$p1 = new PiePlot3D($data);
$p1->SetLegends(array("Jan (%d)","Feb","Mar","Apr","May","Jun","Jul"));
$targ=array("pie3d_csimex1.php?v=1","pie3d_csimex1.php?v=2","pie3d_csimex1.php?v=3",
"pie3d_csimex1.php?v=4","pie3d_csimex1.php?v=5","pie3d_csimex1.php?v=6");
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
$p1->SetCSIMTargets($targ,$alts);
// Use absolute labels
$p1->SetLabelType(1);
$p1->value->SetFormat("%d kr");
// Move the pie slightly to the left
$p1->SetCenter(0.4,0.5);
$graph->Add($p1);
// Send back the HTML page which will call this script again
// to retrieve the image.
$graph->StrokeCSIM();
?><?php
// Connexion au serveur de base de données
$link = mysql_connect("127.0.0.1","root","npidb");
if (!$link)
{
die('Connexion impossible : ' . mysql_error());
}
//echo 'Connecté correctement';
// Sélection de la base de données
$db_selected = mysql_select_db('npidb',$link);
if (!$db_selected)
{
die ('Impossible de sélectionner la base de données : ' . mysql_error());
}
// On va chercher les enregistrements disponibles
$sql =
'SELECT
Release_gsm AS "Release GSM"
, Sub_release_gsm AS "Sub Release"
, SUM(Total_bts) AS "BTS Qty"
, FORMAT(100*SUM(Total_bts)/(SELECT SUM(Total_bts) FROM customer), 1) AS Pourcentage
FROM
customer
WHERE
network_status = "active" -- réseau actif
AND NOT Release_gsm = "/"
GROUP BY
Release_gsm
'
;
$result = mysql_query($sql) or die('Erreur SQL : <br />'.$sql);
// On affiche le contenu si la table n'est pas vide
if (mysql_num_rows($result) > 0)
{
//echo '<br />';
while ($donnees = mysql_fetch_assoc($result))
{
//echo $donnees['datation'].' '.$donnees['type'].' '.$donnees['valeur'].'<br />';
$data[] = $donnees['Pourcentage'];
//echo $data1y.'<br />';
}
}
// content="text/plain; charset=utf-8"
require_once ('jpgraph.php');
require_once ('jpgraph_pie.php');
require_once ('jpgraph_pie3d.php');
//$gJpgBrandTiming=true;
// Some data
//$data = array(40,21,17,27,23);
// Create the Pie Graph.
$graph = new PieGraph(400,200,'auto');
$graph->SetShadow();
// Set A title for the plot
$graph->title->Set("3D Pie Client side image map");
$graph->title->SetFont(FF_FONT1,FS_BOLD);
// Create
$p1 = new PiePlot3D($data);
$p1->SetLegends(array("Jan (%d)","Feb","Mar","Apr","May","Jun","Jul"));
$targ=array("pie3d_csimex1.php?v=1","pie3d_csimex1.php?v=2","pie3d_csimex1.php?v=3",
"pie3d_csimex1.php?v=4","pie3d_csimex1.php?v=5","pie3d_csimex1.php?v=6");
$alts=array("val=%d","val=%d","val=%d","val=%d","val=%d","val=%d");
$p1->SetCSIMTargets($targ,$alts);
// Use absolute labels
$p1->SetLabelType(1);
$p1->value->SetFormat("%d kr");
// Move the pie slightly to the left
$p1->SetCenter(0.4,0.5);
$graph->Add($p1);
// Send back the HTML page which will call this script again
// to retrieve the image.
$graph->StrokeCSIM();
?>
<br>
CONFIG 1:
<br>
<input type="button" name="lien1" value="Release/Sub Release" onClick="self.location.href='pourcentage1.php'"style="width:197px; height:35px; box-shadow:10px 10px 10px #333; font-family:Times Roman; font-size: 20px;"/>
<input type="button" name="lien1" value="RSC/Country" onClick="self.location.href='pourcentage2.1.php'"style="width:197px; height:35px; box-shadow:10px 10px 10px #333; font-family:Times Roman; font-size: 20px;"/><br>
CONFIG 2:
<br>
<input type="button" name="lien1" value=" BTS " onClick="self.location.href='pourcentage1.1.php'"style="width:130px; height:35px; box-shadow:10px 10px 10px #333; font-family:Times Roman; font-size: 20px;"/>
<input type="button" name="lien1" value=" BSC " onClick="self.location.href='pourcentage1.2.php'"style="width:130px; height:35px; box-shadow:10px 10px 10px #333; font-family:Times Roman; font-size: 20px;"/>
<input type="button" name="lien1" value=" MFS " onClick="self.location.href='pourcentage1.3.php'"style="width:130px; height:35px; box-shadow:10px 10px 10px #333; font-family:Times Roman; font-size: 20px;"/><br>
<br>
<?php
// on se connecte à notre base
//echo "Demande de connexion au NAS<br>";
$link = mysql_connect("127.0.0.1","root","npidb") or die ("Impossible de se connecter : " . mysql_error());
//echo "Connexion au NAS reussie<br>Demande de selection de la base<br>";
$reponse=mysql_select_db("npidb",$link) or die("Impossible de selectionner la base de donnee ");
//echo "Selection reussie<br>";
$date = date("d-m-Y");
$heure = date("H:i");
// echo
// "Bonjour et bienvenue, nous sommes le $date , il est $heure ";
?>
<html>
<head>
<title>latest TPM updates</title>
</head>
<body>
<?php
$sql =
'SELECT
Release_gsm AS "Release GSM"
, Sub_release_gsm AS "Sub Release"
,count(*) AS Total
, FORMAT(100*COUNT(*)/(SELECT COUNT(*) FROM customer), 1) AS Pourcentage
-- , GROUP_CONCAT(DISTINCT Sub_Release_gsm SEPARATOR " - ") AS "Sub releases"
FROM
customer
WHERE
network_status = "active" -- réseau actif
AND NOT Release_gsm = "/"
GROUP BY
Release_gsm, Sub_Release_gsm
WITH ROLLUP'
;
$req = mysql_query($sql) or die('Erreur SQL !<br />'.$sql.'<br />'.mysql_error());
?>
<div style="float:up; width:400px;">
<table width = "100%" border="1" cellspacing="1" cellspacing="1" >
<tr>
<th> Releases </th>
<th> Sub Releases </th>
<th> Total </th>
<th> Pourcentage </th>
</tr>
<?php
while ($data = mysql_fetch_array($req)) {
?>
<tr><td>
<?php echo $data['Release GSM']; ?>
</td><td>
<?php echo $data['Sub Release'];?>
</td><td>
<?php echo $data['Total']; ?>
</td><td>
<?php echo $data['Pourcentage']; ?>
</td>
<?php
}
mysql_free_result ($req);
mysql_close ();
?>
</table>
</div> |
Partager