<?php 
session_start();
?>
<head>
	<title>Ταμειακές-Διαχείριση Λαθών</title>
	<link href="logos/ofm1.ico" rel="shortcut icon" type="image/x-icon"> 
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="">
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">	
</head>
<?php   
if($_SESSION['CheckPWD']==false){ header("Location: login.php"); }
	
$myTopCaption_Text="ΤΑΜΕΙΑΚΕΣ - ΔΙΑΧΕΙΡΙΣΗ ΛΑΘΩΝ ";
$MyFormName=str_replace('.php', '', basename($_SERVER['PHP_SELF']));
$MyADDFormName="tameiakes_errors_add";
$tblName="tameiakes_errors";
$MyIDFieldName="IDError";
$ListExist=true;
$prefix=$MyFormName."@";
$frmOpenNew='"'.$MyIDFieldName.'","0","'.$MyADDFormName.'",0,0' ;
 
include 'include/top_vars.php';  
include_once 'include/header.php';
 
$simera2=date_olografos($now); 

?> 
<style>
.red {background: #FF5733;color:white;}
.green {background: #52BE80;color:white;}
.normal { }
</style>
 
<form id="<?php echo $MyFormName;?>" name="<?php echo $MyFormName;?>" autocomplete="off">
 <body OnLoad="document.<?php echo $MyFormName.'.'.$prefix ?>FindWhat.focus();">
 
 <div class="vsboxDetail hide1" >
	<h1> ΚΑΤΑΣΤΑΣΗ ΛΑΘΩΝ ΤΑΜΕΙΑΚΩΝ</h1>
 </div>
 <?php include 'include/top_grid_list_buttons.php';  ?>

<div class="scroll" style="margin-bottom:0px;padding-bottom:0px;width:100%;" > 
<div class="sticky">
  <table id="CustomerList" class="gridList" > 
   <tr  >
	<td class="r w50" >A/A<a onclick="grdsrt('IDError');" class="sortpic"/></td>
	<td class="l w120">ΤΑΜΕΙΑΚΗ<a onclick="grdsrt('Tameiakes_Error_Model');" class="sortpic"/></td>
	<td class="c w80">Error No </td>
	<td class="hide1">ΠΕΡΙΓΡΑΦΉ<a onclick="" class="sortpic"/></td>
	<td class="hide1">Λύση (Solution)<a onclick="grdsrt('Tameiakes_Error_Solution');" class="sortpic"/></td> 
  </tr> 
</table>
</div>
 
 <table class="gridListNoCaption"  > 
<?php
 


    $flds="IDError, Tameiaki_Model, Error_No, Error_Perigrafi, Error_Solution, Sxolia";
 $filter=filter_make($flds, $FindWhat);
 $query=" SELECT * FROM ". $tblName . " " . $filter ; 
 

  if($SortValue==''){$query=$query ." ORDER BY Tameiaki_Model ";} else {$query=$query." ORDER BY " . $SortValue . " ";}
 
 $_SESSION['EXCEL_SQL']=$query;
 
  $num_rows=RecordsCount($conn,$query);
     $RecNo=$num_rows;
   $FromRec=($pgNo-1)*$RecsPP ;
     $pgMax=intval($num_rows/$RecsPP)+1;
  
    $query=$query.' LIMIT '.$FromRec . ', ' . $RecsPP ;
   $result=mysqli_query($conn, $query);
 
$iRow=$FromRec;

 while ($rs = mysqli_fetch_array($result)) {

$iRow +=1;
 
$IDError = $rs['IDError'];
$Tameiaki_Model=$rs['Tameiaki_Model'];
$Error_No=$rs['Error_No'];
$Error_Perigrafi = $rs['Error_Perigrafi'];
$Error_Solution= $rs['Error_Solution'];
 
$frmOpen='"'.$MyIDFieldName.'","'.$IDError.'","'.$MyADDFormName.'",' ;
  
// ========================================
//  Tameiakes List
// ========================================
 
    echo "<tr class='tablerowdata'  onclick='javascript:OpenFormADD($frmOpen);'> ";
	echo "<td class='r w50'>$iRow</td>";
	echo "<td class='l w120'> $Tameiaki_Model </td>";
	echo "<td class='c w80'> $Error_No </td>";
	echo "<td class='hide1'>$Error_Perigrafi</td>";
	echo "<td class='hide1'>$Error_Solution</td>";
    echo "</tr>";   
 }
  
 
for ($x = $iRow+1; $x <= $pgNo*$RecsPP; $x++) {
    echo "<tr class='tablerowdata' onclick='javascript:OpenFormADD($frmOpenNew);'> ";
	echo "<td class='r w50'></td>";
	echo "<td class='l w120'></td>";
	echo "<td class='c w80'></td>";
	echo "<td class='hide1'></td>";
	echo "<td class='hide1'></td>";
    echo "</tr>";
 }	
 

?>
</table>


<?php include 'include/recs_div_bottom.php'; ?>
 
</div>	
 
</body>
 
</form> 

<script type="text/javascript" src="js/mycheck.js"></script>  
<?php 
  include 'include/footer2020.php';
?>
 
<script language="JavaScript" type="text/JavaScript">

function export_to_excel() {

var mSQL="<?php echo $query; ?>";


	export_excel(mSQL);
	
}
</script>
