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

	$search_type = $_POST["search_type"];
	$search_text = $_POST["search_text"];
	$search_logic = $_POST["search_logic"];
	$search_class = $_POST["search_class"];

	$search_page = 0;
	$search_limit = 10;
	$search_words = split ('[ +,]', $search_text);

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

		$thisuser = new User();
		$thisuser->readfromdb ($ch_uid);

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

	}

	$thispatient = new Patient();
	$patientsearchinfo = $thispatient->fetchpatientinfo ($search_words, $search_type, $search_logic, $search_page, $search_limit, "tiername", "nachname", "vorname", $search_class);

	if (!is_array ($patientsearchinfo) || sizeof ($patientsearchinfo) == 0)
	{
		$message = _("No patients found.");
	}
	elseif (sizeof ($patientsearchinfo) == 1)
	{

		$_GET ["patientuid"] = $patientsearchinfo[0]["uid"];

		if ($user->getRechte() >= 2)
			$page = "editpatient";
		else
			$page = "viewpatient";

		unset ($patientsearchinfo);

	} else
		$message = _("Multiple patients found.");

?>
Return current item: OpenVet