Location: PHPKode > scripts > Biometrics Class > biometrics-class/class.biometrics.php
<?php
class biometrics {

	// BIOMETRICS CLASS
	// ----------------
	//   Author  : Copyright Pierre FAUQUE, hide@address.com, oct 2007.
	//   Usage   : Do a lot of body biometrics measures.
	//   License : Aladdin Free Public License (provided with this file)
	//   Version : 1.0
	//
	//   <DELETE>
	//
	//   Help and information about this class are written between the tags <DELETE> and </DELETE>.
	//   Of course you can delete them after you have printed them off.
	//
	//   The formulas of these measures belong to their respective authors and have been collected
	//   by Dr Aly ABBARA on its website. For some formulas, only weight and height are used.
	//   For others, age, sex and activity are needed. For this reason, only weight and height
	//   parameters are expected by the class but their presence aren't verified. The decimal
	//   separator in weight and height can be either a dot or a comma.
	//   Others parameters (optional) are set by default :
	//     - if not provided, default sex is "Man"                   (global variable: $sex)
	//     - if not provided, default age is 30 years old            (global variable: $age)
	//     - if not provided, activity is worker (and not sedentary) (global variable: $work)
	//
	//   Using javascript, you have to verify the presence of weight and height. You can
	//   copy and paste this javascript from the example page (biomdemo.php).
	//
	//   Afther an instanciation such as :
	//          $body = new biometrics($weight,$size);
	//   all results are stored in the attributes of the class. You have just to use 'echo' to
	//   print the attributes you want to display. See the list below and the demo to use them.
	//
	//   Example of use:
	//      |...
	//      |require("class.biometrics.php");
	//      |$body = new biometrics($weight,$size);
	//      |echo "According to Lorentz, your ideal weight is " . $body->lorentz . " kg";
	//      |echo "Every day you need " . $body->enerneed . "Kcal";
	//      |...
	//
	//   By default, results have been set with 4 decimals. But you can modify the number of
	//   decimals at the instanciation, providing this optional parameter. Ex:
	//          $body = new biometrics($weight,$size,2);   // results with 2 decimals
	//
	//   Versions
	//   --------
	//   1.0   (14/10/2007)  Initial version.
	//
	//   URL : http://www.fr-webdev.net/ (headings: "scripts", "la classe biometrics")
	//   ---
	//
	//   download:     "téléchargement"
	//   wishes list:  "wishes list"
	//   report a bug: "signaler un bug"
	//
	//   </DELETE>

	// ATTRIBUTES OF THIS CLASS

	// About this class
	var $biover     = "1.0";
	var $biorelease = "14 oct 2007";
	var $bioauthor  = "Pierre FAUQUE";
	var $bioemail   = "hide@address.com";
	var $biosite    = "http://www.fr-webdev.net";
	var $biourl     = "http://www.fr-webdev.net/dev/cbiometrics";
	var $biobug     = "http://www.fr-webdev.net/index.php?p=cbiometrics.bug.php";
	var $biowish    = "http://www.fr-webdev.net/index.php?p=cbiometrics.wl.php";

	// Working parameters
	var $nbdec     = 4;     // Number of decimals

	// Provided data
	var $size      = 0;	// Size in centimeters
	var $weight    = 0;	// Weight in kilograms
	var $sex       = 1;	// Sex (1: man by default ; 2: woman)
	var $age       = 30;	// Age (default is 30 years old)
	var $work      = 1;	// Working (1) or not-working (0) person (default = 1)

	// BMI: Body Mass Index
	var $bmi       = 0;	// Index
	var $bmilevel  = 0;	// BMI level (0..9)
	var $bmistatus = "";	// BMI status
	var $hlimit    = 0;	// High limit (weight in kilograms)
	var $llimit    = 0;	// Low limit (weight in kilograms)

	// IBW: Ideal Body Weight
	var $devine    = 0;	// Formula of Devine (1974)
	var $lorentz   = 0;	// Formula of Lorentz (1929)
	var $lorentza  = 0;	// Formula of Lorentz taking account of age
	var $pecks     = 0;     // Formula of Peck's

	// LBM: Lean Body Mass
	var $hume_lbm  = 0;	// Formula of Hume (1966)
	var $james     = 0;	// Formula of James (1981)

	// CTW: Calculation of Total Water
	var $hume_ctw  = 0;	// Formula of Hume
	var $watson    = 0;	// Formula of Watson

	// BSA: Body Surface Area
	var $boyd      = 0;	// Formula of Boyd
	var $dubois    = 0;	// Formula of Dubois and Dubois (1916)
	var $dubois2   = 0;	// Formula of Dubois and Dubois, other formula
	var $gehan     = 0;	// Formula of Gehan and George (1970)
	var $haycock   = 0;	// Formula of Haycock (1978)
	var $mosteller = 0;	// Formula of Mosteller (1987)

	// EER: Energy Expense at Rest
	var $black     = 0;	// Formula of Black and al (1996)
	var $harris    = 0;	// Formula of Harris and Benedict (1919)
	var $harrisrs  = 0;	// Formula of Harris and Benedict recalculated by Roza and Shizgal (1994)

	// DEN: Daily Energy Need
	var $enerneed  = 0;	// Dayly Energy Need based on the formula of Black and al

	// Texts. (All texts begin by $t_*). Can be translated
	var $t_sex     = array(	1 => "Man","Woman");
	var $t_work    = array(	"Sedentary","Worker");
	var $t_bmitext = array(	"Malnutrition level 5",
					"Malnutrition level 4",
					"Malnutrition level 3",
					"Malnutrition level 2",
					"Malnutrition level 1",
					"Health weight",
					"Overweight",
					"Obesity level 1",
					"Obesity level 2",
					"Obesity level 3"
				);

	//============================================================================
	// Constructor. Calculate all and store results in attributes
	function biometrics($weight=0,$size=0,$nbdec=0) {

		if(!$weight && !$size) { return 0; }

		$this->valid_size($size);                 // Save size in centimeters
		$this->valid_weight($weight);             // Save weight in kilograms
		if($nbdec) { $this->nbdec = $nbdec; }     // Save number of decimal if provided

		$age    = $GLOBALS["age"];
		$sex    = $GLOBALS["sex"];
		$work   = $GLOBALS["work"];

		// Use the provided parameters or keep defaults
		if(isset($age) && $age != 30)  { $this->age = $age;   }
		if(isset($sex) && $age != 1)   { $this->sex = $sex;   }
		if(isset($work) && $work != 1) { $this->work = $work; }

		// BMI: Body Mass Index
		$this->bmi = $this->bmi();                // Calculate the Body Mass Index
		$this->evalbmi();                         // Calculate the BMI level
		$this->reverse_bmi();                     // Calculate the weight limits

		// IBW: Ideal Body Weight
		$this->devine    = $this->devine();       // Formula of Devine (1974)
		$this->lorentz   = $this->lorentz();      // Formula of Lorentz (1929)
		$this->lorentza  = $this->lorentza();     // Formula of Lorentz taking account of the age
		$this->pecks     = $this->pecks();        // Formula of Peck's

		// LBM: Lean Body Mass
		$this->hume_lbm  = $this->hume_lbm();	// Formula of Hume (1966)
		$this->james     = $this->james();        // Formula of James (1981)

		// CTW: Calculation of Total Water
		$this->hume_ctw  = $this->hume_ctw();     // Formula of Hume
		$this->watson    = $this->watson();       // Formula of Watson

		// BSA: Body Surface Aera
		$this->boyd      = $this->boyd();         // Formula of Boyd (most precise)
		$this->dubois    = $this->dubois();       // Formula of Dubois and Dubois (1916)
		$this->dubois2   = $this->dubois2();      // Formula of Dubois and Dubois
		$this->gehan     = $this->gehan();        // Formula of Gehan and George (1970)
		$this->haycock   = $this->haycock();      // Formula of Haycock (1978)
		$this->mosteller = $this->mosteller();    // Formula of Mosteller (1987)

		// EER: Energy Expense at Rest
		$this->black     = $this->black();        // Formula of Black and al (1996). Reference.
		$this->harris    = $this->harris();       // Formula of Harris and Benedict (1919)
		$this->harrisrs  = $this->harrisrs();     // Formula of Harris and Benedict/Roza and Shizgal (1994)

		// DEN: Daily Energy Need
		$this->enerneed  = $this->enerneed();     // Energy need (based on Formula of Black and al)

	}

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Set the size in the correct format
	function valid_size($size) {
		$toreplace = array(",");
		$size = str_replace($toreplace,".",$size);
		$this->size = $size * 100;	// $this->size is in centimeters
	}

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// Set the weight in the correct format
	function valid_weight($weight) {
		$toreplace = array(",");
		$weight = str_replace($toreplace,".",$weight);
		$this->weight = $weight;	// $this->weight is in kilograms
	}

	//============================================================================
	// BMI: Body Mass Index = Poids(kg) / Taille(m)2 
	function bmi() {
		return round($this->weight/pow($this->size/100,2),$this->nbdec);
	}

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// BMI: Evaluate the BMI level
	//	According to OMS  : Organisation Mondiale de la Santé
	//	         and IOTF : International Obesity Task Force (1998)
	//      Status                   BMI          Signification
	//    ------------------------+------------+------------------------------
	//	Malnutrition level 5      < 10   
	//	Malnutrition level 4     10 - 12.9   
	//	Malnutrition level 3     13 - 15.9   
	//	Malnutrition level 2     16 -16.9   
	//	Malnutrition level 1     17 - 18.4   
	//	Thinness (malnutrition)  < 18,5   
	//	Normal                   18,5 - 24.9   
	//	Overweight               25 - 29,9    Weight Relatively increased 
	//	Obésity                  > 30         Weight clearly increased 
	//	    - Obésity level 1    30 - 34,9    Common or moderate obesity
	//	    - Obésity level 2    35 - 39,9    Heavy obesity
	//	    - Obésity level 3    > 40         Massive or morbid obesity
	//    -----
	function evalbmi() {
		if($this->bmi>=40)  { $this->bmilevel = 9; }
		if($this->bmi<40)   { $this->bmilevel = 8; }
		if($this->bmi<35)   { $this->bmilevel = 7; }
		if($this->bmi<30)   { $this->bmilevel = 6; }
		if($this->bmi<25)   { $this->bmilevel = 5; }
		if($this->bmi<18.5) { $this->bmilevel = 4; }
		if($this->bmi<17)   { $this->bmilevel = 3; }
		if($this->bmi<16)   { $this->bmilevel = 2; }
		if($this->bmi<13)   { $this->bmilevel = 1; }
		if($this->bmi<10)   { $this->bmilevel = 0; }
		$this->bmistatus = $this->t_bmitext[$this->bmilevel];
	}

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// The correct BMI is between 18,5 and 24,9
	// Calculate the low and high limits of correct weight
	function reverse_bmi() {
		$this->llimit = round(18.5*pow($this->size/100,2),1);
		$this->hlimit = round(24.9*pow($this->size/100,2),1);
	}

	//============================================================================
	// IBW: Ideal Body Weight. Formula of Devine (1974)
	// Man:   50 + 2.3[size(in) - 60]
	// Woman: 45.5 + 2.3[size(in) - 60]
	// age > 18 years old   ;   size: 140 < cm < 220   (55 to 87 inch)
	function devine() {
		switch($this->sex) {
			case 1:
				return round((50+(2.3*(($this->size/2.54)-60))),$this->nbdec);
				break;
			case 2:
				return round((45.5+(2.3*(($this->size/2.54)-60))),$this->nbdec);
				break;
		}
	}

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// IBW: Formula of Lorentz (1929)
	// Man:   size(cm) - 100 - [size(cm) - 150]/4
	// Woman: size(cm) - 100 - [size(cm) - 150]/2
	// age > 18 years old   ;   size: 140 < cm < 220   (55 to 87 inch)
	function lorentz() {
		switch($this->sex) {
			case 1:
				return $this->size-100-(($this->size-150)/4);
				break;
			case 2:
				return $this->size-100-(($this->size-150)/2);
				break;
		}
	}

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// IBW: Formula of Lorentz (taking account of age)
	// Weight = 50 + [size(cm) - 150]/4 + [age(years) - 20]/4
	function lorentza() {
		return round(50+(($this->size-150)/4)+(($this->age-20)/4),$this->nbdec);
	}

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// IBW: Formula of Peck's (1974)
	// Man   (> 18 years old):  -130.736 + [4.064 * size(in)]
	// Woman (> 18 years old):  -111.621 + [3.636 * size(in)]
	// Boy  (<= 18 years old):  -59.6035 + [5.2878 * size(in)] - [0.123939 * size(in)^2] + [0.00128936 * size(in)^3]
	// Girl (<= 18 years old):  -77.55796 + [6.93728 * size(in)] - [0.171703 * size(in)^2] + [0.001726 * size(in)^3]
	// Weight converted in kg  (in pounds in formula)  ;   size: 45 < cm < 220   (17 to 86 inch)
	function pecks() {
		switch($this->sex) {
			case 1:
				if($this->age > 18) {
					return round((-130.736+(4.064*$this->size/2.54))*0.453599,$this->nbdec); }
				else {
					$a = 5.2878*$this->size/2.54;
					$b = 0.123939*pow($this->size/2.54,2);
					$c = 0.00128936*pow($this->size/2.54,3);
					return round((-59.6035+$a-$b+$c)*0.453599,$this->nbdec);
				}
				break;
			case 2:
				if($this->age > 18) {
					return round((-111.621+(3.636*$this->size/2.54))*0.453599,$this->nbdec); }
				else {
					$a = 6.93728*$this->size/2.54;
					$b = 0.171703*pow($this->size/2.54,2);
					$c = 0.001726*pow($this->size/2.54,3);
					return round((-77.55796+$a-$b+$c)*0.453599,$this->nbdec);
				}
				break;
		}
	}

	//============================================================================
	// LBM: Lean Body Mass. Formula of Hume (1966)
	// Man:   [0.32810 * weight(kg)] + [0.33929 * size(cm)] - 29.5996 
	// Woman: [0.29569 * weight(kg)] + [0.41813 * size(cm)] - 43.2933 
	// Man:   age: 16 < years < 80   ;   weight: 45 < kg < 140   ;   size: 150 < cm < 185
	// Woman: age: 30 < years < 80   ;   weight: 35 < kg < 130   ;   size: 145 < cm < 180
	function hume_lbm() {
		switch($this->sex) {
			case 1:
				return round((0.32810*$this->weight)+(0.33929*$this->size)-29.5996,$this->nbdec);
				break;
			case 2:
				return round((0.29569*$this->weight)+(0.41813*$this->size)-43.2933,$this->nbdec);
				break;
		}
	}

	//----------------------------------------------------------------------------
	// LBM: Formula of James (1981)
	// Man:   1.10 * weight(kg) - {128 * [weight(kg)^2/size(cm)^2]} 
	// Woman: 1.07 * weight(kg) - {148 * [weight(kg)^2/size(cm)^2]}
	// age: 18 < years < 80   ;   weight: 35 < kg < 130   ;   size: 140 < cm < 185
	function james() {
		switch($this->sex) {
			case 1:
				return round((1.10*$this->weight)-(128*(pow($this->weight,2)/pow($this->size,2))),$this->nbdec);
				break;
			case 2:
				return round((1.07*$this->weight)-(148*(pow($this->weight,2)/pow($this->size,2))),$this->nbdec);
				break;
		}
	}

	//============================================================================
	// CTW: Calculation of Total Water. Formula of Hume
	// Man:   -14.012934 + [0.296785 * weight(kg)] + [0.194786 * size(cm)]
	// Woman: -35.270121 + [0.183809 * weight(kg)] + [0.34454 * size(cm)]
	function hume_ctw() {
		switch($this->sex) {
			case 1:
				return round(-14.012934+(0.296785*$this->weight)+(0.194786*$this->size),$this->nbdec);
				break;
			case 2:
				return round(-35.270121+(0.183809*$this->weight)+(0.34454*$this->size),$this->nbdec);
				break;
		}
	}

	//----------------------------------------------------------------------------
	// CTW: Calculation of Total Water. Formula of Watson
	// Man:    2.447 + [0.3362 * weight(kg)] + [0.1074 * size(cm)] - [0.09156 * age(years)]
	// Woman: -2.097 + [0.2466 * weight(kg)] + [0.1069 * size(cm)]
	function watson() {
		switch($this->sex) {
			case 1:
				return round(2.447+(0.3362*$this->weight)+(0.1074*$this->size)-(0.09156*$this->age),$this->nbdec);
				break;
			case 2:
				return round(-2.097+(0.2466*$this->weight)+(0.1069*$this->size),$this->nbdec);
				break;
		}
	}

	//============================================================================
	// BSA: Body Surface Area. Formula of Boyd. The most precise
	// Weight in grams, log = log 10.
	// S m² = 0.0003207 * weight(g)^(0.7285-0.0188*log10(weight(g))) * size(cm)^0.3
	// weight: 15 < kg < 200   ;   size: 99 < cm < 250
	function boyd() {
		$weight = $this->weight*1000;
		$exp    = 0.7285-(0.0188*log10($weight));
		return round(0.0003207*pow($weight,$exp)*pow($this->size,0.3),$this->nbdec);
	}

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// BSA: Formula of Dubois and Dubois (1916)
	// S m² = 0.007184 * size(cm)^0.725 * weight(kg)^0.425
	// weight: 6 < kg < 93   ;   size: 73 < cm < 184
	function dubois() {
		return round(0.007184*pow($this->size,0.725)*pow($this->weight,0.425),$this->nbdec);
	}

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// BSA: Formula of Dubois and Dubois (2)
	// S m² = 0.20247 * size(m)^0.725 * weight(kg)^0.425
	function dubois2() {
		return round(0.20247*pow($this->size/100,0.725)*pow($this->weight,0.425),$this->nbdec);
	}

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// BSA: Formula of Gehan and George (1970)
	// S m² = 0.0235 * size(cm)^0.42246 * weight(kg)^0.51456
	// weight: 4 < kg < 132   ;   size: 50 < cm < 220
	function gehan() {
		return round(0.0235*pow($this->size,0.42246)*pow($this->weight,0.51456),$this->nbdec);
	}

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// BSA: Formula of Haycock (1978)
	// S m² = 0.024265 * size(cm)^0.3964 * weight(kg)^0.5378
	// weight: 1 < kg < 120   ;   size: 30 < cm < 200
	function haycock() {
		return round(0.024265*pow($this->size,0.3964)*pow($this->weight,0.5378),$this->nbdec);
	}

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// BSA: Formula of Mosteller (1987)
	// S m² = [size(cm) * weight(kg) / 3600]^0.5
	// or
	// S m² = [size(inch) * weight(pound) / 3131]^0.5
	function mosteller() {
		return round(pow(($this->size*$this->weight/3600),0.5),$this->nbdec);
	}

	//============================================================================
	// EER: Expense Energy at Rest. Formula of Black and al (1996)
	// Man:   [1.083 * weight(kg)^0.48 * size(m)^0,50 * age(years)^-0.13] * (1000/4.1855)
	// Woman: [0.963 * weight(kg)^0,48 * size(m)^0.50 * age(years)^-0,13] * (1000/4.1855)
	// Reference formula, especially for overweight and for 60 year old and more.
	function black() {
		switch($this->sex) {
			case 1: $coef = 1.083; break;
			case 2: $coef = 0.963; break;
		}
		return round(($coef*pow($this->weight,0.48)*pow($this->size/100,0.5)*pow($this->age,-0.13))*(1000/4.1855),$this->nbdec);
	}

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// EER: Formula of Harris and Benedict (1919)
	// Man:   [13.7516 * weight(kg)] + [500.33 * size(m)] - [6.7550 * age(years)] + 66.473
	// Woman: [9.5634 * weight(kg)] + [184.96 * size(m)] - [4.6756 * age(years)] + 655.0955
	function harris() {
		switch($this->sex) {
			case 1:
				return round((13.7516*$this->weight)+(500.33*$this->size/100)-(6.755*$this->age)+66.473,$this->nbdec);
				break;
			case 2:
				return round((9.5634*$this->weight)+(184.96*$this->size/100)-(4.6756*$this->age)+655.0955,$this->nbdec);
				break;
		}
	}

	//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
	// EER: Formula of Harris and Benedict recalculated by Roza and Shizgal (1994)
	// Man:   [13.707 * weight(kg)] + [492.3 * size(m)] - [6.673 * age(years)] + 77.607
	// Woman: [9.740 * weight(kg)] + [172.9 * size(m)] - [4.737 * age(years)] + 667.051
	function harrisrs() {
		switch($this->sex) {
			case 1:
				return round((13.707*$this->weight)+(492.3*$this->size/100)-(6.673*$this->age)+77.607,$this->nbdec);
				break;
			case 2:
				return round((9.740*$this->weight)+(172.9*$this->size/100)-(4.737*$this->age)+667.051,$this->nbdec);
				break;
		}
	}

	//============================================================================
	// DEN: evaluate the Daily Energy Need according to working or not-working person.
	// Not active (0): EER * 1.375
	// Active (1):     EER * 1.55
	function enerneed() {
		switch($this->work) {
			case 0: return round(($this->black*1.375),$this->nbdec); break;
			case 1: return round(($this->black*1.55),$this->nbdec);  break;
		}
	}

	// <DELETE>
	// Lines between <DELETE> and </DELETE> (included) can be removed.
	// However they are useful to know if a new version exists
	// For this, use the file 'biominfos.php'
	//****************************************************************************
	// ADDITIONAL METHODS ABOUT THIS CLASS, COPYRIGHT AND LAST VERSION
	//****************************************************************************
	// Show all information about this class
	function showallinfos() {
		$this->info("about",1);
		$this->info("bug",1);
		$this->info("wish",1);
		$this->info("copyright",1);
	}

	// Display the requested information : about|bug|wish|copyright
	function info($what,$sep) {
		echo "<style type=\"text/css\">a {text-decoration:none}</style>\n";
		if($what == "about")     { $this->about($sep);     }
		if($what == "bug")       { $this->reportBug($sep); }
		if($what == "wish")      { $this->askWish($sep);   }
		if($what == "copyright") { $this->copyright($sep); }
	}

	// Verify the version of this class
	function about($sep=0) {
		echo "<pre><hr>Class Biometrics v-$this->biover ($this->biorelease)\n";
		echo "&copy $this->bioauthor <a href=\"mailto:$this->bioemail\">$this->bioemail</a>\n";
		$hf = fopen($this->biourl."/lastver.biometrics.txt","r");
		$line = chop(fgets($hf,1000));
		$infos = explode(";",$line);
		if($this->biover == $infos[0]) {
			echo "You're using the lastest version.\n"; }
		else {
			$ver = explode(".",$infos[0]);
			$dnlurl = $this->biourl."/cbiometrics".$ver[0].$ver[1].".zip";
			echo "\nYou're using the version $this->biover ($this->biorelease) of this class.\n";
			echo "There is a version ".$infos[0]." (".$infos[1].") on the original server.\n";
			echo "Would you like to <a href=\"$dnlurl\">download that version</a> ?\n";
			echo "Features: ".$infos[2]."\n";
		}
		if($sep==0) { echo "<hr></pre>\n"; }
	}

	// Go to the correct URL to report a bug found in this class
	function reportBug($sep=0) {
		if($sep==0) { echo "<pre><hr>Class Biometrics version $this->biover : "; }
		echo "- <a href=\"$this->biobug\">Report a bug</a>";
		if($sep==0) { echo "<hr></pre>"; }
	}

	// Go to the correct URL to ask for a new feature
	function askWish($sep=0) {
		if($sep==0) { echo "<pre><hr>Class Biometrics version $this->biover : "; }
		echo "- <a href=\"$this->biowish\">Ask a feature</a>";
		if($sep==1) { echo "\n"; } else { echo "<hr></pre>"; }
	}

	// Display copyright
	function copyright($sep=0) {
		if($sep==1) { $msg = ""; } else { $msg  = "<pre><hr>"; }
		$msg .= "Class Biometrics version $this->biover, a body biometrics calculator<br>"
		      . "&copy; $this->biorelease $this->bioauthor, "
		      . "<a href=\"mailto:$this->bioemail\">$this->bioemail</a>.\n\n"
		      . "This program is free software; you can redistribute it and/or modify it under\n"
		      . "the terms of the Aladdin Free Public License version 9, September 18, 2000\n"
		      . "published by Aladdin Enterprises: Menlo Park, California, U.S.A.\n\n"
		      . "NOTE: This license is not the same as any of the GNU Licenses\n"
		      . "published by the Free Software Foundation. Its terms are\n"
		      . "substantially different from those of the GNU Licenses.\n"
		      . "If you are familiar with the GNU Licenses, please read this\n"
		      . "Aladdin Free Public License, provided with this class, with extra care.\n"
		      . "THE PROGRAM IS PROVIDED TO YOU \"AS IS\" WITHOUT WARRANTY.<hr></pre>\n";
		echo $msg;
	}
	//----------------------------------------------------------------------------
	// </DELETE>
}
?>
Return current item: Biometrics Class