Your IP : 216.73.216.65


Current Path : /home/ataenra/www/ATA/INTRANET/GenPDF/9JPgraph/
Upload File :
Current File : /home/ataenra/www/ATA/INTRANET/GenPDF/9JPgraph/genjpgraphqualitenr.php

<?php // content="text/plain; charset=utf-8"



require_once ('../../Outils/jpgraph/jpgraph.php');

require_once ('../../Outils/jpgraph/jpgraph_line.php');





//connexion a la base de donnée

require_once '../../Outils/co.php';



//recuperation des informations selon IDPAC 

$sth2 = $dbco->prepare("SELECT * FROM ".$table_produits." P JOIN ".$table_jointure." J ON J.ID_produit=P.ID_Produit JOIN ".$table_ensemble." E ON E.ID_Ens=J.ID_ens WHERE J.ID_ens = '$R->IDm'"); 

$sth2->execute();

$R2 = $sth2->fetch(PDO::FETCH_OBJ);





if($R->Regimeau == "BT35"){$Puissance = "P7m35";}elseif($R->Regimeau == "MT55"){$Puissance = "P7m55";}elseif($R->Regimeau == "HT70"){$Puissance = "P7m70";}

$Deperditions = $R->Deperditions;

$TempExtRef = -9;

$TempIntConf = $R->TempIntConf;
$PuissancePac10 = $R2->$Puissance;




//$PuissancePac = $R2->Puissance*1000;

$A = ((0-$Deperditions)/($TempIntConf-$TempExtRef));
$B = ($Deperditions-$A*$TempExtRef);



$datay1 = array(

$A*-15+$B,$A*-14+$B,$A*-13+$B,$A*-12+$B,$A*-11+$B,
$A*-10+$B,$A*-9+$B,$A*-8+$B,$A*-7+$B,$A*-6+$B,
$A*-5+$B,$A*-4+$B,$A*-3+$B,$A*-2+$B,$A*-1+$B,
$A*0+$B,$A*1+$B,$A*2+$B,$A*3+$B,$A*4+$B,
$A*5+$B,$A*6+$B,$A*7+$B,$A*8+$B,$A*9+$B,
$A*10+$B,$A*11+$B,$A*12+$B,$A*13+$B,$A*14+$B,
$A*15+$B,$A*16+$B,$A*17+$B,$A*18+$B,$A*19+$B,
$A*20+$B

);

//NON HYBRIDE
//SELECTION REGIME EAU ET VALEURS CORRESPONDANTES
if($R->Regimeau == "BT35"){$Puissance = "P7m35"; $CoefA= $R2->A35; $CoefB= $R2->B35; $Scop = "ScopBT35"; $NS = "NS35"; $CE = "CE35"; $Pmax=$R2->Pmax35;}            
if($R->Regimeau == "MT55"){$Puissance = "P7m55"; $CoefA= $R2->A55; $CoefB= $R2->B55; $Scop = "ScopMT55"; $NS = "NS55"; $CE = "CE55"; $Pmax=$R2->Pmax55;}   
if($R->Regimeau == "HT"){$Puissance = "P7m70"; $CoefA= $R2->A70; $CoefB= $R2->B70; $Scop = "ScopHT70"; $NS = "NS70"; $CE = "CE70"; $Pmax=$R2->Pmax70;}   


if(($R2->typep != "Hybride") ){

$pm15 = $CoefA*-15+$CoefB; if($pm15 <= $Pmax){$Pm15=$pm15;}else{$Pm15=$Pmax;}
$pm14 = $CoefA*-14+$CoefB; if($pm14 <= $Pmax){$Pm14=$pm14;}else{$Pm14=$Pmax;}
$pm13 = $CoefA*-13+$CoefB; if($pm13 <= $Pmax){$Pm13=$pm13;}else{$Pm13=$Pmax;}
$pm12 = $CoefA*-12+$CoefB; if($pm12 <= $Pmax){$Pm12=$pm12;}else{$Pm12=$Pmax;}
$pm11 = $CoefA*-11+$CoefB; if($pm11 <= $Pmax){$Pm11=$pm11;}else{$Pm11=$Pmax;}
$pm10 = $CoefA*-10+$CoefB; if($pm10 <= $Pmax){$Pm10=$pm10;}else{$Pm10=$Pmax;}
$pm9 = $CoefA*-9+$CoefB; if($pm9 <= $Pmax){$Pm9=$pm9;}else{$Pm9=$Pmax;}
$pm8 = $CoefA*-8+$CoefB; if($pm8 <= $Pmax){$Pm8=$pm8;}else{$Pm8=$Pmax;}
$pm7 = $CoefA*-7+$CoefB; if($pm7 <= $Pmax){$Pm7=$pm7;}else{$Pm7=$Pmax;}
$pm6 = $CoefA*-6+$CoefB; if($pm6 <= $Pmax){$Pm6=$pm6;}else{$Pm6=$Pmax;}
$pm5 = $CoefA*-5+$CoefB; if($pm5 <= $Pmax){$Pm5=$pm5;}else{$Pm5=$Pmax;}
$pm4 = $CoefA*-4+$CoefB; if($pm4 <= $Pmax){$Pm4=$pm4;}else{$Pm4=$Pmax;}
$pm3 = $CoefA*-3+$CoefB; if($pm3 <= $Pmax){$Pm3=$pm3;}else{$Pm3=$Pmax;}
$pm2 = $CoefA*-2+$CoefB; if($pm2 <= $Pmax){$Pm2=$pm2;}else{$Pm2=$Pmax;}
$pm1 = $CoefA*-1+$CoefB; if($pm1 <= $Pmax){$Pm1=$pm1;}else{$Pm1=$Pmax;}
$p0 = $CoefA*0+$CoefB; if($p0 <= $Pmax){$P0=$p0;}else{$P0=$Pmax;}
$pp1 = $CoefA*1+$CoefB; if($pp1 <= $Pmax){$Pp1=$pp1;}else{$Pp1=$Pmax;}
$pp2 = $CoefA*2+$CoefB; if($pp2 <= $Pmax){$Pp2=$pp2;}else{$Pp2=$Pmax;}
$pp3 = $CoefA*3+$CoefB; if($pp3 <= $Pmax){$Pp3=$pp3;}else{$Pp3=$Pmax;}
$pp4 = $CoefA*4+$CoefB; if($pp4 <= $Pmax){$Pp4=$pp4;}else{$Pp4=$Pmax;}
$pp5 = $CoefA*5+$CoefB; if($pp5 <= $Pmax){$Pp5=$pp5;}else{$Pp5=$Pmax;}
$pp6 = $CoefA*6+$CoefB; if($pp6 <= $Pmax){$Pp6=$pp6;}else{$Pp6=$Pmax;}
$pp7 = $CoefA*7+$CoefB; if($pp7 <= $Pmax){$Pp7=$pp7;}else{$Pp7=$Pmax;}
$pp8 = $CoefA*8+$CoefB; if($pp8 <= $Pmax){$Pp8=$pp8;}else{$Pp8=$Pmax;}
$pp9 = $CoefA*9+$CoefB; if($pp9 <= $Pmax){$Pp9=$pp9;}else{$Pp9=$Pmax;}
$pp10 = $CoefA*10+$CoefB; if($pp10 <= $Pmax){$Pp10=$pp10;}else{$Pp10=$Pmax;}
$pp11 = $CoefA*11+$CoefB; if($pp11 <= $Pmax){$Pp11=$pp11;}else{$Pp11=$Pmax;}
$pp12 = $CoefA*12+$CoefB; if($pp12 <= $Pmax){$Pp12=$pp12;}else{$Pp12=$Pmax;}
$pp13 = $CoefA*13+$CoefB; if($pp13 <= $Pmax){$Pp13=$pp13;}else{$Pp13=$Pmax;}
$pp14 = $CoefA*14+$CoefB; if($pp14 <= $Pmax){$Pp14=$pp14;}else{$Pp14=$Pmax;}
$pp15 = $CoefA*15+$CoefB; if($pp15 <= $Pmax){$Pp15=$pp15;}else{$Pp15=$Pmax;}
$pp16 = $CoefA*16+$CoefB; if($pp16 <= $Pmax){$Pp16=$pp16;}else{$Pp16=$Pmax;}
$pp17 = $CoefA*17+$CoefB; if($pp17 <= $Pmax){$Pp17=$pp17;}else{$Pp17=$Pmax;}
$pp18 = $CoefA*18+$CoefB; if($pp18 <= $Pmax){$Pp18=$pp18;}else{$Pp18=$Pmax;}
$pp19 = $CoefA*19+$CoefB; if($pp19 <= $Pmax){$Pp19=$pp19;}else{$Pp19=$Pmax;}
$pp20 = $CoefA*20+$CoefB; if($pp20 <= $Pmax){$Pp20=$pp20;}else{$Pp20=$Pmax;}




$datay2 = array(
    

$Pm15,$Pm14,$Pm13,$Pm12,$Pm11,$Pm10,$Pm9,$Pm8,$Pm7,$Pm6,$Pm5,$Pm4,$Pm3,$Pm2,$Pm1,$P0,$Pp1,$Pp2,$Pp3,$Pp4,$Pp5,$Pp6,$Pp7,$Pp8,$Pp9,$Pp10,$Pp11,$Pp12,$Pp13,$Pp14,$Pp15,$Pp16,$Pp17,$Pp18,$Pp19,$Pp20    
    
);

}else{

$datay2 = array(
    
$CoefA*-15+$CoefB,$CoefA*-14+$CoefB,$CoefA*-13+$CoefB,$CoefA*-12+$CoefB,$CoefA*-11+$CoefB,
$CoefA*-10+$CoefB,$CoefA*-9+$CoefB,$CoefA*-8+$CoefB,$CoefA*-7+$CoefB,$CoefA*-6+$CoefB,
$CoefA*-5+$CoefB,$CoefA*-4+$CoefB,$CoefA*-3+$CoefB,$CoefA*-2+$CoefB,$CoefA*-1+$CoefB,
$CoefA*0+$CoefB,$CoefA*1+$CoefB,$CoefA*2+$CoefB,$CoefA*3+$CoefB,$CoefA*4+$CoefB,
$CoefA*5+$CoefB,$CoefA*6+$CoefB,$CoefA*7+$CoefB,$CoefA*8+$CoefB,$CoefA*9+$CoefB,
$CoefA*10+$CoefB,$CoefA*11+$CoefB,$CoefA*12+$CoefB,$CoefA*13+$CoefB,$CoefA*14+$CoefB,
$CoefA*15+$CoefB,$CoefA*16+$CoefB,$CoefA*17+$CoefB,$CoefA*18+$CoefB,$CoefA*19+$CoefB,
$CoefA*20+$CoefB    
            
);

}


// Setup the graph

$graph = new Graph(1000,600);

$graph->SetScale("textlin");



$theme_class=new UniversalTheme;



$graph->SetTheme($theme_class);

$graph->img->SetAntiAliasing(false);

$graph->title->Set('Graphique Déperditions / Puissance PAC (Hors Appoint) '.$R2->appel.' @ '.$R->Regimeau.'°C');

$graph->SetBox(false);



$graph->SetMargin(40,20,36,43);



$graph->img->SetAntiAliasing();



$graph->yaxis->HideZeroLabel();

$graph->yaxis->HideLine(false);

$graph->yaxis->HideTicks(false,false);



$graph->xgrid->Show();

$graph->xgrid->SetLineStyle("solid");

$graph->xaxis->SetTickLabels(array('-15','-14','-13','-12','-11','-10','-9','-8','-7','-6','-5','-4','-3','-2','-1','0','1','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18','19','20'));

$graph->xgrid->SetColor('#E3E3E3');



// Create the first line

$p1 = new LinePlot($datay1);

$graph->Add($p1);

$p1->SetColor("#6495ED");

$p1->SetLegend('Déperditions');





// Create the second line

$p2 = new LinePlot($datay2);

$graph->Add($p2);

$p2->SetColor("#FF0000");

$p2->SetLegend('Pac Max');


$graph->legend->SetFrameWeight(1);





$chemin ="../../../FICHIERS/$ID/Qualitenr";

// Création du nouveau répertoire

    if(!is_dir($chemin)) { 

                    

                      mkdir($chemin, 0777,true); 

    }









// Output line

$graph->Stroke("../../../FICHIERS/".$ID."/Qualitenr/graph".$ID.".png");



?>