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

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

		$thisillness = new Illness();

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

	}

	$ch_patient = $_POST["patientuid"];
	$ch_arzt = $_POST["arzt"];
	$ch_problemname = $_POST["problemname"];
	$ch_vorbericht = $_POST["vorbericht"];
	$ch_diagnose = $_POST["diagnose"];
	$ch_behandlung = $_POST["behandlung"];
	$ch_medikation = $_POST["medikation"];
	$ch_notizen = $_POST["notizen"];

	$thisillness->setPatient ($ch_patient);
	$thisillness->setArzt ($ch_arzt);
	$thisillness->setProblemname ($ch_problemname);
	$thisillness->setVorbericht ($ch_vorbericht);
	$thisillness->setDiagnose ($ch_diagnose);
	$thisillness->setBehandlung ($ch_behandlung);
	$thisillness->setMedikation ($ch_medikation);
	$thisillness->setNotizen ($ch_notizen);
	$thisillness->setLetzteAenderung (time());
	$thisillness->setErstellt (time());
	$thisillness->setGeschlossen (0);

	$thispatient = new Patient();
	if ($thispatient->doesexistuid ($ch_patient))
	{
		if (!$thisillness->writetodb () || !$thisillness->validateData())
			$message = $thisillness->getError();
		else
			$message = _("A new illness was created.");
	} else
			$message = _("You can't add an illness to a not existing patient.");

	$_GET["illnessuid"] = $thisillness->getID();
?>
Return current item: OpenVet