<?php

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

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


$shift = $_REQUEST["shift"];
$vouchno = $_REQUEST["vouchno"];
$netsale = $_REQUEST["netsale"];
$prodcode = $_REQUEST["prodcode"];
$vouchdt = $_REQUEST["vouchdt"];
$pumpno = $_REQUEST["pumpno"];
mysqli_query($conn, "Delete from `save_read_temp` where vouchno = '$vouchno' and pumpno = '$pumpno' and prodcode='$prodcode'");
if ($netsale > 0) {
    mysqli_query($conn, "INSERT INTO `save_read_temp`(`vouchno`, `netsale`, `prodcode`,shift, vouchdt,pumpno)
                                    VALUES('$vouchno', '$netsale', '$prodcode','$shift', '$vouchdt','$pumpno')") or die(mysqli_error($conn));
}
?>
