<style>
._titleJudul{
	font-size: 20px;
}
._tanya{
	padding-left: 15px;
}
._tanya2{
	padding-left: 50px;
}
._tanya3{
	text-align: center;
}
</style>
<?php 
?>
<p class="_titleJudul"><a href=""><u>Change Password</u></a></p>

<div id="_divIconPil" style="height: 300px; overflow: auto; margin-top: 20px">
	<form method="POST" action="" id="_simpan">
	<table class="_form" style="margin-top: 20px">
		<tr>
			<td class="_label" style="width: 130px">Old Password</td>
			<td class="_spasi">:</td>
			<td class="_isi"><input type="password" size="10" id="pass" name="pass" class="_formIns" style="width: 150px"></td>
		</tr>
		<tr>
			<td class="_label">New Password</td>
			<td class="_spasi">:</td>
			<td class="_isi"><input type="password" size="10" id="pass2" name="pass2" class="_formIns" style="width: 150px"></td>
		</tr>
		<tr>
			<td class="_label">Conf Password</td>
			<td class="_spasi">:</td>
			<td class="_isi"><input type="password" size="10" id="pass3" name="pass3" class="_formIns" style="width: 150px"></td>
		</tr>

		<tr>
			<td class="_label"></td>
			<td class="_spasi"></td>
			<td class="_isi">
				<input type="submit" id="_proses" value="Simpan">
			</td>
		</tr>
		<tr>
			<td colspan="3">&nbsp;</td>
		</tr>
	</table>
	</form>
	
</div>
<?php
$notNull = array();
$notNull[] = 'pass';
$notNull[] = 'pass2';
$notNull[] = 'pass3';
?>

<script type="text/javascript">
$(document).ready(function(){
	_height = screen.height;
	_height = parseInt(_height) - 350;
	$('#_divIconPil').css("height", _height+'px');
	
	_prosesSimpan = false;
	$('#_simpan').submit(function(e){
		e.preventDefault();
		
		_nul = false;
		<?php foreach($notNull as $r){ ?>
			_style = $('#<?php echo $r ?>').attr('style');
			if(_style === undefined){
				_style = '';
			}
			_style = str_ireplace(';background-color: #f59fb0', '', _style);
				
			_cek = $('#<?php echo $r ?>').val();
			_cek = _cek.trim();
			$('#<?php echo $r ?>').removeAttr('style');
			if(_cek === ''){
				_style+= ';background-color: #f59fb0';
				_nul = true;
			}
			$('#<?php echo $r ?>').attr('style', _style);
		<?php } ?>
		
		if(_nul === true){
			return;
		}
		
		if(_prosesSimpan != false){
			_prosesSimpan.abort();
		}
		_prosesSimpan = $.ajax({
		type: 'POST',
			url: $('#defaultBaseUrl').val()+$('#defaultController').val()+'/eks/',
			data: $(this).serialize(),
			success: function(data) {
				$('#errorDisplay').html(data);
			}
		})
	})
	
})
</script>