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

<?php
session_start(); 


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:


$query = mysql_query('SELECT name,email FROM utenti WHERE username = "'.$user['username'].'"');
$array = mysql_fetch_array($query, MYSQL_BOTH) ;
$nome_club = $array['name'];
$mail_club = $array['email'];
$data = date('d/m/y');

if (isset($_GET['lettera']))
{
$lettera = $_GET['lettera'];
$percento = "%";
$filtro = $lettera."".$percento;

$query = "SELECT * FROM socio WHERE club = '".$user["username"]."' AND cognome LIKE '$filtro' ORDER BY cognome ASC";
$risultato = mysql_query($query) or die("Query 1 failed");
} else {

$query = "SELECT * FROM socio WHERE club = '".$user["username"]."' AND cognome LIKE 'A%' ORDER BY cognome ASC";
$risultato = mysql_query($query) or die("Query 1 failed");
$num_rows = mysql_num_rows($risultato); 
}

if (isset($_GET['regdata']))
{
$regdata = $_GET['regdata'];
$query = "SELECT * FROM socio WHERE club = '".$user["username"]."' AND regdate = '$regdata' ORDER BY id DESC";
$risultato = mysql_query($query) or die("Query 1 failed");

}
?>
<!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">
<SCRIPT language="javascript"> 

function PrintBtnClicked(nomeclub,email,socio,datareg)
      {
        var DymoAddIn, DymoLabel;
        DymoAddIn = new ActiveXObject('DYMO.DymoAddIn');
        DymoLabel = new ActiveXObject('DYMO.DymoLabels');
		
		var etichetta = nomeclub+' - '+email+'\n'+socio+'\n'+datareg+'\nACSI - Tel. 0497801907 - www.acsipadova.it\n';
 
        if (DymoAddIn.Open('C:\\Documents and Settings\\All Users\\Documenti\\DYMO Label\\Label Files\\Indirizzo (99010).LWL'))
        {
          DymoLabel.SetAddress(1,etichetta);
		  DymoAddIn.Print(1, true);

        }
        else if (DymoAddIn.Open('C:\\Program Files\\DYMO Label\\Label Files\\Address (30252, 30320).LWL'))
        {
          DymoLabel.SetAddress(1,etichetta);
		  DymoAddIn.Print(1, true);
        }
        else if (DymoAddIn.Open('C:\\Program Files\\Dymo Label\\Label Files\\Address  (30252, 30320).LWT'))
        {
          DymoLabel.SetAddress(1,etichetta);
		  DymoAddIn.Print(1, true);

        }
        else
          alert('Attenzione: sembra che non sia stata correttamente installata la stampante DYMO LabelPrinter 400!');
       }



 
  
  
</SCRIPT>

</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">
<form method="post" action="delete.php">
<table width="100%" class="table2">
  <!--DWLayoutTable-->
  <tr>
    <td height="22" colspan="25" valign="center">
      <div align="center">Lista Soci 
	  
	  <?php echo "".$user["username"]." ($lettera$regdata)"; 

	  
	  ?></div></td>
  </tr>
 <tr>
    <td width="44" ><div align="center"><a href="lista.php?lettera=a">A</a></div></td>
    <td width="41" ><div align="center"><a href="lista.php?lettera=b">B</a></div></td>
    <td width="41" ><div align="center"><a href="lista.php?lettera=c">C</a></div></td>
    <td width="44" ><div align="center"><a href="lista.php?lettera=d">D</a></div></td>
    <td width="41" ><div align="center"><a href="lista.php?lettera=e">E</a></div></td>
    <td width="41" ><div align="center"><a href="lista.php?lettera=f">F</a></div></td>
    <td width="44" ><div align="center"><a href="lista.php?lettera=g">G</a></div></td>
    <td width="44" ><div align="center"><a href="lista.php?lettera=h">H</a></div></td>
    <td width="34" ><div align="center"><a href="lista.php?lettera=i">I</a></div></td>
	 <td width="34" ><div align="center"><a href="lista.php?lettera=j">J</a></div></td> 
<td width="41" ><div align="center"><a href="lista.php?lettera=k">K</a></div></td>
    <td width="37" ><div align="center"><a href="lista.php?lettera=l">L</a></div></td>
    <td width="47" ><div align="center"><a href="lista.php?lettera=m">M</a></div></td>
    <td width="44" ><div align="center"><a href="lista.php?lettera=n">N</a></div></td>
    <td width="44" ><div align="center"><a href="lista.php?lettera=o">O</a></div></td>
    <td width="41" ><div align="center"><a href="lista.php?lettera=p">P</a></div></td>
    <td width="44" ><div align="center"><a href="lista.php?lettera=q">Q</a></div></td>
    <td width="41" ><div align="center"><a href="lista.php?lettera=r">R</a></div></td>
    <td width="41" ><div align="center"><a href="lista.php?lettera=s">S</a></div></td>
    <td width="41" ><div align="center"><a href="lista.php?lettera=t">T</a></div></td>
    <td width="44" ><div align="center"><a href="lista.php?lettera=u">U</a></div></td>
    <td width="41" ><div align="center"><a href="lista.php?lettera=v">V</a></div></td>
    <td width="54" ><div align="center"><a href="lista.php?lettera=w">W</a></div></td>
	<td width="41" ><div align="center"><a href="lista.php?lettera=y">Y</a></div></td>

    <td width="50" ><div align="center"><a href="lista.php?lettera=z">Z</a></div></td>

  </tr>
  </table>
  <p></p>
  <table width="100%" class="table3">
    <!--DWLayoutTable-->
	<thead>
		<tr><th height="20">ID</th>
 <th height="20">Cognome</th>
 <th height="20">Nome</th>
 <th height="20">Documento</th>
 <th height="20">Data Reg.</th> 
 <th height="20"></th>
 <th height="20"></th>
  <th height="20"></th>
 </th>
	  </tr></thead>
 <?php
while ($array = mysql_fetch_array($risultato, MYSQL_BOTH)) { 
echo " 
 <tr >
 <td valign='top'><a href='modsocio.php?id=".$array['id']."' >".$array['id']."</a></td>
<td valign='top'>".strtoupper($array['cognome'])."</td>
<td valign='top'>".strtoupper($array['nome'])."</td>
<td valign='top'>".$array['numdoc']." ".$array['datadoc']."</td>
<td valign='top'>".$array['regdate']."</td>
 <td><input type='checkbox' name='delete[".$array['id']."]' value='del'></td>
 <td><a href='schedasocio.php?id=".$array['id']."'><img src='images/info.gif' border='0' alt='Vai alla scheda del socio'></a></td>
  <td><a href=\"javascript:PrintBtnClicked('".$nome_club."','".$mail_club."','".strtoupper($array['cognome'])." ".strtoupper($array['cognome'])."','".$data."');\">LW</a></td>
</tr>";
 }
?>
</table>

<table class="table4">
<tr><td class="table4" >
  <div align="center">
    <input type="submit" name="e-postmain" value="Cancella selezionati">
    	  <?php
          if(isset($_GET['regdata'])) {

    echo '<input type="button" onclick="window.open(\'listaprint.php?regdata='.$regdata.'\')" value="Stampa" >';
} ?>
  </div></td>
</tr>
</table>
</form>
</div>
</body>
</html>

<?php 
break;
case AUTH_NOT_LOGGED:
header("Refresh: 0;URL=index.php");
		
break; } ?>