function ewr_ErrorFn($DbType, $ErrorType, $ErrorNo, $ErrorMsg, $Param1, $Param2, $Object) { if ($ErrorType == 'CONNECT') { if ($DbType == "ado_access" || $DbType == "ado_mssql") { $msg = "Failed to connect to database. Error: " . $ErrorMsg; } else { $msg = "Failed to connect to {$Param2} at {$Param1}. Error: " . $ErrorMsg; } } elseif ($ErrorType == 'EXECUTE') { if (defined("EWR_DEBUG_ENABLED") && EWR_DEBUG_ENABLED) { $msg = "Failed to execute SQL: {$Param1}. Error: " . $ErrorMsg; } else { $msg = "Failed to execute SQL. Error: " . $ErrorMsg; } } if (function_exists("ewr_AddMessage") && defined("EWR_SESSION_FAILURE_MESSAGE")) { ewr_AddMessage($_SESSION[EWR_SESSION_FAILURE_MESSAGE], $msg); } else { echo "<div class=\"alert alert-danger ewError\">" . $msg . "</div>"; } }
function setWarningMessage($v) { ewr_AddMessage($_SESSION[EWR_SESSION_WARNING_MESSAGE], $v); }
function ewr_ErrorFn($DbType, $ErrorType, $ErrorNo, $ErrorMsg, $Param1, $Param2, $Object) { if ($ErrorType == 'CONNECT') { $msg = "Failed to connect to {$Param2} at {$Param1}. Error: " . $ErrorMsg; } elseif ($ErrorType == 'EXECUTE') { if (EWR_DEBUG_ENABLED) { $msg = "Failed to execute SQL: {$Param1}. Error: " . $ErrorMsg; } else { $msg = "Failed to execute SQL. Error: " . $ErrorMsg; } } ewr_AddMessage($_SESSION[EWR_SESSION_FAILURE_MESSAGE], $msg); }