1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138
| <!DOCTYPE html>
<html>
<meta charset="UTF-8">
<head>
<title>Title</title>
<link rel="stylesheet" type="text/css" href="rsync.css"> <! lien avec le fichier css >
</head>
<body>
<?php
//$date = date("d-n-Y");
$date=date('d-n-Y', strtotime("1 day ago" ));
echo "<h1>Titre pour le $date</h1>";
?>
<form method="post" action="connexion.php">
<h3>
<input type="radio" name="nom" value="toto" required />toto
<input type="radio" name="nom" value="tatat" required />tata
<input type="submit" class="submit" value="connexion"/>
</h3>
<?php
echo "<table>"; //on ouvre la 1ère du tableau
echo "<tr>";
echo "<th>"; //création 1ère cellule
echo "UNITE"; //mot qui apparaît dans la cellule
echo "</th>";
echo "<th>"; //création 2ème cellule
echo '@ IP'; //mot qui apparaît dans la cellule
echo "</th>";
echo "<th>"; //création 3ème cellule
echo 'Taille disque'; //mot qui apparaît dans la cellule
echo "</th>";
echo "<th>"; //création 4èmee cellule
echo 'ETAT'; //mot qui apparaît dans la cellule
echo "</th>";
echo "</tr>";
//------------------------SERVEUR 1 --------------------------------------
echo "<tr>"; //on ouvre la 1ère cellule
$bt4084=fopen("unites/4084_html.log","r"); // on ouvre le fichier
$bt4084_lines = file('unites/4084_html.log'); //mise en place des données sous forme d'un tableau
foreach($bt4084_lines as $bt4084_cle=>$bt4084_line) {
$bt4084_line = trim($bt4084_line);
$bt4084_info[$bt4084_cle] = split(';', $bt4084_line); }
echo "<td>"; //création 1ère cellule
echo 'SERVEUR1'; //mot qui apparaît dans la cellule
echo "</td>";
echo "<td>"; //création 2ème cellule
echo 'XXX.XXX.XXX.XXX';
echo "</td>";
if ($bt4084) //si ouverture OK du fichier texte
{
echo "<td>"; //création 3ème cellule
echo $bt4084_info[0][0]; //donnés du disque du fichier lu (1ère ligne / 1ère colonne
echo "</td>";
$bt4084_couleur=$bt4084_info[2][0]; //donnés état sauvegarde (3ème ligne / 1ère colonne
if (preg_match("#vert#", $bt4084_couleur)) // si le mot vert est présent dans $fichier
{
echo( //création 4ème cellule pour pastille verte apparaît
"<td>
<img src=\"vert2.jpg\" width=\"50\" height=\"50\" title=\"sauvegardes OK\" alt=\"sauvegardes OK\" border=\"0\" style=\"float:right;\" />
</td>");
}
else
{
echo( //sinon création 4ème cellule pour pastille rouge apparaît
"<td>
<img src=\"rouge2.jpg\" width=\"50\" height=\"50\" title=\"sauvegardes NOK\" alt=\"sauvegardes NOK\" border=\"0\" style=\"float:right;\" />
</td>");
}
}
else //si le fichier texte n'est pas lu
{
echo "<td>"; //création 3ème cellule
echo 'Information indisponible'; //mot qui apparaît dans la cellule
echo "</td>";
echo( //pastille orange apparaît
"<td>
<img src=\"orange2.jpg\" width=\"50\" height=\"50\" title=\"Rapport absent\" alt=\"Rapport absent\" border=\"0\" style=\"float:right;\" />
</td>");
}
fclose($bt4084); //on ferme le fichier texte
echo "<td>";
?>
<input type="radio" name="ip" value="XXX.XXX.XXX.XXX" />
<?php
echo "</td>";
echo "</tr>"; //fermeture de la ligne
</body>
</html> |
Partager