Kod
<?
laczenie z baza etc. ..
while ($wynik=mysql_fetch_array($sql_result))
{
$tytul=$wynik['tytul'];
$tresc=$wynik['tresc'];
$data=$wynik['data'];
$procent=$wynik['procent'];
echo '<br/><div class="prj_wew" >';
echo "Nazwa:<strong>$tytul</strong>Data rozpoczecia: $data<br/>$tresc<br/>Procent zaawansowania prac nad projektem:<strong> $procent</strong> %";
$x=100;
$y=100;
$st=$procent;
$pol_x = 0.5 * $x;
$pol_y = 0.5 * $y;
$stopien_obliczony = 3.6 * $st;
$koncowy_st = 360 - $stopien_obliczony;
// obrazek
$image = imagecreate($x, $y);
//kolory
$tlo = imagecolorallocate($image, 173, 216, 230);
$wolny = imagecolorallocate($image, 0, 0, 200);
$cien_w = imagecolorallocate($image, 0, 0, 120);
$zajety = imagecolorallocate($image, 245, 0, 228);
$cien_z = imagecolorallocate($image, 197, 0, 203);
//ustalenie tla obrazu
ImageFill($image,0,0,$tlo);
// cienie
for ($i = $pol_y+20; $i > $pol_y; $i--)
{
imagefilledarc($image, $pol_x, $i, $x, $pol_y, 0, $koncowy_st, $cien_w, IMG_ARC_PIE);
imagefilledarc($image, $pol_x, $i, $x, $pol_y, $koncowy_st, 360 , $cien_z, IMG_ARC_PIE);
}
// wykres
imagefilledarc($image, $pol_x, $pol_y, $x, $pol_y, 0, $koncowy_st, $wolny, IMG_ARC_PIE);
imagefilledarc($image, $pol_x, $pol_y, $x, $pol_y, $koncowy_st, 360 , $zajety, IMG_ARC_PIE);
// obrazek na ekran
header('Content-type: image/png');
imagepng($image,"wyk.png");
imagedestroy($image);
echo '</div><br/>';
}
mysql_free_result($sql_result);
mysql_close($connection);
?>
laczenie z baza etc. ..
while ($wynik=mysql_fetch_array($sql_result))
{
$tytul=$wynik['tytul'];
$tresc=$wynik['tresc'];
$data=$wynik['data'];
$procent=$wynik['procent'];
echo '<br/><div class="prj_wew" >';
echo "Nazwa:<strong>$tytul</strong>Data rozpoczecia: $data<br/>$tresc<br/>Procent zaawansowania prac nad projektem:<strong> $procent</strong> %";
$x=100;
$y=100;
$st=$procent;
$pol_x = 0.5 * $x;
$pol_y = 0.5 * $y;
$stopien_obliczony = 3.6 * $st;
$koncowy_st = 360 - $stopien_obliczony;
// obrazek
$image = imagecreate($x, $y);
//kolory
$tlo = imagecolorallocate($image, 173, 216, 230);
$wolny = imagecolorallocate($image, 0, 0, 200);
$cien_w = imagecolorallocate($image, 0, 0, 120);
$zajety = imagecolorallocate($image, 245, 0, 228);
$cien_z = imagecolorallocate($image, 197, 0, 203);
//ustalenie tla obrazu
ImageFill($image,0,0,$tlo);
// cienie
for ($i = $pol_y+20; $i > $pol_y; $i--)
{
imagefilledarc($image, $pol_x, $i, $x, $pol_y, 0, $koncowy_st, $cien_w, IMG_ARC_PIE);
imagefilledarc($image, $pol_x, $i, $x, $pol_y, $koncowy_st, 360 , $cien_z, IMG_ARC_PIE);
}
// wykres
imagefilledarc($image, $pol_x, $pol_y, $x, $pol_y, 0, $koncowy_st, $wolny, IMG_ARC_PIE);
imagefilledarc($image, $pol_x, $pol_y, $x, $pol_y, $koncowy_st, 360 , $zajety, IMG_ARC_PIE);
// obrazek na ekran
header('Content-type: image/png');
imagepng($image,"wyk.png");
imagedestroy($image);
echo '</div><br/>';
}
mysql_free_result($sql_result);
mysql_close($connection);
?>
podejrzewam ze chodzi o header, ale nie wiem co dokladnie zrobic zeby to dzialalo..moze wogole tak nie wolno/nie powinno sie ?
Prosze o porade.
c0der