<?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 Jenis Pengadaan Baru");
	$kode="";
	$nama="";
	if($id>0){
		$page->setJudul("Edit Jenis Pengadaan");
		$query="SELECT * FROM tb_jenis_pengadaan WHERE id=?";
		$rs=$db->loadAssoc($query,array($id));
		if(isset($rs['id'])){
			$nama=$rs['nama'];
			$kode=$rs['kode'];
		}
	}
	$page->addLoad("jenispengadaan.edit($id)");
	?>
	<div class="group_form">
		<title>Kode</title>
		<div class="col10"><input id="kode" value="<?php echo $kode;?>" />
			
		</div>
	</div>
	<div class="group_form">
		<title>Nama Jenis Pengadaan</title>
		<div class="col10"><input id="nama" value="<?php echo $nama;?>" />
			
		</div>
	</div>
	<div class="group_form">
		<title> </title>
		<div class="col10">
			<div id="box_error_simpan" class="error"></div>
			<div class="box_button_bawah">
				<span class="btmerah btncancel" onclick="jenispengadaan.kembali()">Kembali</span>&nbsp;&nbsp;<span onclick="jenispengadaan.simpan()" class="bthijau btnsave">Simpan</span>
			</div>
		</div>
	</div>
	<?php
}else{
	$page->addLoad("jenispengadaan.load()");
	$page->setJudul("Master Data Jenis Pengadaan");
	?>
	<div class="box_button_atas">
		Jumlah baris: <select id="jumlah_hal" class="slkecil" onchange="jenispengadaan.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="jenispengadaan.load()"><option value="1">1</option></select>
		&nbsp;<input placeholder="Default: Nama Jenis Pengadaan" onkeypress="jenispengadaan.enter(event)" id="cari" class="in_cari" />
		&nbsp;&nbsp;<span id="btcari" class="btnone btncari" onclick="jenispengadaan.loade()">Cari</span>
		&nbsp;&nbsp;<span class="btnone btncanggih" onclick="jenispengadaan.caricanggih()">Cari Detail</span>
	</div>
	<div id="grid_jenispengadaan"></div>
	<div class="box_button_bawah">
		<span onclick="jenispengadaan.buat(0)" class="bthijau btninput">Input Jenis Pengadaan Baru</span>
	</div>
	<div id="btedit" style="display:none;">
		<span class="icon_del" onclick="jenispengadaan.hapus(#{id})"></span>
		<span class="icon_edit" onclick="jenispengadaan.buat(#{id})"></span>
	</div>
	<span onclick="jenispengadaan.setstatus(#{id},##{jumlah_tabel},##{baris_tabel},this)" id="btstatus" class="#(#{status}==1)?'mini_ok':'mini_dis'#"></span>
	<?php
}
?>
