<?PHP
if(isset($_POST['btnSiswa'])){
$jumlah = count($_POST['nim']);
echo "<h1>Informasi</h1>";
for($i=0; $i<$jumlah; $i++){
$urut = $i+1;
$nim = $_POST['nim'][$i];
$nama = $_POST['nama'][$i];
$tglproses1 = "{$_POST[day]}/{$_POST[month]}/{$_POST[year]}";
$terdakwa1 = $_POST['namaterdakwa'];
$sumber1 = $_POST['sumberasal'];
$jenis1 = $_POST['jenis'];
$pdm1 = "{$_POST[pdm]}/$jenis1/{$_POST[month]}/{$_POST[year]}";
$rb1 = "{$_POST[rb]}/$jenis1/{$_POST[month]}/{$_POST[year]}";
$pasal1 = $_POST['pasal'];
$ijinsita1 = $_POST['ijinsita'];
$jaksa1 = $_POST['jaksa'];
$petugas1 = $_POST['petugas'];
$bidang = $_POST['bidangnya'];
$ukey1 = "{$_POST[jenisnya]}{$_POST[year]}{$_POST[month]}-{$_POST[pdm]}-{$_POST[rb]}-{$urut}";
include("index.db.php");
mysql_connect("$server", "$username", "$password");
mysql_select_db("$database");
$query = "Select * from barbuk_db where t_id = '1'"; 
$result = mysql_query($query); 
if($row = mysql_fetch_array($result)){ 
$mytable = $row['t_table'];

$query = "insert into $mytable(UKEY,TGLPROSES,TERDAKWA,IJINSITA,SUMBERASAL,JENIS,PDM,RB,JAKSA,PASAL,PETUGAS,NAMABARANG,LOKASI,BIDANG)values('$ukey1','$tglproses1','$terdakwa1','$ijinsita1','$sumber1','$jenis1','$pdm1','$rb1','$jaksa1','$pasal1','$petugas1','$nim','$nama','$bidang')";
mysql_query($query);

?>
<LINK href="../images/index.css" rel="stylesheet" type="text/css">
<table width="100%"  border="0" cellspacing="1" cellpadding="1">
  <tr>
    <td height="20">&nbsp;</td>
  </tr>
</table>
<table width="80%"  border="0" align="center" cellpadding="0" cellspacing="0">
    <tr>
      <td bgcolor="#000000"><table width="100%"  border="0" cellspacing="4" cellpadding="4">
        <tr>
          <td bgcolor="#FFFFFF"><table width="100%"  border="0" cellspacing="2" cellpadding="2">
            <tr>
              <td height="20"><strong>BERHASIL DI INPUT BARANG BUKTI SEBAGAI BERIKUT</strong></td>
            </tr>
            <tr>
              <td height="20">&nbsp;</td>
            </tr>
            <tr>
              <td height="20"><?PHP echo $urut.". ".$nim ." Disimpan di "; ?>
                <?PHP if($nama == "1"){ echo "GUDANG KEJARI<br />"; }
if($nama == "2"){ echo "RUBASAN<br />"; }
if($nama == "3"){ echo "PENITIPAN<br />"; }
 ?></td>
            </tr>
            <tr>
              <td height="20">&nbsp;</td>
            </tr>
          </table></td>
        </tr>
      </table></td>
    </tr>
</table>
  <table width="100%"  border="0" cellspacing="1" cellpadding="1">
    <tr>
      <td height="20">&nbsp;</td>
    </tr>
  </table>
  </div>

<? }} 
}?><table width="80%"  border="0" align="center" cellpadding="0" cellspacing="0">
        <tr>
          <td bgcolor="#FFFFFF"><table width="100%"  border="0" cellspacing="1" cellpadding="0">
            <tr>
              <td><a href="index.cetaklabel.php?ukey=<?PHP echo $rb1; ?>" target="_blank" class="menu">CETAK LABEL </a></td>
            </tr>
            <tr>
              <td><a href="index.php" class="menu">KEMBALI KE HALAMAN BERANDA</a></td>
            </tr>
          </table></td>
        </tr>
      </table>
<table width="100%"  border="0" cellspacing="1" cellpadding="1">
  <tr>
    <td height="20">&nbsp;</td>
  </tr>
  <tr>
    <td height="20">&nbsp;</td>
  </tr>
</table>
