<?php 
session_start();
?>
<head>
	<Title>Visualsoft Office Manager - Ταμείο</Title>
	<link href="logos/ofm1.ico" rel="shortcut icon" type="image/x-icon"> 
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<meta name="description" content="">
	<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<?php
if($_SESSION['CheckPWD']==false){ header("Location: login.php"); }

$myTopCaption_Text=" ΤΑΜΕΙΟ - ΕΠΕΞΕΡΓΑΣΙΑ ΕΓΓΡΑΦΗΣ ";
$MyFormName=str_replace('.php', '', basename($_SERVER['PHP_SELF']));
$tblName='tameio';
$IDcField='IDTameiou';
$FocusField="Hmnia";
$RequiredField="Aitiologia";
$CloseType="Close";
$ReturnTo='tameio_list.php';
//include 'include/Header.php';
include 'myfunctions.php';
include 'include/del_yes_no.php';
include 'include/buttons_bar_top-popup.php';
?>
 
<html > 
	<link rel="stylesheet" type="text/css" href="css/tab2023.css"  /> 	
<?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='Μετρητά';
$IDPelati=0;$EponymiaPelati="";
$IDProm=0;$EponymiaProm="";

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

$IDTameiou = gConvertField($rs['IDTameiou'],0);
$IDPelati = gConvertField($rs['IDPelati'],0);
$IDProm = gConvertField($rs['IDProm'],0);

$EponymiaPelati= $rs['Pelatis_Eponymia']; 
$EponymiaProm= $rs['Prom_Eponymia'];
 
$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'];
$UpToDate=$rs['UpToDate'];
$Sxolia=$rs['Sxolia'] ;
 
if($RecType==''){$RecType='Μετρητά';} 

//if($isCreditCard==-1){$isCreditChk='checked';} 
 if($IDc==0){$LeftCap="ΤΑΜΕΙΟ > ΝΕΑ ΕΓΓΡΑΦΗ";}else{$LeftCap="ΤΑΜΕΙΟ > ΜΕΤΑΒΟΛΗ ΕΓΓΡΑΦΗΣ";}

$UpToDateChk="";
if($UpToDate==-1){$UpToDateChk='checked';} 

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

 <form  name="<?php echo $MyFormName;?>" id="<?php echo $MyFormName;?>" method="post" action=""> 
 <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">Ημερομηνία</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></input>
			</div>  
		</div>
		<div class="col-60 r" style="padding-bottom:4px;" >
			<div><?php  input_yesno("Ενημερώθηκε", "UpToDateChk", "UpToDate", $UpToDate,"" )?> </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-80"><?php cboTameioRecTypesMake($conn,$IDRecType);?></div>
		</div>		
		
		<div class="row" >
			<div class="col-20"><label for="Esoda">Εσοδα €</label></div>
			<div class="col-20"><input type="text" class="r f18" id="Esoda" name="Esoda" value="<?php echo $Esoda;?>"></input></div>
			<div class="col-10 hide1"><input hidden type="text" id="IDPelati" name="IDPelati"  value="<?=$IDPelati;?>"></input></div>
		<div class="col-60" style="position: relative; display: inline;">
		<input type="text" id="EponymiaPelati" name="EponymiaPelati" placeholder='Πελάτης...'  onKeyUp="eponymia_upd();" value="<?= $EponymiaPelati;?>"  > 
			<a class="btnKartela" style="position:absolute;top:8;right:68;" onclick="javascript:pelatis_show();"> </a> 
			<a class="btnFind" style="position:absolute;top:8;right:40;" onclick="javascript:pelatis_select('');"> </a> 
			<a class="btnCancel" style="position:absolute;top:8;right:12;" onclick="javascript:pelatis_remove('');"> </a> 
		</input>
		
		</div>
		</div> 		
 
		<div class="row">
			<div class="col-20"><label for="Exoda">Εξοδα €</label></div>
			<div class="col-20"><input type="text" class="r f18" id="Exoda" name="Exoda" value="<?php echo $Exoda;?>"></input></div>		
			<div class="col-10 hide1"><input type="text" hidden class="c" id="IDProm" name="IDProm" readonly value="<?php echo $IDProm;?>"></input></div>
			<div class="col-60" style="position: relative; display: inline;">
			<input type="text" id="EponymiaProm" name="EponymiaProm" placeholder='Προμηθευτής...' value="<?php echo $EponymiaProm;?>">
				<a class="btnKartela" style="position:absolute;top:8;right:68;" onclick="javascript:prom_show();"> </a> 
				<a class="btnFind" style="position:absolute;top:8;right:40;" onclick="javascript:prom_select('');"> </a>
				<a class="btnCancel" style="position:absolute;top:8;right:12;" onclick="javascript:prom_remove('');"> </a> 
			</input>
			</div>
		</div>		
 
		<div class="row">
		<div class="col-20"><label for="Sxolia">Σημειώσεις</label></div>
		<div class="col-80">	
				<textarea name="Sxolia" id="Sxolia"  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="IDTameiou" id="IDTameiou" value="<?php echo $IDTameiou;?>"> 
	  <input type="text" name="IDRecType" id="IDRecType" value="<?php echo $IDRecType;?>"> 
	  <input type="text" name="UpToDate" id="UpToDate" value="<?php echo $UpToDate;?>"> 
	  <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>

<!-- 
<div id="mpsearch" style="border:1px solid red;top:1px;min-height:200px;" ></div>
--> 
  
<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 pel_upd(){ pelatis_update(document.getElementById("IDPelati").value) ;}
function prom_upd(){prom_update(document.getElementById("IDProm").value) ;}
</script>
</html>

 

 