par
matt62400 » 18 févr. 2016, 15:30
Bonjour à tous, j'ai une erreur lors de l'affiche de mon graphique JpGraph et je ne comprends pas pourquoi, l'erreur est la suivante(je la comprends j'ai modifié les permissions) : JpGraph Error: 25107 Can't write to file "='images/image"...".png". Check that the process running PHP has enough permission.
Voici mon code :
session_start();
//if(!isset($_GET['obj']))$_GET['obj'] = 'menustatistique';
include "include/mysql-connect.php"; //connexion à la base de données
include 'objet/'.$_GET['obj'].'.php';
include 'include/fonction.inc.php';
include ("jpgraph-3.5.0b1/src/jpgraph.php");
include ("jpgraph-3.5.0b1/src/jpgraph_line.php");
$datedebut=$_POST['datedebut'];
$datefin=$_POST['datefin'];
$datedebutexplode=explode('-', $datedebut);
$datefinexplode = explode('-', $datefin);
$moisdatedebut=10;
$moisdatefin=10;
$anneedatedebut=2015;
//echo $_GET['annee'];
//echo $_GET['mois'];
$anneedatefin=2016;
$j=0;
while($j<count($tab_donnees)){
if($tab_donnees[$j][7]=="graphoui"){
$reqAffiche="SELECT @cumul := @cumul + valeur1,valeur2,valeur3 from( select count(".$tab_donnees[$j][5].") as valeur1, month(".$tab_donnees[$j][4].") as valeur2 ,year(".$tab_donnees[$j][4].") as valeur3 from ".$tab_donnees[$j][2]." where ".$tab_donnees[$j][3]."='$idfou' and ".$tab_donnees[$j][4]." between '$anneedatedebut-$moisdatedebut-01' and '$anneedatefin-$moisdatefin-31' group by year(".$tab_donnees[$j][4]."),month(".$tab_donnees[$j][4].") )C JOIN (SELECT @cumul :=0)tmp ";
// echo $reqAffiche;
$resultAffiche = mysqli_query($cnx, $reqAffiche) or die ("Erreur de la requête");
while($donnees = mysqli_fetch_array($resultAffiche))
{
$Nbnonconformites[]= $donnees[0];
$moisgraph[] = $donnees[1];
}
}
$j++;
}
//Initialisation du Graphique
$graph = new Graph(920,500);
$graph->SetScale("intlin");
$graph->SetMargin(80,30,40,50);
$graph->SetMarginColor('white');
$graph->SetFrame(false,'blue',3);
//On initialise le titre du graphique
$graph->title->Set("Nombre de non_conformités en fonction du mois");
$graph->yaxis->SetTitleMargin(50);
//On initialise le nom de l'axe des abscisses et ses valeurs
$graph->xaxis->SetTickLabels($moisgraph);
$graph->xaxis->title->Set("Mois");
$graph->xaxis->SetTextLabelInterval(2);
$graph->xgrid->Show();
//On initialise le nom de l'axe des ordonnées et ses valeurs
$graph->yaxis->title->Set("Nombre de non-conformités");
$graph->yaxis->SetLabelAlign('right','bottom');
// Creation de la courbe et affichage
$p1 = new LinePlot($Nbnonconformites);
$p1->value->SetAlign('center');
$graph->Add($p1);
$graph->Stroke("='images/image-".$_GET['obj'].".png");
Bonjour à tous, j'ai une erreur lors de l'affiche de mon graphique JpGraph et je ne comprends pas pourquoi, l'erreur est la suivante(je la comprends j'ai modifié les permissions) : JpGraph Error: 25107 Can't write to file "='images/image"...".png". Check that the process running PHP has enough permission.
Voici mon code :
[php]session_start();
//if(!isset($_GET['obj']))$_GET['obj'] = 'menustatistique';
include "include/mysql-connect.php"; //connexion à la base de données
include 'objet/'.$_GET['obj'].'.php';
include 'include/fonction.inc.php';
include ("jpgraph-3.5.0b1/src/jpgraph.php");
include ("jpgraph-3.5.0b1/src/jpgraph_line.php");
$datedebut=$_POST['datedebut'];
$datefin=$_POST['datefin'];
$datedebutexplode=explode('-', $datedebut);
$datefinexplode = explode('-', $datefin);
$moisdatedebut=10;
$moisdatefin=10;
$anneedatedebut=2015;
//echo $_GET['annee'];
//echo $_GET['mois'];
$anneedatefin=2016;
$j=0;
while($j<count($tab_donnees)){
if($tab_donnees[$j][7]=="graphoui"){
$reqAffiche="SELECT @cumul := @cumul + valeur1,valeur2,valeur3 from( select count(".$tab_donnees[$j][5].") as valeur1, month(".$tab_donnees[$j][4].") as valeur2 ,year(".$tab_donnees[$j][4].") as valeur3 from ".$tab_donnees[$j][2]." where ".$tab_donnees[$j][3]."='$idfou' and ".$tab_donnees[$j][4]." between '$anneedatedebut-$moisdatedebut-01' and '$anneedatefin-$moisdatefin-31' group by year(".$tab_donnees[$j][4]."),month(".$tab_donnees[$j][4].") )C JOIN (SELECT @cumul :=0)tmp ";
// echo $reqAffiche;
$resultAffiche = mysqli_query($cnx, $reqAffiche) or die ("Erreur de la requête");
while($donnees = mysqli_fetch_array($resultAffiche))
{
$Nbnonconformites[]= $donnees[0];
$moisgraph[] = $donnees[1];
}
}
$j++;
}
//Initialisation du Graphique
$graph = new Graph(920,500);
$graph->SetScale("intlin");
$graph->SetMargin(80,30,40,50);
$graph->SetMarginColor('white');
$graph->SetFrame(false,'blue',3);
//On initialise le titre du graphique
$graph->title->Set("Nombre de non_conformités en fonction du mois");
$graph->yaxis->SetTitleMargin(50);
//On initialise le nom de l'axe des abscisses et ses valeurs
$graph->xaxis->SetTickLabels($moisgraph);
$graph->xaxis->title->Set("Mois");
$graph->xaxis->SetTextLabelInterval(2);
$graph->xgrid->Show();
//On initialise le nom de l'axe des ordonnées et ses valeurs
$graph->yaxis->title->Set("Nombre de non-conformités");
$graph->yaxis->SetLabelAlign('right','bottom');
// Creation de la courbe et affichage
$p1 = new LinePlot($Nbnonconformites);
$p1->value->SetAlign('center');
$graph->Add($p1);
$graph->Stroke("='images/image-".$_GET['obj'].".png");[/php]