<script language="javascript">
	$(document).ready(function(){
		$("#bkdate").datepicker({
			dateFormat : "yy-mm-dd",
			changeMonth : true,
			changeYear : true,
		});
	});
	function save_click(){
		if((form.pyd_nilai.value=="") ){
			alert("Silakan isi nilai penyusutan.");
			form.pyd_nilai.focus();
			return false;
		}else{
			var a = confirm("Apakah anda yakin akan menyimpan data?");
			if (a == true){
				form.action ='?page=Proses-Penyusutan&Act=PAY_SAVE'; 
				form.method = 'post';
				form.submit();			
				return true;
			}
		}
	}
	function close_click(){
		form.action ='?page=Proses-Penyusutan&Act=CLOSE'
		form.method = 'post';
		form.submit();		
		return true;
	}
</script>
<form action="#" method="post" name="form" enctype="multipart/form-data">
<table width="100%">
	<tr>
		<th colspan="4">INPUT PENYUSUTAN</th>
	</tr>	
	<tr>
		<td colspan="4">&nbsp;</td>
	</tr>
	<tr>
		<td width="15%">Tipe Penyusutan</td>
		<td width="35%">: <input type="hidden" name="py_id" size="27" value="<?=$py_id;?>">
			<input type="text" name="py_tipe" value="<?=$py_tipe;?>" size="50" readonly="true" style="background-color:#CCFFFF " />
		</td>
		<td width="15%">&nbsp;</td>
		<td width="35%">&nbsp;</td>
	</tr>
	<tr>
		<td>Nama Barang</td>
		<td>: <input type="text" name="py_nmbarang" value="<?=$py_nmbarang;?>" size="50" readonly="true" style="background-color:#CCFFFF " /></td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
    <tr>
		<td>Satuan</td>
		<td>: <input type="text" name="py_stbarang" value="<?=$py_stbarang;?>" size="10" readonly="true" style="background-color:#CCFFFF " /></td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
    <tr>
		<td>Nilai</td>
		<td>: <input type="text" name="py_nilai" value="<?=$py_nilai;?>" size="15" readonly="true" style="background-color:#CCFFFF;text-align:right " /></td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
    <tr>
		<td>Sudah disusutkan</td>
		<td>: <input type="text" name="bnilai" value="<?=$bnilai;?>" size="15" readonly="true" style="background-color:#CCFFFF;text-align:right " /></td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
    <tr>
		<td>Sisa</td>
		<td>: <input type="text" name="snilai" value="<?=$snilai;?>" size="15" readonly="true" style="background-color:#CCFFFF;text-align:right " /></td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
    <!--<tr>
		<td>Tipe</td>
		<td>: 
        	<select name="bbp_tipe">
		  	<option value="0" selected="selected">PILIH</option> 
			<?php
			  $dataSql = mysql_query("SELECT bbt_tipe FROM buku_besar_tipe WHERE bbt_status=10 AND id in(1,2) ORDER BY id ASC");
			  while ($dataRow = mysql_fetch_array($dataSql)) {
				if ($dataRow['bbt_tipe']== $bbp_tipe) {
					$cek = " selected";
				} else { $cek=""; }
				echo "<option value='$dataRow[bbt_tipe]' $cek>$dataRow[bbt_tipe]</option>";
			  }
			  $sqlData ="";
			?>
		 </select>
        </td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>-->
    <tr>
		<td>Tanggal</td>
		<td>: <input type="text" name="pyd_tanggal" value="<?php if(empty($pyd_tanggal)){$pyd_tanggal=$date;} echo $pyd_tanggal; ?>" size="12" id="bkdate" 
				  readonly="true" style="background-color:#CCFFFF " /></td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
    <tr>
		<td>Nilai Penyusutan</td>
		<td>: <input type="text" name="pyd_nilai" value="<?=$pyd_nilai;?>" size="15" style="text-align:right" /></td>
		<td>&nbsp;</td>
		<td>&nbsp;</td>
	</tr>
	<tr>
		<td colspan="4">&nbsp;</td>
	</tr>
	<tr>
		<td colspan="4" align="center">
		    <input type="button" name="btnSave" value="SIMPAN" style="cursor:pointer" onclick="save_click();">
			<input type="button" name="btnclose" value="BATAL" style="cursor:pointer" onclick="close_click();" />
		</td>
	</tr>
</table>
</form>