{include file="header.dwt"}
      <div id="list" class="f_l">
	<script language="javascript" type="text/javascript">
	function fnLaunch(tbID)
	{
		var myObject = new Object();
		var returnv=window.showModalDialog("management.php?act=cpForm&tbID="+tbID,myObject, "dialogWidth:420px; dialogHeight:280px; dialogLeft:300px;");
		alert(returnv);
	}
	</script>
	<script language="javascript" type="text/javascript" >
	//自定义函数名为checkname的函数
	$.extend({
		checkname:function(nid,cid,url){
				$(function(){
						$.ajax({
							type:'post',
							url:url,
							data:$(nid).serialize(),
							success:function(msg){
								if (msg=='NoExist!') {
								$(cid).show() ;
								return true;
								}else{
								alert(msg);
								$(nid).focus() ;
								$(cid).hide() ;
								return false;
								}}
						});
				});
		}
	});
	
	$(function(){
		$('#tbUserName').blur(function(){
		//按钮点击事件$('#btnok').bind('onclick',function(){
		//var user_name = $('#tbUserName').val();
		//alert($(this).serialize());
		//用户名为空时也查询不到该用户，所以也会显示绿勾图片,所以用下行语句加以控制。
			$.checkname('#tbUserName','#isExist','management.php?act=ckExist');
		});
		//以下是防止尽管失焦检测到用户名为空但还是点击提交时会保存到空用户名
		$('#add_user').submit(function(){
			if($('#tbUserName').val()!=''){
					return true;
			}else{
					return false;
			}
			return false;
		});
		
	});
	</script>
	  <form action="management.php?act=save_user&tab=user_list" method="post" name="add_user" id="add_user">
	  <h2 style="text-align:center; margin-top:30px;">User Summary</h2>
      <TABLE width="100%" border="1" cellPadding="1" cellSpacing="1" bordercolor="#5272A9">
          <TBODY>
            <TR align="middle" class="tb_title">
              <TD width="100%">User Summary Add/Edit</TD>
            </TR>
            <TR>
              <TD>
                <table width="100%"  border="0" cellpadding="1" cellspacing="1">
				<tr>
                    <td width="25%" class="strong_r">User Name：</td>
                    <td  width="26%">
<input name="tbUserName" id="tbUserName" type="text" size="30" value="" />
					 <img id="isExist" style="display:none; float:right;" src="pics/right.gif" />
					</td>
					<td width="21%" class="strong_r">Password：</td>
                    <td width="31%">
					<input name="tbPassword" type="text" size="40" value="789963" />					
				   </td>
                  </tr>
                  <tr>
                    <td class="strong_r">English Name：</td>
                    <td>
					<input name="tbName" type="text" size="30" value="" /></td>
					<td width="21%" class="strong_r">Company：</td>
                    <td width="31%">
 							<select name="tbCompanyID" id="tbCompanyID">
                            <option value=''>====Select Company====</option>
                           <!--{foreach from=$allCompany item=all }-->
                            <option value='{$all.tbCompanyID}'>
										 {$all.tbNickName}
							</option>
                           <!--{/foreach}-->
                          </select>
				   </td>
                   </tr>
				   <tr>
                    <td class="strong_r">Chinese Name：</td>
                    <td><input name="tbCnName" type="text" size="30" value="" /></td>
					 <td class="strong_r">Email：</td>
                    <td><input name="tbMail" type="text" size="40" value="" /></td>
                  </tr>
                  <tr>
				    <td class="strong_r" height="30">Rank：</td>
                    <td colspan="3">
					<input name="tbRank" type="radio" value="90" title="Super Admin"  />Super Admin
			        <input name="tbRank" type="radio" value="70" title="System Admin" />System Admin
			        <input name="tbRank" type="radio" value="60" title="QA" />CY's QA
			        <input name="tbRank" type="radio" value="50" title="Client" />Client
			        <input name="tbRank" type="radio" value="40" title="Factory" checked="checked" />Factory
			        <input name="tbRank" type="radio" value="20" title="Client's Client" />Client's Client
					</td>
                  </tr>
				  <tr>
				  <td class="strong_r" height="30">Receive Inspection Notification：</td>
                    <td>
			        <input name="tbSentMail" type="radio" value="1" title="Yes" checked="checked" />Yes
					<input name="tbSentMail" type="radio" value="0" title="No" />No
					</td>
				  <td class="strong_r">Open/Close：</td>
                    <td>
					<input name="tbOpen" type="radio" value="1" title="Open" checked="checked" />Open
					<input name="tbOpen" type="radio" value="0" title="Close" />Close
			 		</td>
				  </tr>
				  <tr>
				    <td class="strong_r">Title：</td>
                    <td><input name="tbTitle" type="text" size="40" value="" /></td>
				    <td width="21%" class="strong_r">Department：</td>
                    <td width="31%"><input name="tbDepartment" type="text" size="40" value="" /></td>
                  </tr>
                  <tr>
				    <td width="22%" class="strong_r">Phone Number：</td>
                    <td width="26%"><input name="tbPhoneNumber" type="text" size="40" value="" /></td>
                    <td class="strong_r">Cell Number：</td>
                    <td><input name="tbCellNumber" type="text" size="40" value="" /></td>
                  </tr>
                </table>
              </TD>
            </TR>
          </TBODY>
      </TABLE>
<table width="624"  border="0" align="center" cellpadding="3" cellspacing="3">
  <tr>
    <td><div align="center">
        <input type="button" name="Back" OnClick='location.href="management.php"' value="Back To management List">
        <input type="submit" name="Save" value="Save">
</div></td>
  </tr>
</table></form>
      </div>
      {include file="footer.dwt"}
</div>
</body>
</html>
