<script language="javascript">
	function save_click(){
		if(form.user_idn.value==""){
			alert("Silakan isi user id.");
			form.user_idn.focus();
			return false;
		}else if((form.user_name.value=="") ){
			alert("Silakan isi user name.");
			form.user_name.focus();
			return false;
		}else if((form.user_pass.value=="") ){
			alert("Silakan isi password.");
			form.user_pass.focus();
			return false;
		}else{
			var a = confirm("Apakah anda yakin akan menyimpan data?");
			if (a == true){
				form.action ='?page=Proses-User&Act=SAVE';
				form.method = 'post';
				form.submit();			
				return true;
			}
		}
	}
	function close_click(){
		form.action ='?page=Proses-User&Act=CLOSE'
		form.method = 'post';
		form.submit();		
		return true;
	}
</script>
<form action="#" method="post" name="form">
<table width="100%">
	<tr>
		<th colspan="4">INPUT DATA USER</th>
	</tr>	
	<tr>
		<td colspan="4">&nbsp;</td>
	</tr>
	<!--<tr>
		<td width="15%">User Level</td>
		<td width="35%">: 
			<?php if($userlevel==1){ ?>
			<input type="hidden" name="id" size="27" value="<?php echo $id; ?>">
			<select name="user_level">
			  <option value="BLANK">PILIH</option> 
				<?php
				  $dataSql = mysql_query("SELECT id, user_level FROM user_level ORDER BY id ASC");
				  while ($dataRow = mysql_fetch_array($dataSql)) {
					if ($dataRow['id']== $user_level) {
						$cek = " selected";
					} else { $cek=""; }
					echo "<option value='$dataRow[id]' $cek>$dataRow[user_level]</option>";
				  }
				  $sqlData ="";
				?>
			</select>
			<?php }else{ ?>
			<input type="hidden" name="id" size="27" value="<?php echo $id; ?>">
			<select name="user_level">
			  <option value="BLANK">PILIH</option> 
				<?php
				  $dataSql = mysql_query("SELECT id, user_level FROM user_level WHERE id > 1 ORDER BY id ASC");
				  while ($dataRow = mysql_fetch_array($dataSql)) {
					if ($dataRow['id']== $user_level) {
						$cek = " selected";
					} else { $cek=""; }
					echo "<option value='$dataRow[id]' $cek>$dataRow[user_level]</option>";
				  }
				  $sqlData ="";
				?>
			</select>	
			<?php } ?>			  
		</td>
		<td width="15%">&nbsp;</td>
		<td width="35%">&nbsp;</td>
	</tr>-->
	<tr>
		<td width="15%">User ID</td>
		<td width="35%">: <input type="hidden" name="id" size="27" value="<?php echo $id; ?>">
		<input type="text" name="user_idn" size="27" value="<?php echo $user_idn; ?>"></td>
		<td width="15%">&nbsp;</td>
		<td width="35%">&nbsp;</td>
	</tr>
	<tr>
		<td>User Name</td>
		<td>: <input type="text" name="user_name" size="27" value="<?php echo $user_name; ?>"></td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td>Password</td>
		<td>: <input type="password" name="user_pass" value="<?=$user_pass;?>"></td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td colspan="4">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="4" align="center"><input type="button" name="btnSave" value="SIMPAN" onclick="save_click();">&nbsp;
			<input type="button" value="BATAL" onclick="close_click();" />
		</td>
	</tr>
</table>
</form>