<?php 
session_start();
 
if(!isset($_SESSION['CheckPWD']) || $_SESSION['CheckPWD'] == '' ){header("Location: login.php");die();}
$MyFormName=str_replace('.php', '', basename($_SERVER['PHP_SELF']));

$tblName='users';
$IDcField='IDUser';
$FocusField="UserName";
$RequiredField="UserName";
$CloseType="Close";
$ReturnTo='user_list.php';
 
include 'myfunctions.php';
include 'include/del_yes_no.php';
include 'include/buttons_bar_top-popup.php';
?>

<html > 
 
	<head>
	<Title>Visualsoft Office Manager - User</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"  /> 
 
<style>
table td {
	 padding-bottom:0px; 
} 
input {margin-bottom:3px; }
</style> 	
<?php
 
//========================================
//       Record Read
//========================================
$closeCap=" Επιστροφή ";
 
// print_r($_SESSION); 

$IDc=0;$IDNote=0;$Aitiologia='';
$Hmnia= date_create('now')->format('d/m/Y'); 
$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);

$IDUser = $rs['IDUser'];
$IDc=$IDUser ;
$UserName=$rs['UserName'];
$UserPassword=$rs['UserPassword'];
$UserType = $rs['UserType'];
$Eponymia = $rs['Eponymia'];
$Dnsi = $rs['Dnsi'];
$Poli = $rs['Poli'];
$TK = $rs['TK'];
$Phone = $rs['Phone'];
$email = $rs['email'];
$isActive = $rs['isActive'];
$Sxolia = $rs['Sxolia'];

$isActiveChk='unckecked';
if($isActive==-1){$isActiveChk='checked';} 
if($IDc==0){$LeftCap="Χρήστες : Νέα εγγραφή";}else{$LeftCap="Χρήστες: Μεταβολή εγγραφής";}
 
// ============================
   
// ============================
?> 

<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="UserName">User Name</label></div>
			<div class="col-30"><input type="text" id="UserName" name="UserName" required value="<?php echo $UserName;?>"></div>
			<div class="col-50 r">
				<?php input_yesno("Καρτέλα Ενεργός", "isActiveChk", "isActive", $isActive,"" )?> 
			</div>
		</div>
	
		<div class="row">
			<div class="col-20"><label for="UserPassword">Password</label></div>
			<div class="col-30"><input type="password" id="UserPassword" name="UserPassword"  onfocus="this.select();" required value="<?php echo $UserPassword;?>"></div>
			<div class="col-20 c "><label for="UserType" style="padding-top:8px;">Ιδιότητα</label></div>
			<div class="col-30"><?php UserTypeComboBoxMake($conn,"UserType",$UserType);?></div>
		</div>

		<div class="row">
			<div class="col-20"><label for="Eponymia">Επωνυμία</label></div>
			<div class="col-80"><input type="text" id="Eponymia" name="Eponymia" required value="<?php echo $Eponymia;?>"></div>
		</div>
		<div class="row">
			<div class="col-20"><label for="Dnsi">Διεύθυνση</label></div>
			<div class="col-80"><input type="text" id="Dnsi" name="Dnsi" value="<?php echo $Dnsi;?>"></div>
		</div> 
		<div class="row">
			<div class="col-20"><label for="Poli">Πόλη-TK</label></div>
			<div class="col-60"><input type="text" id="Poli" name="Poli" value="<?php echo $Poli;?>"></div>
			<div class="col-20"><input type="text" id="TK" name="TK" value="<?php echo $TK;?>"></div>		
		</div> 
		<div class="row">
			<div class="col-20"><label for="Phone">&#x260E; Τηλέφωνο</label></div>
			<div class="col-80"><input type="text" id="Phone" name="Phone" value="<?php echo $Phone;?>"></div>
		</div> 
		<div class="row">
			<div class="col-20"><label for="email">&#x2709; email</label></div>
			<div class="col-80"><input type="text" id="email" name="email" value="<?php echo $email;?>"></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>
 
 
</body>
 
 <Div style="visibility:hidden ; position:absolute; margin-left:-110px; margin-top:-150px; top:-150; width:20%; " >
	  <input type="text" name="IDUser" id="IDUser" value="<?php echo $IDc;?>"> 
	  <input type="text" name="isActive" id="isActive" value="<?php echo $isActive;?>">  
	  <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;?>">
	  <input type="text" id="FocusField" value="<?php echo $FocusField;?>">
 </div>	
				<!---   ΚΛΕΙΝΕΙ ΤΟ FRAME  visibility:hidden; --->
</form>
 
</html>
 
<script type="text/javascript" src="js/mycheck.js"></script>   