<?php
	include("php.inc");
	$content_description = $_GET["content_description"];
	
	function entry_form ()
	{
		#check for session username to fill in email.
		if (!isset ($_SESSION)) session_start();
		if(isset($_SESSION["session_username"]))
		{
			$email = $_SESSION["session_username"];
			$password = $_SESSION["session_password"];
		}
		html_begin("Enter Gene List","", "Enter Gene List");
		$today = date("m\-d\-Y");
		print "<form action=\"enter_gene_lists.php\" method=\"POST\">";
		print "Upload your gene group here...<p>";	
		print "<table class=\"entry\">";
		#name
		print "<tr>";
		print "<td class=\"entry\">Group Name:</td><td class=\"entry\">";
		print "<input type=\"text\" name=\"group_name\">";

		print "<tr>";
		print "<td class=\"entry\" valign=\"top\">Genes:</td><td class=\"entry\">";
		print "<textarea name=\"gene_list\" rows=\"10\" cols=\"40\"></textarea>\n";
		print "<td class=\"annotation\">Separate each gene name with white space, a new line, or a comma.</td></tr>";


		#Description - drop box or text
		print "<tr>";
		print "<td class=\"entry\" valign=\"top\">Description:</td><td class=\"entry\">";
		print "<textarea name=\"description\" rows=\"5\" cols=\"40\"></textarea></td></tr>\n";

		#Date
		print "<tr>";
		print "<td class=\"entry\" valign=\"top\">Date:</td><td class=\"entry\"><input type=\"text\" name=\"date\" size=\"9\" maxlength=\"10\" value=\"$today\"></td></tr>\n";
		print "<tr>";

		#tags
		print "<td class=\"entry\">Tags:</td><td class=\"entry\"><input type=\"text\" name=\"tags\" size=\"40\"></td>\n";
		print "<td class=\"annotation\">Tags are like categories for your gene group. Separate each tag with a space: pombe meiosis. Or to join 2 words together in one tag, use double quotes: \"spore development\".</td></tr>";
		
		print "<tr>";
		print "<td class=\"entry\">Email:</td><td class=\"entry\"><input type=\"text\" name=\"email\" value=\"$email\"></td></tr>\n";
		
		print "<tr>";
		print "<td class=\"entry\">Visibility:</td><td class=\"entry\"><input type=\"radio\" name=\"visibility\" value=\"public\" checked>Public&nbsp;&nbsp;&nbsp;<input type=\"radio\" name=\"visibility\" value=\"private\">Private</td></tr>\n";
		

		print "</table><p>";
		print "<input class=\"button\" type=\"Submit\" value=\"Add to database\"><p>";
		print "</form>";
		print "<a href=\"batch.php\">Batch upload</a>";
	}

$db = db_connect();
entry_form();
print "</div>";
html_end();

?>
