<?php 
session_start();
 
if($_SESSION['CheckPWD']==false){header("Location: login.php"); }

$myTopCaption_Text="ΠΕΛΑΤΟΛΟΓΙΟ © 2020";
$MyFormName=str_replace('.php', '', basename($_SERVER['PHP_SELF']));
$MyADDFormName="eforiesAdd";$w=850;$h=540;
$MyIDFieldName="IDc";
$tblName='efories';
$FocusField='btnClose'; 
$ListExist=true;
$prefix="eforiesList_";

$RecsPP_fld=$prefix.'RecsPP';
$HmApoCookieName=$prefix.'HmApo';
$HmEosCookieName=$prefix.'HmEos'; 
$SortFLD=$prefix.'srt';
$SortValue="";
 
if(!isset($_COOKIE[$SortFLD])) {$SortValue='';} else { $SortValue=$_COOKIE[$SortFLD];}

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 ="";
 $pgNo=1;

if (isset($_GET[$prefix.'FindWhat'])) {
  $FindWhat1 = trim(filter_input(INPUT_GET, $prefix.'FindWhat', FILTER_SANITIZE_SPECIAL_CHARS));
}
if (isset($_GET[$prefix.'pgNo'])) {
  $pgNo = trim(filter_input(INPUT_GET, $prefix.'pgNo', FILTER_SANITIZE_SPECIAL_CHARS));
}
if(is_numeric($pgNo)){	 } else { $pgNo=1;} 
  
include 'include\Header.php';
#include 'myFunctions.php';
include '_RecsNoMax_Div.php';
?>

<link href="logos/ApplicationLogo.png" rel="shortcut icon" type="image/x-icon"> 
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,300italic,700&subset=latin,greek,greek-ext" rel="stylesheet" type="text/css">
<link rel="stylesheet" href="css/Search2020.css" />

<head>
	<title>vs Contracts</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="">
</head>

<form id="<?php echo $MyFormName;?>" name="<?php echo $MyFormName;?>">
<body OnLoad="document.<?php echo $MyFormName.'.'.$prefix ?>FindWhat.focus();">

 <div class="vsboxDetail">
	<h1> ΚΑΤΑΣΤΑΣΗ ΕΦΑΡΜΟΓΩΝ </h1>    
</div>	

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

 <div class="sticky">
  <table id="CustomerList" class="gridList"  > 
   <tr >
	<td align="right" width="40">A/A</td>
	<td class="center w100">ΚΩΔΙΚΟΣ</td>
    <td>ΔΟΥ</td>
	<td>ΔΙΕΥΘΥΝΣΗ</td>
	<td>ΤΚ - ΠΟΛΗ</td>
    <td class="w100"> ΤΗΛΕΦΩΝΟ 1  </td>
	<td class="w100"> ΤΗΛΕΦΩΝΟ 2  </td>
	<td>ΠΑΡΑΤΗΡΗΣΕΙΣ </td>
  </tr> 
  </table >
</div  >  

  <table class="gridListNoCaption"  > 
 
<?php
     $flds="Kodikos,DOY,TKPoli,Sxolia";
   $filter=filter_make($flds, $FindWhat1);
    $query=" SELECT * FROM ". $tblName . " " . $filter ; 
if($SortValue==''){$query=$query ." ORDER BY DOY, Kodikos ";} else {$query=$query." ORDER BY " . $SortValue . " ";} 	
	 
  $num_rows=RecordsCount($conn,$query);
   $FromRec=($pgNo-1)*$RecsPP ;
     $pgMax=intval($num_rows/$RecsPP)+1;
// ====================================  
 
// ====================================
    $query = $query .  ' LIMIT ' .$FromRec . ', ' . $RecsPP ;
   $result = mysqli_query($conn, $query);
 
 echo ('<script> document.getElementById("'.$RecNo_fld.'").value='.$num_rows.'</script>') ;
 echo ('<script> document.getElementById("'.$pgNo_fld.'").value='.$pgNo.'</script>') ;
 echo ('<script> document.getElementById("'.$pgMax_fld.'").value='.$pgMax.'</script>') ;
  
$iRow=($pgNo-1)*$RecsPP;

 while ($rs = mysqli_fetch_array($result)) {
$iRow +=1;
 
$IDc = gconvertfield($rs['IDc'],0);
$DOY = $rs['DOY']; $Dnsi = $rs['Dnsi']; $TKPoli = $rs['TKPoli'];
$Til1 = $rs['Til1'];$Til2 = $rs['Til2'];
$Sxolia = $rs['Sxolia']; 
 
// ============ 
//  Rec List
// ============ 
    echo "<tr class='tablerowdata'  onclick='javascript:OpenFormADD_onWin($IDc);'> ";
    echo "<td width='40' class='r1' >$iRow</td>";
	echo "<td width='100' class='c1'>$IDc</td>";
    echo "<td>$DOY</td>";
	echo "<td>$Dnsi</td>";
	echo "<td>$TKPoli</td>";
	echo "<td class='c1 w100'>$Til1</td>";
	echo "<td class='c1 w100'>$Til2</td>";
	echo "<td>$Sxolia</td>";
    echo "</tr>";
 }
for ($x = $iRow+1; $x <= $pgNo*$RecsPP; $x++) {
    echo "<tr class='tablerowdata'  onclick='javascript:OpenFormADD_onWin(0);'> ";
    echo "<td></td> <td></td> <td></td> <td></td> <td></td>  <td class='c1 w100'></td>";
    echo " <td class='c1 w100'> </td><td></td>";
    echo "</tr>";
 }	
 ?> 

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

</div>	
 
</body>
  
</form> 
 
 
<?php 
  include 'js\vsFunctions.js';
  if ($ListExist==true){ include 'js\RecsNextPrv.js'; }
  include 'include\Footer2020.php';
?>
 
 


