<?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';
?>



<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/myPopUp.css" />  
	<link rel="stylesheet" href="css/vsButtons.css" />	
	<link rel="stylesheet" href="css/yesno.css">
 
	<link rel="stylesheet" href="css/datepicker.css">

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

$IDc=0;$IDNote=0;$Aitiologia='';
$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="Σημειώσεις: Μεταβολή εγγραφής";}
 
// ============================
   
// ============================
  
?> 
	
<form name="<?php echo $MyFormName; ?>" id="<?php echo $MyFormName;?>" method="post" action=""> 
 
 <body  OnLoad="javascript:onLoadFocus();"  >
 

   
<?php //<div id="dataDiv"  > ?>
   
    <div id="111" class="fieldset3 " >  
	<h1> ΣΗΜΕΙΩΣΕΙΣ </h1>
	<table width="100%" border="0"  style=" margin-bottom:50px;" >
 		<tr >
			<td style="width:20% "> Ημερομηνία</td>
			<td style="width:30%;min-width:140px;>
			<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>			
			
			</td>
			 
			 <td style="width:40%;text-aligh:right;float:right;padding-top:10px;"> 
				
				<label class='t2' style="margin-top:-5px;">
					<span class='text'>Ολοκληρώθηκε</span>
					<input  type='checkbox' id="isDoneCheck" name="isDoneCheck"  <?php echo $isDoneChk ?> onclick="javascript:chkUpd('isDone');"  />
					<span class='value'></span>
				</label>

			 </td> 
		</tr> 
		<tr>
			<td style="width:20% "> Αιτιολογία-Ενέργεια</td>
			<td colspan="3">
			
			<input type="text" id="Aitiologia" name="Aitiologia" required value="<?php echo $Aitiologia;?>">
			</td>
		</tr>
 
		<tr>
			<td colspan="4">
			<label for="Sxolia">Σημειώσεις</label><textarea name="Sxolia" id="Sxolia"  style="height:80px;" value="<?php echo $Sxolia;?>" ><?php echo $Sxolia;?></textarea>
			</td>
		</tr>
		
		<tr></tr>
		<tr >
			
			<td colspan="4" style=" text-aligh:right;float:right;padding-top:10px;">
				<label class='t2' style="margin-top:0px;">
					<span class='text'>Ολοκληρώθηκε</span>
					<input  type='checkbox' id="isDoneCheck" name="isDoneCheck"  <?php echo $isDoneChk ?> onclick="javascript:chkUpd('isDone');"  />
					<span class='value'></span>
				</label>
			</td>
		</tr>
		
	</table>
 
 </div>

 </div>
 
<?php
  include 'include/del_yes_no.php';
  include 'include/buttons_bar_down.php';
?>
	
 </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>	
				<!---   ΚΛΕΙΝΕΙ ΤΟ FRAME  visibility:hidden; --->
</form>
</html>
 
<script type="text/javascript" src="js/mycheck.js"></script>   
<script type="text/javascript" src="js/datepicker.js"></script>   