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

$arrsett=array();
$page->setJudul("Manajemen Profile");
$query="select * from tb_setting where id=3";
$rsst=$db->loadAssoc($query);
if(isset($rsst['id'])){
	$arrsett=json_decode($rsst['setting'],true);
}
$arrsett['namafile']="PILIH FILE LOGO";
$arrsett['namabaru']="";
$arrsett['namafolder']="";

if(isset($arrsett['idlogo'])){
	$query="select * from tb_dokumen where id=?";
	$rsdok=$db->loadAssoc($query,array($arrsett['idlogo']));
	if(isset($rsdok['id'])){
		$arrsett['namafile']=$rsdok['nama_awal'];
		$arrsett['namabaru']=$rsdok['nama_baru'];
		$arrsett['namafolder']=$rsdok['folder'];
	}
}

$arrsett['namalogopr']="PILIH FILE LOGO PERUSAHAAN";
$arrsett['namabarulogopr']="";
$arrsett['folderlogopr']="";
if(isset($arrsett['idlogoperusahaan'])){
	$query="select * from tb_dokumen where id=?";
	$rsdokpr=$db->loadAssoc($query,array($arrsett['idlogoperusahaan']));
	if(isset($rsdokpr['id'])){
		$arrsett['namalogopr']=$rsdokpr['nama_awal'];
		$arrsett['namabarulogopr']=$rsdokpr['nama_baru'];
		$arrsett['folderlogopr']=$rsdokpr['folder'];
	}
}

$arrsett['namaheaderhalaman']="PILIH FILE HEADER HALAMAN";
$arrsett['namabaruheaderhalaman']="";
$arrsett['folderheaderhalaman']="";
if(isset($arrsett['idheaderhalaman'])){
	$query="select * from tb_dokumen where id=?";
	$rsdokpr=$db->loadAssoc($query,array($arrsett['idheaderhalaman']));
	if(isset($rsdokpr['id'])){
		$arrsett['namaheaderhalaman']=$rsdokpr['nama_awal'];
		$arrsett['namabaruheaderhalaman']=$rsdokpr['nama_baru'];
		$arrsett['folderheaderhalaman']=$rsdokpr['folder'];
	}
}
$rsst['setting']=json_encode($arrsett,true);
$page->addLoad("profile.load(".json_encode($rsst,true).")");
?>
<div class="box_main_konten">
	<h3>DETAIL PROFILE</h3>
	<div class="group_form">
		<title>Text Header 1</title>
		<div class="col10"><input id="theader"/>
			
		</div>
	</div>
	<div class="group_form">
		<title>Text Header 2</title>
		<div class="col10"><input id="theader2"/>
			
		</div>
	</div>
	<div class="group_form">
		<title>Logo Header</title>
		<div class="col10">
			<div id="upload_logo"></div>
		</div>
	</div>
	<div class="group_form">
		<title>Default Header halaman</title>
		<div class="col10">
			<div id="upload_header_halaman"></div>
		</div>
	</div>
	
	<div class="group_form">
		<title>Nama Instansi</title>
		<div class="col10"><input id="nama"/>
			
		</div>
	</div>
	<div class="group_form">
		<title>Alamat Instansi</title>
		<div class="col10"><input id="alamat"/>
			
		</div>
	</div>
	<div class="group_form">
		<title>Geo location</title>
		<div class="col10">
			<input id="lokasi"/>
			<!--
			<div class="box_button_bawah">
				<span class="bthijau medium" onclick="profile.bukapeta()">input lokasi</span>
			</div>
			-->
		</div>
	</div>
	<div class="group_form">
		<title>Email</title>
		<div class="col10"><input id="email"/>
			
		</div>
	</div>
	<div class="group_form">
		<title>No Telphon</title>
		<div class="col10"><input id="telp"/>
			
		</div>
	</div>
	<div class="group_form">
		<title>No Fax</title>
		<div class="col10"><input id="fax"/>
			
		</div>
	</div>
	<div class="group_form">
		<title>HP</title>
		<div class="col10"><input id="hp"/>
			
		</div>
	</div>
	<div class="group_form">
		<title>WA</title>
		<div class="col10"><input id="wa"/>
			
		</div>
	</div>
	
	<div style="clear: both;"></div>
</div>
<div class="box_main_konten">
	<h3>DESKRIPSI PROFILE</h3>
	<div>
		<textarea id="deskripsi"></textarea>
	</div>
	<div style="clear: both;"></div>
</div>
<div class="box_button_bawah" style="margin-top: 20px;">
	<div id="err_mainsimpan"></div>
	<span onclick="profile.simpan()" class="bthijau">Simpan</span>
</div>
<div id="box_preview" style="display: none">
	<img id="img_banner" style="width: 100%" />
</div>