From 643b6ed665b9a7efe99adc8c0cc0a6b7ddc928f9 Mon Sep 17 00:00:00 2001 From: bbs2web Date: Wed, 28 Oct 2020 15:17:26 +0200 Subject: [PATCH] Additional PHP 7 modifications Signed-off-by: bbs2web --- common/lib/iam_csvdump.php | 26 +++++++++++++------------- customer/simulator.php | 2 +- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/common/lib/iam_csvdump.php b/common/lib/iam_csvdump.php index d80fa5926..f8e53763e 100644 --- a/common/lib/iam_csvdump.php +++ b/common/lib/iam_csvdump.php @@ -215,13 +215,13 @@ public function _db_connect($dbname="mysql", $user="root", $password="", $host=" public function _db_connect_mysql($dbname="mysql", $user="root", $password="", $host="localhost") { - $result = @mysql_pconnect($host, $user, $password); + $result = @mysqli_connect($host, $user, $password); if (!$result) { // If no connection, return 0 return false; } - if (!@mysql_select_db($dbname)) { // If db not set, return 0 + if (!@mysqli_select_db($result, $dbname)) { // If db not set, return 0 return false; } @@ -272,13 +272,13 @@ public function _generate_csv_mysql($query_string, $dbname="mysql", $user="root" if(!$conn= $this->_db_connect_mysql($dbname, $user , $password, $host)) die("Error. Cannot connect to Database."); else { - $result = @mysql_query($query_string, $conn); + $result = @mysqli_query($conn, $query_string); if(!$result) - die("Could not perform the Query: ".mysql_error()); + die("Could not perform the Query: ".mysqli_error($conn)); else { $file = ""; $crlf = $this->_define_newline(); - while ($str= @mysql_fetch_array($result, MYSQL_NUM)) { + while ($str= @mysqli_fetch_array($result, MYSQLI_NUM)) { $file .= $this->arrayToCsvString($str,",").$crlf; } echo $file; @@ -366,9 +366,9 @@ public function _generate_xml_mysql($query_string, $dbname="mysql", $user="root" if (!$conn= $this->_db_connect_mysql($dbname, $user , $password, $host)) { die("Error. Cannot connect to Database."); } else { - $result = @mysql_query($query_string, $conn); + $result = @mysqli_query($conn, $query_string); if (!$result) { - die("Could not perform the Query: ".mysql_error()); + die("Could not perform the Query: ".mysqli_error($result)); } else { $file = ""; $crlf = $this->_define_newline(); @@ -391,22 +391,22 @@ public function _generate_msqlxml($result=NULL) // Output header row $j = 0; echo "\t
\n"; - $totalFields = @mysql_num_fields($result); + $totalFields = @mysqli_num_fields($result); for ($i=0; $i<$totalFields; $i++) { - $name = htmlspecialchars(@mysql_field_name($result, $i)); - $type = htmlspecialchars(@mysql_field_type($result, $i)); + $name = htmlspecialchars(@mysqli_fetch_field_direct($result, $i)->name); + $type = htmlspecialchars(@mysqli_fetch_field_direct($result, $i)->type); echo "\t\t\n"; } echo "\t
\n"; echo "\t\n"; - $totalRows = @mysql_num_rows($result); - while ($row = @mysql_fetch_array($result, MYSQL_NUM)) { + $totalRows = @mysqli_num_rows($result); + while ($row = @mysqli_fetch_array($result, MYSQLI_NUM)) { $j = 0; echo "\t\t\n"; for ($l = 0; $l < $totalFields; $l++) { - $name = htmlspecialchars(@mysql_field_name($result, $l)); + $name = htmlspecialchars(@mysqli_fetch_field_direct($result, $l)->name); $v = $row[$l]; if ($v != null) { $v = htmlspecialchars($v); diff --git a/customer/simulator.php b/customer/simulator.php index 4798e3c52..c721578e8 100644 --- a/customer/simulator.php +++ b/customer/simulator.php @@ -102,7 +102,7 @@ if ($FG_DEBUG == 1) echo "cardnumber = " . $result[0][0] . " - balance=$balance
"; - if ($A2B->callingcard_ivr_authenticate_light($error_msg)) { + if ($A2B->callingcard_ivr_authenticate_light($error_msg, 0)) { if ($FG_DEBUG == 1) $RateEngine->debug_st = 1;