$idapp = $_GET['idapp'];
$idfoto = $_GET['idfoto'];
if ($idapp == '') {
header("location:avvio.php");
}
include("../database.php");
$queryf = mysql_db_query($db_database,"SELECT foto.ID, userlist.username, foto.nomefoto, foto.note, Appuntamenti.ID
FROM (foto INNER JOIN userlist ON foto.userid = userlist.ID) INNER JOIN Appuntamenti ON foto.appid = Appuntamenti.ID
WHERE (((Appuntamenti.ID)='".$idapp."'));
",$connessione);
$num=mysql_num_rows($queryf);
$abc=0;
while ( $abc<$num ){
if (mysql_result($queryf,$abc,"foto.id") == $idfoto) {
$nfoto = $abc;
$nrfoto = $abc-1;
$nnfoto = $abc+1;
if ($nnfoto == $num) $nnfoto=0;
if ($nrfoto == -1) $nrfoto=$num-1;
}
$abc++;
}
?>
function dataformat($data){
$ggdin = substr($data, 8, 2);
$mmdin = substr($data, 5, 2);
$aadin = substr($data, 0, 4);
$dataformat= $ggdin.'-'.$mmdin.'-'.$aadin;
return $dataformat;
}
function annoformat($data){
$aadin = substr($data, 0, 4);
$dataformat= $aadin;
return $dataformat;
}
$query = mysql_db_query($db_database,"SELECT * FROM Appuntamenti WHERE id='".$idapp."'",$connessione);
if ($idfoto <> '') {
print '
| Chiudi X
|
|
|
|
| Foto di: | '.mysql_result($queryf,$nfoto,"userlist.username").' | Note: | '.mysql_result($queryf,$nfoto,"foto.note").' |
|
|
';
}
include("../testa.php");
print '
';
$query = mysql_db_query($db_database,"SELECT * FROM foto WHERE appid='".$idapp."'",$connessione);
$num=mysql_num_rows($query);
print '';
$abc=0;
$tr=0;
while ( $abc<$num ) {
$tr++;
print'
|
';
if ($tr == 5) {
print '
';
$tr=0;
}
$abc++;
}