function pr($variable, $name = null, $color = 'fff') { if (!Manager_Config::isDev()) { return; } // Panda_Exam::vrd(); echo '<br style="clear:both;" />' . '<pre style="width:100%;clear:both;height: 100px;overflow: auto;font-size:12px;margin:10px 40px;text-align:left;;color:red;z-index:1000;width:100%;background:#000;position: fixed;bottom:0;;">'; echo '<br/>************************** '; if ($name != null) { echo '<span style="color:#fff;">' . $name . '</span>'; } if (is_array($variable)) { echo ' [tablica] *******************<br/>'; print_r($variable); } elseif (is_object($variable)) { echo ' [object] *******************<br/>'; print_r($variable); } elseif (is_bool($variable)) { echo ' [boolean] *******************<br/>'; var_dump($variable); } else { if (is_string($variable)) { echo ' [string] *******************<br/>'; } elseif (is_int($variable)) { echo ' [integer] *******************<br/>'; } elseif (is_float($variable)) { echo ' [float] *******************<br/>'; } elseif (is_null($variable)) { echo ' [null] *******************<br/>'; } else { echo ' [nierozpoznany] *******************<br/>'; } echo $variable; } echo '<br/>********************************************************* <br/>'; echo '</pre>'; }
public function throwErrorDB($aQuery = null, $message = null) { if (self::$_db->error) { try { throw new Exception($message . ' MySQL error: ' . self::$_db->error . ' <br/> Query:<br/> ' . $aQuery, self::$_db->errno); } catch (Exception $e) { //printuje bledy gdy ustawienie w config na to zezwala if (Manager_Config::isDev()) { $this->showErrorsDB("Error No: " . $e->getCode() . " - " . $e->getMessage()); $this->showErrorsDB(nl2br($e->getTraceAsString())); } else { $this->showErrorsDB('Wystąpił błąd prosimy ponowić'); } $this->_error = true; return false; } } else { return true; } }