<?php 
session_start();
?>
<head>
	<title>Visualsoft Office Manager - Service</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"); }

error_reporting(E_ALL); ini_set('display_errors', 1);

$myTopCaption_Text="Service Παραλαβές-Επισκευές ";
$MyFormName=str_replace('.php', '', basename($_SERVER['PHP_SELF']));
$MyADDFormName="service_add"; $w=0; $h=0; //$w=800;$h=400;
$MyIDFieldName="IDService";
$tblName='service';
$ListExist=true;
$prefix=$MyFormName."@";
$pFind=$prefix."FindWhat";
$FocusField=$prefix."FindWhat";
$IDcField="";
$RequiredField="";
$frmOpenNew='"'.$MyIDFieldName.'","0","'.$MyADDFormName.'",' ;

include 'include/top_vars.php';   
include_once 'include/header.php';
 
#$now = new DateTime();
#$now= $now->format('d/m/Y'); 

#$simera2=date_olografos($now); 
#app_head();
?> 
 
<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('IDService');" class="sortpic"/></td>
	<td class="c w100">ΠΑΡΑΛΑΒΗ<a onclick="grdsrt('HmniaParalavis');" class="sortpic"/></td>
	<td class="l"> ΠΕΛΑΤΗΣ <a onclick="grdsrt('Eponymia');" class="sortpic"/></td>
	<td class="l w120 hide1" >ΣΥΣΚΕΥΗ<a onclick="grdsrt('EidosSyskeyis');" class="sortpic"/></td> 
    <td class="l w180  hide1" >MODEL<a onclick="grdsrt('Model');" class="sortpic"/></td> 
    <td class="hide1">ΠΕΡΙΓΡΑΦΗ ΒΛΑΒΗΣ<a onclick="grdsrt('PerigrafiVlavis');" class="sortpic"/></td>
	<td class="c w100  hide1"> ΠΑΡΑΔΟΣΗ </td>
  </tr> 
</table>
</div>
 
 <table class="gridListNoCaption"  > 
<?php
 
 $start_date=formatMyDate($HmApo,"GrToMySql"); 
   $end_date=formatMyDate($HmEos,"GrToMySql"); 
 
   $flds="Eponymia,EidosSyskeyis,Model,SerialNo,PerigrafiSyskeyis,PerigrafiVlavis ";
 $filter=filter_make($flds, $FindWhat);
 // $query=" SELECT pelates.Eponymia," . $tblName . ".* FROM ". $tblName .
//		 " INNER JOIN pelates ON service.IDPelati = pelates.IDPelati " . $filter ; 
 
 $query = service_query() . $filter ; ;
 
if ($show_all_value!=="checked" ){
 	if($filter==""||$filter==null) {
 		 $query=$query ." WHERE HmniaParalavis BETWEEN '" . $start_date . "' AND '" . $end_date . "' ";
 	   }
}
  if($SortValue==''){$query=$query ." ORDER BY HmniaParalavis desc ";} else {$query=$query." ORDER BY " . $SortValue . " ";}
 
 # echo $query;
 
  $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);
 
$iRow=$FromRec;

 while ($rs = mysqli_fetch_array($result)) {
$iRow +=1;
 
$IDService = $rs['IDService'];
$HmniaParalavis=formatMyDate($rs['HmniaParalavis'],"MySqlToGr");
$Eponymia = $rs['Eponymia'];
$EidosSyskeyis = $rs['EidosSyskeyis'];
$Model = $rs['Model'];
$PerigrafiVlavis = $rs['PerigrafiVlavis'];
$HmniaEpiskeyis=formatMyDate($rs['HmniaEpiskeyis'],"MySqlToGr"); 
 $frmOpen='"'.$MyIDFieldName.'","'.$IDService.'","'.$MyADDFormName.'",' ;
// ========================================
//  notes List
// ========================================
 
    echo "<tr class='tablerowdata' onclick='javascript:OpenFormADD($frmOpen);'> ";
    echo "<td class='r w50'>$iRow</td>";
	echo "<td class='c w100'>$HmniaParalavis</td>";
    echo "<td>$Eponymia</td>";
	echo "<td class='l w120 hide1'>$EidosSyskeyis</td>";
	echo "<td class='l w180 hide1'>$Model</td>";
	echo "<td class='hide1'>$PerigrafiVlavis</td>";
	echo "<td class='c w100 hide1'>$HmniaEpiskeyis</td>";
    echo "</tr>";   
 }
 
for ($x = $iRow+1; $x <= $pgNo*$RecsPP; $x++) {
    echo "<tr class='tablerowdata'  onclick='javascript:OpenFormADD( $frmOpenNew);'> ";
    echo "<td class='c w50' > </td>";
	echo "<td class='c w100'></td>";
    echo "<td></td>";
	echo "<td class='w120 hide1'> </td>";
    echo "<td class='w180 hide1'> </td>";	
	echo "<td class='hide1'></td>";
	echo "<td class='w100 hide1'> </td>";	
    echo "</tr>";
 }	
 

?>
</table>

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

</div>	
 
 <?php include 'include/recs_no_max_div.php'; ?>

</body>
 
</form> 
 
<?php 
  include 'HmApoEos.php';
  #include 'include/list_filters.php';
  include_once 'include/footer2020.php';
?>
<script type="text/javascript" src="js/mycheck.js"></script>  
<script type="text/javascript" src="js/datepicker.js"></script>    



