<?php
 
//========================================
//       Record Read
//========================================
$closeCap=" Επιστροφή ";
 
$IDc=0;$IDNote=0;$Aitiologia="";$isDone=0;$Sxolia="";
$Hmnia= date_create('now')->format('d/m/Y'); 
$HmniaNum=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'] ;

$isDoneChk='unchecked'; 
if($isDone==-1){$isDoneChk='checked';} 
if($IDc==0){$LeftCap="Σημειώσεις : Νέα εγγραφή";}else{$LeftCap="Σημειώσεις: Μεταβολή εγγραφής";}
 
// ============================
   
// ============================
$mtab=$MyFormName.'@tab';
if ($IDc==0) {$_SESSION[$mtab]="tab1";}
if (isset($_SESSION[$mtab])) {$mySelect_tab = $_SESSION[$mtab];}else{$mySelect_tab = "tab1";}
	
?> 
<style>
.textarea-container {
  position: relative;
}
.textarea-container textarea {
  width: 100%;
  box-sizing: border-box;
}
.textarea-container button {
  position: absolute;
  top: 0;
  right: 2;
}
</style>
 
<form name="<?php echo $MyFormName; ?>" id="<?php echo $MyFormName;?>" method="post" action=""> 
 <body  OnLoad="javascript:onLoadFocus();"  >
	
 <div  class="vsBoxNew full"  style="height:50vh auto; padding:10px 5px 10px 5px ; ">
 
		<div class="row">
		<div class="col-20"><label for="Hmnia">Ημερομηνία</label></div>
		<div class="col-20">
				<div class="vscombo-div">
				  <input class="datepicker" type="text" id="Hmnia" name="Hmnia" value="<?php echo $Hmnia;?>" >
				  <a class="vscombo_date_button" name="Hmnia_Button" id="Hmnia_Button" ></a>
				</div>  
		</div>
		</div>
		<div class="row">
			<div class="col-20"><label for="Aitiologia">Αιτιολογία-Ενέργεια</label></div>
			<div class="col-80" style="position: relative; display: inline;">	
				<input type="text" id="Aitiologia" name="Aitiologia" style="padding-right:24px;" required value="<?php echo $Aitiologia;?>">
				<a class="btnMicrophone" style="position:absolute;top:8;right:12;" onclick="runSpeechRecognition('Aitiologia');"></a>
				</input>
			</div>
		</div>
 
		<div class="row">
		<div class="col-20"><label for="Sxolia">Σημειώσεις</label></div>
		<div class="col-80 textarea-container" style="position: relative; display: inline;">	
				<textarea name="Sxolia" id="Sxolia" style="padding-right:26px;overflow-y:scroll;" spellcheck="true" value="<?php echo $Sxolia;?>" ><?php echo $Sxolia;?></textarea>
				<a class="btnMicrophone" style="position:absolute;top:6;right:28;" onclick="runSpeechRecognition('Sxolia');"></a>
		</div>
		</div>
 	
		<div class="row">
		<div class="col-20"><label for="isDoneChk">Ολοκληρώθηκε</label></div>
		<div class="col-80">	
				<?php  input_yesno_only("Ολοκληρώθηκε", "isDoneChk", "isDone", $isDone,"" )?> 
		
		</div>
		</div>
 
 </div>
 
 </body>
 
 <Div style="visibility:hidden ; position:absolute; margin-left:-110px; margin-top:-150px; top:-150; 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="HmniaNum" id="HmniaNum" value="<?php echo $HmniaNum;?>">
	  <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;?>">
	  <input type="text" name="FocusField" id="FocusField" value="<?php echo $FocusField;?>">
 
 </div>	
				 
</form>
 
   