Vyhledávání zaměstnanců JU
$uid = $_GET['user'];
$a = file("http://abilunon.jcu.cz/user_page_low.php?uid=".$uid);
if ($a[0] != "NOT EXIST")
{
/* Result format:
format:
[fieldname]:data\n
[fieldname]:data\n
......
fieldname:
title_pre - titul pred jmenem
title_post - titul za jmenem
fname - jmeno
lname - prijmeni
uname - username
func1 - funkce (napr. dekan)
func2 - funkce
func3 - funkce
pozit - pozice (napr. pedagog.)
phone1 - telefon
phone2 - telefon
phone3 - telefon
email - email
sub - ustav/fakulta
depm - utvar/katedra
build - budova
who - 'Z' zamestananec, 'S' student
branch - jmeno oboru u studentu (jinak 'none')
img - URL na obrazek (pokud je v DB)
PGP - PGP klic (pokud je v DB)
*/
echo "";
for($i=0; $i < count($a); $i++)
{
$str = $a[$i];
$sz = strlen($str);
$sep = strpos($str, ":");
$name = substr($str, 0, $sep);
$data = substr($str, $sep+1, $sz-$sep-2);
if ($data=="none" || $data=="")
continue;
if ("title_pre" == $name)
$name = "Titul před jménem:";
if ("title_post" == $name)
$name = "Titul za jménem:";
if ("fname" == $name)
$name = "Jméno:";
if ("lname" == $name)
$name = "Přijmení:";
if ("uname" == $name)
{
$name = " ";
$data = " ";
}
if ("branch" == $name)
$name = "branch";
if ("func1" == $name)
$name = "Funkce:";
if ("func2" == $name)
$name = "Funkce:";
if ("func3" == $name)
$name = "Funkce:";
if ("pozit" == $name)
$name = "Pozice:";
if ("phone1" == $name)
$name = "Telefon:";
if ("phone2" == $name)
$name = "Telefon:";
if ("phone3" == $name)
$name = "Telefon:";
if ("email" == $name)
{
$name = "E-mail:";
$data = "$data";
}
if ("sub" == $name)
$name = "Fakulta/Ústav:";
if ("depm" == $name)
$name = "Katedra/Útvar:";
if ("build" == $name)
$name = "Budova:";
if ("who" == $name)
{
$name = "Typ:";
if ($data == "Z")
$data = "Zaměstnanec";
else
$data = "Student";
}
if ("branch" == $name)
$name = "Obor";
echo "". $name . " | " . $data . " |
\n";
}
echo "
";
}
else echo "nic nebylo nalezeno";
?>