$PurchasedQuantity = $_POST['QuantityPurchased']; $PurchasedBranch = $_POST['BranchPurchased']; $PurchasedQuery = "SELECT Quantity FROM Has Where barcode = " . $PurchasedBarcode . " and bID = " . $PurchasedBranch . ""; $PurchasedSelected = OCI_parse($dbhandle, $PurchasedQuery); $resultof = OCI_execute($PurchasedSelected); while ($row = OCI_Fetch_ASSOC($PurchasedSelected)) { $finaldestinationQuantity = $row['QUANTITY']; } $newupdatedquantityeye = $finaldestinationQuantity - $PurchasedQuantity; echo $newupdatedquantityeye; $date = strtotime("+15 day"); $endDate = date('M d, Y', $date); $receiptNumber = 999999999999; $receiptNumber = $receiptNumber - 1; $PurchasedQueryone = "update has set Quantity = " . $newupdatedquantityeye . " Where barcode = " . $PurchasedBarcode . ""; $RecieptUpdateQuery = "Insert INTO PurchaseExpDate VALUES(" . $receiptNumber . ", '" . $endDate . "')"; $PurchasedSelectedone = OCI_parse($dbhandle, $PurchasedQueryone); $PurchasedReciept = OCI_parse($dbhandle, $RecieptUpdateQuery); $resultonethousand = OCI_execute($PurchasedSelectedone); if (!$resultonethousand) { echo "bleh"; } $resulttwothousand = OCI_execute($PurchasedReciept); if (!$resulttwothousand) { echo "blah"; } OCICommit($dbhandle); } ?>
<html> <body> List: <?php $db_conn = oci_connect("ora_r3v8", "a21491139", "ug"); $productname = $_POST['name']; $query = "SELECT distinct NAME FROM PRODUCTBARCODE WHERE name = '" . '%$productname%' . "'"; $selected = OCI_parse(db_conn, $query); $success = OCI_execute($selected); ?> </body> </html>