<link href="css/form.css" type="text/css" rel="stylesheet" />


<?php
	
	$q0=mysqli_query($mysqli, "SELECT * FROM m_user WHERE id='$_SESSION[ses_id_tpk]'");
	$d0=mysqli_fetch_array($q0);
	$nmuser=$d0["username"];
	
	
	
	
	$q0=mysqli_query($mysqli, "SELECT * FROM settings WHERE username='$nmuser'");
	$d0=mysqli_fetch_array($q0);
	$ta=$d0["tahun_anggaran"];
	
  $id_anggaran=$_GET["id_anggaran"];
  $query=mysqli_query($mysqli,"SELECT * FROM t_anggaran WHERE id='$id_anggaran'");
  $data=mysqli_fetch_array($query);
	
	$q1=mysqli_query($mysqli, "SELECT * FROM transaksi WHERE id_anggaran='$id_anggaran' AND tahun_anggaran='$ta'");
	$d1=mysqli_fetch_array($q1);

	echo "<h3>MENAMBAHKAN TRANSAKSI PENGADAAN BARANG/JASA DESA</h3>";
	echo "<h3 align=\"right\"><a href=\"javascript:history.back()\" style=\"color:#FF0066\">Kembali</a></h3>";

?>

<form name="form1" method="post" action="_save_transaksi.php">
  <table width="600" border="0" cellspacing="0" cellpadding="0">
    <tr>
      <td width="204">&nbsp;</td>
      <td width="396">&nbsp;</td>
    </tr>
    <tr>
      <td valign="top">Kode Rekening</td>
      <td valign="top"><input type="text" name="txtKodeRekening" id="txtKodeRekening" class="kotak" value="<?php echo $data[kode_rekening] ?>" readonly>
			
			<input type="hidden" name="txtIdAnggaran" id="txtIdAnggaran" class="kotak" value="<?php echo $data[id] ?>" readonly>
			
			<input type="hidden" name="txtIdTransaksi" id="txtIdTransaksi" class="kotak" value="<?php echo $d1[id] ?>" readonly>
			
			</td>
    </tr>

    <tr>
      <td valign="top">Paket</td>
      <td valign="top"><input type="text" name="txtPaket" id="txtPaket" class="kotak" size="40" value="<?php echo $data[uraian] ?>" readonly></td>
    </tr>

    <tr>
      <td valign="top">Anggaran</td>
      <td valign="top"><input type="text" name="txtAnggaran" id="txtAnggaran" class="kotak" style="text-align:right" size="40" value="<?php echo number_format($data[anggaran],0,',','.') ?>" readonly /></td>
    </tr>

    <tr>
      <td valign="top">Nama Penyedia Pemenang</td>
      <td valign="top"><input type="text" name="txtPemenang" id="txtPemenang" class="kotak" size="40" value="<?php echo $d1[pemenang] ?>" /></td>
    </tr>

    <tr>
      <td valign="top">Harga Penawaran</td>
      <td valign="top"><input type="text" name="txtPenawaran" id="txtPenawaran" class="kotak" style="text-align:right" size="40" value="<?php echo number_format($d1[harga_penawaran],0,',','.') ?>" /></td>
    </tr>

    <tr>
      <td valign="top">Keterangan</td>
      <td valign="top"><textarea name="txtKeterangan" id="txtKeterangan" class="kotakarea" cols="40"><?php echo $d1[keterangan] ?></textarea></td>
    </tr>
    
    <tr>
      <td width="204">&nbsp;</td>
      <td width="396">&nbsp;</td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td><input type="submit" name="button" id="button" value="Simpan" class="tombol">&nbsp; &nbsp; <input type="button" name="hapus" id="hapus" value="   Hapus   " class="tombol" onclick="window.location='_del_transaksi.php?id=<?php echo $d1[id] ?>'"></td>
    </tr>
    <tr>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>
</form>

