<?php
session_start();
require_once 'db_connection.php'; 
$user_id = $_SESSION['user_id'];
$today = date('Y-m-d H:i:s');

$product = $_POST['product'];
$price = $_POST['price'];
$qty = $_POST['qty'];
$dis = $_POST['dis'];

if(!$product>0){
	echo "Select Product...";
}elseif (!$price>0) {
	echo "Enter price..";
}elseif (!$qty>0) {
	echo "Enter Quantity..";
}else{


$sql = "INSERT INTO quotation_items (qi_no, qi_pro_id, qi_pro_price, qi_pro_qty, qi_pro_discount, qi_user, qi_date)
VALUES (0, '$product', '$price', '$qty', '$dis', '$user_id', '$today')";

if ($conn->query($sql) === TRUE) {
  echo 1;
} else {
  echo "Error: " . $sql . "<br>" . $conn->error;
}

$conn->close();


}

?>