From: <rc...@us...> - 2017-01-12 16:41:40
|
Revision: 7724 http://sourceforge.net/p/web-erp/reponame/7724 Author: rchacon Date: 2017-01-12 16:41:38 +0000 (Thu, 12 Jan 2017) Log Message: ----------- Removes the "&" before the variable $ResultIndex in ConnectDB_XXX.inc. Modified Paths: -------------- trunk/doc/Change.log trunk/includes/ConnectDB_mysql.inc trunk/includes/ConnectDB_mysqli.inc trunk/includes/ConnectDB_postgres.inc Modified: trunk/doc/Change.log =================================================================== --- trunk/doc/Change.log 2017-01-12 13:54:26 UTC (rev 7723) +++ trunk/doc/Change.log 2017-01-12 16:41:38 UTC (rev 7724) @@ -1,7 +1,7 @@ webERP Change Log +12/01/17 RChacon: Removes the "&" before the variable $ResultIndex in ConnectDB_XXX.inc. 12/1/17 Phil: Added a discount percentage field to the payment methods - to allow calculation of discount when receipts entered... still yet to code this bit -06/01/17 RChacon: Add Turn off/on the page help and the field help. 05/01/17 RChacon: In GLCashFlowsIndirect.php, fix named key in Associative array with config value. Thanks Tim. 05/01/17 RChacon: For strict Standards, removes the "&" before the variable in DB_fetch_row() and in DB_fetch_array() in ConnectDB_XXX.inc. Thanks Tim. 21/12/16 RChacon: In PurchasesReport.php, fix date comparison and title. Thanks Tim. Modified: trunk/includes/ConnectDB_mysql.inc =================================================================== --- trunk/includes/ConnectDB_mysql.inc 2017-01-12 13:54:26 UTC (rev 7723) +++ trunk/includes/ConnectDB_mysql.inc 2017-01-12 16:41:38 UTC (rev 7724) @@ -49,17 +49,13 @@ //DB wrapper functions to change only once for whole application -function DB_query($SQL, - $ErrorMessage='', - $DebugMessage= '', - $Transaction=false, - $TrapErrors=true) { +function DB_query($SQL, $ErrorMessage='', $DebugMessage= '', $Transaction=false, $TrapErrors=true) { global $debug; global $PathPrefix; global $db; - $result=mysql_query($SQL,$db); + $result = mysql_query($SQL, $db); $_SESSION['LastInsertId'] = mysql_insert_id($db); if($DebugMessage == '') { @@ -112,32 +108,32 @@ function DB_fetch_row($ResultIndex) { $RowPointer = mysql_fetch_row($ResultIndex); - Return $RowPointer; + return $RowPointer; } -function DB_fetch_assoc(&$ResultIndex) { +function DB_fetch_assoc($ResultIndex) { $RowPointer = mysql_fetch_assoc($ResultIndex); - Return $RowPointer; + return $RowPointer; } function DB_fetch_array($ResultIndex) { $RowPointer = mysql_fetch_array($ResultIndex); - Return $RowPointer; + return $RowPointer; } function DB_data_seek(&$ResultIndex,$Record) { mysql_data_seek($ResultIndex,$Record); } -function DB_free_result(&$ResultIndex) { +function DB_free_result($ResultIndex) { mysql_free_result($ResultIndex); } -function DB_num_rows(&$ResultIndex) { +function DB_num_rows($ResultIndex) { return mysql_num_rows($ResultIndex); } -function DB_affected_rows(&$ResultIndex) { +function DB_affected_rows($ResultIndex) { return mysql_affected_rows($ResultIndex); } @@ -168,17 +164,17 @@ function DB_show_tables(&$Conn='') { $Result = DB_query('SHOW TABLES'); - Return $Result; + return $Result; } function DB_show_fields($TableName, &$Conn='') { $Result = DB_query("DESCRIBE $TableName"); - Return $Result; + return $Result; } function interval( $val, $Inter ) { - global $DBType; - return "\n".'interval ' . $val . ' '. $Inter."\n"; + global $DBType; + return "\n".'interval ' . $val . ' '. $Inter."\n"; } function DB_Maintenance() { Modified: trunk/includes/ConnectDB_mysqli.inc =================================================================== --- trunk/includes/ConnectDB_mysqli.inc 2017-01-12 13:54:26 UTC (rev 7723) +++ trunk/includes/ConnectDB_mysqli.inc 2017-01-12 16:41:38 UTC (rev 7724) @@ -27,7 +27,7 @@ printf("Connect failed: %s\n", mysqli_connect_error()); session_unset(); session_destroy(); - echo '<p>' . _('Click') . ' ' . '<a href="index.php">' . _('here') . '</a>' . ' ' ._('to try logging in again') . '</p>'; + echo '<p>' . _('Click') . ' ' . '<a href="index.php">' . _('here') . '</a>' . ' ' ._('to try logging in again') . '</p>'; exit(); } @@ -51,22 +51,18 @@ unset ($_SESSION['DatabaseName']); exit; - } + } } //DB wrapper functions to change only once for whole application -function DB_query($SQL, - $ErrorMessage='', - $DebugMessage= '', - $Transaction=false, - $TrapErrors=true) { +function DB_query($SQL, $ErrorMessage='', $DebugMessage= '', $Transaction=false, $TrapErrors=true) { global $debug; global $PathPrefix; global $db; - $result=mysqli_query($db, $SQL); + $result = mysqli_query($db, $SQL); $_SESSION['LastInsertId'] = mysqli_insert_id($db); @@ -120,34 +116,34 @@ function DB_fetch_row($ResultIndex) { $RowPointer=mysqli_fetch_row($ResultIndex); - Return $RowPointer; + return $RowPointer; } -function DB_fetch_assoc(&$ResultIndex) { +function DB_fetch_assoc($ResultIndex) { $RowPointer=mysqli_fetch_assoc($ResultIndex); - Return $RowPointer; + return $RowPointer; } function DB_fetch_array($ResultIndex) { $RowPointer = mysqli_fetch_array($ResultIndex); - Return $RowPointer; + return $RowPointer; } function DB_data_seek(&$ResultIndex,$Record) { mysqli_data_seek($ResultIndex,$Record); } -function DB_free_result(&$ResultIndex) { - if(is_resource($ResultIndex)) { - mysqli_free_result($ResultIndex); - } +function DB_free_result($ResultIndex) { + if(is_resource($ResultIndex)) { + mysqli_free_result($ResultIndex); + } } -function DB_num_rows(&$ResultIndex) { +function DB_num_rows($ResultIndex) { return mysqli_num_rows($ResultIndex); } -function DB_affected_rows(&$ResultIndex) { +function DB_affected_rows($ResultIndex) { global $db; return mysqli_affected_rows($db); @@ -182,12 +178,12 @@ function DB_show_tables($Conn='') { global $db; $Result = DB_query('SHOW TABLES'); - Return $Result; + return $Result; } function DB_show_fields($TableName, $Conn='') { $Result = DB_query("DESCRIBE $TableName"); - Return $Result; + return $Result; } function interval($val, $Inter) { Modified: trunk/includes/ConnectDB_postgres.inc =================================================================== --- trunk/includes/ConnectDB_postgres.inc 2017-01-12 13:54:26 UTC (rev 7723) +++ trunk/includes/ConnectDB_postgres.inc 2017-01-12 16:41:38 UTC (rev 7724) @@ -11,14 +11,14 @@ } if( isset( $DBUser ) && ($DBUser != "") ) { - // if we have a user we need to use password if supplied - $PgConnStr .= " user=".$DBUser; - if( isset( $DBPassword ) && ($DBPassword != "") ) { - $PgConnStr .= " password=".$DBPassword; - } + // if we have a user we need to use password if supplied + $PgConnStr .= " user=".$DBUser; + if( isset( $DBPassword ) && ($DBPassword != "") ) { + $PgConnStr .= " password=".$DBPassword; + } } -global $db; // Make sure it IS global, regardless of our context +global $db; // Make sure it IS global, regardless of our context $db = pg_connect( $PgConnStr ); if( !$db ) { @@ -61,7 +61,7 @@ $SQL = 'rollback'; $Result = DB_query($SQL); if(DB_error_no($Conn) !=0) { - prnMsg('<br />' . _('Error Rolling Back Transaction!!'), '', _('DB DEBUG:') ); + prnMsg('<br />' . _('Error Rolling Back Transaction!!'), '', _('DB DEBUG:') ); } } if($TrapErrors) { @@ -75,32 +75,32 @@ function DB_fetch_row($ResultIndex) { $RowPointer=pg_fetch_row($ResultIndex); - Return $RowPointer; + return $RowPointer; } -function DB_fetch_assoc(&$ResultIndex) { +function DB_fetch_assoc($ResultIndex) { $RowPointer=pg_fetch_assoc($ResultIndex); - Return $RowPointer; + return $RowPointer; } function DB_fetch_array($ResultIndex) { $RowPointer = pg_fetch_array($ResultIndex); - Return $RowPointer; + return $RowPointer; } function DB_data_seek(&$ResultIndex,$Record) { pg_result_seek($ResultIndex,$Record); } -function DB_free_result(&$ResultIndex) { +function DB_free_result($ResultIndex) { pg_free_result($ResultIndex); } -function DB_num_rows(&$ResultIndex) { +function DB_num_rows($ResultIndex) { return pg_num_rows($ResultIndex); } // Added by MGT -function DB_affected_rows(&$ResultIndex) { +function DB_affected_rows($ResultIndex) { return pg_affected_rows($ResultIndex); } @@ -120,7 +120,7 @@ } function DB_escape_string($String) { - Return pg_escape_string(htmlspecialchars($String, ENT_COMPAT, 'ISO-8859-1')); + return pg_escape_string(htmlspecialchars($String, ENT_COMPAT, 'ISO-8859-1')); } function INTERVAL( $val, $Inter ) { @@ -129,13 +129,13 @@ } function DB_show_tables(&$Conn) { $Result =DB_query("SELECT table_name FROM information_schema.tables WHERE table_schema = 'public'"); - Return $Result; + return $Result; } function DB_show_fields($TableName,&$Conn) { $Result = DB_query("SELECT table_name FROM information_schema.tables WHERE table_schema='public' AND table_name='" . $TableName . "'"); if(DB_num_rows($Result)==1) { $Result = DB_query("SELECT column_name FROM information_schema.columns WHERE table_name ='$TableName'"); - Return $Result; + return $Result; } } function DB_Maintenance() { |