<?php 

function salesCart($productID, $quantity, $rate, $customerID, $vat, $discount, $docID, $userID){

    $vat = ($quantity*$rate*$vat)/100;
    $discount = ($quantity*$rate*$discount)/100;
    $bsID = getBsid($userID);
    $amount = ($quantity*$rate);

    $query = "INSERT INTO `salesCart`( `ProductID`, `quantity`, `rate`, `customerID`, `discount`, `vatRate`, `Amount`, `payType`, `store`, `docID`, `userID`, `bsID`) 
    VALUES ('$productID','$quantity','$rate','$customerID','$discount','$vat','$amount','na','na','$docID','$userID','$bsID')";

    exe($query);

}

function getBsid($userID){

    return 1;
}

function getDocSC($docID){

    $query = "SELECT * FROM `salesCart` WHERE `docID` = '$docID'";

    return exe($query);
}


function docID(){
    return rand(1,1000);
}
?>