1
0

version fonctionnelle

This commit is contained in:
Daniel Tartavel
2021-06-17 18:35:51 +02:00
parent 3c303efeb9
commit ab2f9b87a7
243 changed files with 23955 additions and 100 deletions

View File

@@ -7,8 +7,8 @@
if ( isset($_GET["ok"] ))
{
$fisrt_line = false;
$fh = fopen("../lang/9mfo-traduction.csv", "r") or die("Can't open csv");
$fhIndex = fopen("../lang/lang.json", "w") or die("Can't open lang/lang.json");
$fh = fopen("../lang/9mfo-traduction.csv", "r") or die( __FILE__ ." ligne: " . __LINE__ . " Can't open csv");
$fhIndex = fopen("../lang/lang.json", "w") or die( __FILE__ ." ligne: " . __LINE__ . " Can't open lang/lang.json");
fwrite($fhIndex, '{');
$first_line = true;
$first_column_line = true;
@@ -36,7 +36,7 @@
$index = explode("/",$column);
echo "opening ../lang/" . $index[0] . EOLH;
$fhl[++$i] = fopen("../lang/" . $index[0], "wb") or die("can't open lang/" . $index[0]);
$fhl[++$i] = fopen("../lang/" . $index[0], "wb") or die( __FILE__ ." ligne: " . __LINE__ . " can't open lang/" . $index[0]);
fwrite($fhl[$i], '{');
if ( $first_column == true )
{
@@ -92,19 +92,21 @@
fwrite($fhx, '}');
fclose($fhx);
}
$fh = fopen("../lang/lang.json","r");
$fh = fopen("../lang/lang.json","r") or die("Can't open ../lang/lang.json" . __FILE__ ." ligne: " . __LINE__);
$str = fgets($fh);
fclose($fh);
$lang = json_decode( $str, true);
foreach ($lang as $key => $value)
$langArray = json_decode( $str, true);
foreach ($langArray as $key => $value)
{
print $key ." : ";
if ( getLang($key, true) !== false )
$lang = getLang($key, true);
if ( $lang != false )
{
print $key ." : ";
print json_last_error_msg() . EOLH;
}else
{
print "erreur à l'ouverture du fichier";
print __FILE__ ." ligne: " . __LINE__ . " erreur à l'ouverture du fichier";
}
}
}

83
gestion/gestionDB.php Normal file
View File

@@ -0,0 +1,83 @@
<?php
/*if ( !isset($site) )
{
require_once( "../include/config.inc.php" );
print "accueil =>" . $accueil;
header( 'Location: ' . $accueil );
}*/
require_once '../session_init.php';
require_once 'config.inc.php';
require_once 'db.class.php';
require_once 'envoi_courriel.inc.php';
require_once 'log.php';
print '
<!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>';
verifPeripetieAvion();
function verifAvionpoeme()
{
$query = "SELECT * FROM avionpoeme";
$db->query($query);
$avions = $db->result->fetch_all(MYSQLI_ASSOC);
foreach($avions as $avion)
{
}
return $fresult;
}
function verifPeripetieAvion()
{
print "Vérification des liens péripétie/avionpoème" . EOLH;
$db = new db();
// requête Mysql
$query = "SELECT * FROM avionPeripetie";
$db->query($query);
$peripeties = $db->result->fetch_all(MYSQLI_ASSOC);
$query = "SELECT * FROM avionpoeme";
$db->query($query);
$avions = $db->result->fetch_all(MYSQLI_ASSOC);
$avionsId = array_column($avions, 'expeMail', 'idAvion');
print_r($avionsId);
foreach($peripeties as $peripetie)
{
print "Péripétie " . $peripetie["idAP"] . EOLH;
$idAvion = $peripetie["idAvion"];
if ( empty($avionsId[$idAvion]) )
{
print "Péripétie " . $peripetie["idAP"] . " n'a pas d'avion poème idAvion=>" . $idAvion . EOLH;
}
}
$db->close();
}
print "</body></html>";
?>

View File

@@ -1,4 +1,7 @@
<?php
require_once '../session_init.php';
require_once 'config.inc.php';
?>
<!DOCTYPE html>
<html>
<head>
@@ -27,5 +30,9 @@
</head>
<body>
<a href="lang.php">Générer les fichiers de langue</a>
<a href="logs.php">Lire les logs</a>
<a href="lang.php">Générer les fichiers de langue</a><br>
<a href="logs.php">Lire les logs</a><br>
<a href="gestionDB.php">Vérifier la base de données</a><br>
</body>
</html>