Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <script>
- var datafield = [
- '<td nowrap="nowrap"><strong>Kategori</strong></td><td nowrap="nowrap"><strong>:</strong></td><td nowrap="nowrap"><?php echo $combo; ?></td><td><strong>Nama Barang</strong></td><td nowrap="nowrap"><strong>:</strong></td><td nowrap="nowrap"><select id="tb_barang"><option value="0">....</option></select></td><td nowrap="nowrap"><input type="button" value="DEL" onclick="delfield(this)"></td>',
- '<td nowrap="nowrap"><strong>Keterangan</strong></td><td nowrap="nowrap"><strong>:</strong></td><td nowrap="nowrap"><input name="txtKeterangan[]" value="" size="70" maxlength="200" /></td><td nowrap="nowrap"><strong>Jumlah Ambil </strong></td><td nowrap="nowrap"><strong>:</strong></td><td nowrap="nowrap" colspan="2"><input name="txtJumlahambil[]" value="" size="10" maxlength="4" /></td>'
- ];
- function addfield() {
- var df=document.getElementById("datafield");
- var el=document.createElement("TR");
- el.innerHTML=datafield[0];
- df.appendChild(el);
- el=document.createElement("TR");
- el.innerHTML=datafield[1];
- df.appendChild(el);
- }
- function delfield(t) {
- var pr=t.parentNode.parentNode.parentNode;
- var el1=t.parentNode.parentNode;
- var el2=el1.nextElementSibling;
- pr.removeChild(el2);
- pr.removeChild(el1);
- }
- function loadbarang(kd_kategori) {
- var xmlhttp;
- if(window.XMLHttpRequest) {xmlhttp=new XMLHttpRequest();}
- else {xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");}
- xmlhttp.onreadystatechange=function() {
- if(xmlhttp.readyState==4 && xmlhttp.status==200) {document.getElementById("tb_barang").innerHTML=xmlhttp.responseText;}
- }
- xmlhttp.open("GET","loadbarang.php?kd_barang="+kd_kategori,true);
- xmlhttp.send();
- }
- </script>
- <form action="" method="post" name="form1" target="_self">
- <table id="datafield" class="table-list" width="700" border="0" cellspacing="1" cellpadding="3" >
- <tr>
- <th colspan="7" scope="col"><strong>TAMBAH DATA PENGAMBILAN BARANG</strong></th>
- </tr>
- <tr>
- <td width="133"><strong>Tanggal Transaksi</strong></td>
- <td width="5"><strong>:</strong></td>
- <td width="441"><input name="txtTanggal" class="tcal" value="<?php echo $tanggal; ?>" size="22" align="10"/></td>
- <td><strong>Nama Pengambil</strong></td>
- <td><strong>:</strong></td>
- <td>
- <select name="cmbNamapengambil">
- <option value="KOSONG">....</option>
- <?php
- $mySql = "SELECT * FROM tb_karyawan ORDER BY nama_karyawan";
- $myQry = mysql_query($mySql, $koneksidb) or die ("Gagal Query".mysql_error());
- while ($myData = mysql_fetch_array($myQry)) {
- if ($myData['kd_karyawan']== $dataNamapengambil) {
- $cek = " selected";
- } else { $cek=""; }
- echo "<option value='$myData[kd_karyawan]' $cek> $myData[nama_karyawan] </option>";
- }
- ?>
- </select>
- </td>
- <td id="addfield"><input type="button" value="ADD FIELD" onclick="addfield()"></td>
- </tr>
- <tr>
- <td nowrap="nowrap"><strong>Kategori</strong></td>
- <td nowrap="nowrap"><strong>:</strong></td>
- <td nowrap="nowrap">
- <?php echo $combo; ?>
- </td>
- <td>
- <strong>Nama Barang</strong></td>
- <td nowrap="nowrap"><strong>:</strong></td>
- <td nowrap="nowrap" colspan="2">
- <select id="tb_barang">
- <option value="0">....</option>
- </select>
- </td>
- </tr>
- <tr>
- <td nowrap="nowrap"><strong>Keterangan</strong></td>
- <td nowrap="nowrap"><strong>:</strong></td>
- <td nowrap="nowrap"><input name="txtKeterangan[]" value="" size="70" maxlength="200" /></td>
- <td nowrap="nowrap"><strong>Jumlah Ambil </strong></td>
- <td nowrap="nowrap"><strong>:</strong></td>
- <td nowrap="nowrap" colspan="2"><input name="txtJumlahambil[]" value="" size="10" maxlength="4" /></td>
- </tr>
- </table>
- <input type="submit" name="btnSimpan" value=" Simpan " style="cursor:pointer;"><input value="Kembali" type="button" onClick="self.history.back()">
- </form>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement