Location: PHPKode > projects > OpenVet > openvet/action/editpatient.php
<?php

	$ch_uid = $_POST["patientuid"];

	if ($user->getRechte() >= 2)
	{

		$thispatient = new Patient();

		if (!$thispatient->readfromdb ($ch_uid))
		{
			header("Location: index.php?tab=medical&page=notauthorized");
			exit ();
		}

	} else {
		
		header("Location: index.php?tab=medical&page=notauthorized");
		exit ();

	}

	$ch_anrede = $_POST["anrede"];
	$ch_vorname = $_POST["vorname"];
	$ch_nachname = $_POST["nachname"];
	$ch_addresse = $_POST["addresse"];
	$ch_telefonnummer = $_POST["telefonnummer"];
	$ch_mobilnummer = $_POST["mobilnummer"];
	$ch_email = $_POST["email"];
	$ch_tiername = $_POST["tiername"];
	$ch_geschlecht = $_POST["geschlecht"];
	$ch_tierart = $_POST["tierart"];
	$ch_rasse = $_POST["rasse"];
	$ch_farbe = $_POST["farbe"];
	$ch_gewicht = $_POST["gewicht"];
	$ch_groesse = $_POST["groesse"];
	$ch_merkmale = $_POST["merkmale"];
	$ch_chipnummer = $_POST["chipnummer"];
	$ch_geburtstag = $_POST["geburtstag"];
	$ch_todestag = $_POST["todestag"];
	$ch_lebenslauf = $_POST["lebenslauf"];
	$ch_situation = $_POST["situation"];
	$ch_notizen = $_POST["notizen"];

	$thispatient->setAnrede ($ch_anrede);
	$thispatient->setVorname ($ch_vorname);
	$thispatient->setNachname ($ch_nachname);
	$thispatient->setAddresse ($ch_addresse);
	$thispatient->setTelefonnummer ($ch_telefonnummer);
	$thispatient->setMobilnummer ($ch_mobilnummer);
	$thispatient->setEmail ($ch_email);
	$thispatient->setTiername ($ch_tiername);
	$thispatient->setGeschlecht ($ch_geschlecht);
	$thispatient->setTierart ($ch_tierart);
	$thispatient->setRasse ($ch_rasse);
	$thispatient->setFarbe ($ch_farbe);
	$thispatient->setGewicht ($ch_gewicht);
	$thispatient->setGroesse ($ch_groesse);
	$thispatient->setMerkmale ($ch_merkmale);
	$thispatient->setChipnummer ($ch_chipnummer);

	if (ereg ("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})", $ch_geburtstag))
	{

		$time = split ("[./ ]", $ch_geburtstag);
		$ch_geburtstag = mktime (0, 0, 0, $time[1], $time[0], $time[2]);
		$thispatient->setGeburtstag ($ch_geburtstag);

	} else
		$thispatient->setGeburtstag (0);

	if (ereg ("([0-9]{1,2}).([0-9]{1,2}).([0-9]{4})", $ch_todestag))
	{

		$time = split ("[./ ]", $ch_todestag);
		$ch_todestag = mktime (0, 0, 0, $time[1], $time[0], $time[2]);
		$thispatient->setTodestag ($ch_todestag);

	} else
		$thispatient->setTodestag (0);

	$thispatient->setLebenslauf ($ch_lebenslauf);
	$thispatient->setSituation ($ch_situation);
	$thispatient->setNotizen ($ch_notizen);

	if (!$thispatient->writetodb () || !$thispatient->validateData())
		$message = $thispatient->getError();
	else
		$message = _("The patient data was changed.");

?>
Return current item: OpenVet