Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- //mencari kode terakhir
- $kd_reg='INV';
- $cari_kode=mysql_query("select tbayar_no_bukti from tb_transaksi_pembayaran
- JOIN tb_beban ON tb_transaksi_pembayaran.tbayar_beban_sud=tb_beban.id
- order by tb_transaksi_pembayaran.id DESC");
- $tm_cari=mysql_fetch_array($cari_kode);
- $kode=substr($tm_cari['tbayar_no_bukti'],3);
- $tambah=$kode + 1;
- if($tambah<10)
- {
- $tbayar_no_bukti=$kd_reg.'00000'.$tambah;
- }
- elseif($tambah>=10 AND $tambah<100)
- {
- $tbayar_no_bukti=$kd_reg.'0000'.$tambah;
- }
- elseif($tambah>=100 AND $tambah<1000)
- {
- $tbayar_no_bukti=$kd_reg.'000'.$tambah;
- }
- elseif($tambah>=1000 AND $tambah<10000)
- {
- $tbayar_no_bukti=$kd_reg.'00'.$tambah;
- }
- elseif($tambah>=10000 AND $tambah<100000)
- {
- $tbayar_no_bukti=$kd_reg.'0'.$tambah;
- }
- elseif($tambah>=100000)
- {
- $tbayar_no_bukti=$kd_reg.$tambah;
- }
- //akhir mencari kode
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement