Sto costruendo un programma di gestione turni basato su tre tabelle Date, Ciclazione, Agente. nella tabella ci sono sia i campi con i cognomi degli agenti che dei campi con numeri che indicano le righr vuote.
Nella visualizzazione vorrei che i campi con i numeri non vengano visualizzati come posso fare?
posto il codice da me sviluppato:
Codice HTML:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Documento senza titolo</title> <link href="css/moduli.css" rel="stylesheet" type="text/css" /> </head> <body> <div id="menu"> <a href="inserisci-data.html">INSERISCI DATA</a> </div> <div id="left"> <form name="data_attuale" method="post" action="index.php"> <input name="data" type="date" /> <input name="invio" type="submit" /> </form> </div> <div id="boxright">Codice PHP:<?php
require 'function/config.php';
require 'function/connect.php';
require 'function/memorizza_data.php';
require 'function/visualizza_data.php';
//RECUPERO LA DATA IMMESSA
$data=memorizza_data($_POST['data']);
//PRELEVO LE DATE DAL DATABASE
$query="SELECT * FROM data";
$result=mysql_query($query);
if(!$result){
die('ERRORE NELLA QUERY $query:'.mysql_error());
}
$data1=visualizza_data($data);
while ($row=mysql_fetch_assoc($result)){
$data_lunedi=visualizza_data($row['data']);
if(!$data_lunedi)$data_lunedi=' ';
list ($giorno,$mese,$anno)=explode("-",$data1);
list ($giorno1,$mese1,$anno1)=explode("-",$data_lunedi);
if($anno==$anno1&&$mese==$mese1){
switch($giorno-$giorno1)
{
case 0:
echo "<h2>Lunedi $data1</h2><br/>";
echo '
<table border=\"1\">
<tr>
<th>Agente</th>
<th>Turno</th>
<th> </th>
<th> </th>
</tr>';
$query1="SELECT * FROM ciclazione,agente WHERE ID_ciclazione=ID_agente ORDER BY cognome";
$result1=mysql_query($query1);
if(!$result1){
die('ERRORE NELLA QUERY $query1:'.mysql_error());
}
while($row1=mysql_fetch_assoc($result1)){
$id_ciclazione=htmlentities($row1['ID_ciclazione']);
$lunedi=htmlentities($row1['lunedi']);
$agente=htmlentities($row1['cognome']);
echo "
<tr>
<td>$agente</td>
<td>$lunedi</td>
<td></td>
<td></td>
</tr>";
}
echo '</table>';
break;
case 1:
echo "<h2>Martedi $data1</h2><br/>";
break;
}else{
echo 'Dati errati';
}
}
?>Codice HTML:</div> </body> </html>

LinkBack URL
About LinkBacks
