Location: PHPKode > projects > Todo Manager > todo/project_edit.php
<?php
require_once "config.inc.php";
require_once "controllers/project_edit.class.php";

$c = new ProjectEdit();
$current_user = $c->getCurrentUser();
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title><?=TITLE?></title>
<link rel="stylesheet" type="text/css" href="common.css" />
<link rel="stylesheet" type="text/css" href="style.css" />
<script type="text/javascript" src="javascript.js"></script>
<style type="text/css">
<!--
table#table1 td {
	padding-right: 25px;
}
-->
</style>
<script type="text/javascript">
<!--

function selectAllItems(_select_id) {
	var _select = document.getElementById(_select_id);
	for (var i = 0; i < _select.length; i ++)
		_select.options[i].selected = true;
}

function moveAllItems(from_select_id, to_select_id) {
	var from_select = document.getElementById(from_select_id);
	var to_select = document.getElementById(to_select_id);
	
	// copy all the items
	for (var i = 0; i < from_select.length; i ++) {
		var option = document.createElement('OPTION');
		option.value = from_select.options[i].value;
		option.text = from_select.options[i].text;
		
		try {
			to_select.add(option, null); // standards compliant; doesn't work in IE
		}
		catch(ex) {
			to_select.add(option); // IE only
		}
	}
	
	// remove all the items
	for (var i = from_select.length - 1; i >= 0; i --) {
		from_select.remove(i);
	}
}

function moveSelectedItems(from_select_id, to_select_id) {
	var from_select = document.getElementById(from_select_id);
	var to_select = document.getElementById(to_select_id);
	
	// copy selected items
	for (var i = 0; i < from_select.length; i ++) {
		if (from_select.options[i].selected) {
			var option = document.createElement('OPTION');
			option.value = from_select.options[i].value;
			option.text = from_select.options[i].text;
			
			try {
				to_select.add(option, null); // standards compliant; doesn't work in IE
			}
			catch(ex) {
				to_select.add(option); // IE only
			}
		}
	}
	
	// remove selected items
	for (var i = from_select.length - 1; i >= 0; i --) {
		if (from_select.options[i].selected)
		  from_select.remove(i);
	}
}
-->
</script>
</head>

<body onload="javascript: setFocus('title'); ">
	<div class="divContainer">
		<div class="divHeader">
			<ul class="ulHeaderMenu">
				<li><a href="task.php"><?=$c->getMessage("tasks")?></a></li>
				<?php
				if ($current_user->get("admin") == "yes") {
					echo "<li><a class='ulHeaderMenu_current' href='project.php'>".$c->getMessage("projects")."</a></li>\n";
					echo "<li><a href='user.php'>".$c->getMessage("users")."</a></li>\n";
				}
				?>
				<li><a href="profile.php"><?=$c->getMessage("profile")?></a></li>
			</ul>
			<p class="pLogin"><strong><?=$c->getMessage("welcome")?>, <?=htmlentities($current_user->get("username"))?></strong><br /><a class="warning" href="logout.php"><?=$c->getMessage("exit")?></a></p>
		</div>
		<div class="divBody">
			<form id="form1" action="<?=htmlentities($c->getCurrentPage())?>" method="post" onsubmit="javascript: selectAllItems('from_user_id'); selectAllItems('to_user_id'); ">
				<table class="tableGroup" style="margin: 0 auto; " border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td>
				<h2><?=htmlentities($c->getTitle())?></h2>
				
				<?=$c->getErrorLn("error", "error")?>
				<table class="tableText" style="margin-bottom: 0; " border="0" cellpadding="0" cellspacing="0">
					<tr><td colspan="3"><strong><?=$c->getMessage("title")?></strong></td></tr>
					<tr><td colspan="3"><input class="inputText" style="width: 600px; " type="text" name="title" id="title" value="<?=htmlentities($c->getParam("title"))?>" /></td></tr>
				</table>
				
				<table class="tableText" id="table1" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td><strong><?=$c->getMessage("status")?></strong></td>
					</tr>
					<tr>
						<td>
							<select name="status">
								<option value="">&nbsp;</option>
								<option value="open"<?=$c->getParam("status") == "open"? " selected='selected'": NULL?>><?=$c->getMessage("open")?></option>
								<option value="closed"<?=$c->getParam("status") == "closed"? " selected='selected'": NULL?>><?=$c->getMessage("closed")?></option>
							</select>
						</td>
					</tr>
				</table>
				
				<table class="tableText" border="0" cellpadding="0" cellspacing="0">
					<tr>
						<td colspan="3"><strong><?=$c->getMessage("add_users_to_the_project")?></strong></td>
					</tr>
					<tr>
						<td>
							<select style="width: 15em; " multiple="multiple" size="7" name="from_user_id[]" id="from_user_id">
								<?php
								$rows = $c->getUsers($c->getParam("from_user_id"));
								foreach($rows as $row) {
									echo "<option value='".$row["id"]."'>".htmlentities($row["username"])."</option>\n";
								}
								?>
							</select>
						</td>
						<td style="text-align: center; ">
							<input class="inputButton" style="width: 3em; " type="button" value="&gt;&gt;" onclick="javascript: moveAllItems('from_user_id', 'to_user_id'); " /><br />
							<input class="inputButton" style="width: 3em; " type="button" value="&gt;" onclick="javascript: moveSelectedItems('from_user_id', 'to_user_id'); " /><br />
							<input class="inputButton" style="width: 3em; " type="button" value="&lt;" onclick="javascript: moveSelectedItems('to_user_id', 'from_user_id'); " /><br />
							<input class="inputButton" style="width: 3em; " type="button" value="&lt;&lt;" onclick="javascript: moveAllItems('to_user_id', 'from_user_id'); " />
						</td>
						<td>
							<select style="width: 15em; " multiple="multiple" size="7" name="to_user_id[]" id="to_user_id">
								<?php
								$rows = $c->getUsers($c->getParam("to_user_id"));
								foreach($rows as $row) {
									echo "<option value='".$row["id"]."'>".htmlentities($row["username"])."</option>\n";
								}
								?>
							</select>
						</td>
					</tr>
				</table>
				
				<table class="tableText" border="0" cellpadding="0" cellspacing="0">
					<tr><td><strong><?=$c->getMessage("description")?></strong></td></tr>
					<tr>
						<td colspan="3"><textarea name="description" style="width: 600px; height: 300px; "><?=htmlentities($c->getParam("description"))?></textarea></td>
					</tr>
				</table>
				
				<p>
					<input class="inputButton" style="width: 8em; " type="submit" value="<?=$c->getMessage("accept")?>" />
					<input class="inputButton" style="width: 8em; " type="button" value="<?=$c->getMessage("cancel")?>" onclick="javascript: previousPage('form1'); " />
				</p>
						</td>
					</tr>
				</table>
			</form>
		</div>
	</div>
</body>
</html>
Return current item: Todo Manager