Location: PHPKode > projects > Mozart > Mozart-0.0.4/addtodo.php
<?
// called from: calendar.php
// description: gathers data for instodo.php
//
include("connect.inc");
include("reqlogin.inc");
include("userprefs.inc");
?>
<html>
<title>Mozart: Add New Appointment</title>
<body bgcolor=<? echo $bgcolor ?> text=<? echo $txtcolor ?>>
<?
include("links.inc");
include("getallusers.inc");

printf("<form action=\"instodo.php?Mon=%s&Day=%s&Year=%s&SearchSys=%s\" method=\"post\">", $Mon, $Day, $Year, $SearchSys);
print ("Add To Do for: <select name=\"ForUser\">");
while ($ownerdata = mysql_fetch_array($OwnerData)) {
	if ($ownerdata["user_id"] == $SearchSys) {
	    $selected = " selected";
	    $selected_user = $ownerdata["user_id"];
	}
	else {
	    $selected = "";
	}
	printf("<option value=%s %s>%s", $ownerdata["user_id"], $selected, $ownerdata["system_id"]);
}
print("</select>");
?>
Month: <select name=SelMon>
<?
$x = 1;
while ($x <= 12) {
	if ($x == $Mon) {
		$selected = " selected";
	}
	else {
		$selected = "";
	}
	printf ("<option%s>%s", $selected, $x);
	$x++;
}
?>
</select>
Day: <select name=SelDay>
<?
$x = 1;
while ($x <= 31) {
	if ($x == $Day) {
		$selected = " selected";
	}
	else {
		$selected = "";
	}
	printf ("<option%s>%s", $selected, $x);
	$x++;
}
?>
</select>
Year: <select name=SelYear>
<?
$current_date = getdate();
$curryear = $current_date["year"];
$x = 1;
while ($x <= 10) {
	if ($curryear == $Year) {
		$selected = " selected";
	}
	else {
		$selected = "";
	}
	printf ("<option%s>%s", $selected, $curryear);
	$x++;
	$curryear++;
}
?>
</select>
<br>
Priority:<select name=Priority>
<option>1
<option>2
<option>3
</select>
<br>
To Do Details:<br><textarea cols=50 rows=10 wrap="hard" name=Information></textarea>
<br>
<?
$ProjDataSQL = "SELECT proj_id, name FROM project, userxproj WHERE proj_id = xproj_id AND xuser_id = '$selected_user' ORDER BY name";
$ProjData    = mysql_query($ProjDataSQL);
print ("Associate with project: <select name=\"ForProject\">");
print ("<option value=0>None");
while ($projdata = mysql_fetch_array($ProjData)) {
	printf("<option value=%s>%s", $projdata["proj_id"], $projdata["name"]);
}
print("</select>");
?>
<br>
<input type=submit name=Insert value="Add To Do">
<input type=reset value="Reset">
</form>
<?
//printf("<form action=\"addtodo.php?Mon=%s&Day=%s&Year=%s\" method=\"post\">", $Mon, $Day, $Year);
//printf("<input type=submit name=ReloadProject value=\"Reload Projects\">");
//printf("</form>");

include("links.inc");
?>
</body>
</html>
Return current item: Mozart