<?php include("config.php"); ?>
<?php include("lock.php"); ?>
<!DOCTYPE html>
<title>αναζήτηση δικαιούχων ΟΑΕΔ</title>

<style type="text/css">
<!--
.style1 {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 14px;
	}
.style2 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 10px;
}
.style3 {
	font-family: Verdana, Arial, Helvetica, sans-serif;
	font-size: 9px;
}


.style4 {font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 14px; font-weight: bold; }
a:link {
	text-decoration: none;
	color: #555;
}
a:visited {
	text-decoration: none;
	color: #555;
}
a:hover {
	text-decoration: none;
	color: #555;
}
a:active {
	text-decoration: none;
	color: #555;
}
-->
</style>
 
<p>&nbsp;</p>
<td width="901" align="left" valign="top">
<p align="center" class="style4"></p>
<p>&nbsp;</p>
<div align="center" class="style39 style1"><h2>αναζήτηση δικαιούχων ΟΑΕΔ</h2></div>
<p><div align="center" class="style7 style2">(αναζήτηση με επώνυμο ή αρ.επιταγής)</div>
</p>
   <div align="center"> <form action="<?php echo $_SERVER['PHP_SELF']; ?>" method="GET">
        <input type="text" size="40" name="a" />
        <input type="submit" value="Search" />
    </form>
   
   <p>&nbsp;</p> 
       
<?php
    $query = $_GET['a']; 
  
     
    $min_length = 1;
  
     
    if(strlen($query) >= $min_length)
	{ 
         
        $query = htmlspecialchars($query); 
       
         
        $query = mysql_real_escape_string($query);
      
         
        $raw_results = mysql_query("SELECT * FROM dikaiouxoi WHERE ((`eponimo` LIKE '%".$query."%') OR (`epitagh` LIKE '%".$query."%'))  order by eponimo asc ") or die(mysql_error());
             
        
         
        if(mysql_num_rows($raw_results) > 0)
		{ ?>
             <table width="1200"  align="center" cellpadding="2" cellspacing="0" class="display" border="1" bordercolor="#333">
   <thead><tr  bgcolor="#ffcc00">
      
      <th width="140" align="center"><span class="style1">Επωνυμο</span></th>
      <th width="140" align="center"><span class="style1">Ονομα</span></th>
      <th width="160" align="center"><span class="style1">Πατρος</span></th>
      <th width="160" align="center"><span class="style1">Μητρος</span></th>
      <th width="60"  align="center"><span class="style1">ΑΦΜ</span></th>
      <th width="60"  align="center"><span class="style1">ΑΜΚΑ</span></th>
      <th width="220" align="center"><span class="style1">Επιταγή</span></th>
      <th width="430" align="center"><span class="style1">Ωφελουμενοι</span></th>
      
    </tr> </thead>  
       <?     while($results = mysql_fetch_array($raw_results))
			{
		$datein=date('d/m/Y',  strtotime($results['date_in'])); 	
  echo '<tr class="style3" style="background:',(($c=!$c)? '#fff' : '#FFFFcc' ),'">';
  echo '<td align="left"  style="font-size:9px"; >'.$results['eponimo'].'     </td>';   
  echo '<td align="left"  style="font-size:9px"; >'.$results['onoma'].'     </td>';   
  echo '<td align="left"  style="font-size:9px"; >'.$results['patros'].'     </td>'; 
  echo '<td align="left"  style="font-size:9px"; >'.$results['mitros'].'     </td>'; 
  echo '<td align="center"  style="font-size:9px"; >'.$results['afm'].'     </td>';      
  echo '<td align="center"  style="font-size:9px"; >'.$results['amka'].'     </td>';   
  echo '<td align="center"  style="font-size:9px"; >'.$results['epitagh'].' </td>';   
  echo '<td align="left"  style="font-size:9px"; >'.$results['ofeloumenoi'].' </td>'; 
  
  echo '</tr>' ;           
            }
             
        }
        if(mysql_num_rows($raw_results) === 0)
		{  
		 echo '<table width="460"  align="center" cellpadding="0" cellspacing="0" class="display" border="0" bordercolor="#333">';
		echo '<tr class="styleb" style="background:',(($c=!$c)? '#e9e9e9' : '#c2c2c2' ),'">';
		 echo  '<td align="center" td colspan="3" bgcolor="#fff" style="font-size:15px"; height="30" ><font color="#900">Δεν βρέθηκαν εγγραφές </font></b></td>';   
       echo '</tr>' ;    
	    }
         
    }
    
?>    
    </div> 
</table>    