From aeb6b23889c9e7e04e0748a840a815416cc2862b Mon Sep 17 00:00:00 2001 From: Jonathan Rosenbaum Date: Fri, 4 Aug 2017 06:24:54 +0000 Subject: [PATCH] Adds volunteer history update. --- json/transaction.php | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/json/transaction.php b/json/transaction.php index fa28f2e..02171a6 100644 --- a/json/transaction.php +++ b/json/transaction.php @@ -4,6 +4,7 @@ require_once('../Connections/database_functions.php'); require_once('../Connections/YBDB.php'); mysql_select_db($database_YBDB, $YBDB); + /* require_once('../php-console/src/PhpConsole/__autoload.php'); $handler = PhpConsole\Handler::getInstance(); @@ -272,10 +273,24 @@ $stand_time_value = STAND_TIME_VALUE; echo "First Volunteer History"; } else { // Description may have newlines - $volunteer_history_result = str_replace("\n", "\\n",$result['history']); + $volunteer_history_result = str_replace("\n", "\\n",$result['volunteer']); echo $volunteer_history_result; } } // end Volunteer history - fetch history + + // Volunteer history update + if(isset($_POST['volunteer_history_update'])) { + $json = json_encode($_POST['volunteer_history']); + $query = "UPDATE contacts SET volunteer='$json'" . + ' WHERE contact_id="' . $_POST['contact_id'] . '";'; + $result = mysql_query($query, $YBDB) or die(mysql_error()); + + // show volunteer history + if(isset($_POST['more_than_one'])) { + list_history($_POST['volunteer_history']); + } + } + // Volunteer history update // Transaction history - fetch history if(isset($_POST['history_select'])) {