<?php
if(count(get_included_files())==1) exit("Direct access not permitted.");
$mod = basename(__FILE__, '.php');
$page->tbCss($mod);

$datapushid=array();
$wh="";

$query="select count(distinct t1.id) as jumlahsektor,
		count(distinct t2.id) as jumlahbidang
	from tb_subsektor_ekraf as t1
	left join tb_subsektor_ekraf_bidang as t2 on t1.id=t2.idsubsektor
	where t1.status=1";
$rssektor=$db->loadAssoc($query,$datapushid);

$jumlahsektor=0;
$jumlahbidang=0;
if(isset($rssektor['jumlahsektor'])) $jumlahsektor=number_format($rssektor['jumlahsektor'],'0',',','.');
if(isset($rssektor['jumlahbidang'])) $jumlahbidang=number_format($rssektor['jumlahbidang'],'0',',','.');

$query="select count(distinct t1.id) as jumlahlsp, 
		count(distinct t2.id) as jumlahskema,
		count(distinct t3.id) as jumlahtuk,
		count(distinct t4.id) as jumlahasesor
	from tb_lsp as t1
	inner join tb_skema as t2 on t1.id=t2.idlsp and t2.status=1
	left join tb_tuk as t3 on t1.id=t3.idlsp and t3.status=1
	left join tb_asessor as t4 on t1.id=t4.idlsp and t4.status=1
	where t1.status=1";
$rslsp=$db->loadAssoc($query,$datapushid);

$jumlahlsp=0;
$jumlahskema=0;
$jumlahtuk=0;
$jumlahasesor=0;

if(isset($rslsp['jumlahlsp'])) $jumlahlsp=number_format($rslsp['jumlahlsp'],'0',',','.');
if(isset($rslsp['jumlahskema'])) $jumlahskema=number_format($rslsp['jumlahskema'],'0',',','.');
if(isset($rslsp['jumlahtuk'])) $jumlahtuk=number_format($rslsp['jumlahtuk'],'0',',','.');
if(isset($rslsp['jumlahasesor'])) $jumlahasesor=number_format($rslsp['jumlahasesor'],'0',',','.');


$query="SELECT count(distinct nik) as jumlahasesi FROM bisproku_datadb.tb_sertifikasi_asesi where kompeten=1";
$rsasesi=$db->loadAssoc($query);

$jumlahasesi=0;
if(isset($rsasesi['jumlahasesi'])) $jumlahasesi=number_format($rsasesi['jumlahasesi'],'0',',','.');

?>
<div class="box_menuicon">
	<div class="judul_menu_icon">Profile Ekonomi Kreatif</div>
	<div class="des_menu_icon">Badan Ekonomi Kreatif adalah Lembaga Pemerintah Non Kementerian yang bertanggungjawab di bidang ekonomi kreatif dengan <b><?php echo $jumlahsektor;?></b> subsektor dan <b><?php echo $jumlahbidang;?></b> kategori.</div>

	<div class="box_mod_profile_data" align="center">
		<div class="mod_profile_data">
			<a href="<?php echo NPAGE.'lsp';?>">
				<div class="mod_profile_data_ch1">
					<div class="jumlah_profile"><?php echo $jumlahlsp;?></div>
					<div class="judul_profile">LSP</div>
				</div>
			</a>
		</div>
		<div class="mod_profile_data mod_profile_data_kiri">
			<a href="<?php echo NPAGE.'lsp';?>">
				<div class="mod_profile_data_ch1">
					<div class="jumlah_profile"><?php echo $jumlahtuk;?></div>
					<div class="judul_profile">TUK</div>
				</div>
			</a>
		</div>
		<div class="mod_profile_data mod_profile_data_kiri">
			<a href="<?php echo NPAGE.'lsp';?>">
				<div class="mod_profile_data_ch1">
					<div class="jumlah_profile"><?php echo $jumlahskema;?></div>
					<div class="judul_profile">SKEMA</div>
				</div>
			</a>
		</div>
		<div class="mod_profile_data mod_profile_data_kiri">
			<a href="<?php echo NPAGE.'lsp';?>">
				<div class="mod_profile_data_ch1">
					<div class="jumlah_profile"><?php echo $jumlahasesor;?></div>
					<div class="judul_profile">ASESOR</div>
				</div>
			</a>
		</div>
		<div class="mod_profile_data mod_profile_data_kiri">
			<a href="<?php echo NPAGE.'lsp';?>">
				<div class="mod_profile_data_ch1">
					<div class="jumlah_profile"><?php echo $jumlahasesi;?></div>
					<div class="judul_profile">ASESI</div>
				</div>
			</a>
		</div>
	</div>
	<div style="clear: both;"></div>
	
</div>