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

$myTopCaption_Text=" ΣΗΜΕΙΩΣΕΙΣ - ΕΠΕΞΕΡΓΑΣΙΑ ΕΓΓΡΑΦΗΣ ";
$MyFormName=str_replace('.php', '', basename($_SERVER['PHP_SELF']));
$tblName='notes';
$IDcField='IDNote';
$FocusField="Hmnia";
$RequiredField="Aitiologia";
$CloseType="Close";

//include 'include\Header.php';
include 'myFunctions.php';
?>

<style>
#Hmnia {
	font-size:20px !important;
}
</style>

<html > 
   
	<head>
	  <meta name="theme-color" content="#ffe3eb">
	
		<!-- Chrome, Firefox OS and Opera -->
		<meta name="theme-color" content="#999999">
		<!-- Windows Phone -->
		<meta name="msapplication-navbutton-color" content="#999999">
		<!-- iOS Safari -->
		<meta name="apple-mobile-web-app-status-bar-style" content="#999999">
	</head>
	
	<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="shortcut icon" href="icons/Asthenis_24x24.ico" />
    <link rel="stylesheet" href="css/vsFormIstoriko.css" />  
	<link rel="stylesheet" href="css/vsButtons.css" />	
	<link rel="stylesheet" href="css/checkbox/chkBoxStyle4.css">

<style>
body {
	background:#F3F3F3;
}
</style>
<?php
  include 'DelYesNo.php';
?>
 
<?php

//========================================
//       Record Read
//========================================
$closeCap=" Επιστροφή ";
 
// print_r($_SESSION); 

$IDc=0;$IDNote=0;$Aitiologia='';
$Hmnia= date_create('now')->format('d/m/Y'); 
$HmniaDateNum=0;$Sxolia='';

if($conn == false){
	 echo 'Δεν υπαρχει συνδεση...<br>';
	  dbConnect();
}
   $IDc = gConvertField($_COOKIE[$IDcField], '0');
 $query = "SELECT * FROM ".$tblName . " WHERE ". $IDcField . "=" . $IDc ;
 
// echo '<br>'. $query ;
$result = mysqli_query($conn, $query);
    $rs = mysqli_fetch_assoc($result);

$IDNote = gConvertField($rs['IDNote'],0);
$IDc=$IDNote;
$Hmnia=formatMyDate($rs['Hmnia'],"MySqlToGr",date_create('now')->format('d/m/Y')); 
$HmniaNum= $rs['HmniaNum'] ; 
$Aitiologia=$rs['Aitiologia'];
$isDone=$rs['isDone'];
$Sxolia=$rs['Sxolia'] ;
 
if($isDone==-1){$isDoneChk='checked';} 
 if($IDc==0){$LeftCap="Σημειώσεις : Νέα εγγραφή";}else{$LeftCap="Σημειώσεις: Μεταβολή εγγραφής";}
 
// ============================
   
// ============================
  
?> 

 <form  name="<?php echo $MyFormName;?>" id="<?php echo $MyFormName;?>" method="post" action="_rs.php"> 
 <body  OnLoad="javascript:onLoadFocus();"  >
 
  <div class="title"> <?php echo $myTopCaption_Text ;?> </div>
    <div class="datadivForPopUp" >

	<table border="1"   >
 		<tr  >
			<td style="width:20%;min-width:140px; ">
			<label for="Hmnia">Ημερομηνία</label>
			<input type="text" id="Hmnia" name="Hmnia" style="text-align:center;" onfocus="this.select();" required value="<?php echo $Hmnia;?>">
			</td>
			<td style="width:50%;"></td>
			  
			 <td style="width:30%;float:bottom;padding-top:24px;"> 
				<label class="mychk_container" > Ολοκληρώθηκε  
				  <input id="isDoneCheck" name="isDoneCheck" type="checkbox" <?php echo $isDoneChk ?>  onchange="javascript:chkUpd('isDone');" >
				  <span class="checkmark"></span>
				</label>
			 </td> 
		</tr> 
		<tr>
			<td colspan="3">
			<label for="Aitiologia">Αιτιολογία</label><input type="text" id="Aitiologia" name="Aitiologia" required value="<?php echo $Aitiologia;?>">
			</td>
		</tr>
 
		<tr>
			<td colspan="3">
			<label for="Sxolia">Σημειώσεις</label><textarea name="Sxolia" id="Sxolia"  style="height:60px;" value="<?php echo $Sxolia;?>" ><?php echo $Sxolia;?></textarea>
			</td>
		</tr>
	</table>
 
 </div>

 <div class="footerForPopUp">
<?php
  include 'include/ButtonsBarDown.php';
?>
</div>	
 </body>
 
 <Div style="visibility:hidden; position:absolute; margin-left:150px; margin-top:-150px; top:-50; width:20%; " >
	  <input type="text" name="IDNote" id="IDNote" value="<?php echo $IDNote;?>"> 
	  <input type="text" name="isDone" id="isDone" value="<?php echo $isDone;?>">  
	  <input type="text" name="HmniaDateNum" id="HmniaDateNum" value="<?php echo $HmniaDateNum;?>">
	  <input type="text" name="PageName" id="PageName" value="<?php echo $MyFormName.'.php';?>">
	  <input type="text" name="tblName" id="tblName" value="<?php echo $tblName;?>">
	  <input type="text" name="IDcField" id="IDcField" value="<?php echo $IDcField;?>">
	  <input type="text" name="IDc" id="IDc" value="<?php echo $IDc;?>">  
	  <input type="text" name="CloseType" id="CloseType" value="<?php echo $CloseType;?>">
 </div>	
				<!---   ΚΛΕΙΝΕΙ ΤΟ FRAME  visibility:hidden; --->
</form>
 

 
</html>

 
<?php 
	if ($ListExist==true){ include 'js\RecsNextPrv.js'; }
 	include 'js\vsFunctions.js';
//	include 'include\Footer2020.php';
?> 
<script type="text/javascript" src="js\vsFunctions.js"> </script>
	 
<script language="JavaScript" type="text/JavaScript">
 function confirmExit(){ window.close();}
 
 //var w=850;
 //var el=document.getElementById("btnClose") ;
 //var h1=getOffset(el).top + getOffset(el).height + 90;
 //window.resizeTo(w, h1);
 //window.moveTo((screen.width-w)/2, (screen.height-h1)/2);
 
</script> 
 