<?php 

// $IDcField="IDPelati";
$prefix='app_pelates@';

$RecsPP_fld=$prefix.'cboRecPP';
$HmApoCookieName=$prefix.'HmApo';
$HmEosCookieName=$prefix.'HmEos'; 
 
if(!isset($_COOKIE[$RecsPP_fld])) {$RecsPP=10;} else { $RecsPP=$_COOKIE[$RecsPP_fld];}
if(!isset($_COOKIE[$HmApoCookieName])) {$HmApo= date_create('now')->format('d/m/Y');} else { $HmApo=$_COOKIE[$HmApoCookieName];} 
if(!isset($_COOKIE[$HmEosCookieName])) {$HmEos=date_create('now')->format('d/m/Y'); } else { $HmEos=$_COOKIE[$HmEosCookieName];}
 
$FindWhat1 = trim(filter_input(INPUT_GET, 'FindWhat', FILTER_SANITIZE_SPECIAL_CHARS));
     $pgNo = trim(filter_input(INPUT_GET, $prefix.'pgNo', FILTER_SANITIZE_SPECIAL_CHARS));
     if(is_numeric($pgNo)){	 } else { $pgNo=1;} 

//echo "PageNo=" . $pgNo . " ==== RecsPP=" . $RecsPP . "<br>"; 
?> 
<div class="scroll" style="height:54vh; margin-bottom:0px;padding-bottom:0px;" > 
 
	  <table id="CustomerList" class="gridList" > 
	   <tr >
		<td class='r w40'>A/A</td>
		<td class="c w100">ΗΜΕΡΟΜΗΝΙΑ</td>
		<td>ΕΦΑΡΜΟΓΗ</td>
		<td class="c w100">ΛΗΞΗ</td>
		<td class=" w100"> ΧΡΕΩΣΗ </td>
		<td>ΣΗΜΕΙΩΣΕΙΣ</td>
	  </tr> 
<?php
$RecNo=0;
$iRow=0;
$ApplicationName="";
$IDPelati=
//$IDc = gConvertField($IDApp, '0');
$query="SELECT * FROM symvolaia WHERE IDPelati=$IDPelati ORDER BY ActivateStartDate ";
 // echo "<br>". $query."<br>";
  $num_rows=RecordsCount($conn,$query);
   $FromRec=($pgNo-1)*$RecsPP ;
     $pgMax=intval($num_rows/$RecsPP)+1;
 	$RecNo = $num_rows;
     $iRow = $FromRec;
	 
    $query = $query .  ' LIMIT ' .$FromRec . ', ' . $RecsPP ;
   $result = mysqli_query($conn, $query);

 while ($rs = mysqli_fetch_array($result)) {
$iRow +=1;
 
$IDApp= $rs['IDApp'];
$ActivateStartDate=formatMyDate($rs['ActivateStartDate'],"MySqlToGr");
$ActivateEndDate=formatMyDate($rs['ActivateEndDate'],"MySqlToGr");
$ApplicationName= $rs['ApplicationName'];
$Sxolia= $rs['Sxolia'];
$Xreosi=$rs['Xreosi'];
$Xreosi=number_format($Xreosi, 2, ',', '.');
 
// ========================================
//  Pelates List
// ========================================
 
    echo "<tr class='tablerowdata'  onclick='javascript:OpenFormADD($IDPelati);'> ";
    echo "<td class='r w40' >$iRow</td>";
	echo "<td class='c w100'>$ActivateStartDate</td>";
	echo "<td >$ApplicationName</td>";
	echo "<td class='c w100'>$ActivateEndDate</td>";
	echo "<td class='r w100'>$Xreosi</td>";
	echo "<td >$Sxolia</td>";
    echo "</tr>";
 } 
 for ($x = $iRow+1; $x <= $pgNo*$RecsPP; $x++) {
    echo "<tr class='tablerowdata'  onclick='javascript:OpenFormADD(0);'> ";
    echo "<td class='w40'> </td> <td class='w100'> </td> "; 
	echo "<td> </td> ";
	echo "<td class='w100'> </td>";
	echo "<td class='w100'> </td>";
	echo "<td> </td>";
    echo "</tr>";
 }	
 ?> 

</table>


<?php include 'include/recs_div_bottom.php'; ?>

 

</div>
 