<?php
$previous = $this->nativesession->get_flash_session('history');
$username = "";
$password = "";
$password_repeat = "";
$fullname = "";
$email = "";
$alter_email = "";
$block = "0";
$expired_date = "";
$tupoksi ='';
$hakim_id = "";
$jurusita_id = "";
$panitera_id = "";
$action = "add";
$action_name = "Tambah";
$readonly = "";
if($user_info!=''){
	if($user_info->num_rows>0){
		foreach ($user_info->result() as $row) {
			$username = $row->username;
			$fullname = $row->fullname;;
			$block = $row->block;
			$email = $row->email;
			$alter_email = $row->alternative_email;
			$action = "updt";
			$action_name = "Update";
			$readonly = "readonly='readonly'";
		}
	}
}
?>
<hr class="thick-line" style="clear:both;">
<div id=''>
	<div style="padding:20px;"></div>
	<div class="detil" style="font-size:14px;margin-top:25px;width: 50%;margin: 0 auto;border-color: #FFFFFF;">
		<form id="frm_user" style="background:white;margin:0;" method="post" action="<?php echo base_url().'edit_profile/validate_input';?>">
			<table id="tableDetilPerkara" style="font-size:14px;">
				<col width="30%">
				<col width="70%">
				<tbody>
					<tr>
						<td>Nama Lengkap <font color="red">*</font></td>
						<td style="padding:0px;padding-left:5px;">
							<input type="text" id='fullname' name='fullname' value="<?php echo $fullname;?>" class="standard-input" maxlength="255">
						</td>
					</tr>
					<tr>
						<td>Username <font color="red">*</font></td>
						<td style="padding:0px;padding-left:5px;"><?php echo $username;?></td>
					</tr>
					<tr>
						<td>Password <font color="red">*</font></td>
						<td style="padding:0px;padding-left:5px;">
							<input type="password" id='password' name='password' value="<?php echo $password;?>" class="standard-input" maxlength="30">
						</td>
					</tr>
					<tr>
						<td>Ulangi Password <font color="red">*</font></td>
						<td style="padding:0px;padding-left:5px;">
							<input type="password" id='password_repeat' name='password_repeat' value="<?php echo $password_repeat;?>" class="standard-input" maxlength="30">
						</td>
					</tr>
					<tr>
						<td>Email <font color="red">*</font></td>
						<td style="padding:0px;padding-left:5px;">
							<input id='email' name='email' value="<?php echo $email;?>" class="standard-input" maxlength="100">
						</td>
					</tr>
					<tr>
						<td>Alternative Email</td>
						<td style="padding:0px;padding-left:5px;">
							<input id='alter_email' name='alter_email' value="<?php echo $alter_email;?>" class="standard-input" maxlength="100">
						</td>
					</tr>
					<tr>
						<td colspan="3" style="background:white;" align="center">
							<input type="hidden" id="userid" name="userid" value="<?php echo $userid;?>">
							<input type="hidden" id="act" name="act" value="<?php echo $action;?>">
							<input type="button" onClick='kembali();' id="back" value="Kembali" class="btn">
							<input type="submit" value="<?php echo $action_name;?>" class="btn">
						</td>
					</tr>
				</tbody>
			</table>
		</form>
	</div>
</div>
<style type="text/css">
.standard-input {
	font-family: Century Gothic, sans-serif;
	font-size: 13px;
	padding: 5px;
	padding-left: 10px;
	width: 350px;
	border: 1px solid rgb(166, 166, 166);
}
</style>
<script type="text/javascript">
function kembali(){
	window.open("<?php echo base_url();?>","_self");
}

var ori_name = $('#fullname').val();
var counter = 0;


$('#frm_user').SubmitHandling({
   	refresh:'1',
    setRefresh:1,
    divRef:'#frm_user',
    clicked:1,
    btnClicked:'#back',
    whenStatus:1,
});

$( function() {
        $('#expired_date').datepicker({
            inline: true,
            showOtherMonths: true,
            dateFormat: 'dd/mm/yy',
            dayNamesMin: ['Ming', 'Sen', 'Sel', 'Rab', 'Kam', 'Jum', 'Sab'],
            });
    });

$('.datepicker').ValidateDateInput();
</script>
