<?php
session_start();
setlocale(LC_ALL,'it_IT');
error_reporting(E_ALL ^ E_NOTICE);
include_once("include/config.php");
include_once("include/auth.lib.php");
list($status, $user) = auth_get_status();
if($status == AUTH_LOGGED & auth_get_option("TRANSICTION METHOD") == AUTH_USE_LINK){
$link = "?uid=".$_GET['uid'];
}else $link = '';
switch($status){
case AUTH_LOGGED:
$TotClub = 0;
$TotAff = 0;
$stato = (!empty($_GET['stato'])) ? $_GET['stato'] : '%';
$query = "SELECT * FROM utenti";
$query.= " WHERE stato LIKE '$stato'";
$denominazione = '%';
if(!empty($_GET['denominazione'])) {
$denominazione = $_GET['denominazione'];
$query.= " AND name LIKE '%$denominazione%'";
}
$telefono = '%';
if(!empty($_GET['telefono'])) {
$telefono = $_GET['telefono'];
$query.= " AND tel LIKE '%$telefono%'";
}
$email = '%';
if(!empty($_GET['email'])) {
$email = $_GET['email'];
$query.= " AND email LIKE '%$email%'";
}
$indirizzo = '%';
if(!empty($_GET['indirizzo'])) {
$indirizzo = $_GET['indirizzo'];
$query.= " AND indirizzo LIKE '%$indirizzo%'";
}
$cognome = '%';
if(!empty($_GET['cognome1'])) {
$cognome = $_GET['cognome1'];
$query.= " AND cognome1 LIKE '%$cognome%'";
}
$nome = '%';
if(!empty($_GET['nome1'])) {
$nome = $_GET['nome1'];
$query.= " AND nome1 LIKE '%$nome%'";
}
$query.= " ORDER BY name ASC";
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Database ACSI Comitato Provinciale di Padova</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
body {
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:9px;
}
#tabella{
border:1px #ccc solid;
border-collapse:collapse;
margin:auto;
}
#tabella thead tr{
color:white;
background-color:#333333;
}
#tabella td{
border:1px #ccc solid;
border-collapse:collapse;
}
-->
legend {font-size:15px; font-weight:bold}
fieldset ul, fieldset li{
border:0; margin:0; padding:0; list-style:none;
}
fieldset li{
clear:both;
list-style:none;
padding-bottom:10px;
}
fieldset input{
float:left;
}
fieldset label{
width:140px;
margin:7px;
float:left;
}
</style>
<script type="text/javascript" src="js/jquery-1.3.2.min.js"></script>
<script>
$(document).ready(function(){
$('#tabella tbody tr').filter(":even").css("background-color", "#fff").hover(
function(){
$(this).css({"background-color":"#666", "color":"#d9d9d9"});
},
function(){
$(this).css({"background-color":"#fff", "color":"#000"});
});
$('#tabella tbody tr').filter(":odd").css("background-color", "#d6d6d6").hover(
function(){
$(this).css({"background-color":"#666", "color":"#d9d9d9"});
},
function(){
$(this).css({"background-color":"#d6d6d6", "color":"#000"});
});
});
</script>
</head>
<body>
<p align="center"><img src="/admin/images/image/intestazione acsi-senzarif.jpg">
<h2 align="center">CERCA CLUB ACSI-AES</h2>
</p>
<form name="report" action="" method="get">
<fieldset>
<legend>Cerca club</legend>
<ul>
<li>
<label>Nome</label>
<input type="text" name="denominazione" value="<?php echo $_GET['denominazione']; ?>">
</li>
<li>
<label>Telefono</label>
<input type="text" name="telefono" value="<?php echo $_GET['telefono']; ?>">
</li>
<li>
<label>Email</label>
<input type="text" name="email" value="<?php echo $_GET['email']; ?>">
</li>
<li>
<label>Indirizzo</label>
<input type="text" name="indirizzo" value="<?php echo $_GET['indirizzo']; ?>">
</li>
<li>
<label>Cognome Presidente</label>
<input type="text" name="cognome1" value="<?php echo $_GET['cognome1']; ?>">
</li>
<li>
<label>Nome Presidente</label>
<input type="text" name="nome1" value="<?php echo $_GET['nome1']; ?>">
</li>
<li>
<label>Stato </label>
<select name="stato">
<option value="" <?php echo ($_GET['stato'] == '') ? 'selected' : ''; ?>>Tutti</option>
<option value="aperto" <?php echo ($_GET['stato'] == 'aperto') ? 'selected' : ''; ?>>Aperto</option>
<option value="chiuso" <?php echo ($_GET['stato'] == 'chiuso') ? 'selected' : ''; ?>>Chiuso</option>
<option value="altroente" <?php echo ($_GET['stato'] == 'altroente') ? 'selected' : ''; ?>>Altro Ente</option>
<option value="nonoperativo" <?php echo ($_GET['stato'] == 'nonoperativo') ? 'selected' : ''; ?>>Non operativo</option>
</select>
</li>
<li>
<input type="submit" name="Submit" value="Filtra">
</li>
</ul>
</fieldset>
</form>
<?php
if(isset($_GET['Submit'])) {
$html.= '<table width="100%" border="1" id="tabella">';
$html.= '<thead><tr><td><b>NOME CLUB</b></td>
<td><b>PRESIDENTE</b></td>
<td><b>TELEFONO</b></td>
<td><b>CELLULARE</b></td>
<td><b>EMAIL</b></td>
<td><b>SOMMINISTRAZIONE</b></td>
<td></td>
</tr></thead>';
$risultato = mysql_query($query) or die(mysql_error());
while ($array = mysql_fetch_array($risultato, MYSQL_BOTH)) {
$somministrazione =($array['somministrazione'] == 1) ? 'SI' : 'NO';
$html.= '<tr><td>'.$array['name'].'</td>';
$html.= '<td>'.$array['nome1'].' '.$array['cognome1'].'</td>';
$html.= '<td>'.$array['tel'].'</td>';
$html.= '<td>'.$array['cel'].'</td><td>'.$array['email'].'</td><td>'.$somministrazione.'</td>
<td><a href="schedaclub.php?club='.$array['username'].'"><img src="images/info.gif"></a></tr>';
}
}
$html.= '</table>';
echo $html;
?>
</body>
</html>
<?php
break;
case AUTH_NOT_LOGGED:
header("Refresh: 0;URL=index.php");
break; } ?>