<?php
session_start();
require_once("../lib/dbconn.php");

echo "<pre>";
echo print_r($_POST);
echo "</pre>";
//die();

$item_id = $_POST[layananid];
$jumlah = $_POST[jumlah];
$dk = $_POST[dk];
$tgl = $_POST[tgl_trans];
$kwitansi = $_POST[kwitansi];
$s = $_POST[max_layanan];

for ($i = 0; $i <= $s-1; $i++) {
    $cek1 = getFromTable("select count(id) from tbl_other_jurnal");
	$kd = $cek1 + 1;
     	
   mysql_query("insert into tbl_other_jurnal (id, tgl_trans, no_kwitansi, id_jurnal,
			d_k, jumlah, tgl_input, user_input) values 
            ('$kd', '".$tgl."', '$kwitansi[$i]', '$item_id[$i]', 
        	'$dk[$i]', ".$jumlah[$i].", CURRENT_DATE, '".$_SESSION[nama_usr]."')");
}

echo "<script language='JavaScript'>document.location='../index2.php?p=other_cash'</script>";


?>