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

$datarr=array("module"=>$mod);
$_SESSION['moduleload']=$mod;

$page->addLoad("pilihsurat.init(".json_encode($datarr,true).")");

?>
<div id="box_pilihsurat" style="display:none;">
	<div style="padding: 10px;">
		<div class="box_button_atas">
			Jenis. <select id="sl_jenis_srt" class="slkecil" onchange="pilihsurat.loadesrt()">
				<option value="0">Semua Jenis Surat</option>
				<?php
				$qrk="select * from tb_master_jenissurat where status=1 and in_out=1";
				$rsk=$db->loadAll($qrk);
				foreach ($rsk as $obk) {
					?>
					<option value="<?php echo $obk['id'];?>"><?php echo $obk['nama'];?></option>
					<?php
				}
				?>
			</select> &nbsp;
			Baris: <select id="jumlah_hal_srt" class="slkecil" onchange="pilihsurat.loadesrt()">
				<option value="30">30</option>
				<option value="50">50</option>
				<option value="100">100</option>
			</select> &nbsp;
			Hal: <select id="hal_ke_srt" class="slkecil" onchange="pilihsurat.loadsrt()"><option value="1">1</option></select>
			&nbsp;<input placeholder="Default: Nomor Surat" onkeypress="pilihsurat.entersrt(event)" id="cari_srt" class="in_cari" />
			&nbsp;&nbsp;<span id="btcari_srt" class="btnone btncari" onclick="pilihsurat.loadesrt()">Cari</span>
		</div>
		<div id="grid_data_srt"></div>
		<div id="box_loader_srt" align="left" class="error"></div>
		<div class="box_button_bawah">
			<span class="btmerah medium" onclick="pilihsurat.bataldatasrt()">BATAL</span>
			<span id="btprosesmulti" style="display: none">
				&nbsp;&nbsp;<span class="bthijau medium" onclick="pilihsurat.prosesstatus()">PROSES</span>
			</span>
		</div>
	</div>
</div>
<div id="btdetaildata" style="display: none;">
	<div><b>#{tujuan}</b></div>
	<div style="margin-top: 5px;"><b>#{tujuan}</b></div>
</div>
<span id="btstatus" style="display: none;cursor: default;background: #{bg}" class="medium">
	<span style="color: #{warna}">#{namastatus}</span>
</span>
<span id="btpilihtunggalsrt" style="display: none;" stpilih="0" class="bt_next" onclick="pilihsurat.pilihsuratbl(#{id},##{jumlah_tabel},##{baris_tabel})"></span>
<span id="btpilihmultisrt" style="display: none;" stpilih="0" class="bt_tidak" onclick="pilihsurat.pilihsuratmulti(#{id},##{jumlah_tabel},##{baris_tabel})"></span>