<?php

require("includes/check_auth_user.php");
require("includes/dbconnect.php");
include('includes/function.php');

$admin = $_SESSION["admin_" . $dbname];
$zdb = $_SESSION["zdbyear_" . $dbname];
mysqli_select_db($conn, $zdb);
$trandb4 = 'finprodpack';



if ($_REQUEST['prodcode']) {
    $psrno = $_REQUEST["srno"];
    $packing = $_REQUEST["packing"];
    $punit = $_REQUEST["unit"];
    $pqty = $_REQUEST["qty"];
    $prelprod = $_REQUEST["prodcode"];
    $code = $_REQUEST["code"];

    if (mysqli_query($conn, "INSERT INTO `$trandb4`(`code`, `srno`, `packing`, `unit`, `qty`, `relprod`)
                                       VALUES('$code', '$psrno', '$packing', '$punit', '$pqty', '$prelprod')")) {
        echo "success";
    } else {
        echo "fail";
    }
}
    