<?php
    include('../loginsession.php');
    error_reporting(E_ALL);
    $filename = __FILE__;  //---Nama file saat ini
    if (strlen(__FILE__) > 48) {$filename = substr(__FILE__, 48);}
    $save = mysqli_query($conn, "INSERT INTO novia_abc_user_logs (userid,filename) VALUES ('$userini_id','$filename')");
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//ID" "http://www.w3.org/TR/html4/frameset.dtd">
<html lang="id">
<head>
   <title>BELANJA</title>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" type="text/css" href="../css/style.css">
	<link href="../images/balance.ico" rel="icon" type="image/icon"/>

</head>
<body>

<?php
//ambil data berdasarkan parameter GET id
$b = mysqli_fetch_array(mysqli_query($conn, "SELECT id, subcategory_item FROM novia_abc_cash_category_sub where id='$_GET[id]'"));
?>

	<table width="100%" max-width="600px" cellpadding="5" align="center">
			<tr class="satu">
				<td><a href="cash-main.php?id=<?php echo $b["id"];?>" title="KEMBALI"><button style="padding : 10px; width:100%">BATALKAN BELANJA</button></a></td>
			</tr>
	</table>

<form  method="post"  action="cash-belanja-insert.php?id=<?php echo $b['id']; ?>">
	<table width="100%" max-width="600px" cellpadding="5" align="center">
    <tbody>
    <tr class="satu">
		<td colspan="3" style='text-transform:uppercase' align="center">
			<h1>Belanja - <?php echo $b['subcategory_item'];?></h1>
		</td>
	</tr>
    <tr class="head" align="left">
		<th width="150">Parameter</th>
        <th>Data Belanja</th>
    </tr>
    <tr class="satu"><td colspan="3"></td></tr>
    <tr class="dua">
        <td>ID</td>
        <td><?php echo $b['subcategory_item']; ?></td>
    </tr>
	
	<tr class="satu">
        <td>Harga</td>
        <td><input type="text" name="harga" placeholder="harga" size="3" maxlength="5" autocomplete="off" autofocus value=""/></td>
    </tr>

	<tr class="satu">
        <td>Jumlah</td>
        <td><input type="text" name="jumlah" placeholder="jumlah" size="3" maxlength="3" autocomplete="off" autofocus value=""/></td>
    </tr>
    
	<tr class="dua">
        <td>Keterangan</td>
        <td><input type="text" name="keterangan" placeholder="keterangan" size="20" maxlength="30" autocomplete="off" autofocus value=""/></td>
    </tr>

	<tr class="satu">
        <td>Tanggal Belanja</td>
        <td><input type="text" name="tgl_belanja" placeholder="tgl_belanja" size="20" maxlength="30" autocomplete="off" autofocus value="<?php echo date("Y-m-d H:i:s")?>"/></td>
    </tr>
	
    <tr class="dua">
		<td><input type="text" name="password" placeholder="Masukkan Password" size="15" maxlength="30" value=""/></td>
        <td colspan="1"><button type="submit" name="simpan" style="padding: 10px; width: 100%">DAFTARKAN BELANJA</button</td>
    </tr>
</tbody>
</table>
</form>
</body>
</html>