<?php
include_once("../../../../lib/konfig.php");
include_once("../../../../lib/function.php");
session_start();
$kodebrg = $_POST['kodebrg'];
$deskripsibrg = $_POST['deskripsibrg'];
$unit1brg = $_POST['unit1brg'];
$unit2brg = $_POST['unit2brg'];
$ratio2brg = $_POST['ratio2brg'];
$unit3brg = $_POST['unit3brg'];
$ratio3brg = $_POST['ratio3brg'];
$lokasibrg = $_POST['lokasibrg'];

$MySQLi = new MySQLi($strDBHostName, $strDBUsername, $strDBPassword, $strDBName);
$lot = "insert into item(
        strKdItem,
        strDeskripsi,
        strUnit,
        strUnit2,
        iRatio2,
        strUnit3,
        iRatio3,
        strItemLoc,
        stsAktif,
        dtCreate,
        usrCreate  
        ) values (
        '$kodebrg',
        '$deskripsibrg',     
        '$unit1brg',
        '$unit2brg',
         $ratio2brg, 
        '$unit3brg',
         $ratio3brg,
        '$lokasibrg',
        1,
        now(),
        '" . $_SESSION['strEmail'] . "');";
$MySQLi->query($lot);

if ($MySQLi->affected_rows == 1) {
    echo "1";
} else {
    echo "0";
}
