Location: PHPKode > projects > Mozart > Mozart-0.0.4/addproject.php
<?
include("connect.inc");
include("reqlogin.inc");
include("userprefs.inc");
?>
<html>
<title>Mozart: Add New Project</title>
<body bgcolor=<? echo $bgcolor ?> text=<? echo $txtcolor ?>>
<?
include("links.inc");

$ProjectTypeSQL = "SELECT type_id, type_name FROM types WHERE type_source = 'Project' ORDER BY type_name";
$ProjectType    = mysql_query($ProjectTypeSQL); 

$ProjectStatusSQL = "SELECT type_id, type_name FROM types WHERE type_source = 'ProjectStatus' ORDER BY type_name";
$ProjectStatus = mysql_query($ProjectStatusSQL);
?>
<center>
<b>Add New Project</b>
<form action="insproject.php" method="post">
<input type=hidden name="id" value="<? echo $project["proj_id"]?>"><br>
<table border=1 cellspacing=0 cellpadding=0>
<tr><td>Project Owner:</td><td><select name="ForUser">
<?
include("getallusers.inc");
while ($ownerdata = mysql_fetch_array($OwnerData)) {
	if ($ownerdata["user_id"] == $UserID) {
	   $selected = " selected";
	}
	else {
	   $selected = "";
	}
	printf("<option value=%s %s>%s", $ownerdata["user_id"], $selected, $ownerdata["system_id"]);
}
?>
</select></td></tr>
<br>
<tr><td>Name:</td><td><input type="text" name=ProjectName value="<? echo $project["name"] ?>"></td></tr>
<br>
<tr><td>Number:</td><td><input type="text" name=ProjectNumber value="<? echo $project["number"] ?>"></td></tr>
<br>
<tr><td>Type:</td><td><select name="ProjectType">
<?
while ($projecttype = mysql_fetch_array($ProjectType)) {
       if ($projecttype["type_id"] == $project["type"]) {
           $selected = " selected";
       }
       else {
           $selected = "";
       }
       printf("<option value=%s%s>%s", $projecttype["type_id"], $selected, $projecttype["type_name"]);
}
?>
</select></td></tr>
<br>
<tr><td>Status:</td><td><select name="ProjectStatus">
<?
while ($projectstatus = mysql_fetch_array($ProjectStatus)) {
       if ($projectstatus["type_id"] == $project["status"]) {
          $selected = " selected";
       }
       else {
           $selected = "";
       }
       printf("<option value=%s%s>%s", $projectstatus["type_id"], $selected, $projectstatus["type_name"]);
}
?>
</select></td></tr>
<br>
<?
$ContListSQL = "SELECT contact_id, first, last FROM contact ORDER BY last, first";
$ContList    = mysql_query($ContListSQL);
?>
<tr><td>Client:</td><td><select name="SelContact">
<option value=0>None
<?
while ($contlist = mysql_fetch_array($ContList)) {
  printf("<option value=%s>%s, %s", $contlist["contact_id"], $contlist["last"], $contlist["first"]);
}
?>
</select></td></tr>
<br>
<tr><td>Notes:</td><td><textarea cols=50 rows=10 wrap="hard" name="ProjectNotes"><? echo $project["notes"]?></textarea></td></tr>
<br>
<tr><td><input type="submit" value="Add Project"></td>
<td><input type="reset" value="Reset"></td></tr>
<input type=hidden name="id" value="<? echo $id ?>"><br>
</table>
</form>
<?
include("links.inc");
?>
</center>
</body>
</html>
Return current item: Mozart