REQ_NAME = func_get_arg(0);
if ($numargs == 2) {
$this->MOREINFOS = func_get_arg(1);
} else {
$this->MOREINFOS = "";
}
fonctions::silent_error($this->REQ_NAME, $this->MOREINFOS, "no");
if (VARS_DEFS == "online") {
$return = "Erreur d'execution de la requète : $this->REQ_NAME.
\n";
$return .= "Désolé pour l'inconvénient.
\n";
$return .= "Vous pouvez aider à résoudre le problème en le signalant au webmestre.
\n";
$return .= "Erreur ".$this->id_error."\n";
} else {
$this->URI = explode("&", basename($this->REQUEST_URI));
$return = "Erreur requète : $this->REQ_NAME@$this->SCRIPT_FILENAME
\n";
$return .= "Script en cours: $this->SCRIPT_NAME
\n";
$return .= "URI:
\n";
foreach ($this->URI as $key => $val) {
$return .= "$val\n";
}
$return .= "\n";
if (isset($this->MOREINFOS)) $return .= "Plus: $this->MOREINFOS\n";
}
return $return;
}
// Erreur silencieuse
function silent_error() {
$numargs = func_num_args();
$this->REQ_NAME = func_get_arg(0);
if ($numargs >= 2) {
$this->MOREINFOS = func_get_arg(1);
} else {
$this->MOREINFOS = "";
}
$this->REQUEST_URI = $_SERVER['REQUEST_URI'];
$this->SCRIPT_FILENAME = $_SERVER['SCRIPT_FILENAME'];
$this->SCRIPT_NAME = $_SERVER['SCRIPT_NAME'];
if (isset($_SERVER['HTTP_REFERER'])) {
$this->HTTP_REFERER = $_SERVER['HTTP_REFERER'];
} else {
$this->HTTP_REFERER = "";
}
if (VARS_DEFS == "online") {
/*
$DB = new database;
$DB->MysqlConnect();
$DB->dbconnect("zedc_zedcnet");
if (!defined(APPLI)) define("APPLI", "N/D");
$q_error = @mysql_query("INSERT INTO log_error SET
appli = '".APPLI."',
requete = '".$this->REQ_NAME."',
uri = '".$this->REQUEST_URI."',
filename = '".$this->SCRIPT_FILENAME."',
scriptname = '".$this->SCRIPT_NAME."',
moreinfos = '".$this->MOREINFOS."',
provenance = '".$this->HTTP_REFERER."'") or die ("Fatal Error!");
$this->id_error = mysql_insert_id();
*/
$this->id_error = 0;
} elseif (func_num_args(2) == "no") {
$this->URI = explode("&", basename($REQUEST_URI));
$return = "Erreur requète : $this->REQ_NAME@$this->SCRIPT_FILENAME
\n";
$return .= "Script en cours: $this->SCRIPT_NAME
\n";
$return .= "URI:
\n";
foreach ($this->URI as $key => $val) {
$return .= "$val\n";
}
$return .= "\n";
if (isset($this->MOREINFOS)) $return .= "Plus: $this->MOREINFOS\n";
return $return;
}
}
function erreur() {
// erreur(int code, [string message,] string reaction "back" "stay")
$numargs = func_num_args();
$code = func_get_arg(0);
if ($numargs == 2) {
$react = func_get_arg(1);
} elseif ($numargs == 3) {
$message = func_get_arg(1);
$react = func_get_arg(2);
}
if (!isset($message)) {
// if($code == 0) $message = "";
if($code == 1) $message = "Enregistrement OK";
if($code == 2) $message = "Modification OK";
if($code == 3) $message = "Suppression OK";
if($code == 51) $message = "Information manquante";
if($code == 52) $message = "Erreur d\'execution de la requète";
if($code == 53) $message = "Erreur d\'execution";
if($code == 54) $message = "Information incohérente";
if($code == 55) $message = "Le lien ne répond pas";
if($code == 56) $message = "Date incohérente";
if($code == 100) $message = $message;
}
print"\n";
return $print;
}
}// fin class
require_once(COMMON_PATH . "Browser.php");
$Browser = new Browser();
if( $Browser->getBrowser() == Browser::BROWSER_IE ) {
define("BROWSER", "IE");
} else {
define("BROWSER", "NOIE");
}
if( $Browser->getBrowser() == Browser::BROWSER_FIREFOX ) {
define("BROWSER_FF", "YES");
} else {
define("BROWSER_FF", "NO");
}
$Func = new fonctions;
$DbFunc = new database;
?>