<?php 
include_once ("includes/setup.inc.php");

$myID = fetch_postget_val('id',$_POST, $_GET);
$readonly = fetch_postget_val('readonly',$_POST, $_GET);
$temp = ($my_details->usr_id).'_'.time();

$indicator_Query = "SELECT t_pemohon.*
				  FROM t_pemohon
				  WHERE id_pemohon = ?";
$PDO_stmt = $PDO->prepare($indicator_Query);
$PDO_stmt->bindValue(1, $myID, PDO::PARAM_INT);
$PDO_stmt->execute();
$indicator_List = $PDO_stmt->fetch(PDO::FETCH_ASSOC);

?>
<div class="modal-header">
	<h5 class="modal-title">Daftar / Kemaskini Pengguna</h5>
	<button type="button" class="close" data-dismiss="modal" aria-label="Close" id="closeBtn" name="closeBtn" ></button>
</div>
<div class="modal-body">
	<form action="javascript:;" class="form-horizontal" name="pengguna_form" id="pengguna_form">
		<div class="form-body">
			<div class="row">
				<?php
					createTextBox('Nama', 'nama', 'Nama', $indicator_List['nama'], 3, $readonly, 7, 12, '', 'text', '');
					createTextBox('Email', 'emel', 'Email', $indicator_List['emel'], 3, $readonly, 7, 12, '', 'email');
					createDropDown($PDO, 'Peranan', 't_peranan', 'id_peranan', $indicator_List['id_peranan'], 'Pilih Peranan', 7, 3, 12, $readonly);
					
					if($myID > 0)
					{
						$myArray = [];
						$myArray[] = array(1, 'YA');
						createDropDown_Array('Aktif', $myArray, 'aktif', $indicator_List['aktif'], 'TIDAK', 7, 3, 12, $readonly);
					}
				?>
			</div>
		</div>
	</form>
</div>
<div class="modal-footer">
	<?php
		echo '<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>';
	?>
</div>

<script>
$(document).ready(function(){  

	$('.select2').select2({ width: '100%' }); 
});		
</script>
