<?php 

if($_COOKIE['sejahtera_role'] == 10)
{
	include_once ("includes/setup_pemohon.inc.php");
}
else
{
	include_once ("includes/setup.inc.php");
}

$myID = fetch_postget_val('id',$_POST, $_GET);
$id_program = fetch_postget_val('program',$_POST, $_GET);
$readonly = fetch_postget_val('readonly',$_POST, $_GET);
$name_id_program = $id_program;
if ($id_program < 10 && (!(substr($id_program, 0, 1) === '0')))
{
	$name_id_program = '0'.$id_program;
}

$indicator_Query = "SELECT A.*, B.desk_program, C.desk_statusmohon
				  FROM m_anakemas A
				  LEFT JOIN i_program B ON B.id_program = A.id_program
				  LEFT JOIN i_statusmohon C ON C.id_statusmohon = A.id_statusmohon
				  WHERE A.id_anakemas = ?";
$PDO_stmt = $PDO->prepare($indicator_Query); 
$PDO_stmt->bindValue(1, $myID, PDO::PARAM_INT);
$PDO_stmt->execute();
$info_List = $PDO_stmt->fetch(PDO::FETCH_ASSOC);

$pembayaran = '';
if($info_List['id_statusmohon'] == 4)
{
	$pembayaran = ' (BELUM DIBAYAR)';	
	if($info_List['flag_bayaran'] == 1)
	{
		$pembayaran = ' (TELAH DIBAYAR - Sila semak maklumat pembayaran)';	
	}
}
?>

<div class="modal-header">
	<h5 class="modal-title">Nama Anak Emas : <b><?=$info_List['nama_anakemas']?></b><br>Program : <b><?=$info_List['desk_program']?></b>
	<br>Status Semasa : <b><?=$info_List['desk_statusmohon'].$pembayaran?></b></h5>
	<button type="button" class="close" data-dismiss="modal" aria-label="Close" id="closeBtn" name="closeBtn" ></button>
</div>
<div class="modal-body">
	<div class="row">
		<div class="col-md-12">		
			<!--begin::Card-->
			<div class="card card-custom gutter-b example-hover">
				<div class="card-body">
					<?php require('general-papar_sub.php');?>
				</div>
			</div>
			<!--end::Card-->										
		</div>
	</div>
	<?php
	if($my_details->user_level != 10)
	{
	?>
		<!--begin::Row-->
		<div class="accordion accordion-solid accordion-panel accordion-svg-toggle" id="accor4">
			<div class="card">
				<div class="card-header" id="head1">
					<div class="card-title collapsed" data-toggle="collapse" data-target="#col4">
						<div class="card-label">													
							<span class="svg-icon svg-icon-primary menu-icon">
								<?=$Tapisanhome_svg?>
							</span>Log Sistem</div>
						<span class="svg-icon">
							<?=$Tapisan_svg?>
						</span>
					</div>
				</div>
				<div id="col4" class="collapse" data-parent="#accor4">					
					<div class="row">
						<div class="col-md-12">
							<div class="card-body">
								<table>
									<tbody><br>
										<?php
											echo '<a class="btn btn-success btn-sm mr-2" onclick="loadMyModal(\'general-log_sub.php?id='.$info_List['id_anakemas'].'\', \'#ajax-modal\')" title="Log Permohonan"><i class="flaticon2-poll-symbol"></i>Log Permohonan</a>';
										?>
									</tbody>
								</table>								
							</div>
						</div>
					</div>
				</div>
			</div>
		</div> 		
	<?php
	}
	?>
</div>
<div class="modal-footer">
	<?php
		echo '<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>';
	?>
</div>

<script>
</script>