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

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

//include 'include\Header.php';
include 'myFunctions.php';
?>
 
<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" />	
	<link rel="stylesheet" href="css/checkbox/chkBoxStyle2.css">
<?php
  include 'DelYesNo.php';
?>
 
<?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="Μεταβολή εγγραφής";}
 
// ============================
   
// ============================
 
?> 

 <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 width="120px">
			<label for="IDRecType">ID Rec Type</label>
			<input type="text" id="IDRecType" name="IDRecType"  required value="<?php echo $IDRecType;?>">
			</td>
			<td width="120px"></td>
			
 	    <td style="float:right; width:200px; padding-top:20px;line-height:2px; ">
			 <div class="chkDiv" style="height:24px;">
			 <label class="control control--checkbox">Είναι αποθεματικό
			  <input type="checkbox" <?php echo $isReserveChk;?> onclick="javascript:chkUpd('isReserve');" value="<?php echo $isReserve;?>">
			  <div class="control__indicator"></div>
			 </label>
			 </div> 
			 
		</td>
 
		</tr> 
		<tr>
			<td colspan="3">
			<label for="RecType">Περιγραφή</label>
			<input type="text" id="RecType" name="RecType" required value="<?php echo $RecType;?>">
			</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="  position:absolute; margin-left:150px; margin-top: 150px; top:-500; 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="IDc" id="IDc" value="<?php echo $IDc;?>">  
	  <input type="text" name="CloseType" id="CloseType" value="<?php echo $CloseType;?>">
	  
 </div>	
				<!---   ΚΛΕΙΝΕΙ ΤΟ FRAME  visibility:hidden; --->

</form>
 
<?php 
   include 'js/vsFunctions.js';
?> 

<script language="JavaScript" type="text/JavaScript">
  function confirmExit(){ window.close();}
</script> 
 
 
</html>

 
 