 
<?php
  include 'include/buttons_bar_top.php';
?>
<form name="<?php echo $MyFormName;?>" id="<?php echo $MyFormName;?>" method="post" action=""> 
 <body  OnLoad="javascript:onLoadFocus();"  >
 
	
 <div id="block_container" style="width:90%;"> 
 <div id="bloc1" style="box-shadow: 1px 3px 8px #999999 ;"> 
	<h1>ΣΤΟΙΧΕΙΑ ΠΕΛΑΤΗ</h1> 
	
	 <div  class=" vsBoxNew "  style="height:50vh auto;width:50%; padding:10px 5px 10px 5px ; ">
 
		<div class="row">
		<div class="col-20"><label for="Eponymia">Επωνυμία</label></div>
		<div class="col-10"><input type="text" id="IDPelati" name="IDPelati"  value="<?php echo $IDPelati;?>"></div>
		<div class="col-70"><input type="text" id="Eponymia" name="Eponymia" required value="<?php echo $Eponymia;?>"></div>
		</div>
	  </div>
	  
	<div class="parent" style="border:1px solid red;">
		<label class="child" style="width:20%;" for="Eponymia">Επωνυμία</label>	
			
			 <input class="child" type="text" id="IDPelati" name="IDPelati" value="<?php echo $IDPelati;?>" style="width:10%;">
			 <input class="child" type="text" id="Eponymia" name="Eponymia" required onclick='javascript:OpenFormADD_onWin(<?php echo$frmOpen; ?>);' value="<?php echo $Eponymia;?>"  style="">
			<!-- <a class="vscombo_button" onclick="javascript:cbo_select('pelates','');"></a>
			  <a class="vscombo_button" onclick="javascript:creatediv(this);"></a> -->
		 
	</div>
	
	<table border="0" width="100%" >
		<tr>
			<td colspan="3">
			<label for="Eponymia">Επωνυμία</label>	
			<div class="vscombo-div" >
			 <input type="text" id="IDPelati" name="IDPelati" value="<?php echo $IDPelati;?>" style="width:50px;">
			 <input type="text" id="Eponymia" name="Eponymia" required onclick='javascript:OpenFormADD_onWin(<?php echo$frmOpen; ?>);' value="<?php echo $Eponymia;?>"  style="width:90%;";>
			<!-- <a class="vscombo_button" onclick="javascript:cbo_select('pelates','');"></a>
			  <a class="vscombo_button" onclick="javascript:creatediv(this);"></a> -->
			</div>	
		</tr>
		<tr>
			<td><label for="AFM">ΑΦΜ</label>	<input type="text" id="AFM" name="AFM" value="<?php echo $AFM;?>"></td>
			<td width="10px"></td>
			<td><label for="DOY">ΔΟΥ</label>	<input type="text" id="DOY" name="DOY" value="<?php echo $DOY;?>"></td>
		</tr>
		<tr>
			<td><label for="Tilefono">Τηλέφωνο</label><input type="text" id="Tilefono" name="Tilefono" maxlength="50" value="<?php echo $Tilefono;?>"></td>
			<td width="10px"></td>
			<td><label for="Kinito">Κινητό</label>	<input type="text" id="Kinito" name="Kinito" value="<?php echo $Kinito;?>"></td>	
		</tr>
		<tr>
			<td colspan="3">
			<label for="email">email</label><input type="text" id="email" name="email"   value="<?php echo $email;?>">
			</td>
		</tr>
		<tr>
			<td  colspan="3">
			<label for="Terminal">Terminals</label>
			<textarea name="Terminal" id="Terminal"  style="font-size:0.8em; resize:none; min-height:100px;max-height: 100%;padding:10px;"  value="<?php echo $Terminal;?>" ><?php echo $Terminal;?></textarea>
			</td>
		</tr> 	 
	</table>
 
</div>

 		<!-- =============================== basika stoixeia part2 =======================-->
 <div id="bloc2" class="fieldset2" style="box-shadow: 1px 3px 8px #999999 ;"> 
	<h1>ΣΤΟΙΧΕΙΑ ΕΦΑΡΜΟΓΗΣ</h1> 
	<table  border="0" width="100%;">
		<tr>
			<td colspan="3" >
			  <label for="cboApplicationName">Εφαρμογή</label>
				  <select id="cboApplicationName" name="cboApplicationName" data-size="10" required title="Επιλογή εφαρμογής..." onclick="javascript:comboChange(this,'ApplicationName','IDApp');"> 
					<?php 
					  $x= AppsComboBoxMake($conn, $ApplicationName);
					?>
				  </select>
			</td>
		</tr>
		<tr>
			<td>
				<label for="ActivateStartDate">Ημερομηνία έναρξης</label>
				<div class="vscombo-div" >
				  <input class="datepicker" type="text" id="ActivateStartDate" name="ActivateStartDate"  required value="<?php echo $ActivateStartDate;?>" onchange="javascript:HmniaCheck(this);">
				  <a class="vscombo_date_button" name="Hmnia_Button" id="Hmnia_Button" ></a>
				</div>	
			</td>
			<td width="10px"></td>
			<td>
				<label for="ActivateEndDate">Ημερομηνία λήξης</label>
				<div class="vscombo-div" >
				  <input class="datepicker" type="text" id="ActivateEndDate" name="ActivateEndDate"  required value="<?php echo $ActivateEndDate;?>" onchange="javascript:HmniaCheck(this);">
				  <a class="vscombo_date_button" name="Hmnia_Button" id="Hmnia_Button" ></a>
				</div>			
			</td>
		</tr>		
		<tr>
			<td><label for="ApplicationCustomerVer">Έκδοση (Ver.)</label> <input type="text" id="ApplicationCustomerVer" name="ApplicationCustomerVer"  value="<?php echo $ApplicationCustomerVer;?>"></td>
			<td width="10px"></td>
			<td><label for="ActivateUses">Χρήσεις</label> <input type="text" id="ActivateUses" name="ActivateUses"   value="<?php echo $ActivateUses;?>"></td>
		</tr>	
			
 
		<tr>
			<td><label for="SerialNo">Serial No</label>	<input type="text" id="SerialNo" name="SerialNo"   value="<?php echo $SerialNo;?>"></td>
			<td width="10px"></td>
			<td><label for="License">License</label>	<input type="text" id="License" name="License" value="<?php echo $License;?>"></td>
		</tr>
		<tr>
			<td colspan="3">
			<label for="Sxolia">Σημειώσεις-Παρατηρήσεις</label>
			<textarea name="Sxolia" id="Sxolia"  style="font-size:0.8em; resize:none; min-height:80px;max-height: 100%;padding:10px;"  value="<?php echo $Sxolia;?>" ><?php echo $Sxolia;?></textarea>
			</td>
		</tr>		
	</table>
		
	<table border="0" style="width:99%;margin:5px 0px 5px 0px;" align="center">

 		<tr>
			<td colspan="3">
 
			<label class='t2' style="margin-top:-5px;float:right;">
				<span class='text'>Συμβόλαιο Ενεργό</span>
				<input  type='checkbox' id="chkisActive" name="chkisActive"  <?php echo $isActiveChk ?> onclick="javascript:chkUpd('isActive');"  />
				<span class='value'></span>
			</label>
 
			</td>
		</tr>
		
	</table>
</div>
</div>        
</body>

 
<?php
 # include 'include/buttons_bar_down.php';
?>

	 <Div style="visibility:hidden;  position:absolute; margin-left:150px; margin-top:-500; top:50; width:15%; float:inline;" >
		  <input type="text" name="IDSymvolaiou" id="IDSymvolaiou"   value="<?php echo $IDSymvolaiou;?>">
		  <input type="text" name="IDPelati" id="IDPelati" value="<?php echo $IDPelati;?>">  
		  <input type="text" name="ApplicationName" id="ApplicationName" value="<?php echo $ApplicationName;?>">
		  <input type="text" name="IDApp" id="IDApp" value="<?php echo $IDApp;?>"> 
		  <input type="text" name="ActivateStartDateNum" id="ActivateStartDateNum" value="<?php echo $ActivateStartDateNum;?>">
		  <input type="text" name="ActivateEndDateNum" id="ActivateEndDateNum" value="<?php echo $ActivateEndDateNum;?>">
		  <input type="text" name="Message" id="Message" value="<?php echo $Message;?>">
		  <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;?>">
	 </div>	
</form>

<?php
  include 'include/del_yes_no.php';
?> 

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

  var ep = document.getElementById("Eponymia");
ep.addEventListener("keypress", function(event) {
  if (event.key === 'Enter') {
	   event.preventDefault(); 
	   var fw="?pelates_select@FindWhat="+ep.value;
       cbo_select('pelates',fw);
   }
});
 
function myBlurFunction() {
   alert("Δεν έχει γίνει αποθήκευση της καρτέλας. Να γίνει αποθήκευση της καρτέλλας; ");
}
 
function HmniaCheck(e){
 	//var hm1=document.getElementById("ActivateStartDate").value;
	var d0 = e.value.split('/');
	var myNum= pad(d0[2],4) + pad(d0[1],2)  + pad(d0[0],2) ; 
	var mySqlDate = d0[2]+"/"+d0[1]+"/"+d0[0];
	var myJvDate  = d0[1]+"/"+d0[0]+"/"+d0[2];
	//var myEndDate=d0[0] +"/"+d0[1] +"/"+ YearEnd.toString();
	var newDate = new Date(mySqlDate);	 
	var month = newDate.getMonth() + 1;
	var day = newDate.getDate(); 
	var year = newDate.getFullYear()+1;
	var endDate=pad(day,2) + "/" + pad(month,2) + "/" + pad(year,4);
   // var endDateNum=pad(year,4)+ pad(month,2)+pad(day,2);
 
	if(isValidDate(myJvDate)){
		document.getElementById(e.name+"Num").value=myNum;
		document.getElementById("ActivateEndDate").value=endDate;
	//	document.getElementById("ActivateEndDateNum").value=endDateNum;
		}else{
		alert("Λάθος ημερομηνία..."); 
		e.focus();
		}	   
}	

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

<script type="text/javascript">

function creatediv(e) {
	
	
	
    var cbo_div = document.createElement('div');
	  cbo_div.name='cbo_div';
	  cbo_div.id='cbo_div';
	  //alert(e.name + " " + e.top.value);
		//cbo_div.style.backgroundColor = "red";
		cbo_div.style.position = "absolute";
		 cbo_div.style.left = getOffset(e).left;
	 	cbo_div.style.top = getOffset(e).top +getOffset(e).height ;
		cbo_div.style.width = getOffset(e).width ;
		cbo_div.style.height = "200px";
		cbo_div.style.border="1px solid black";
	    cbo_div.style.overflow="hidden";
	  
	//height: fit-content;
       // cbo_div.innerHTML = e.name;
   // alert(e.name);
	

// document.getElementById("cbo_div").innerHTML='<object type="text/html" data="pelates_find.php" ></object>';

 cbo_div.innerHTML='<object width="100%" height="100%" type="text/html" data="pelates_find.php" ></object>';


document.body.appendChild(cbo_div);

 
} 
 
function getOffset(el) {
  const rect = el.getBoundingClientRect();
// alert(el.name + " " + el.offsetWidth);
 
  return {
    width: el.offsetWidth,
	height: el.offsetHeight,
	left: rect.left + window.scrollX,
    top: rect.top + window.scrollY
  };
}
</script>
 