<?php

if ($action == "go")
{
    header("Location: ../$location");
    exit;
}

print "<form method=\"POST\" action=\"inc/inc_teleporter.php?action=go\"><SELECT NAME=\"location\">";

$result = mysql_query( "SELECT * FROM $grouptable ORDER BY intGroupId" );
$num_rows = mysql_num_rows( $result );

//Dispay records
while ( $a_row = mysql_fetch_object( $result ) )
{
    if ($a_row->ynGroupMaster == "2")
    {
        print "<OPTION VALUE=\"forums.php\">Teleporter</option>\n";
        continue;
    }

    if ($a_row->ynGroupMaster == "1")
    {
        print "<OPTION VALUE=\"forums.php\">$a_row->strName</option>\n";
        continue;
    }

    if ($a_row->ynGroupMaster == "0")
    {
        print "<OPTION VALUE=\"topics.php?groupid=$a_row->intId\">-&nbsp;&nbsp;&nbsp;&nbsp;$a_row->strName</option>\n";
    }
}
print "</SELECT>&nbsp;<input type=\"submit\" value=\"Go!\">";
?>