Current Path : /web/htdocs/www.entinoprofit.org/home/database/
Upload File :
Current File : /web/htdocs/www.entinoprofit.org/home/database/listasinistri.php

<?php
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:

if ($user["username"] == 'acsi'){

$year = (isset($_GET['year'])) ? $_GET['year'] : '%';

$query = "SELECT s.nome,s.cognome,ss.* FROM sinistri ss,socio s WHERE ss.idsocio = s.id AND ss.data_sinistro LIKE '%$year%'";

$risultato = mysql_query($query) or die(mysql_error());
}

?>
<!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">
</head>

<body>
<table width="100%" class="table1">
  <!--DWLayoutTable-->
  <tr>
    <td height="20" colspan="9"><div align="center">Database ACSI Comitato Provinciale di Padova</div></td>
  </tr>
  <tr>
    <td height="20"></td>
  </tr>
  <tr>
    <td height="20" colspan="9"><div align="center"><?php include('in.php'); ?></div></td>
  </tr>
 </table>

<div id="main">

<div class="alert" style="height:25px;"> 
	<div style="width:200px;float:left;"><form name="year">Filtra per anno 
	<select name="Cyear" onChange="MM_jumpMenu('parent',this,0)">
	<option value='listasinistri.php'>Tutti gli anni</option>
	<option value='listasinistri.php?year=2011' <?php if($_GET['year'] == '2011') echo 'selected'; ?>>2011</option>
	<option value='listasinistri.php?year=2010' <?php if($_GET['year'] == '2010') echo 'selected'; ?>>2010</option>
	<option value='listasinistri.php?year=2009' <?php if($_GET['year'] == '2009') echo 'selected'; ?>>2009</option>
	<option value='listasinistri.php?year=2008' <?php if($_GET['year'] == '2008') echo 'selected'; ?>>2008</option>
	<option value='listasinistri.php?year=2007' <?php if($_GET['year'] == '2007') echo 'selected'; ?>>2007</option>
	</select>
	</form>
	</div>
</div>

<p></p>

  <table width="100%" class="table2">
    <!--DWLayoutTable-->
	<thead><tr>
				<th width="5%" height="20" valign="top"><div align="center">ID</div></th>
				<th width="20%" valign="top"><div align="center">Socio</div></th>
				<th width="10%" valign="top"><div align="center">Tessera</div></th>
				<th width="10%" valign="top"><div align="center">Stato</div></th>
				<th width="15%" valign="top"><div align="center">Spesa</div></th>
				<th width="20%" valign="top"><div align="center">Data sinistro</div></th>
				<th width="20%" valign="top"><div align="center">Data inserimento</div></th>
</tr></thead> 
<?php
while ($array = mysql_fetch_array($risultato, MYSQL_BOTH)) { 
		
	$data_ins = ucfirst(strftime("%a %d %b %Y",strtotime($array['data_ins']))); 
	$data_sinistro = ucfirst(strftime("%a %d %b %Y",strtotime($array['data_sinistro']))); 
		
		
			echo '<tr class="ticket2"><td height="20"><a href="modsinistro.php?id='.$array['idsocio'].'&idSin='.$array['id'].'">'.$array['id'].'</a></td><td>'.$array['nome'].' '.$array['cognome'].'</td><td>'.$array['tessera'].'</td><td>'.$array['stato'].'</td><td>'.$array['spesa'].'</td><td>'.$data_sinistro.'</td><td>'.$data_ins.'</td></tr>';
			
			if($array['descrizione'] != '') {
			
				echo '<tr ><td colspan="7">'.$array['descrizione'].'</td></tr>';
			
			}
			
			
			echo '<tr class="ticket"><td height="20px" colspan="7"></td></tr>';
			
		}
?>
</table>


</div> 
</body>
</html>
<?php } ?>