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