Import initial du site ship2net.fr : pages PHP, config, traductions t(), composer.json
This commit is contained in:
@@ -0,0 +1,198 @@
|
||||
<?php
|
||||
include "../config/config.php";
|
||||
Init_session(basename($_SERVER['SCRIPT_NAME'])); // Fonction ouvrant la session et vérifiant que les accès sont autorisés.
|
||||
|
||||
Entete_page_html();
|
||||
|
||||
|
||||
//************************************************************************************************************************************
|
||||
// Initialisation des variables globales
|
||||
//************************************************************************************************************************************
|
||||
$message_erreur = "";
|
||||
$message_information = "";
|
||||
$flag_redirection = false;
|
||||
|
||||
Ouverture_bdd(); // Connexion à MySql
|
||||
|
||||
|
||||
//************************************************************************************************************************************
|
||||
// Traitement des variables d'entrées
|
||||
//************************************************************************************************************************************
|
||||
|
||||
// Variables de SESSION :
|
||||
if (!isset($_SESSION['Uploads']['page'])) $_SESSION['Uploads']['page'] = 'Accueil';
|
||||
if (!isset($_SESSION['Uploads']['ancre'])) $_SESSION['Uploads']['ancre'] = "#";
|
||||
|
||||
|
||||
// Variables GET :
|
||||
if (isset($_GET['action']))
|
||||
{
|
||||
switch ($_GET['action'])
|
||||
{
|
||||
//===================================
|
||||
case "navigation":
|
||||
{
|
||||
if (isset($_GET['destination']))
|
||||
{
|
||||
$_SESSION['Uploads']['page'] = $_GET['destination'];
|
||||
$_SESSION['display_menu'] = false;
|
||||
}
|
||||
|
||||
if (isset($_GET['ancre']))
|
||||
{
|
||||
$_SESSION['Uploads']['ancre'] = $_GET['ancre'];
|
||||
$_SESSION['display_menu'] = false;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
//===================================
|
||||
case "changement_langue":
|
||||
{
|
||||
if (isset($_GET['langue']))
|
||||
{
|
||||
$_SESSION['langue'] = $_GET['langue'];
|
||||
chargement_langue();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
case "toggle_edit":
|
||||
{
|
||||
if ($_SESSION['modifier_texte'] == 0) $_SESSION['modifier_texte'] = 1;
|
||||
else if ($_SESSION['modifier_texte'] == 1) $_SESSION['modifier_texte'] = 0;
|
||||
|
||||
break;
|
||||
}
|
||||
//---------------------------------------
|
||||
case "changement_type":
|
||||
{
|
||||
if (isset($_GET['type']))
|
||||
{
|
||||
$_SESSION['type_utilisateur'] = $_GET['type'];
|
||||
chargement_langue(1);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!$flag_redirection)
|
||||
{
|
||||
header('Location:uploads.php'.$_SESSION['Uploads']['ancre'].'');
|
||||
exit(); // Evite que le traitement des données (ci-dessous) soit fait avant la redirection (et qu'on perde donc le resultat de ce traitement...)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Variables POST :
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
//************************************************************************************************************************************
|
||||
// Traitement des données
|
||||
//************************************************************************************************************************************
|
||||
|
||||
// Protection contre les accès directs :
|
||||
if ((!$_SESSION['acces_valide']) OR ($_SESSION['shipmember']['Niveau_acces'] < NIVEAU_MINI_ACCES_ADMINISTATEUR)) header('Location:shipmembers.php?action=navigation&destination=Login');
|
||||
|
||||
switch ($_SESSION['Uploads']['page'])
|
||||
{
|
||||
//****************************************************************************************************************************
|
||||
case "Accueil":
|
||||
{
|
||||
Fermeture_bdd(); // Déconnexion de MySQL car sera réouvert dans la partie code
|
||||
include REPERTOIRE_FICHIERS_CRON."/uploads_code.php";
|
||||
Ouverture_bdd(); // Connexion à MySql pour garder la structure de tous les fichiers
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
//****************************************************************************************************************************
|
||||
default:
|
||||
{
|
||||
$_SESSION['Uploads']['page'] = "Accueil";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Fermeture_bdd(); // Déconnexion de MySQL
|
||||
|
||||
//************************************************************************************************************************************
|
||||
// Affichage
|
||||
//************************************************************************************************************************************
|
||||
|
||||
|
||||
//********************************************************************************************************************************
|
||||
// Affichage principal :
|
||||
echo '<div id="Uploads">';
|
||||
|
||||
//=========================================================================================
|
||||
// Entête :
|
||||
Entete_page($message_erreur, $message_information);
|
||||
|
||||
switch ($_SESSION['Uploads']['page'])
|
||||
{
|
||||
//************************************************************************************************************************
|
||||
case "Accueil":
|
||||
{
|
||||
echo '<div id="accueil" class="page_principale">';
|
||||
|
||||
echo '<h1>Uploads</h1>';
|
||||
|
||||
echo '<p>Nb total de fichiers traités = <span class="gras">'.$nb_total_fichiers.'</span> (maxi = '.$max_nb_total_fichiers.') en '.$execution_time.' secondes</p>';
|
||||
|
||||
for ($i = 0; $i < $nb_repertoires_bateaux; $i ++)
|
||||
{
|
||||
if ($repertoires_bateaux[$i]['nb_fichiers'] == 0) continue;
|
||||
|
||||
echo '<h2>Fichiers traités pour le bateau <span class="gras">'.$repertoires_bateaux[$i]['nom_bateau'].'</span></h2>';
|
||||
|
||||
echo '<p>Nb de fichiers traités pour ce bateau = <span class="gras">'.$repertoires_bateaux[$i]['nb_fichiers'].'</span></p>';
|
||||
|
||||
echo '<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Fichier</th>
|
||||
<th>Résultat</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>';
|
||||
for ($j = 0; $j < $repertoires_bateaux[$i]['nb_fichiers']; $j ++)
|
||||
{
|
||||
echo '<tr>
|
||||
<td>'.($j+1).' - '.$repertoires_bateaux[$i]['fichiers'][$j].'</td>';
|
||||
if ($repertoires_bateaux[$i]['resultats'][$j] == "Ok") echo '<td>';
|
||||
else echo '<td class="erreur_fichier">';
|
||||
|
||||
echo $repertoires_bateaux[$i]['resultats'][$j].'</td>';
|
||||
}
|
||||
echo '</tbody>
|
||||
</table>';
|
||||
}
|
||||
|
||||
echo '<div class="boutons_bas_de_page">';
|
||||
echo '<a title="" href="administration.php?action=navigation&destination=Accueil">Retour au menu Administration</a>';
|
||||
echo '</div>';
|
||||
|
||||
echo '</div>';
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
//************************************************************************************************************************
|
||||
default:
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
echo '</div>';
|
||||
|
||||
|
||||
|
||||
|
||||
Pied_de_page();
|
||||
Reference in New Issue
Block a user