1
0

gestion+debug

This commit is contained in:
Daniel Tartavel 2021-03-24 21:26:05 +01:00
parent f3ed3e9f90
commit 56a16aaa69
6 changed files with 104 additions and 13 deletions

View File

@ -0,0 +1,19 @@
<strong>Documentation pour l'importation des langues.</strong>
Depuis <a href="https://lite.framacalc.org/9mfo-traduction">https://lite.framacalc.org/9mfo-traduction</a>
<ol>
<li>cliquer sur enregistrer</li>
<li>choisir "ODS" comme format d'export</li>
<li>ouvrir avec "LibreOffice Calc"</li>
<li>dans "LibreOffice Calc" , menu "Fichier" => "enregistrer sous ..."</li>
<li>sélectionner le dossier dans lequel vous voulez enregistrer le fichier</li>
<li>choisir le format "Texte CSV(.csv)"à la place de "Classeur ODF(.ods)" (en bas à droite de la fenêtre)</li>
<li>cliquer sur enregistrer</li>
<li>cliquer sur "Utiliser le format Texte CSV"</li>
<li>sélectionner le Jeu de caractère "Unicode (UTF-8)"</li>
<li>dans "Séparateur de champ" sélectionner ";"</li>
<li>cliquer sur valider</li>
<li>uploader le fichier sur le serveur dans le dossier lang/</li>
<li>en admin lancer le script genere_lang.php</li>
</ol>

View File

@ -1,5 +1,7 @@
Depuis https://lite.framacalc.org/9mfo-traduction
Documentation pour l'importation des langues.
Depuis https://lite.framacalc.org/9mfo-traduction
1 - cliquer sur enregistrer
2 - choisir "ODS" comme format d'export
3 - ouvrir avec "LibreOffice Calc"

30
gestion/index.php Normal file
View File

@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Administration</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<!-- CSS -->
<link href="../src/app.css" rel="stylesheet">
<!-- navbar -->
<nav class="navbar navbar-expand-md fixed-top navbar-light bg-light">
<a class="navbar-brand" href="#">Avions Poèmes</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="#">Anthologie</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="modal" data-target="#aboutModal" >À propos</a>
</li>
</ul>
</div>
</nav>
</head>
<body>
<a href="lang.php">Générer les fichiers de langue</a>

36
gestion/lang.php Normal file
View File

@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Administration</title>
<meta name="viewport" content="initial-scale=1,maximum-scale=1,user-scalable=no">
<!-- CSS -->
<link href="../src/app.css" rel="stylesheet">
<!-- navbar -->
<nav class="navbar navbar-expand-md fixed-top navbar-light bg-light">
<a class="navbar-brand" href="#">Avions Poèmes</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarCollapse" aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarCollapse">
<ul class="navbar-nav mr-auto">
<li class="nav-item">
<a class="nav-link" href="#">Anthologie</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#" data-toggle="modal" data-target="#aboutModal" >À propos</a>
</li>
</ul>
</div>
</nav>
</head>
<body>
<?php
$filename = 'comment_exporter_tableur_vers_cvs.html';
$fh = fopen($filename, "r") or die("Can't open '" . $filename . "'");
$text = fread($fh, filesize($filename));
echo nl2br($text);
?>
<a href="genere_lang.php">Générer les fichiers de langue</a>

View File

@ -9,6 +9,7 @@ define( "INFO", 1 );
define( "ALERT", 2 );
define( "ERROR", 3 );
define( "RESULTS_BY_PAGE", 20 ); //Nombre de ligne d'anthologie par page
define( "DATE_MYSQL", "Y-m-d H:i:s" );
//variables diverses

View File

@ -86,7 +86,7 @@ class db
//print_r( $this );
}
function newPlane()
function newPlane() //return 0 on error
{
$query = "INSERT INTO avionpoeme VALUES ('0','";
$query .= $this->protect($this->message) . "', '";
@ -119,25 +119,28 @@ class db
function getCurrentPlanes()
{
$query = "SELECT deliveryTime, deliveryTZ, destLat, destLon, destName, sentTime, sentTZ, startLon, startLat, startName, color FROM avionpoeme WHERE deliveryTimeServer>NOW() AND public='1'";
$db->query($query);
$planes = $db->fetch_all(MYSQLI_ASSOC);
$query = "SELECT deliveryTime, deliveryTZ, destLat, destLon, destName, startTime, startTZ, startLon, startLat, startName, color FROM avionpoeme WHERE deliveryTimeServer>NOW() AND public='1'";
$this->query($query);
$planes = $this->result->fetch_all(MYSQLI_ASSOC);
print json_encode($planes);
}
function getAnthology($page=0)
{
if ($page==0) //renvoie le nombre de ligne d'anthologie
$query = "SELECT COUNT(*) as count FROM avionpoeme WHERE public='1'";
$this->query($query);
$result = $this->result->fetch_assoc();
$n_pages = $result["count"] / RESULTS_BY_PAGE + 1;
if ($page <= 0) //renvoie le nombre de ligne d'anthologie
{
$query = "SELECT COUNT(*) as count FROM avionpoeme WHERE public='1'";
$db->query($query);
print "['" . $db->data_seek(0) . "']";
print '{"nAnthology":"' . $result["count"] . '","nPages":"' . $n_pages .'"}';
}else //renvoie les lignes d'anthologie
{
$query = "SELECT deliveryTime, deliveryTZ, destName, sentTime, sentTZ, startName, message FROM avionpoeme WHERE public='1' LIMIT " . ($page-1)*20+1 . ",20";
$db->query($query);
$planes = $db->fetch_all(MYSQLI_ASSOC);
print json_encode($planes);
if ($page > $n_pages) $page=$n_pages;
$query = "SELECT deliveryTime, deliveryTZ, destName, startTime, startTZ, startName, message FROM avionpoeme WHERE public='1' LIMIT " . ($page-1)*RESULTS_BY_PAGE+1 . "," . RESULTS_BY_PAGE;
$this->query($query);
$planes = $this->result->fetch_all(MYSQLI_ASSOC);
print json_encode($planes, JSON_FORCE_OBJECT);
}
}