v1
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<?php
|
||||
|
||||
define( 'EOL', "\n" );
|
||||
define( 'EOLH', "</br>" );
|
||||
define( 'EOLH', "<br>\n" );
|
||||
define( 'LF', "\r\n" );
|
||||
define( 'TAB', "\t" );
|
||||
|
||||
@@ -20,14 +20,9 @@ $site = "Avion Poème";
|
||||
$dossier = "/www";
|
||||
$basedir = dirname( $_SERVER['DOCUMENT_ROOT'] ) . $dossier;
|
||||
|
||||
$base_url = "https://avion-poe.me";
|
||||
$base_url = "http://avion-poe.me";
|
||||
$base_path = "/flex/storage/avion-poe.me/site/www/";
|
||||
//$url_admin = $base_url . "/admin";
|
||||
$url_admin = $base_url . "/gestion";
|
||||
$accueil = $base_url . "/index.html";
|
||||
|
||||
if ( !isset( $_SESSION['base_url']) )
|
||||
{
|
||||
$_SESSION['base_url'] = $base_url;
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -7,6 +7,7 @@ if ( !isset($site) )
|
||||
|
||||
require_once "config.inc.php";
|
||||
require_once "log.php";
|
||||
require_once "fonctions.inc.php";
|
||||
require_once "envoi_courriel.inc.php";
|
||||
|
||||
$table_prefix = "";
|
||||
@@ -30,6 +31,7 @@ class db
|
||||
public $startLon;
|
||||
public $startName;
|
||||
public $startTime;
|
||||
public $startTimeRFC822;
|
||||
public $startTZ;
|
||||
public $destMail;
|
||||
public $destLat;
|
||||
@@ -38,9 +40,13 @@ class db
|
||||
public $public;
|
||||
public $color;
|
||||
public $deliveryTime;
|
||||
public $deliveryTimeRFC822;
|
||||
public $deliveryTZ;
|
||||
public $deliveryTimeServer;
|
||||
public $deliveryMethod;
|
||||
public $avionJournalier;
|
||||
public $urlAvion;
|
||||
|
||||
// peripeties
|
||||
public $idPeripetie;
|
||||
public $datePeripetie;
|
||||
@@ -58,7 +64,7 @@ class db
|
||||
$this->connect = new mysqli( $this->server, $this->user, $this->passwd, $this->database );
|
||||
if ( $this->connect->connect_errno )
|
||||
{
|
||||
log_error( "Échec de la connexion : => " . $this->connect->connect_error . "<br />" . __file__ . ' ligne ' . __line__);
|
||||
log_error( "Échec de la connexion : => " . $this->connect->connect_error . "<br />" . __file__ . ' ligne ' . __line__, false,false);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -91,6 +97,7 @@ class db
|
||||
|
||||
function newPlane() //return 0 on error
|
||||
{
|
||||
global $base_url;
|
||||
$query = "INSERT INTO avionpoeme VALUES ('0','";
|
||||
$query .= $this->protect($this->message) . "', '";
|
||||
$query .= $this->protect($this->expeMail) . "', ";
|
||||
@@ -117,10 +124,45 @@ class db
|
||||
$this->query($query);
|
||||
$this->uid = $this->connect->insert_id;
|
||||
echo "{'uid':'" . $this->uid . "'}";
|
||||
$this->startTimeRFC822 = formatteDate( $this->expeLang, $this->startTime, $this->startTZ);
|
||||
$this->deliveryTimeRFC822 = formatteDate( $this->destLang, $this->deliveryTime, $this->deliveryTZ );
|
||||
$this->urlAvion = $base_url . "/?avionpoeme=" . $this->uid;
|
||||
courrielEnvoi($this);
|
||||
$this->newPeripetie();
|
||||
}
|
||||
|
||||
function getPlane($uid)
|
||||
{
|
||||
global $base_url;
|
||||
$query = "SELECT idAvion, message, expeMail, expeKnown, expeLang, destLang, startLat, startLon, startName, UNIX_TIMESTAMP(startTime) as startTime, startTZ, destMail, destLat, destLon, destName, color, UNIX_TIMESTAMP(deliveryTime) as deliveryTime, deliveryTZ, UNIX_TIMESTAMP(deliveryTimeServer) as deliveryTimeServer, deliveryMethod, public FROM avionpoeme WHERE idAvion='" . $uid ."'";
|
||||
$this->query($query);
|
||||
$plane = $this->result->fetch_array(MYSQLI_ASSOC);
|
||||
$this->message = $plane["message"];
|
||||
$this->expeMail = $plane["expeMail"];
|
||||
$this->expeKnown = $plane["expeKnown"];
|
||||
$this->expeLang = $plane["expeLang"];
|
||||
$this->destLang = $plane["destLang"];
|
||||
$this->startLat = $plane["startLat"];
|
||||
$this->startLon = $plane["startLon"];
|
||||
$this->startName = $plane["startName"];
|
||||
$this->startTime = $plane["startTime"];
|
||||
$this->startTZ = $plane["startTZ"];
|
||||
$this->startTimeRFC822 = formatteDate( $this->expeLang, $this->startTime, $this->startTZ);
|
||||
$this->destMail = $plane["destMail"];
|
||||
$this->destLat = $plane["destLat"];
|
||||
$this->destLon = $plane["destLon"];
|
||||
$this->destName = $plane["destName"];
|
||||
$this->color = $plane["color"];
|
||||
$this->deliveryTime = $plane["deliveryTime"];
|
||||
$this->deliveryTZ = $plane["deliveryTZ"];
|
||||
$this->deliveryTimeRFC822 = formatteDate( $this->destLang, $this->deliveryTime, $this->deliveryTZ );
|
||||
$this->deliveryTimeServer = $plane["deliveryTimeServer"];
|
||||
$this->deliveryMethod = $plane["deliveryMethod"];
|
||||
$this->public = $plane["public"];
|
||||
$this->uid = $plane["idAvion"];
|
||||
$this->urlAvion = $base_url . "/?avionpoeme=" . $this->uid;
|
||||
}
|
||||
|
||||
function getCurrentPlanes()
|
||||
{
|
||||
$query = "SELECT idAvion as uid, UNIX_TIMESTAMP(deliveryTime) as deliveryTime, deliveryTZ, destLat, destLon, destName, UNIX_TIMESTAMP(startTime) as startTime, startTZ, startLon, startLat, startName, color FROM avionpoeme WHERE deliveryTimeServer>NOW()";
|
||||
@@ -143,7 +185,7 @@ class db
|
||||
}else //renvoie les lignes d'anthologie
|
||||
{
|
||||
if ($page > $n_pages) $page=$n_pages;
|
||||
$query = "SELECT UNIX_TIMESTAMP(startTime) as startTime, startTZ, startName, message, UNIX_TIMESTAMP(deliveryTime) as deliveryTime , deliveryTZ, destName FROM avionpoeme WHERE deliveryTimeServer<NOW() AND public='1' ORDER BY startTime DESC LIMIT " . ($page-1)*RESULTS_BY_PAGE . "," . RESULTS_BY_PAGE;
|
||||
$query = "SELECT UNIX_TIMESTAMP(startTime) as startTime, startTZ, startName, message, UNIX_TIMESTAMP(deliveryTime) as deliveryTime , deliveryTZ, destName FROM avionpoeme WHERE deliveryTimeServer<NOW() AND public='1' ORDER BY deliveryTime DESC LIMIT " . ($page-1)*RESULTS_BY_PAGE . "," . RESULTS_BY_PAGE;
|
||||
$this->query($query);
|
||||
$planes = $this->result->fetch_all(MYSQLI_ASSOC);
|
||||
print json_encode($planes, JSON_FORCE_OBJECT);
|
||||
@@ -153,11 +195,12 @@ class db
|
||||
|
||||
function savePeripetie()
|
||||
{
|
||||
global $db;
|
||||
|
||||
$query = "INSERT INTO avionPeripetie VALUES ('0','";
|
||||
$query .= $this->protect($this->uid) . "','";
|
||||
$query .= $this->protect($this->idPeripetie) . "', ";
|
||||
$query .= "FROM_UNIXTIME(" . $this->protect($this->datePeripetie) . "))";
|
||||
$query .= "FROM_UNIXTIME(" . $this->protect($this->datePeripetie) . "), '0')";
|
||||
log_write("savePeripetie " . $query);
|
||||
//$query .= $this->protect($this->effetPeripetie) . "', '";
|
||||
//$query .= $this->protect($this->expeMail) . "', '";
|
||||
//$query .= $this->protect($this->destMail) . "')"; echo $query . EOL;
|
||||
@@ -166,27 +209,29 @@ class db
|
||||
|
||||
function newPeripetie()
|
||||
{
|
||||
global $db;
|
||||
|
||||
$query = "SELECT *, DATEDIFF(quand,CURDATE()) as datePeripetie FROM peripeties WHERE quand IS NULL";
|
||||
echo $query .EOL;
|
||||
$this->query($query);
|
||||
$this->startTime = 1616584838;
|
||||
$this->deliveryTime = 1617469941;
|
||||
while ( ($result = $this->result->fetch_assoc()) )
|
||||
{
|
||||
print_r($result["idPeripetie"]);
|
||||
$this->idPeripetie = $result["idPeripetie"];
|
||||
if ((mt_rand(0,100) <= $result["probabilite"])) //calcul de la probabilité de la péripétie
|
||||
{
|
||||
print $this->startTime . "=>" . $this->deliveryTime . "===>";
|
||||
log_write("newPeripetie");
|
||||
$this->datePeripetie = mt_rand($this->startTime, $this->deliveryTime); //ajustement de l'effet
|
||||
print $this->datePeripetie . "EOL";
|
||||
$this->savePeripetie();
|
||||
break; //une seule péripétie par avionpoème. Enlever le break si pas de limites sur le nombre de péripéties
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function avionJournalier()
|
||||
{
|
||||
$query = "SELECT COUNT(*) as count FROM avionpoeme WHERE DATEDIFF(startTime, NOW())=0";
|
||||
$this->query($query);
|
||||
$result = $this->result->fetch_assoc();
|
||||
$this->avionJournalier = $result["count"];
|
||||
return $this->avionJournalier;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
@@ -1,15 +1,7 @@
|
||||
<?php
|
||||
require_once 'log.php';
|
||||
require_once 'fonctions.inc.php';
|
||||
|
||||
function getLang( $lang )
|
||||
{
|
||||
$dico = array();
|
||||
$fh = fopen('lang/'.$lang, 'r');
|
||||
$str = fgets($fh);
|
||||
fclose($fh);
|
||||
$dico = json_decode($str, true);
|
||||
return $dico;
|
||||
}
|
||||
|
||||
function courrielEnvoi( $db )
|
||||
{
|
||||
@@ -17,6 +9,11 @@ function courrielEnvoi( $db )
|
||||
$dicoDest = getLang( $db->destLang );
|
||||
$expediteurIndex = "Notification_denvoi_Expediteur";
|
||||
//print "envoi du courriel" . EOL;
|
||||
|
||||
// Message à l'expéditeur
|
||||
$indexObjet = "Objet_" . $expediteurIndex;
|
||||
$objetMail = replaceVariables($db, $dicoExpe[$indexObjet], $dicoExpe);
|
||||
$mailText = replaceVariables($db, $dicoExpe[$expediteurIndex], $dicoExpe) .EOL .EOL ;
|
||||
if ( $db->expeKnown == false )
|
||||
{
|
||||
$destinataireIndex = "Notification_denvoi_Destinataire_ExpediteurConnu";
|
||||
@@ -24,49 +21,49 @@ function courrielEnvoi( $db )
|
||||
{
|
||||
$destinataireIndex = "Notification_denvoi_Destinataire_ExpediteurAnonyme";
|
||||
}
|
||||
$indexObjet = "Objet_" . $expediteurIndex;
|
||||
$objetMail = $dicoExpe[$indexObjet];
|
||||
$mailText = $dicoExpe[$expediteurIndex] .EOL .EOL ;
|
||||
|
||||
envoiMail( $db->expeMail, $objetMail, $mailText, true);
|
||||
saveMail( $db, $db->expeMail, $objetMail, $mailText);
|
||||
|
||||
// message au destinataire
|
||||
$indexObjet = "Objet_" . $destinataireIndex;
|
||||
$objetMail = $dicoExpe[$indexObjet];
|
||||
$mailText = $dicoExpe[$destinataireIndex] .EOL .EOL ;
|
||||
//sleep (1);
|
||||
envoiMail( $db->destMail, $objetMail, $mailText, true);
|
||||
$objetMail = replaceVariables($db, $dicoExpe[$indexObjet], $dicoDest);
|
||||
$mailText = replaceVariables($db, $dicoDest[$destinataireIndex], $dicoDest) .EOL .EOL ;
|
||||
|
||||
saveMail( $db, $db->destMail, $objetMail, $mailText);
|
||||
}
|
||||
|
||||
function courrielArrivee($uid)
|
||||
function saveMail( $db, $destinataire, $objet, $text, $html=FALSE)
|
||||
{
|
||||
//TODO
|
||||
$query = "INSERT INTO courriels VALUES ('0', '" . $db->protect($destinataire) . "', '" . $db->protect($objet) . "', '" . $db->protect($text) . "', '" . (int)$html . "')";
|
||||
$db->query($query);
|
||||
}
|
||||
|
||||
function envoiMail($destinataire, $sujet, $text, $html=false)
|
||||
function envoiMail($destinataire, $sujet, $text, $html=false, $cc='', $bcc='')
|
||||
{
|
||||
|
||||
$headers = "From: contact@avion-poe.me" . LF;
|
||||
if ($html)
|
||||
{
|
||||
$headers .= "Content-type: text/html; charset=UTF-8" . LF;
|
||||
}else
|
||||
if ( !empty($cc)) $headers .= "Cc: " . $cc . LF;
|
||||
if ( !empty($bcc)) $headers .= "Bcc: " . $bcc . LF;
|
||||
|
||||
if (empty($html))
|
||||
{
|
||||
$headers .= "Content-type: text/plain; charset=UTF-8" . LF;
|
||||
}else
|
||||
{
|
||||
$headers .= "Content-type: text/html; charset=UTF-8" . LF;
|
||||
nl2br($text);
|
||||
}
|
||||
$headers .= "DATE: " . date( 'r' ) . LF . LF;
|
||||
|
||||
log_write(__FILE__ . __LINE__ . " Envoi d'un courriel à " . $text . "sujet:" . $sujet, INFO);
|
||||
log_write(__FILE__ . __LINE__ . " Envoi d'un courriel à " . $destinataire . "sujet:" . $sujet, INFO);
|
||||
if( !mail($destinataire, $sujet, wordwrap($text, 70 , "\r\n"), $headers) ) //Sending mail
|
||||
{
|
||||
log_write(__FILE__ . EOL . __LINE__ . EOL . "Le courriel n'est pas parti:" .$text . EOL . $sujet . EOL, ERROR);
|
||||
return 0;
|
||||
log_write(__FILE__ . EOL . __LINE__ . EOL . "Le courriel n'est pas parti:" .$destinataire . EOL . $sujet, ERROR);
|
||||
return false;
|
||||
}else
|
||||
{
|
||||
log_write(__FILE__ . EOL . __LINE__ . EOL . "Le courriel est parti:" .$text . EOL, INFO);
|
||||
return 1;
|
||||
log_write(__FILE__ . EOL . __LINE__ . EOL . "Le courriel est parti: " . $destinataire . EOL . "text:" . $text, INFO);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
require_once 'log.php';
|
||||
if ( !isset($site) )
|
||||
{
|
||||
require_once( "config.inc.php" );
|
||||
@@ -36,3 +37,69 @@ function mb_ucfirst($str) {
|
||||
return $char . $str;
|
||||
}
|
||||
|
||||
function getLang( $lang )
|
||||
{
|
||||
$dico = array();
|
||||
if ( empty($lang) )
|
||||
{
|
||||
$lang="en";
|
||||
}
|
||||
if (($fh = fopen('lang/'.$lang, 'r') ))
|
||||
{
|
||||
$str = fgets($fh);
|
||||
fclose($fh);
|
||||
$dico = json_decode($str, true);
|
||||
return $dico;
|
||||
}
|
||||
}
|
||||
|
||||
function formatteDate($locale, $date, $tz)
|
||||
{
|
||||
$formatter = new IntlDateFormatter($locale, IntlDateFormatter::FULL, IntlDateFormatter::FULL, $tz, IntlDateFormatter::GREGORIAN );
|
||||
if ($formatter == null)
|
||||
{
|
||||
log_write(InvalidConfigException(intl_get_error_message()));
|
||||
}
|
||||
return $formatter->format($date);
|
||||
}
|
||||
|
||||
function replaceVariables($db, $text, $dico)
|
||||
{
|
||||
$variables = array( 'expediteur' => 'expeMail', 'destinataire' => 'destMail', 'date_depart' => 'startTimeRFC822', 'date_arrivee' => 'deliveryTimeRFC822', 'new_date_arrivee' => 'datePeripetie', 'message' => 'message', 'url_avion' => 'url_avion', 'onglet_apropos' => 'onglet_apropos', 'NB_avion_poeme' => 'avionJournalier', "url_avion" => "urlAvion");
|
||||
$posVar = 0 ;
|
||||
$x =0;
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
$posVar = strpos( $text, "$", $posVar);
|
||||
if ($posVar !== false)
|
||||
{
|
||||
if ($x++ >10 ) break;
|
||||
$posEsp = strpos( $text, " ", $posVar);
|
||||
if ($posEsp === false)
|
||||
{
|
||||
$var = substr($text, $posVar+1, strlen($text)-$posVar);
|
||||
}else
|
||||
{
|
||||
$var = substr($text, $posVar+1, $posEsp-$posVar-1);
|
||||
}
|
||||
$var = trim($var, " .\n\r");
|
||||
$posVar = $posEsp+1;
|
||||
$varReplace = "$" . $var;
|
||||
if ( isset ($variables[$var]) )
|
||||
{
|
||||
$dbVar = $variables[$var];
|
||||
$text = str_replace($varReplace, $db->$dbVar, $text);
|
||||
}elseif ( isset ($dico[$var]) )
|
||||
{
|
||||
$text = str_replace($varReplace, $dico[$var], $text);
|
||||
}else
|
||||
{
|
||||
log_error( "La variable => " . $var . "n'est pas reconnue<br />" . __file__ . ' ligne ' . __line__ . "\n" , true, false);
|
||||
}
|
||||
}else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
return $text;
|
||||
}
|
||||
|
@@ -10,8 +10,8 @@ require_once 'envoi_courriel.inc.php';
|
||||
// $level => INFO, ALERT, ERROR
|
||||
function log_write($log, $level=INFO)
|
||||
{
|
||||
require_once( "envoi_courriel.inc.php" );
|
||||
global $table_prefix, $webmaster;
|
||||
//require_once( "envoi_courriel.inc.php" );
|
||||
global $table_prefix, $webmaster, $db;
|
||||
$user = ( !empty( $_SERVER["PHP_AUTH_USER"])?$_SERVER["PHP_AUTH_USER"]:'' );
|
||||
$log_mail = str_replace ( "<br />", "\n", $log ) . "\n";
|
||||
$log_mail .= ( !empty( $_SERVER["REQUEST_METHOD"])?'$_SERVER["REQUEST_METHOD"]' . $_SERVER["REQUEST_METHOD"] . "\n":'' );
|
||||
@@ -25,29 +25,30 @@ function log_write($log, $level=INFO)
|
||||
$log_mail .= "Utilisateur: $user \n";
|
||||
$log_mail .= ( !empty( $_SERVER["ORIG_PATH_INFO"])?'$_SERVER["ORIG_PATH_INFO"]' . $_SERVER["ORIG_PATH_INFO"] . "\n":'' );
|
||||
$log_mail .= ( !empty( $_SERVER["PATH_INFO"])?'$_SERVER["PATH_INFO"]' . $_SERVER["PATH_INFO"] . "\n":'' );
|
||||
$db1 = new db();
|
||||
$db1->open();
|
||||
if( !empty( $db1->connect ) )
|
||||
//$db = new db();
|
||||
//$db->open();
|
||||
if( !empty( $db->connect ) )
|
||||
{
|
||||
$query = 'INSERT INTO ' . $db1->protect($table_prefix) . 'logs SET date=NOW(), auteur="' . $db1->protect( $user ) . '", log="' . $db1->protect($log) . '", niveau="' . $db1->protect($level) . '"';
|
||||
$db1->query( $query );
|
||||
if ( !$db1->result )
|
||||
$query = 'INSERT INTO ' . $db->protect($table_prefix) . 'logs SET date=NOW(), auteur="' . $db->protect( $user ) . '", log="' . $db->protect($log) . '", niveau="' . $db->protect($level) . '"';
|
||||
$db->query( $query );
|
||||
if ( !$db->result )
|
||||
{
|
||||
$text = $db1->error() . "\n\n" . $log_mail;
|
||||
envoiMail( $webmaster, "Erreur écriture logs => " . __file__ . " ligne " . __line__, $text );
|
||||
$text = $db->error() . "\n\n" . $log_mail;
|
||||
mail( $webmaster, "Erreur écriture logs => " . __file__ . " ligne " . __line__, $text );
|
||||
}
|
||||
$db1->close();
|
||||
|
||||
}else
|
||||
{
|
||||
echo $db1->error();
|
||||
envoiMail( $webmaster, "Erreur écriture logs => " . __file__ . " ligne " . __line__ , $log_mail);
|
||||
echo $db->error();
|
||||
mail( $webmaster, "Erreur écriture logs => " . __file__ . " ligne " . __line__ , $log_mail);
|
||||
}
|
||||
//$db->close();
|
||||
if ( $level == ALERT )
|
||||
{
|
||||
envoiMail( $webmaster, "Alerte Site Web", $log_mail );
|
||||
mail( $webmaster, "Alerte Site Web", $log_mail );
|
||||
}elseif ( $level == ERROR )
|
||||
{
|
||||
envoiMail( $webmaster, "Erreur Site Web", $log_mail );
|
||||
mail( $webmaster, "Erreur Site Web", $log_mail );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -57,12 +58,12 @@ function log_error($log, $w_db=true, $die=false)
|
||||
{
|
||||
global $webmaster, $headers, $accueil, $db;
|
||||
if ( $w_db ) log_write($log, ERROR);
|
||||
echo "$log<br />\n";
|
||||
//echo "$log<br />\n";
|
||||
$log_err = 'erreur dans la requête<br/>un rapport détaillé a été envoyé au webmaster';
|
||||
if ( $die )
|
||||
{
|
||||
echo "\n";
|
||||
die( $log_err );
|
||||
//echo "\n";
|
||||
//die( $log_err );
|
||||
}else
|
||||
{
|
||||
$_SESSION['error'] = $log_err;
|
||||
@@ -70,19 +71,20 @@ function log_error($log, $w_db=true, $die=false)
|
||||
}
|
||||
}
|
||||
|
||||
function affich_log( $nl, $np = 1, $level=INFO )
|
||||
function affich_log( $nl, $np = 1, $level=0)
|
||||
{
|
||||
global $table_prefix, $base_url, $path, $page;
|
||||
if( !empty( $db->open() ) )
|
||||
$db = new db();
|
||||
if( !empty( $db->connect ) )
|
||||
{
|
||||
$level_s = array( "aucun" , "info" , "alerte" , "erreur" );
|
||||
$query = 'SELECT * FROM ' . $table_prefix . 'logs';
|
||||
$query = 'SELECT * FROM ' . $table_prefix . 'logs ORDER BY id_log DESC';
|
||||
if ( $level != 0 )
|
||||
{
|
||||
$query .= " WHERE niveau='" . $db->protect($level) . "'";
|
||||
}
|
||||
$db->query($query) OR log_error($db->error() . "<br />" . __file__ . " ligne " . __line__ );
|
||||
$total_lignes = $db->result->num_rows();
|
||||
$db->query($query);
|
||||
$total_lignes = $db->result->num_rows;
|
||||
if ($total_lignes != 0 )
|
||||
{
|
||||
|
||||
@@ -139,9 +141,9 @@ function affich_log( $nl, $np = 1, $level=INFO )
|
||||
}
|
||||
|
||||
$query .= ' ORDER BY date DESC LIMIT ' . ( ( ( $np - 1 ) * $nl ) ) . ',' . $nl;
|
||||
$db->query( $query ) OR log_error( $db->error( ) . "<br />" . __file__ . " ligne " . __line__ );
|
||||
$db->query( $query );
|
||||
echo "<table border='1' width='90%'><tr><td><b>date</b></td><td><b>auteur</b></td><td><b>log</b></td><td><b>niveau</b></td></tr>\n";
|
||||
while ( $db->connect->mysqli_fetch_array( $db->result ) )
|
||||
while ( ($donnees =$db->result->fetch_array()) )
|
||||
{
|
||||
$niveau = $donnees["niveau"];
|
||||
echo "<tr><td>" . $donnees["date"] . "</td><td>" . $donnees["auteur"] . "</td><td>" . $donnees["log"] . "</td><td>" . $level_s[ $niveau ] . "</td></tr>\n";
|
||||
|
Reference in New Issue
Block a user