<?php
if(count(get_included_files()) ==1) exit("Direct access not permitted.");
if(!$statuslogin) exit;
$mod = basename(__FILE__, '.php');
$page->tbJs($mod);
if(isset($_GET['id'])){
	$id=strip_tags(stripslashes($_GET['id']));
	$page->setJudul("Input nama Propinsi");
	$nama="";
	$kode="";
	$lokasi="KLIK UNTUK BUAT LOKASI";
	if($id>0){
		
		$page->setJudul("Edit nama Propinsi");
		$query="SELECT * FROM tb_propinsi WHERE id=?";
		$rs=$db->loadAssoc($query,array($id));
		if(isset($rs['id'])){
			$nama=$rs['propinsi'];
			$kode=$rs['kode'];
			if(isset($rs['lokasi'])) $lokasi=$rs['lokasi'];
		}
	}
	$page->addLoad("masterpropinsi.edit($id)");
	?>
	<div class="box_main_konten">
		<h3>DETAIL DATA PROPINSI</h3>
		<div class="box_admin_konten">
			<div class="group_form">
				<title>Kode Propinsi</title>
				<div class="col10"><input id="kode" value="<?php echo $kode;?>" />
					
				</div>
			</div>
			<div class="group_form">
				<title>Nama Propinsi</title>
				<div class="col10"><input id="nama" value="<?php echo $nama;?>" />
					
				</div>
			</div>
			<div class="group_form" style="display: none;">
				<title>Koordinat Lokasi</title>
				<div class="col10">
					<div id="lokasi" class="boxparrent" onclick="masterpropinsi.pilihlokasi()"><?php echo $lokasi;?></div>
				</div>
			</div>
			
		</div>
		<div style="clear: both;"></div>
	</div>
	
	<div class="box_button_bawah">
		<div id="error_ppropinsi" class="error"></div>
		<span class="btmerah btncancel" onclick="masterpropinsi.kembali()">Kembali</span>&nbsp;&nbsp;<span onclick="masterpropinsi.simpan()" class="bthijau btnsave">Simpan</span>
	</div>
	<?php
}else{
	$page->addLoad("masterpropinsi.load()");
	$page->setJudul("Master Propinsi");
	?>
	<div class="box_button_atas">
		Jumlah baris: <select id="jumlah_hal" class="slkecil" onchange="masterpropinsi.loade()">
			<option value="30">30</option>
			<option value="50">50</option>
			<option value="100">100</option>
		</select> &nbsp;
		Hal: <select id="hal_ke" class="slkecil" onchange="masterpropinsi.load()"><option value="1">1</option></select>
		&nbsp;<input placeholder="Default: Nama Propinsi" onkeypress="masterpropinsi.enter(event)" id="cari" class="in_cari" />
		&nbsp;&nbsp;<span id="btcari" class="btnone btncari" onclick="masterpropinsi.loade()">Cari</span>
		&nbsp;&nbsp;<span class="btnone btncanggih" onclick="masterpropinsi.caricanggih()">Cari Detail</span>
	</div>
	<div id="grid_masterpropinsi"></div>
	<div id="loader_propinsi" class="error"></div>
	<div class="box_button_bawah">
		<span onclick="masterpropinsi.buat(0)" class="bthijau btninput">Tambah Nama Propinsi</span>
	</div>
	<div id="btedit" style="display:none;">
		<span class="icon_del" onclick="masterpropinsi.hapus(#{id})"></span>
		<span class="icon_edit" onclick="masterpropinsi.buat(#{id})"></span>
	</div>
	<span id="btstatus" class="#(#{status}==1)?'mini_ok':'mini_dis'#" style="display:none;" onclick="masterpropinsi.setstatus(#{id},##{jumlah_tabel},##{baris_tabel},this)"></span>
	<span id="btlokasi" class="bthijau medium" style="display:none;" onclick="masterpropinsi.setlokasi(#{id},##{jumlah_tabel},##{baris_tabel},this)">#{lokasipeta}</span>
	<?php
}
?>
