ich bräuchte mal eure Hilfe,
also das ist mein Quelltext:
Und so sieht das aus: http://www.mamis-online.de/temp/kurve.p ... 6961c4a5ff<?php // Copyright (c) Anja Vogel
// -----------------------------ACHTUNG: wenn DB geändert wird unten ändern und in image.php---------------------
require("standard.inc");
$max = 40;
if (!isset($id)){
$id = 1;
$user_id = 2;
}
$blume = imagecreatefrompng("blume.png");
$pic1 = imagecreatefrompng("1.png");
$pic2 = imagecreatefrompng("2.png");
$pic3 = imagecreatefrompng("3.png");
$pic4 = imagecreatefrompng("4.png");
// Daten auslesen und Arrays zuweisen
$sql = "SELECT * FROM temperatur WHERE id = $id";
$erg = mysql_query($sql);
$res = mysql_fetch_array($erg);
// -----------------------------ACHTUNG: wenn DB geändert wird hier ändern und in table.php---------------------
for ($i=4; $i<44; $i++){ // Werte in Array einlesen
$arTemp[] = $res[$i]; //echo $arTemp[($i-2)]." ";
}
for ($i=44; $i<84; $i++){ // Werte in Array einlesen
$arZervix[] = $res[$i];
}
for ($i=84; $i<124; $i++){ // Werte in Array einlesen
$arGV[] = $res[$i];
}
// Bildgröße und Abstände
$x = 640;
$y = 394;
$dx = 30;
$dy = 10;
$max = 40;
// Farben
$image = imagecreate($x ,$y);
$hell = imagecolorallocate($image, 255, 120, 40);// orange
$orange = imagecolorallocate($image, 255, 202, 40); // orange2
$mittel = imagecolorallocate($image, 0, 0, 0); // schwarz
$dunkel = imagecolorallocate($image, 255, 120, 40); // orange
$black = imagecolorallocate($image, 0, 0, 0);
imagefill($image, 0, 0, $orange);
$cnt = 37.4;
for ($i=0; $i<=300; $i=$i+15){ // horizontal
imageline($image, 10, $dy+$i, $dx+600, $dy+$i, $hell);
imagestring ($image, 1, 10, $dy+4+$i, "$cnt", $mittel); // Temperaturen
$cnt = $cnt - 0.1;
}
imageline($image, 10, $dy+314, $x-10, $dy+314, $hell);
imageline($image, 10, $dy+329, $x-10, $dy+329, $hell);
imagestring ($image, 1, 15, $dy+333, "ZS", $mittel);
imageline($image, 10, $dy+344, $x-10, $dy+344, $hell);
imagestring ($image, 1, 15, $dy+348, "GV", $mittel);
imageline($image, 10, $dy+359, $x-10, $dy+359, $hell);
$cnt = 0;
for ($i=1; $i<=$max; $i++){ // vertikal
imageline($image, $dx+$cnt, $dy, $dx+$cnt, 369, $hell);
imagestring ($image, 1, $dx+4+$cnt, 329, "$i", $mittel); // Tag
$cnt = $cnt + 15;
}
imageline($image, $dx+$cnt, $dy, 30+$cnt, 369, $hell);
imagestring ($image, 1, 12, 329, "Tag", $mittel);
$position = array ( 317 => 35.4,
302 => 35.5,
287 => 35.6,
272 => 35.7,
257 => 35.8,
242 => 35.9,
227 => 36.0,
212 => 36.1,
197 => 36.2,
182 => 36.3,
167 => 36.4,
152 => 36.5,
137 => 36.6,
122 => 36.7,
107 => 36.8,
92 => 36.9,
77 => 37.0,
62 => 37.1,
47 => 37.2,
32 => 37.3,
17 => 37.4,);
$pos1 = $dx+7; //37
$pos2 = $dx+22; //52
for ($i=0; $i<$max; $i++){
if ($arTemp[$i] > 30 and $arTemp[($i+1)] > 30){
imageline($image, $pos1, array_search($arTemp[$i], $position), $pos2, array_search($arTemp[($i+1)], $position), $mittel);
}
switch ($arZervix[$i]){
case "4": ImageCopy($image, $pic4, $pos1-6, 340, 0, 0, 14, 14); break;// Mens.
case "3": ImageCopy($image, $pic3, $pos1-6, 340, 0, 0, 14, 14); break;// gelb
case "2": ImageCopy($image, $pic2, $pos1-6, 340, 0, 0, 14, 14); break;// klar
case "1": ImageCopy($image, $pic1, $pos1-6, 340, 0, 0, 14, 14); break;// weiß
case "0":
default:
}
if ($arGV[$i] == 1){
ImageCopy($image, $blume, $pos1-6, 355, 0, 0, 14, 14); // 31, 26
}
$pos1 = $pos1 + 15;
$pos2 = $pos2 + 15;
}
// Legende
ImageCopy($image, $pic1, 31, 374, 0, 0, 14, 14);
imagestring ($image, 2, 46, 374, "weiss & cremig", $mittel);
ImageCopy($image, $pic2, 241, 374, 0, 0, 14, 14);
imagestring ($image, 2, 256, 374, "glaskar & spinnbar", $mittel);
ImageCopy($image, $pic3, 151, 374, 0, 0, 14, 14);
imagestring ($image, 2, 166, 374, "gelblich", $mittel);
ImageCopy($image, $pic4, 391, 374, 0, 0, 14, 14);
imagestring ($image, 2, 406, 374, "Menstruation", $mittel);
ImageCopy($image, $blume, 496+15, 374, 0, 0, 14, 14);
imagestring ($image, 2, 526, 374, "Geschlechtsverkehr", $mittel);
// an Browser senden
imagepng($image);
?>
Jetzt möchte ich das aber alles in den Farben haben:
http://www.mamis-online.de/testtemp/login.php
Die anderen Dateien farblich anzupassen war kein Problem, aber wie pass ich hier die Farben an. Sorry, aber was .php anbetrifft hab ich leider nicht so die grosse Ahnung.
Viele Grüsse
Karry