<?php
$job = 'add';
$title = '新增项目模块';
$module_id=0;
$module_name='';
$module_desc='';
$manager_id = 0;
$project_id=$_REQUEST['project_id'];
$parent_id=$_REQUEST['parent_id'];


if(array_key_exists("job", $_REQUEST))
	$job = $_REQUEST['job'];

if($job=='mod')
{
	$title = '修改项目模块';
	$module_id=$_REQUEST['module_id'];
	
	require_once("../module/module.project_module.php");
	$module = new CModuleProjectModule();
	$module->InitModule($module_id);
	
	if($module->module != '')
	{
		$module_name = $module->module->module_name;
		$module_desc = $module->module->module_desc;
		$manager_id = $module->module->manager_id;
	}
}

require_once("../module/module.user.php");
$users = new CModuleUser();
$users->Init();
?>
<input type='hidden' id='project_id' value='<?php echo $project_id?>'>
<input type='hidden' id='module_id' value='<?php echo $module_id?>'>
<input type='hidden' id='parent_id' value='<?php echo $parent_id?>'>
<table border=0 cellspacing='1' cellpadding='0' width=100% bgcolor='#ffffff'>
	<tr bgcolor="#efefef" height=20>
		<td colspan=2>
			<b><span id="project_form_desc"><?php echo $title?></span></b>
			<hr size=1>
		</td>
	</tr>
	<tr>
		<td align=right width=80>模块名称:</td>
		<td>
			<input type=text id="module_name" class=txtput value='<?php echo $module_name?>'>
		</td>
	</tr>
	<tr height=30>
		<td align=right>模块描述:</td>
		<td><input type=text id="module_desc" class=txtput size=40 value='<?php echo $module_desc?>'></td>
	</tr>
	<tr>
		<td align=right valign='top'>负责人:</td>
		<td>
			<select id='manager_id' class=txtput>
				<?php for($i=0;$i<$users->GetSize();$i++){?>
					<option value="<?php echo $users->modules[$i]->user_id ?>" <?php if($users->modules[$i]->user_id == $manager_id){echo "selected";}?>>
						<?php echo $users->modules[$i]->real_name ?>
					</option>
				<?php }?>
			</select>
		</td>
	</tr>
	<tr height=40>
		<td colspan=2 bgcolor="#efefef" align=center>
				<input type=button value=" 提交 " class=button onclick="SubmitModule('<?php echo $job?>')">
				&nbsp;&nbsp;&nbsp;&nbsp;
				<input type=button value=" 取消 " class=button onclick="CloseDialog(0)">
		</td>
	</tr>
</table>