Prima pagina
____________________________________________
<?
if (!$p_file = fopen("log/mail.txt","r"))
{
echo "Spiacente, non posso aprire il file mail.txt";
}
echo "<pre>";
echo "<table id=backup border=3 cellspacing=0 cellpadding=10 align=center>\n";
echo "<tr align=center>


<td>COD_CLIENTE</td>
<td>OGGETTO</td>
<td>DATA</td>
<td>STATO</td>
</tr>";
$cont=0;
while(!feof($p_file))
{
$linea = fgets($p_file, 500);
$array=explode(";",$linea);

$mail= $array[0];
$cliente = $array[1];
$oggetto = $array[2];
$note = $array[3];
$dinvio = $array[4];
$statofin = $array[5];


echo
"<tr align=center>
<td>".$cliente."</td>
<td>".$oggetto."</td>
<td>".$dinvio."</td>
<td>".$statofin."</td>
</tr>";
$cont++;

}


echo"</pre>";
echo" </table>";

fclose($p_file);



?>
_______________________________________________
SECONDA PAGINA

if (!$p_file = fopen("log/mail.txt","r"))
{


echo "Spiacente, non posso aprire il file mail.txt";

}

$conta2=0;
while(!feof($p_file))
{
$linea = fgets($p_file, 500);
$array=explode(";",$linea);


$qs = $_GET["riga"];

if($qs == $conta2){
$mail= $array[0];
$cliente = $array[1];
$oggetto = $array[2];
$note = $array[3];
$dinvio = $array[4];
$statofin = $array[5];
}

$conta2++;
}

fclose($p_file);

echo "<pre>";
echo "<table id=problemi segnalazioni cellspacing=0 cellpadding=10 align=center>\n";
echo "<tr align=center>
<td>E-mail: ".$mail."</td>
</tr>
<tr align=center>
<td>Codice cliente:".$cliente."</td>
</tr>
<tr align=center>
<td>Oggetto:".$oggetto."</td>
</tr>
<tr align=center>
<td>Descrizione del problema:".$note."</td>
</tr>
<tr align=center>
<td>Stato:".$statofin."</td>
</tr>";

echo "</table>";
echo"<hr/>";

?>





<form id="salva" action="index_2a.php" method="GET">

<?
echo "<pre>";
echo "<table id=t_risposta border=0 cellspacing=10 cellpadding=0 align=center>\n";
echo "<tr align=center>
<td>Risposta:</td>
<td><textarea rows=6 name=note cols=15 ></textarea></td>
</tr>
<tr align=center>
<td>Stato:</td>
<td><select name=id_stato>
<option value=A>APERTO</option><option value=C> CHIUSO</option></td>
</tr>
<tr align=center>
<td><input type=hidden name=riga value=$SESSION[contatore]></td>

<td><input id= pulsante type=submit name=salva value=Salva></td>
</tr>";




echo"</pre>";
echo" </table>";

if (!$p_file = fopen("log/mail.txt","r+"))
{
echo "Spiacente, non posso aprire il file mail.txt";
}
$conta3=0;
while(!feof($p_file))
{
$linea = fgets($p_file, 500);
$array=explode(";",$linea);

$qs = $_GET["riga"];

$mail= $array[0];
$cliente = $array[1];
$oggetto = $array[2];
$note = $array[3];
$dinvio = $array[4];
$statofin = $array[5];
$conta3++;
}

if($qs ==$SESSION['contatore'])
{
fwrite($p_file,$_GET['id_stato']);
}else{
fwrite($p_file,"");
}


fclose($p_file);

?>