Example #1
0
}
if (isset($_POST['showpng']) && $_POST['showpng'] == 1) {
    pageHeader();
    echo "<img src='" . basename($_SERVER['PHP_SELF']) . "?" . htmlentities("birthdate=" . urlencode($_REQUEST['birthdate'])) . "' alt=''>";
    pageFooter();
    exit;
}
// specify diagram parameters (these are global)
$diagramWidth = 710;
$diagramHeight = 400;
$daysToShow = 30;
// calculate the number of days this person is alive
// this works because Julian dates specify an absolute number
// of days -> the difference between Julian birthday and
// "Julian today" gives the number of days alive
$daysGone = abs(gregorianToJD($birthMonth, $birthDay, $birthYear) - gregorianToJD(date("m"), date("d"), date("Y")));
// create image
$image = imageCreate($diagramWidth, $diagramHeight);
// allocate all required colors
$colorBackgr = imageColorAllocate($image, 192, 192, 192);
$colorForegr = imageColorAllocate($image, 255, 255, 255);
$colorGrid = imageColorAllocate($image, 0, 0, 0);
$colorCross = imageColorAllocate($image, 0, 0, 0);
$colorPhysical = imageColorAllocate($image, 0, 0, 255);
$colorEmotional = imageColorAllocate($image, 255, 0, 0);
$colorIntellectual = imageColorAllocate($image, 0, 255, 0);
// clear the image with the background color
imageFilledRectangle($image, 0, 0, $diagramWidth - 1, $diagramHeight - 1, $colorBackgr);
// calculate start date for diagram and start drawing
$nrSecondsPerDay = 60 * 60 * 24;
$diagramDate = time() - $daysToShow / 2 * $nrSecondsPerDay + $nrSecondsPerDay;
Example #2
0
	
	    echo "<img src=\"biorhythm.php?birthdate=".urlencode($_REQUEST['birthdate'])."\">";
	    pageFooter();
	    exit();
	}
	// specify diagram parameters (these are global)
	$diagramWidth = 710;
	$diagramHeight = 400;
	$daysToShow = 30;

	// calculate the number of days this person is alive
	// this works because Julian dates specify an absolute number
	// of days -> the difference between Julian birthday and
	// "Julian today" gives the number of days alive
	$daysGone = abs(gregorianToJD($birthMonth, $birthDay, $birthYear)
			- gregorianToJD(date( "m"), date( "d"), date( "Y")));

	// create image
	$image = imageCreate($diagramWidth, $diagramHeight);

	// allocate all required colors
	$colorBackgr       = imageColorAllocate($image, 192, 192, 192);
	$colorForegr       = imageColorAllocate($image, 255, 255, 255);
	$colorGrid         = imageColorAllocate($image, 0, 0, 0);
	$colorCross        = imageColorAllocate($image, 0, 0, 0);
	$colorPhysical     = imageColorAllocate($image, 0, 0, 255);
	$colorEmotional    = imageColorAllocate($image, 255, 0, 0);
	$colorIntellectual = imageColorAllocate($image, 0, 255, 0);

	// clear the image with the background color
	imageFilledRectangle($image, 0, 0, $diagramWidth - 1, $diagramWidth - 1, $colorBackgr);