<?php include("config.php"); ?>
<?php include("lock.php"); ?>

<script>
function goBack()
  {
  window.history.back()
  }
</script>

<style type="text/css">
<!--
.style1 {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-weight: bold; font-size: 14px; 
}
.style3 {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #990000;
}
.style4 {font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 14px; }
.style10 {font-family: Geneva, Arial, Helvetica, sans-serif}
.style111 {font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px}
.style16 {font-family: Geneva, Arial, Helvetica, sans-serif; font-size: 12px; }
a {
	font-family: Geneva, Arial, Helvetica, sans-serif;
	font-size: 12px;
	color: #333333;
	font-weight: bold;
}
a:link {
	text-decoration: none;
	font-size: 12px;
	
}
a:visited {
	text-decoration: none;
	color: #333333;
}
a:hover {
	text-decoration: none;
	color: #333333;
}
a:active {
	text-decoration: none;
	color: #333333;
}
-->
</style>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />



<p align="center">&nbsp;</p>
<p align="center" class="style4"><a href="home.php" >επιστροφή στην αρχική σελίδα</a></p>
<p align="center">&nbsp;</p>
<?
     $kart= $_GET['id'];
     
    
  $data = mysql_query("SELECT * FROM `oaed_thea` where  id='$kart' ")		
 
      or die(mysql_error()); 
	     
      while($infoil = mysql_fetch_array( $data )) 
 {
      $datoil=date('d-m-Y', strtotime($infoil['date_egg']));
      
      
       $datein=date('d/m/Y',  strtotime($infoil['date_in'])); 
      $dateout=date('d/m/Y',  strtotime($infoil['date_out'])); 
      
     
        $dianikt=$dateout-$datein;
        $ssy=$infoil['ar_symb'];
         $pooed=$infoil['name'];
         $poso_apy_oaed=($dianikt*28.00)*($infoil['ar_ofel']+1);
        $poso_apy_pel=($dianikt*4)*($infoil['ar_ofel']+1); 
        $dout=$infoil['date_out']; 
 }   
 
  
 
   
       ?> 
       
       <h2 align="center">Καταχώρηση ΑΠΥ ΟΑΕΔ</h2>
	 <table border="0" align="center">
  
  <form method="post" action="par_oaed_in.php">
            
       <tr class="style1" >
          <td width="" align="right"  bgcolor="#FFFFFF">No ΑΠΥ</td>
          <td width=""><input type="text" name="par_aa" size="10" class="inputbox" required></td>
      </tr>
            
        <tr> <td>&nbsp;  </td></tr>
        <tr class="style1" >
          <td width="" align="right"  bgcolor="#FFFFFF">Δικαιούχος</td>
          <td width=""><input type="text" name="" size="30" class="inputbox" value="<? echo $pooed ?>"  readonly></td>
      </tr>
        
        
        <tr class="style1">
          <td align="right" bgcolor="#FFFFFF">Ημερομηνία έκδοσης</td>
          <td width=""><input type="date" name="par_imer" size="20" class="inputbox" value="<? echo $dout?>" required>
          </tr>      
	
        <tr> <td>&nbsp;  </td></tr>
        
        <tr class="style1">
          <td width="" align="right" >Ποσό </td>
          <td width=""><input type="text" name="par_poso" size="10" class="inputbox" value=" <? echo $poso_apy_oaed ?>"required></td>
       <td width=""><input type="text" name="id_pel" size="10" class="inputbox" value="<? echo $kart ?>" hidden></td>
       <td width=""><input type="text" name="ar_symb_pel" size="10" class="inputbox" value=" <? echo $ssy ?>" hidden></td>
       
         </tr>  
       
        
        <tr> <td>&nbsp;  </td></tr>
       
        
           <tr class="style1" >
          <td width="" align="right"  bgcolor="#FFFFFF">Περιοδος</td>
          <td width=""><select  name="periodos_oaed" class="inputbox">
  <option value="A" selected>Περιοδος Α΄ 22-23</option>
  <option value="b">Περιοδος Β΄ 22-23</option>
  </select></td>
       
         </tr>  
        
        </tr>
        
        
        
        <p>&nbsp;</p>
        
</table>    <p>&nbsp;</p> 
    
   <p align="center"><input type="submit" name="submit" value="καταχώρηση ΑΠΥ" class="button"/></p>
     <p align="center"></p> 
 <p align="center"></p>
 
  <p>&nbsp;</p>
<table width="750"  align="center" cellpadding="3" cellspacing="3" class="display">
  
    <h3 align="center">Kαταχωρήσεις</h3>
  <thead>
    <tr class="style7"bgcolor="#ffcc33">
     
      <th width="110" class="right">Α.Π.Υ.</th>
      
      <th width="100" class="right">Ημερομηνία</th>
      <th width="100" class="right">Ποσό</th>
      <th width="300" class="right">Δικαιουχος</th> 
      
      
    </tr>
  </thead>
  <tbody>
  <? 
  
  
  $datapr = mysql_query("SELECT * FROM par_oaed
                         inner join oaed_thea
                        on par_oaed.id_pel=oaed_thea.id
                        order by par_aa desc
                         ") 
      or die(mysql_error()); 
	     
      while($rowtp = mysql_fetch_array( $datapr )) 
 {
 
  $dat=date('d/m/Y',  strtotime($rowtp['par_imer'])); 
  
 ?>
 
 <? echo '<tr class="style1" style="background:',(($c=!$c)? '#FFFFFF' : '#FFFF99' ),'">';?>     
    
            <td align="center"><?php echo $rowtp['par_aa'];?></td>
            <td align="center"><?php echo $dat;?></td>           
            <td align="center"><?  echo number_format((float)$rowtp['par_poso'], 2, '.', '');?> €</td>
            <td align="center"><?php echo $rowtp['name'];?></td>
              
   
     
    </tr>
     <?	 }  ?>
    
  </tbody>
</table>  