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
| <!doctype html public "-//W3C//DTD HTML 4.0 Transitional//FR">
<html>
<head>
<title>Administration des sauvegardes SICOPS</title>
<meta Http-Equiv="Cache-Control" Content="no-cache" />
<meta Http-Equiv="Pragma" Content="no-cache" />
<meta Http-Equiv="Cache" Content="no store" />
<meta Http-Equiv="Expires" Content="0">
<meta http-equiv="imagetoolelementr" content="no" />
<meta http-equiv='Page-Enter' content='blendTrans(Duration=0.5)' />
<meta http-equiv='Page-Exit' content='blendTrans(Duration=0.5)' />
<link rel='stylesheet' href='data/css/formetest.css' type='text/css' media='all' />
</head>
<body>
<div>
<?php
$element = array('el102','el103','el105','el106','el107','el110','el112','el113','el115','el116','el118','el120','el123','el125','el126','el128','el133','el279','el701','el702','el705','el709');
?>
</div>
<form name="valid" method="POST" action="enregistrer.php">
<table class="tab">
<?php
for ($j=0; $j<22; $j++)
{
echo "<tr>";
echo "<td>$element[$j]</td>";
for ($i=0; $i<20; $i++)
{
if(!file_exists('data/'.$j.'-'.$i.'.txt'));
touch('data/'.$j.'-'.$i.'.txt');
$homepage = file_get_contents('data/'.$j.'-'.$i.'.txt');
echo "<td>";
echo "<select name=\"resultat$j-$i\">";
echo "<option class=\"$homepage\">";
echo $homepage;
echo "</option>";
echo "<option class=\"OK\">OK";
echo "</option>";
echo "<option class=\"ERREUR\">ERREUR";
echo "</option>";
echo "<option>";
echo "</option>";
echo "</select>";
echo "</td>";
echo "<td>";
echo "</td>";
}
echo "</tr>";
}
?>
</table>
<input type="submit" name="envoie" value="ENREGISTRER LES MODIFICATIONS" />
</form>
</div>
</body>
</html>
fichier2 - enregistrer.php
<?php
for ($j=0; $j<22; $j++)
{
for ($i=0; $i<20; $i++)
{
if(!file_exists('data/'.$j.'-'.$i.'.txt'));
unlink('data/'.$j.'-'.$i.'.txt');
if(!file_exists('data/'.$j.'-'.$i.'.txt'));
touch('data/'.$j.'-'.$i.'.txt');
$val="$j-$i";
eval('$valeur = $_POST["resultat'.$val.'"];');
if ( $valeur == 'OK' )
{
$file = 'data/'.$j.'-'.$i.'.txt';
$current = file_get_contents($file);
$current .= "OK";
file_put_contents($file, $current);
}
if ( $valeur == 'ERREUR' )
{
$file = 'data/'.$j.'-'.$i.'.txt';
$current = file_get_contents($file);
$current .= "ERREUR";
file_put_contents($file, $current);
}
if ( $valeur == '' )
{
$file = 'data/'.$j.'-'.$i.'.txt';
$current = file_get_contents($file);
$current .= "";
file_put_contents($file, $current);
}
}
}
echo "Les informations ont bien été enregistrées...";
?> |
Partager