if(isset($pid)) {
$hier_select="polk_id=$pid";
$org_select="SELECT polk_name AS name, polk_arm AS arm, polk_comment AS comment FROM polky WHERE polk_id='$pid'";
$template->AddVar("body", "TAG", "PID");
$template->AddVar("body", "ID", $pid);
$template->AddVar("noindiv", "ID", $pid);
$template->AddVar("noindiv", "LEV", "P");
$string_org="zu diesem <em>polk</em>";
} elseif (isset($sid)) {
$hier_select="sotnja_id=$sid";
$org_select="SELECT sotnja_name AS name, sotnja_comment AS comment FROM sotni WHERE sotnja_id='$sid'";
$template->AddVar("body", "ID", $sid);
$template->AddVar("noindiv", "ID", $sid);
$template->AddVar("noindiv", "LEV", "S");
$string_org="zu dieser <em>sotnja</em>";
} elseif (isset($kid)) {
$hier_select="kurinnja_id=$kid";
$org_select="SELECT kurinnja_name AS name, kurinnja_comment AS comment FROM kurinni WHERE kurinnja_id='$kid'";
$template->AddVar("body", "ID", $kid);
$template->AddVar("noindiv", "ID", $kid);
$template->AddVar("noindiv", "LEV", "K");
$string_org="zu dieser <em>kurinnja</em>";
}