userView.php 3.82 KB
<? include $_SERVER["DOCUMENT_ROOT"] . "/common/classes/AdminUser.php" ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/header.php" ?>
<? include $_SERVER["DOCUMENT_ROOT"] . "/admin/inc/php/leftUserManage.php" ?>
<?
	$obj		= new AdminUser($_REQUEST, "");
	//$userInfo	= $obj->getInfoOfUser();
	
	$rurl		= pack("H*", $_REQUEST["rurl"]) ;
?>

<script language="javascript">
	var _rurl = "<?=$rurl != "" ? $rurl : 0?>";
	var _no = "<?=$_REQUEST[no] != "" ? $_REQUEST[no] : 0?>";


	$(document).ready(function(){

		$(".jCancel").click2(function(){
			location.href = _rurl;
		});


		$(".jDelUser").click2(function(){
			var noArr = new Array(_no);

			if(confirm("정말 삭제하시겠습니까?"))
			{
				deleteUser(noArr);
			}
		});
		$(".jAdd").click2(function(){
			var data = $("#jData").serialize();
			if(confirm("직원회원 계정을 등록하시겠습니까?")){
				$.ajax({
					url : "/action_front.php?cmd=AdminUser.saveManager",
					async : false,
					cache : false,
					dataType : "json",
					data : data,
					success : function(data){
						alert(data.returnMessage);
						if(data.returnCode == "1")
							location.href=_rurl;
						
						/*
						if(_no != "")
							location.reload();
						else
							location.href = _rurl;
						*/
					}
				});
			}
			
			
		});

		$(".jCheckIDRedundancy").click2(function(){
			var data = $("#jData").serialize();
			$.ajax({
				url : "/action_front.php?cmd=AdminUser.checkIDRedundancy",
				async : false,
				cache : false,
				dataType : "json",
				data : data,
				success : function(data){
					alert(data.returnMessage);
				}
			});
			
		});

		$(".jCheckNickRedundancy").click2(function(){
			var data = $("#jData").serialize();
			$.ajax({
				url : "/action_front.php?cmd=AdminUser.checkNickRedundancy",
				async : false,
				cache : false,
				dataType : "json",
				data : data,
				success : function(data){
					alert(data.returnMessage);
				}
			});
			
		});

		

	}) ;



	function deleteUser(noArr)
	{
		$.ajax({
			url : "/action_front.php?cmd=AdminUser.deleteUser",
			async : false,
			cache : false,
			dataType : "json",
			data : {
				"no"	: noArr
			},
			success : function(data){
				//alert("삭제되었습니다");
				location.href = _rurl;
			}
		});
	}

</script>

<div id="Contents"  class="notice">

	<h1>직원 등록</h1>

	<!-- location area -->
	<h2>
		회원 관리 > 직원  > <span>등록</span>
	</h2>
	<!-- location area -->

	<form id="jData">
	<div class="jData"  style="width:50%;">
		<table class="datav" style="width:100%;">
			<colgroup>
				<col width="30%" />
				<col width="70%" />
			</colgroup>
			<tr>
				<th style="height:25px;">아이디</th>
				<td >
					<input name="userID" type="text" style="width:200px"/>
					<span class="button bigrounded blue jCheckIDRedundancy" style="color:white; width:70px">&nbsp;중복확인&nbsp;</span> 
				</td>
			</tr>
			<tr>
				<th style="height:25px;">비밀번호</th>
				<td >
				<input name="userPwd" type="text" style="width:200px"/>
				</td>
			</tr>
			<tr>
				<th style="height:25px;">직원명</th>
				<td class="l">
				<input name="userName" type="text" style="width:200px" />
				</td>
			</tr>
			<tr>
				<th style="height:25px;">닉네임</th>
				<td class="l">
				<input name="nickName" type="text" style="width:200px" />
				<span class="button bigrounded blue jCheckNickRedundancy" style="color:white; width:70px">&nbsp;중복확인&nbsp;</span> 
				</td>
			</tr>
			<tr>
				<th style="height:25px;">전화번호</th>
				<td class="l">
				<input name="userTel1" type="text" style="width:50px"/>&nbsp;  -  &nbsp;<input name="userTel2" type="text" style="width:50px"/>&nbsp;  -  &nbsp;<input name="userTel3" type="text" style="width:50px"/>
				</td>
			</tr>
			
		</table>

		<div class="btngroupcenter">
			<span class="button bigrounded blue jAdd">등록</span>
		</div>

	</div>
	</form>
</div>