mirror of
https://github.com/fspc/Yellow-Bike-Database.git
synced 2026-09-03 02:11:38 -04:00
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:
@@ -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'])) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user