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

$prefix="tameio_rectypes_add@";
$tblName='tameio_rectypes';
$IDcField='IDRecType';
$FocusField="RecType";
$RequiredField="RecType";
$CloseType="Close";
$MyFormName=str_replace('.php', '', basename($_SERVER['PHP_SELF']));
$myTopCaption_Text=" ΤΑΜΕΙΟ - ΕΠΕΞΕΡΓΑΣΙΑ ΕΓΓΡΑΦΗΣ ";
 
$ReturnTo='tameio_rectypes_list.php';

include 'myfunctions.php';
include 'include/del_yes_no.php';
include 'include/buttons_bar_top-popup.php';
?>
 
<html > 
  
<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>

<link rel="stylesheet" type="text/css" href="css/tab2023.css"  /> 
<?php
//========================================
//        Patients Record Read
//========================================
$closeCap=" Επιστροφή ";
// print_r($_SESSION); 
$IDc=0;$IDRecType=0;$RecType='';$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);

$IDRecType = gConvertField($rs['IDRecType'],0);
$IDc=$IDRecType; 
$RecType=$rs['RecType'];
$isReserve=gConvertField($rs['isReserve'],0);
$UpdateUser=$rs['UpdateUser'];
$UpdateDate=formatMyDate($rs['UpdateDate'],"MySqlToGr",date_create('now')->format('d/m/Y')); 
$Sxolia=$rs['Sxolia'] ;

$isReserveChk="";
if ($isReserve=="-1"){$isReserveChk="checked";}
if($IDc==0){$LeftCap="Νέα εγγραφή";}else{$LeftCap="Μεταβολή εγγραφής";}
// ============================
   
// ============================
?> 
 <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 ;"> 
 <form  name="<?php echo $MyFormName;?>" id="<?php echo $MyFormName;?>" method="post" action="_rs.php"> 
 
		<label for="RecType" class="form-label">Περιγραφή</label>
		<input type="text" id="RecType" name="RecType" required value="<?php echo $RecType;?>">
  
		<div class="col-60 r" style="position: relative; display: inline-flex;flex:right;" >
			<div style="padding: 10px 0 10px 0;">
				<?php  input_yesno("Είναι αποθεματικό", "isReserveChk", "isReserve", $isReserve,"" )?> 
			</div>
		</div>
	 
 
		<div class="mb-3" >
			<label for="RecType" class="form-label">Σημειώσεις</label>
			<textarea  class="form-control" id="Sxolia" name="Sxolia" value="<?php echo $Sxolia;?>"><?php echo $Sxolia;?></textarea>
		</div>
 
 </div>	
 
 <Div style="  position:absolute; margin-left:150px; margin-top: 150px; top: -550; width:20%; " >
	  <input type="text" name="PageName" id="PageName" value="<?php echo $MyFormName.'.php';?>">
	  <input type="text" name="isReserve" id="isReserve" value="<?php echo $isReserve;?>">
	  <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="IDRecType" id="IDRecType" value="<?php echo $IDc;?>">
	  <input type="text" name="IDc" id="IDc" value="<?php echo $IDc;?>">  
	  <input type="text" name="CloseType" id="CloseType" value="<?php echo $CloseType;?>">
 </div>	

 </form>
 
 </body>
 

				<!---   ΚΛΕΙΝΕΙ ΤΟ FRAME  visibility:hidden; --->

</form>
 
<script type="text/javascript" src="js/mycheck.js"></script>   

 