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

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

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

<style>
 
.filter-option {
	font-family:  'Open Sans Condensed', "Helvetica", 'Fira Sans Condensed',   'Helvetica Neue',  sans-serif; 
	font-size:16px;
	font-weight:600;
}
#Hmnia {
	font-size:20px !important;
}
</style>

<html > 
   <link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,300italic,700&subset=latin,greek,greek-ext" rel="stylesheet" type="text/css">
	<head><meta name=”theme-color” content=”#999999” /></head>
	<link rel="shortcut icon" href="icons/Asthenis_24x24.ico" />
    <link rel="stylesheet" href="css/vsFormIstoriko.css" />  
	<link rel="stylesheet" href="css/vsButtons.css" />	
<?php
  include 'DelYesNo.php';
?>
 
<?php

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

$IDc=0;$IDTameiou=0;$Aitiologia='';$EsodaFolder='';
$Hmnia= date_create('now')->format('d/m/Y'); 
$HmniaDateNum=0;$Esoda='0';$Exoda='0';$Sxolia='';
$IDRecType=1;$RecType='Μετρητά';

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);

$IDTameiou = gConvertField($rs['IDTameiou'],0);
$IDc=$IDTameiou;
$Hmnia=formatMyDate($rs['Hmnia'],"MySqlToGr",date_create('now')->format('d/m/Y')); 
$HmniaNum= $rs['HmniaNum'] ; 
$Aitiologia=$rs['Aitiologia'];
$Esoda=gConvertField($rs['Esoda'],0);
$Exoda=gConvertField($rs['Exoda'],0);
$IDRecType=gConvertField($rs['IDRecType'],1);
$RecType=$rs['RecType'];
$Sxolia=$rs['Sxolia'] ;

if($RecType==''){$RecType='Μετρητά';} 

if($isCreditCard==-1){$isCreditChk='checked';} 
 if($IDc==0){$LeftCap="Ημερολόγιο : Νέα εγγραφή";}else{$LeftCap="Ημερολόγιο: Μεταβολή εγγραφής";}

// echo  $IDTameiou. ' -- ' . $Hmnia;
//if ($IDTameiou==0) {$Hmnia= date('d/m/Y') };
// ============================
   
// ============================
  
?> 

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

 <div id="aa" class="vsBoxNew" style="margin-top:-5px;"  >
   <h1>
		<table width="100%" align="center" border="0" cellspacing="0" cellpadding="0" style="margin-top:1px;">
		<tr>
			<td align="left"> </td>
			<td style="font-weight:normal;width:220px;" align="center" class="titleRight"><?php echo $LeftCap ;?> </td>
		</tr>  
		</table>
   </h1>
   
    <div id="dataDiv" >

	<table border="0"  >
 		<tr>
			<td colspan="1">
			<label for="Hmnia">Ημερομηνία</label>
			<input type="text" id="Hmnia" name="Hmnia" onfocus="this.select();" required value="<?php echo $Hmnia;?>">
			</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><label for="Esoda">Εσοδα €</label><input type="text" id="Esoda" name="Esoda" style="text-align:right;" value="<?php echo $Esoda;?>"></td>
		<td><label for="Exoda">Εξοδα €</label><input type="text" id="Exoda" name="Exoda" style="text-align:right;" value="<?php echo $Exoda;?>"></td>	
        <td style="width:50% ">
			<label for="cboTameioCases">Τύπος Εγγραφής</label>
			<?php cboTameioRecTypesMake($conn,$IDRecType);?>
		</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>
 
<?php
  include 'include/ButtonsBarDown.php';
?>
	
 </body>
 
 <Div style="visibility:hidden; position:absolute; margin-left:150px; margin-top:-150px; top:-50; width:20%; " >
	  <input type="text" name="IDTameiou" id="IDTameiou" value="<?php echo $IDTameiou;?>"> 
	  <input type="text" name="IDRecType" id="IDRecType" value="<?php echo $IDRecType;?>"> 
	  <input type="text" name="RecType" id="RecType" value="<?php echo $RecType;?>">  
	  <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();}
 
</script> 
 