<?php
include "../../config/koneksi.php";
echo"Loading.... Please Wait";

	$cek = mysql_query("select * from belidetail where id not in (select id_detail from belimasuk ) and billno > 1 ");
	while ($r=mysql_fetch_array($cek)){	
		mysql_query("INSERT INTO belimasuk(id_detail,qty,kasir,gudang) VALUES('$r[id]','$r[qty]','admin','1')");
	}
	
	$cek = mysql_query("select * from buydetail where id not in (select id_detail from belimasuk ) and billno > 1 ");
	while ($r=mysql_fetch_array($cek)){	
		mysql_query("INSERT INTO buymasuk(id_detail,qty,kasir,gudang) VALUES('$r[id]','$r[qty]','admin','1')");
	}

?>