From fa3c3eebf0bcb867c0d1d3fb19c0f28c5292bd68 Mon Sep 17 00:00:00 2001 From: FusionPBX Date: Sat, 23 Nov 2019 10:00:18 -0700 Subject: [PATCH] Update database_transaction_edit.php --- .../database_transaction_edit.php | 60 +++++++++++-------- 1 file changed, 35 insertions(+), 25 deletions(-) diff --git a/app/database_transactions/database_transaction_edit.php b/app/database_transactions/database_transaction_edit.php index 40fcb6c2e2..bf7c367875 100644 --- a/app/database_transactions/database_transaction_edit.php +++ b/app/database_transactions/database_transaction_edit.php @@ -17,7 +17,7 @@ The Initial Developer of the Original Code is Mark J Crane - Portions created by the Initial Developer are Copyright (C) 2016 - 2018 + Portions created by the Initial Developer are Copyright (C) 2016 - 2019 the Initial Developer. All Rights Reserved. Contributor(s): @@ -43,15 +43,14 @@ $text = $language->get(); //set the variables - if (is_uuid($_REQUEST["id"])) { - $database_transaction_uuid = $_REQUEST["id"]; + if (is_uuid($_GET["id"])) { + $database_transaction_uuid = $_GET["id"]; $search = $_GET['search']; $page = $_GET['page']; } //pre-populate the form - if (count($_GET) > 0 && $_POST["persistformvar"] != "true") { - $database_transaction_uuid = $_GET["id"]; + if (count($_GET) > 0 && is_uuid($_GET["id"]) && $_POST["persistformvar"] != "true") { $sql = "select "; $sql .= "t.database_transaction_uuid, d.domain_name, u.username, t.user_uuid, t.app_name, t.app_uuid, "; @@ -84,7 +83,7 @@ } //undo the transaction - if ($_GET['action'] == 'undo' && ($transaction_type = 'delete' || $transaction_type = 'update')) { + if ($_GET['action'] == 'undo' && ($transaction_type == 'delete' || $transaction_type == 'update')) { //get the array $array = json_decode($transaction_old, true); @@ -118,14 +117,13 @@ echo " \n"; echo " ".$text['title-database_transaction']."

\n"; echo " \n"; - if ($transaction_type = 'delete' || $transaction_type = 'update') { + if ($transaction_type == 'delete' || $transaction_type == 'update') { echo " "; } echo " "; echo " \n"; echo " \n"; echo "\n"; - echo "\n"; echo "
\n"; echo " \n"; @@ -134,7 +132,7 @@ echo " ".$text['label-app_name']."\n"; echo " \n"; echo " \n"; echo " \n"; echo " \n"; @@ -288,10 +286,10 @@ $_SESSION['previous_name'] = $_SESSION['name']; $_SESSION['previous_row'] = $_SESSION['row']; //show the results - echo "\n"; - echo " \n"; - echo " \n"; - echo " "; + echo "\n"; + echo " \n"; + echo " \n"; + echo " "; echo "\n"; //echo "
\n"; - echo " ".$app_name."\n"; + echo " ".escape($app_name)."\n"; echo "
".$key."".$old."".$new."
".escape($key)."".escape($old)."".escape($new)."
\n"; } @@ -342,21 +340,19 @@ } } } - + echo "
\n"; echo "\n"; foreach($array as $row) { if ($row['schema'] !== $previous_schema || $row['row'] !== $previous_row) { echo "\n"; echo "\n"; - echo " \n"; + echo " \n"; echo " \n"; echo "\n"; } - echo "\n"; - //echo " \n"; - //echo " \n"; - echo " \n"; - echo " \n"; + echo "\n"; + echo " \n"; + echo " \n"; echo "\n"; $previous_schema = $row['schema']; @@ -399,6 +395,7 @@ $_SESSION['table_header'] = $table_header; //show the difference + echo "
\n"; echo "
 
".$row['schema']."".escape($row['schema'])."value
".$row['schema']."".$row['row']."".$row['name']."".$row['value']."
".escape($row['name'])."".escape($row['value'])."
\n"; show_difference($array); echo "
\n"; @@ -407,11 +404,24 @@ //show the delete if ($transaction_type == "delete") { - //echo "

Record Deleted


\n"; - echo "
\n"; - echo "
\n";
-		print_r($before);
-		echo "
\n"; + echo "

\n"; + echo "\n"; + foreach($before as $table_name => $rows) { + echo " \n"; + echo " \n"; + echo " \n"; + foreach ($rows as $row) { + foreach ($row as $key => $value) { + echo " \n"; + echo " \n"; + echo " \n"; + } + echo " \n"; + echo " \n"; + echo " \n"; + } + } + echo "
".escape($table_name)." 
".escape($key)."".escape($value)."


\n"; } //add a few lines at the end