<?php 
session_start();
if($_SESSION['CheckPWD']==false){ header("Location: login.php"); }
	
$myTopCaption_Text="© Visualsoft Computer Applications";
$MyFormName=str_replace('.php', '', basename($_SERVER['PHP_SELF']));
$MyIDFieldName="IDRandom";
$tblName='r_codes';
$ListExist=true;
$prefix="rCodes_";
$codes_nο="100";
$codes_len="10";

$RecsPP_fld=$prefix.'RecsPP';
$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, $prefix.'FindWhat', FILTER_SANITIZE_SPECIAL_CHARS));
     $pgNo = trim(filter_input(INPUT_GET, $prefix.'pgNo', FILTER_SANITIZE_SPECIAL_CHARS));
 	  if(is_numeric($pgNo)){	 } else { $pgNo=1;} 

include 'include\Header.php';	
echo "<br>";
 
#include 'myFunctions.php';
 
$now = new DateTime();
$now= $now->format('d/m/Y'); 

$simera2=date_olografos($now); 
  
?> 
	<link href="logos/ApplicationLogo.png" rel="shortcut icon" type="image/x-icon"> 
	<link rel="stylesheet" href="css/vsFormIstoriko.css" />  
	<link rel="stylesheet" href="css/search2020.css" />
	<link rel="stylesheet" href="css/vsButtons.css" /> 
	<link rel="stylesheet" href="css/checkbox/chkBoxStyle4.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"  style="padding-bottom:0px;" >
 <h1  >ΓΕΝΝΗΤΡΙΑ ΤΥΧΑΙΩΝ ΚΩΔΙΚΩΝ</h1>
   
	<table class="hideOnPrint MenuBarForGridList" border="0"  > 
		<tr  style="valign:center;" >
			<td width="100%" style="padding-right:4px; display: flex;" >	
			  <a href="javascript:OpenFormADD_onWin(0);" class="button new">Νέα ομάδα</a>
			  <a href="javascript:refresh('<?php echo $prefix ?>');" class="button refresh">Ανανέωση</a>
			  <a href="javascript:window.print();" title=" Εκτύπωση Κατάστασης " class="button print">Δημιουργία Αρχείου .csv</a> 
 
				<div class="btn-vs-group" style="margin-left:10px;">
					 <input type="text" id="codes_nο" title=" Όνομα Πελάτη " class='button2' placeholder="Πελάτης" required value="<?php echo $pelatis;?>">
					 <input type="text" id="codes_nο" title=" Αριθμός Κωδικών "style="width:50px;" class='button2' placeholder="Αριθ.Κωδικών" required value="<?php echo $codes_nο;?>">
					 <input type="text" id="codes_len" title=" Μήκος Κωδικού " style="width:50px;" class='button2' placeholder="Μήκος Κωδικού" required value="<?php echo $codes_len;?>">
				  <a id="calendar_select" href="#" class="button2" title=" Επιλογή Περιόδου "></a>
				</div>				
				</td>
		</tr>	  
	</table>	

<div class="sticky">
  <table class="gridList"  > 
   <tr>
	<td class="c1 w40">AA</td>
	<td class="c1 w100">ΗΜΕΡΟΜΗΝΙΑ</td>
	<td class="c1 w200">ΚΩΔΙΚΟΣ</td>
	<td class="l1"> ΠΕΛΑΤΗΣ</td> 
  </tr> 
</table>
</div>
 
 <table class="gridListNoCaption"  > 
<?php
 
 $start_date=formatMyDate($HmApo,"GrToMySql"); 
  $end_date=formatMyDate($HmEos,"GrToMySql"); 
  $Pelatis="test";
  
  $sql = "DELETE FROM ". $tblName  ;
  $conn->query($sql); 
 $iRow=0;
 
for($ii=0;$ii<100;$ii++) {
 //	echo RandomString()."<br>";
  $rCode=RandomString();
 
 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 +=1;
 
$Hmnia=formatMyDate($rs['Hmnia'],"MySqlToGr");
 
// ========================================
//  notes List
// ========================================
 
    echo "<tr class='tablerowdata' onclick='javascript:OpenFormADD_onWin($IDRandom);'> ";
    echo "<td class='c1 w40'>$iRow</td>";
	echo "<td class='c1 w100'>$Hmnia</td>";
    echo "<td class='w200'>$rCode</td>";
	echo "<td>$Pelatis</td>";
    echo "</tr>";   
 }
if ($iRow<10 ){ 
	for ($x =$iRow; $x < 10; $x++) {
		echo "<tr class='tablerowdata' onclick='javascript:OpenFormADD_onWin(0);'> ";
		echo "<td class='c1 w40'></td>";
		echo "<td class='c1 w100'></td>";
		echo "<td class='w200'></td>";
		echo "<td></td>";
		echo "</tr>";
	 }	
} 

?>
</table>

<table class="gridListFooter"   border="0"  cellspacing="0" cellpadding="0" align="center" valign="bottom">
	<tr>
	 <td align="center" class="styleRecs">Βρέθηκαν <?php echo $num_rows;?> Eγγραφές</td>
	</tr>
</table>
 
</div>	
 
</body>
 
</form> 
 
<?php 
  include 'HmApoEos.php';
  include 'js\vsFunctions.js';
  if ($ListExist==true){ include 'js\RecsNextPrv.js'; }
  include 'include\Footer2020.php';
?>
 



