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

$tblName='tameio_apothematiko';
$IDcField='IDApothematikou';
$FocusField="Hmnia";
$RequiredField="Aitiologia";
$ListExist=false;
$MyFormName=str_replace('.php', '', basename($_SERVER['PHP_SELF']));
$myTopCaption_Text=" ΑΠΟΘΕΜΑΤΙΚΟ - ΕΠΕΞΕΡΓΑΣΙΑ ΕΓΓΡΑΦΗΣ ";
$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 > 
   
 <head>
	<title>vs Contracts</title>
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="">
</head>  

	<link rel="shortcut icon" href="icons/Asthenis_24x24.ico" />
	<link rel="stylesheet" href="css/tab2023.css">
	
<?php
  include 'include/del_yes_no.php';
?>
 
<?php

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

$IDc=0;$IDApothematikou=0;$Aitiologia='';$EsodaFolder='';
$Hmnia= date_create('now')->format('d/m/Y'); 
$HmniaDateNum=0;$Esoda='0';$Exoda='0';$Sxolia='';
$IDRecType=1;$RecType='ΜΕΤΡΗΤΑ';
$isCreditCard=0;

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

$IDApothematikou = gConvertField($rs['IDApothematikou'],0);
$IDc=$IDApothematikou;
$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'],0);
$RecType=$rs['RecType'];
$Sxolia=$rs['Sxolia'] ;


if($isCreditCard==-1){$isCreditChk='checked';} 
 if($IDc==0){$LeftCap="Αποθεματικό : Νέα εγγραφή";}else{$LeftCap="Αποθεματικό: Μεταβολή εγγραφής";}
// echo  $IDApothematikou. ' -- ' . $Hmnia;
//if ($IDApothematikou==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:10px 20px 10px 20px;"  >
   <h1> <?php echo $LeftCap?>
		<table class="hide1" width="100%" align="center" border="0" cellspacing="0" cellpadding="0" style="margin-top:1px;">
		<tr>
			<td style="font-weight:normal;width:120px; margin-top:-24px;" align="center" class="titleRight"><?php echo 'ID: '. $IDc;?> </td>
		</tr>  
		</table>
   </h1>
 </div> 
 
 

 
 <div id="" class="vsBoxNew " style="margin:10px 20px 10px 20px; padding:20px 10px;box-shadow: 1px 3px 8px #999999 ;"> 
		<div class="row">
		<div class="col-20"><label for="Hmnia"><b>Ημερομηνία</b></label></div>
		<div class="col-20">
			<div class="vscombo-div">
			  <input class="datepicker" type="text" id="Hmnia" name="Hmnia" required value="<?php echo $Hmnia;?>" >
			  <a class="vscombo_date_button" name="Hmnia_Button" id="Hmnia_Button" ></a></input>
			</div>  
		</div>
		</div>

		<div class="row">
			<div class="col-20"><label for="Aitiologia">Αιτιολογία-Ενέργεια</label></div>
			<div class="col-80"><input type="text" id="Aitiologia" name="Aitiologia" required value="<?php echo $Aitiologia;?>"></div>
		</div>
		<div class="row" >
			<div class="col-20"><label for="cboTameioCases">Τύπος Εγγραφής</label></div>
			<div class="col-60"><?php cboApothematikoRecTypesMake($conn,$IDRecType);?></div>
 		</div>
		
		<div class="row" >
			<div class="col-20"><label for="Esoda">Εσοδα €</label></div>		
			<div class="col-20"><input type="text" id="Esoda" name="Esoda" style="text-align:right;" value="<?php echo $Esoda;?>"></div>
		</div>
		<div class="row" >
			<div class="col-20"><label for="Exoda">Εξοδα €</label></div>		
			<div class="col-20"><input type="text" id="Exoda" name="Exoda" style="text-align:right;" value="<?php echo $Exoda;?>"></div>
		</div>
 
 		<div class="row" >
			<div class="col-20"><label for="Exoda">Σημειώσεις</label></div>		
			<div class="col-80"><textarea name="Sxolia" id="Sxolia" style="font-size:1em;resize:none;min-height:80px;max-height:100%;padding:10px;"  value="<?php echo $Sxolia;?>" ><?php echo $Sxolia;?></textarea></div>
		</div>
 
 </div>
 
<?php
  include 'include/buttons_bar_down.php';
?>
 
	
 </body>
 
 <Div style="visibility:hidden; position:absolute; margin-left:150px; margin-top:-150px; top:-50; width:20%; " >
	  <input type="text" name="IDApothematikou" id="IDApothematikou" value="<?php echo $IDApothematikou;?>"> 
	  <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>
 
<script type="text/javascript" src="js/mycheck.js"></script>   
<script type="text/javascript" src="js/datepicker.js"></script>   
  
<script language="JavaScript" type="text/JavaScript">
 function confirmExit(){ window.close();}
</script> 
 
 