<?php 
session_start();
 
if($_SESSION['CheckPWD']==false) { header("Location: login.php"); }
$myTopCaption_Text=" ΚΑΡΤΕΛΑ ΠΕΛΑΤΗ ";
$MyFormName=str_replace('.php', '', basename($_SERVER['PHP_SELF']));
$tblName='pelates';
$IDcField='IDPelati';
$FocusField="Eponymia";
$RequiredField="Eponymia";
$ListExist=true;
$ReturnTo='pelates_list.php';
$CloseType="Close";

include 'include/header.php';
 
//========================================
//        Patients Record Read
//========================================
$closeCap=" Επιστροφή ";
 
# print_r($_SESSION); 

$IDPelati = 0;
$IDSymvolaiou = 0;$IDc = 0;$IDApp= 0;$Eponymia='';
$AFM='';$DOY='';$Tilefono='';$Kinito='';$email='';$ApplicationName='';$ApplicationCustomerVer='';
$SerialNo='';$License='';$ActivateEndDate="";
$ActivateStartDateNum=0;$ActivateEndDateNum=0;$ActivateUses=0;$isActive=0;$Message='';$Sxolia='' ;
$isActiveChk='unckecked';
$invemail=""; $invWeb="";
$ActivateStartDate='';

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

$IDPelati=gConvertField($rs['IDPelati'],0);
$IDc=$IDPelati ;
$Eponymia=$rs['Eponymia'];
$AFM=$rs['AFM'];$DOY=$rs['DOY'];$Epaggelma=$rs['Epaggelma'];
$Dnsi=$rs['Dnsi'];$Poli=$rs['Poli'];$TK=$rs['TK'];
$Til=$rs['Til'];$Kinito=$rs['Kinito'];$email=$rs['email'];
$HmEggrafis=formatMyDate($rs['HmEggrafis'],"MySqlToGr","");
$HmEggrafisNum = $rs['HmEggrafisNum'];

$Web=$rs['Web'];
$AMKA=$rs['AMKA'];$Barcode=$rs['Barcode'];
$CountryCode=$rs['CountryCode'];$Country=$rs['Country']; 

$isActive=$rs['isActive'];$Message=$rs['Message'];$Sxolia=$rs['Sxolia']  ;
$IDPoliti =gConvertField($rs['IDPoliti'],0);

$IDEtairias =gConvertField($rs['IDEtairias'],0);
$invEponymia=$rs['invEponymia'];$invEpaggelma=$rs['invEpaggelma'];
$invDnsi=$rs['invDnsi'];$invPoli=$rs['invPoli'];$invTK=$rs['invTK'];
$invAFM=$rs['invAFM'];$invDOY=$rs['invDOY'];
$invTilefono=$rs['invTilefono'];$invFax=$rs['invFax']; 
$invCountryCode=$rs['invCountryCode'];$invCountry=$rs['invCountry']; 
$invemail=$rs['invemail'];$invWeb=$rs['invWeb']; 
  
$isActiveChk='unckecked';
if($isActive==-1){$isActiveChk='checked';} 
 
// ============================ 
// ============================
$mtab=$MyFormName.'@tab';
if ($IDc==0) {$_SESSION[$mtab]="tab1";}

if (isset($_SESSION[$mtab])) {
		$mySelect_tab = $_SESSION[$mtab];
	}else{
		$mySelect_tab = "tab1";
	}
	
include 'include/buttons_bar_top.php';  
?> 

<body  OnLoad="javascript:onLoadFocus();"  > 	
<form name="<?php echo $MyFormName;?>" id="<?php echo $MyFormName;?>" method="post" action=""> 
		<div class="page" style="margin:10px -15px 0px -10px;">
<!--			<div class="pcss3t .pcss3t-icons-right pcss3t-theme-1" style="height:72vh;margin-bottom:-40px;">
				<input type="radio" name="pcss3t" checked  id="tab1" class="tab-content-first"  >
-->
			<div class="pcss3t pcss3t-theme-1 .pcss3t-icons-right">
				<input type="radio" name="pcss3t"  id="tab1" class="tab-content-first" ></input>
				<label for="tab1" onclick="tab_update('tab1');"><i class="icon-large icon-user" ></i>Βασικά Στοιχεία</label>
				<input type="radio" name="pcss3t" id="tab2" class="tab-content-2"></input>
				<label for="tab2" onclick="tab_update('tab2');"><i class="icon-large icon-file" ></i>Στοιχεία Τιμολόγησης</label>
				<input type="radio" name="pcss3t" id="tab3" class="tab-content-3" ></input>
				<label for="tab3" onclick="tab_update('tab3');"><i class="icon-list"></i>Κινήσεις</label>
				<input type="radio" name="pcss3t" id="tab4" class="tab-content-4" ></input>
				<label for="tab4" onclick="tab_update('tab4');"><i class="icon-large icon-tools"></i>Service</label>
				<input type="radio" name="pcss3t" id="tab5" class="tab-content-5"></input>
				<label for="tab5" onclick="tab_update('tab5');"><i class="icon-large icon-pencil"></i>Συμβόλαια</label>				
				<ul style="height:60vh;"  >
					<li class="tab-content tab-content-first typography" ><?php include 'pelates_basika_stoixeia.php'; ?></li>
					<li class="tab-content tab-content-2 typography"><?php include 'pelates_stoixeia_timologisis.php'; ?></li>					
					<li class="tab-content tab-content-3 typography"><?php include 'pelates_kiniseis.php'; ?></li>
					<li class="tab-content tab-content-4 typography"><?php include 'pelates_service.php'; ?></li>
					<li class="tab-content tab-content-5 typography"><?php include 'pelates_symvolaia.php'; ?></li>
				</ul>
			</div>	
		</div>	
 
<?php
  include 'include/del_yes_no.php';
?>  
 <Div style="visibility:hidden; position:absolute; margin-left:150px; margin-top:-500px; top:50; width:20%; " >
	  <input type="text" name="IDPelati" id="IDPelati" value="<?php echo $IDPelati;?>">  
	  <input type="text" name="isActive" id="isActive" value="<?php echo $isActive;?>">  
	  <input type="text" name="CountryCode" id="CountryCode" value="<?php echo $CountryCode;?>"> 
	  <input type="text" name="invCountryCode" id="invCountryCode" value="<?php echo $invCountryCode;?>">   
	  <input type="text" name="HmEggrafisNum" id="HmEggrafisNum" value="<?php echo $HmEggrafisNum;?>">
	  <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>
 </body>


 
<?php
// href="javascript:ShowDateDiv();" 

?> 
<?php
   include 'HmApoEos.php';
   include 'include/footer2020.php';
?> 
 
 <script type="text/javascript" src="js/mycheck.js"></script>   
 <script type="text/javascript" src="js/datepicker.js"></script>

<script language="JavaScript" type="text/JavaScript">

document.onkeyup = function (e) {
    e = e || window.event;
	var fe_to='inv' + document.activeElement.id;
	if(document.getElementById(fe_to)!=null){
	//	if(document.getElementById(fe_to).value==""){
		document.getElementById(fe_to).value = document.activeElement.value; 
	//	}	
	}	
};

	m_tab="<?php echo $mySelect_tab ?>";document.getElementById(m_tab).checked = true;
</script> 