<?php 
require('includes/header.php');

$indicator_Query = "SELECT COUNT(A.id_aduan) as bil
				  FROM m_aduan A
				  WHERE A.id_statusaduan = 1";
$PDO_stmt = $PDO->prepare($indicator_Query); 
$PDO_stmt->execute();
$aduan_List = $PDO_stmt->fetch(PDO::FETCH_ASSOC);

if($my_details->user_level != 1 && $my_details->user_level != 3)
{
	$indicator_Query = "SELECT COUNT(A.id_aduan) as bil
				  FROM m_aduan A
				  WHERE A.id_statusaduan = 1
				  AND A.id_assign = ?";
	$PDO_stmt = $PDO->prepare($indicator_Query); 
	$PDO_stmt->bindValue(1, $my_details->usr_id, PDO::PARAM_INT);
	$PDO_stmt->execute();
	$aduan_List = $PDO_stmt->fetch(PDO::FETCH_ASSOC);	
}

$hyperlink1 = '';
$value1 = 0;
if($aduan_List['bil'] > 0)
{
	$hyperlink1 = '?type=4';
	$value1 = $aduan_List['bil'];	
}
?>	

<!--begin::Content-->
<div class="content d-flex flex-column flex-column-fluid" id="kt_content">
	<!--begin::Entry-->
	<div class="d-flex flex-column-fluid">
		<!--begin::Container-->
		<div class="container">
			<!--begin::Dashboard--> 
			<div class="row">	
				<div class="col-lg-4">
					<!--begin::Callout-->
					<div class="card card-custom wave wave-animate-slow wave-primary card-stretch gutter-b">
						<div class="card-body">
							<div class="d-flex align-items-center p-5">
								<!--begin::Icon-->
								<div class="mr-6">
									<?=$Globe_svg?>
								</div>
								<!--end::Icon-->
								<!--begin::Content-->
								<div class="d-flex flex-column">
									<a href="in_aduan.php" class="text-dark text-hover-primary font-weight-bold font-size-h4 mb-3">Aduan Aktif</a>
									<div class="text-dark-75">Terdapat <?=$value1?> aduan aktif</div>
								</div>
								<!--end::Content-->
							</div>
						</div>
					</div>
					<!--end::Callout-->
				</div>
			</div>	
		</div>
		<!--end::Container-->
	</div>
	<!--end::Entry-->
</div>
<!--end::Content-->
					
<?php 
createModal();
require('includes/footer.php');
?>	

<script>

$(document).ready(function(){
	
	$('#ajax-modal').on('shown.bs.modal', function () {  // this is to clear modal cache each time modal load
		$(this).removeData('bs.modal');
		//location.reload();
	}); 
	//loadJumlah();
	//loadAE();
	
});
</script>