Postingan lainnya
Auto number kdauto tidak berjalan
?php //fungsi kode otomatis $host = "localhost"; $username = "root"; $password = ""; $db = "gudang"; $link = mysqli_connect($host,$username,$password,$db) or die("Koneksi gagal"); mysqli_select_db($link, 'gudang') or die("Database tidak bisa dibuka");
function kdauto($tabel, $inisial, $conn){ $struktur = mysqli_query("SELECT * FROM $tabel"); $field = mysql_field_name($struktur,0); $panjang = mysql_field_len($struktur,0); $qry = mysqli_query("SELECT max(".$field.") FROM ".$tabel); $row = mysqli_fetch_array($qry); if ($row[0]=="") { $angka=0; } else { $angka= substr($row[0], strlen($inisial)); } $angka++; $angka =strval($angka); $tmp =""; for($i=1; $i<=($panjang-strlen($inisial)-strlen($angka)); $i++) { $tmp=$tmp."0"; } return $inisial.$tmp.$angka; } ?> FORM INPUT BARANG MASUKID Transaction" disabled="disabled" /> " />Tanggal$tg"; } ?>
"Jan","Feb","Mar","Apr","Mei","Jun","Jul","Aug","Sep","Okt","Nov","Des"); echo "$nama_bln[$bln]"; } ?> - $i"; } ?> Kode Barang'; echo ' -- Pilih Kode Barang -- '; while ($row = mysqli_fetch_array($result)) { echo '' . $row['kode_brg'] . ''; $jsArray .= "nama_brg['" . $row['kode_brg'] . "'] = {name:'" . addslashes($row['nama_brg']) . "',jenis:'".addslashes($row['jenis_brg'])."'};\n"; } echo ''; ?> Nama BarangJenis BarangJumlah Barang Masuk *Harus di Isi
Belum ada Jawaban. Jadi yang pertama Jawaban
Login untuk ikut Jawaban