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

$ProjectSQL     = "SELECT * FROM project WHERE proj_id = '$id'";
$Project        = mysql_query($ProjectSQL);
$project        = mysql_fetch_array($Project);

$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>
<form action="updateprj.php" method="post">
<input type=hidden name="id" value="<? echo $project["proj_id"]?>"><br>
<table border=0 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"] == $project["owner"]) {
	   $selected = " selected";
	}
	else {
	   $selected = "";
	}
	printf("<option value=%s %s>%s", $ownerdata["user_id"], $selected, $ownerdata["system_id"]);
}
?>
</select>
</td></tr>
<tr><td>Name:</td><td><input type="text" name=ProjectName value="<? echo $project["name"] ?>"></td></tr>
<tr><td>Number:</td><td><input type="text" name=ProjectNumber value="<? echo $project["number"] ?>"></td></tr>
<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>
<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>
<?
$ContListSQL = "SELECT contact_id, first, last FROM contact ORDER BY last, first";
$ContList    = mysql_query($ContListSQL);
$ContXProjSQL = "SELECT xcont_id FROM contxproj WHERE xproj_id='$id' AND client_flag='Y'";
$ContXProj   = mysql_query($ContXProjSQL);
$contxproj   = mysql_fetch_array($ContXProj);
?>
<tr><td>Client:</td><td><select name="SelContact">
<option value=0>None
<?
while ($contlist = mysql_fetch_array($ContList)) {
  if ($contlist["contact_id"] == $contxproj["xcont_id"]) {
     $selected = " selected";
  }
  else {
     $selected = "";
  }
  printf("<option value=%s%s>%s, %s", $contlist["contact_id"], $selected, $contlist["last"], $contlist["first"]);
}
?>
</select></td></tr>
<tr><td>Notes:</td><td><textarea cols=50 rows=10 wrap="hard" name="ProjectNotes"><? echo $project["notes"]?></textarea></td></tr>
<tr><td><input type="submit" value="Update"></td><td><input type="reset" value="Reset"></td></tr>
<input type=hidden name="id" value="<? echo $id ?>"><br>
</table>
</form>
</center>
<?
include("links.inc");
?>
</body>
</html>
Return current item: Mozart