<!DOCTYPE html SYSTEM "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
    <title>RefDB database query form</title>
    <link href="refdbqxhtml.css" type="text/css" rel="stylesheet"/>
    </head>
    <body>
        <h1>RefDB database query form</h1>
        <div class="navigation">
            <h2>Navigation</h2>
            <ul class="navigationMenu">
                <li>
                    <a href="index.html">Login screen</a>
                </li>
                <li>
                    <a href="refdbquery.html">Search references</a>
                </li>
                <li>
                    <a href="refdbkajquery.html">Search keywords, authors, journals</a>
                </li>
                <li>
                    <a href="refdbadd.html">Add new references</a>
                </li>
                <li>
                    <a href="refdbdbquery.php">Change database</a>
                </li>
                <li>
                    <a href="external.php">Search external database</a>
                </li>
                <li>
                    <a href="refdbadmin.php">Administrative Interface</a>
                </li>
                <li>
                    <a href="refdblogout.php">Logout</a>
                </li>
            </ul>
        </div>
        <div class="content">
	    <form action="refdbdbquery.php" method="post" enctype="multipart/form-data">
	    <p><?
	    	//If the user changed databases, set the SESSION variable
		if( isset($submit) )
		{
			$_SESSION["database"] = $db;
		}

		$database = $_SESSION["database"];
		$name = $_SESSION["name"];
		$passwd = $_SESSION["passwd"];
		$refdbc = $_SESSION["refdbc"];
			
		print "Your current database is: <strong>$database</strong><br/>\n";

		//build comand to display databases
		$cmd = "$refdbc -u $name -w $passwd -c stdout -C listdb";
		exec($cmd,$lines);

		print "<select name='db'>\n";
		foreach($lines as $line)
		{
			print "<option value='$line'>$line</option>\n";
		}
		print "</select><br/>\n";
		print "<input type='submit' name='submit' value='Change database'/>\n";
	    
	    ?></p>
	    </form>
	    </div>
        <div class="footer">
            <p><a href="http://refdb.sourceforge.net">RefDB</a> reference manager and bibliography
                tool V. <!--VERSION-->0.9.8-1<!--/VERSION--></p>
        </div>
	  
  </body>
</html>

