<?php
include_once("include/config.php");
include_once("include/auth.lib.php");
list($status, $user) = auth_get_status();
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Visualizzazione Convenzione</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<LINK href="style.css" rel="stylesheet" type="text/css">
</head>
<body>
<?php
switch($status){
case AUTH_LOGGED:
//CATEGORIA
if($_GET['id']) {
$id=$_GET['id'];
$query = "SELECT *,convenzioni.id AS convId FROM convenzioni,tpconvenzioni WHERE convenzioni.idtp = tpconvenzioni.id AND convenzioni.id = '$id'";
$risultato = mysql_query($query) or die(mysql_error());
$i = 0;
while ($array = mysql_fetch_array($risultato, MYSQL_BOTH)) {
echo '<table class="cusco" width="95%" border="0" style="margin:20px;">';
if(is_int($i/2)) {
$tr = '<tr class="odd">';
} else {
$tr = '<tr>';
}
if($array['img']) {
echo $tr;
echo '<td colspan="5" class="cusco" width="30%"><img src="'.$array['img'].'"></td></tr>';
}
echo $tr;
echo '<td colspan="5" class="cusco" width="30%"><b>'.$array['nomePub'].' </b>'; echo stars($array['stars']); '</td></tr>';
echo $tr;
echo '<td colspan="5" class="cusco" width="30%"><b>SCONTO:</B> '.$array['sconto'].'% - <B>EXTRA:</B>'.$array['extra'].'</td></tr>';
echo $tr;
echo '<td colspan="5" class="cusco" width="30%"><b>'.$array['tipo'].''; if($array['cat']) echo ' - '.$array['cat'].''; echo '</b></td></tr>';
echo $tr;
echo '<td colspan="5" class="cusco" width="35%">'.$array['descrizione'].'</td></tr>';
echo $tr;
echo '<th class="cusco">Indirizzo</th><th class="cusco">Telefono</th><th class="cusco">Fax</th><th class="cusco">Web</th><th class="cusco">Email</th></tr>';
echo $tr;
echo '<td class="cusco" width="40%">'.$array['indPub'].' '.$array['cittaPub'].''; if($array['provPub']) echo ' ('.$array['provPub'].') '; echo $array['naz'];
echo '</td><td class="cusco" width="15%">'.$array['telPub'].'</td><td class="cusco" width="15%">'.$array['faxPub'].'</td>';
echo '<td class="cusco" width="15%" align="center">'; if($array['webPub']) echo '<a href="'.$array['webPub'].'" target="_blank"><img src="/images/web.png" border="0"></a>'; echo '</td>';
echo '<td class="cusco" width="15%" align="center">'; if($array['mailPub']) echo '<a href="mailto:'.$array['mailPub'].'"><img src="/images/mail.png" border="0"></a>'; echo'</td>';
echo '</tr>';
echo '</table>';
$i++;
}
}
break;
case AUTH_NOT_LOGGED:
break; }
?>
</body>
</html>