Correct transaction_id for storage transactions in history.

This commit is contained in:
Jonathan Rosenbaum
2015-02-08 09:00:06 +00:00
parent b54cfe2312
commit 8f8e1623df
2 changed files with 34 additions and 2 deletions
+10
View File
@@ -89,6 +89,7 @@ $change_fund = CHANGE_FUND;
}
}
// Transaction history - fetch history
if(isset($_POST['history_select'])) {
$query = 'SELECT history FROM transaction_log WHERE transaction_id="' . $_POST['transaction_id'] . '";';
$sql = mysql_query($query, $YBDB) or die(mysql_error());
@@ -100,6 +101,7 @@ $change_fund = CHANGE_FUND;
}
}
// Transaction history - update transaction history
if(isset($_POST['history_update'])) {
$json = json_encode($_POST['history']);
$query = "UPDATE transaction_log SET history='$json'" .
@@ -108,6 +110,14 @@ $change_fund = CHANGE_FUND;
//echo ;
}
// Check for most recent transaction_id if transaction_id has changed
if(isset($_POST['most_recent_transaction_id'])) {
$query = 'SELECT MAX(transaction_id) as transaction_id FROM transaction_log;';
$sql = mysql_query($query, $YBDB) or die(mysql_error());
$result = mysql_fetch_assoc($sql);
echo $result['transaction_id'];
}
// check if start storage date has been changed since original shop date
if(isset($_POST['date_startstorage'])) {
$query = 'SELECT shops.date FROM transaction_log, shops WHERE transaction_id=' . $_POST['transaction_id'] .