Added editable Change Fund.

1. Mouseover allows edit of Change Fund.
2. Difference is shown, and stored in db for page reloads.
This commit is contained in:
Jonathan Rosenbaum
2015-01-10 07:54:12 +00:00
parent 33b4d29417
commit d16811fe95
7 changed files with 628 additions and 3 deletions
+14
View File
@@ -4,6 +4,7 @@ require_once('../Connections/database_functions.php');
require_once('../Connections/YBDB.php');
mysql_select_db($database_YBDB, $YBDB);
$change_fund = CHANGE_FUND;
// Is there a current shop?
if(isset($_POST['shop_exist'])) {
@@ -45,6 +46,19 @@ mysql_select_db($database_YBDB, $YBDB);
}
// Editable Change Fund
if(isset($_POST['editable_change'])) {
$transaction_id = split('_', $_POST['id'], 1);
$query = 'UPDATE transaction_log set change_fund="' . $_POST['editable_change'] . '" WHERE transaction_id="' . $transaction_id[0] . '";';
$result = mysql_query($query, $YBDB) or die(mysql_error());
$send_back = array(
"changed_change" => $_POST['editable_change'],
"change" => $change_fund,
);
echo json_encode($send_back);
}
// Deposit Calculator
if (isset($_POST['deposit'])) {