<?php 
session_start();
?>
<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>
<?php  

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

$tblName='tameiakes_kai_pos';
$FocusField='btnClose'; 
// $PageName= basename($_SERVER['PHP_SELF']);
$MyFormName=str_replace('.php', '', basename($_SERVER['PHP_SELF']));
$RequiredField="Pelatis_Eponymia";
$myTopCaption_Text="ΤΑΜΕΙΑΚΕΣ & POS";
$closeCap=" Επιστροφή ";
$IDcField="IDTameiakis";
$CloseType="GoBack";
include 'include/header.php';	
?>

<html > 
 
<?php

//========================================
 
# echo "<br><br>======>>>>>>> Session IDTameiakis: " .$_SESSION['IDTameiakis'] ;
# print_r($_SESSION); 

$IDTameiakis = 0;$IDc = 0;$IDPelati = 0;$IDApp= 0;
$Pelatis_Eponymia='';$Eponymia='';$AFM='';$Tilefono='';$Kinito='';$email='';
 

$HmEggrafis= date_create('now')->format('d/m/Y'); 
// $ActivateStartDate=formatMyDate(date(),"MySqlToGr")

if($conn == false){
	 echo 'Δεν υπαρχει συνδεση...<br>';
	// dbConnect();
}
#   $IDc = trim(filter_input(INPUT_GET, 'IDc', FILTER_SANITIZE_SPECIAL_CHARS));
   $IDc = gConvertField($_COOKIE['IDTameiakis'], '0');
 $query = "SELECT * FROM " . $tblName ." WHERE IDTameiakis=" . $IDc ;
 
$result = mysqli_query($conn, $query);
    $rs = mysqli_fetch_assoc($result);

$IDTameiakis = $rs['IDTameiakis'];
$IDPelati = $rs['IDPelati'];
$Pelatis_Eponymia=$rs['Pelatis_Eponymia'];
$Pelatis_Phone=$rs['Pelatis_Phone'];
$Pelatis_Mobile=$rs['Pelatis_Mobile'];
$Pelatis_AFM=$rs['Pelatis_AFM'];

$Tameiaki_Model = $rs['Tameiaki_Model'];
$Tameiaki_SN = $rs['Tameiaki_SN'];
$Tameiaki_Manual = $rs['Tameiaki_Manual'];

$Tameiaki_Voucher= $rs['Tameiaki_Voucher'];
$Tameiaki_Updated= $rs['Tameiaki_Updated'];
$Tameiaki_Updated_Date=formatMyDate($rs['Tameiaki_Updated_Date'],"MySqlToGr");

$POS_Model = $rs['POS_Model'];
$POS_SN = $rs['POS_SN'];
$POS_Trapeza= $rs['POS_Trapeza'];
$POS_Manual= $rs['POS_Manual']; 
$POS_Connected= $rs['POS_Connected'];
$POS_Connected_Date=formatMyDate($rs['POS_Connected_Date'],"MySqlToGr");

$KostosMeFPA =  $rs['KostosMeFPA'];
$Sxolia=$rs['Sxolia'];
 
$Tameiaki_Voucher_Chk='unckecked'; if($Tameiaki_Voucher==-1){$Tameiaki_Voucher_Chk='checked';} 
$Tameiaki_Updated_Chk='unckecked'; if($Tameiaki_Updated==-1){$Tameiaki_Updated_Chk='checked';} 
$POS_Connected_Chk='unckecked';    if($POS_Connected==-1){$POS_Connected_Chk='checked';} 
 
// ============================
            $nn=0; 
// ============================
include 'include/buttons_bar_top.php';  
?> 

<form name="<?= $MyFormName;?>" id="<?= $MyFormName;?>" method="post" action=""> 
 <body  OnLoad="javascript:onLoadFocus();"  >
 
 <div id="block_container" > 
 <div id="bloc1" class="fieldset2  " > 
	<h1>ΣΤΟΙΧΕΙΑ ΤΑΜΕΙΑΚΗΣ</h1> 
	<div class="row"  >
		<div class="col-20"><label class="b" for="Pelatis_Eponymia">Επωνυμία</label></div>
		<div class="col-10 hide1"><input type="text" id="IDPelati" name="IDPelati"  value="<?=$IDPelati;?>"></div>
		<div class="col-70" style="position: relative; display: inline;">
		<input type="text" id="Pelatis_Eponymia" name="Pelatis_Eponymia" style="padding-right:100px;" required placeholder='Πελάτης...'  onKeyUp="eponymia_upd();" value="<?= $Pelatis_Eponymia;?>"  > 
		<a class="btnKartela" style="position:absolute;top:8;right:78;" onclick="javascript:pelatis_show();"> </a> </input>
		<a class="btnFind" style="position:absolute;top:8;right:44;" onclick="javascript:pelatis_select('');"> </a> </input>
		<a class="btnCancel" style="position:absolute;top:8;right:12;" onclick="javascript:pelatis_remove('');"> </a> </input>
		</input>
		</div>	
	</div>

	<div class="row"  >
		<div class="col-20"><label for="Pelatis_Phone"><a class="phone"></a> Τηλέφωνο</label></div>
		<div class="col-20"><input type="text" id="Pelatis_Phone" name="Pelatis_Phone" value="<?= $Pelatis_Phone;?>"></div>
		<div class="col-10"><label for="Pelatis_Mobile">Κινητό</label></div>
		<div class="col-20"><input type="text" id="Pelatis_Mobile" name="Pelatis_Mobile" value="<?= $Pelatis_Mobile;?>"></div>
		<div class="col-10"><label for="Pelatis_AFM">ΑΦΜ</label></div>
		<div class="col-20"><input type="text" id="Pelatis_AFM" name="Pelatis_AFM" value="<?= $Pelatis_AFM;?>"></div>
	</div>	
	
	<div class="row"  >
		<div class="col-20"><label for="cboTameiaki_Model">Ταμειακή Model</label></div>
			<div class="col-30">
				<input type="text" hidden id="ID_Tam_Model" name="ID_Tam_Model"> </input>
				<input type="text" hidden id="Tameiaki_Model" name="Tameiaki_Model" value="<?= $Tameiaki_Model;?>"> </input>
				<select id="cboTameiaki_Model" name="cboTameiaki_Model"  title="Επιλογή Ταμειακής..." onclick="javascript:comboChange(this,'Tameiaki_Model','ID_Tam_Model');tam_model_update(document.getElementById('ID_Tam_Model').value);" > 
					<?php TameiakesModelsComboBoxMake($conn, $Tameiaki_Model); ?>
				</select>
			</div>
		<div class="col-15"><label for="Tameiaki_SN">Serial No</label></div>
		<div class="col-35"><input type="text" id="Tameiaki_SN" name="Tameiaki_SN" value="<?= $Tameiaki_SN;?>"></div>
	</div>	 


 	<div class="row">
		<div class="col-20"><label for="Tameiaki_Updated">Αναβαθμίστηκε</label></div>
		<div class="col-30">	
				<?php  input_yesno_only("Tameiaki_Updated", "Tameiaki_Updated_Chk", "Tameiaki_Updated", $Tameiaki_Updated,"" )?> 
		</div>
 
		<div class="col-15"><label for="Tameiaki_Updated_Date">Ημερομηνία</label></div>
		<div class="col-35">
			<div class="vscombo-div">
			 <input class="datepicker" type="text" id="Tameiaki_Updated_Date" name="Tameiaki_Updated_Date" value="<?= $Tameiaki_Updated_Date;?>" />
			 <a class="vscombo_date_button" name="Hmnia_Button1" id="Hmnia_Button1" ></a></input>
			</div>
		</div>	
 
	</div>
	<div class="row"  >
		<div class="col-20"><label for="Tameiaki_Manual">Manual</label></div>
		<div class="col-80">
			<input type="text" id="Tameiaki_Manual" name="Tameiaki_Manual" ondblclick="javascript:opendoc(this); " value="<?= $Tameiaki_Manual;?>">
		</div>
	</div>
	
	<br>
	<div class="row"><hr></div>
	
	<div class="row">
		<div class="col-20"><label for="Tameiaki_Voucher">Voucher</label></div>
		<div class="col-80">	
				<?php  input_yesno_only("Voucher", "Tameiaki_Voucher_Chk", "Tameiaki_Voucher", $Tameiaki_Voucher,"" )?> 
		</div>
	</div>
	<br>
	<div class="row">
		<div class="col-20"><label for="KostosMeFPA"> Κόστος €</label></div>
		<div class="col-30"><input type="text" id="KostosMeFPA" name="KostosMeFPA" value="<?= $KostosMeFPA;?>"></div>
	</div>
</div>

 		<!-- =============================== basika stoixeia part2 =======================-->
 <div id="bloc2" class="fieldset2 "  > 
	<h1>ΣΤΟΙΧΕΙΑ POS</h1> 
	
	<div class="row"  >
		<div class="col-20"><label for="POS_Model"> POS Model</label></div>
		<div class="col-40">
			<input type="text" id="POS_Model" name="POS_Model" value="<?= $POS_Model;?>"> </input>
		</div>	
		<div class="col-15"><label for="POS_SN">Serial No</label></div>
		<div class="col-25"><input type="text" id="POS_SN" name="POS_SN" value="<?= $POS_SN;?>"></div>
	</div>	
	
	<div class="row"  >
		<div class="col-20"><label for="POS_Trapeza">Τράπεζα</label></div>
		<div class="col-80"><input type="text" id="POS_Trapeza" name="POS_Trapeza" value="<?= $POS_Trapeza;?>"></div>
	</div>	
	<div class="row"  >
		<div class="col-20"><label for="POS_Manual">Manual</label></div>
		<div class="col-80">
			<input type="text" id="POS_Manual" name="POS_Manual" ondblclick="javascript:opendoc(this); " value="<?= $POS_Manual;?>">
		</div>
	</div>
 	<div class="row">
		<div class="col-20"><label for="POS_Connected_Chk">Συνδέθηκε</label></div>
		<div class="col-30">	
				<?php  input_yesno_only("Συνδέθηκε", "POS_Connected_Chk", "POS_Connected", $POS_Connected,"" )?> 
		</div>
 
		<div class="col-15"><label for="POS_Connected_Date">Ημερομηνία </label></div>
		<div class="col-35">
			<div class="vscombo-div">
			 <input class="datepicker" type="text" id="POS_Connected_Date" name="POS_Connected_Date" value="<?= $POS_Connected_Date;?>" />
			 <a class="vscombo_date_button" name="Hmnia_Button1" id="Hmnia_Button1" ></a></input>
			</div>
		</div>
  <br>

		
	</div>	

 		<div class="row">
			<div class="col-20"><label for="Sxolia">Σημειώσεις</label></div>
			<div class="col-80 textarea-container" style="position: relative; display: inline;">	
					<textarea name="Sxolia" id="Sxolia" style="padding-right:26px; min-height:100px;overflow-y:scroll;" value="<?php echo $Sxolia;?>" ><?php echo $Sxolia;?></textarea>
					<a class="btnMicrophone" style="position:absolute;top:6;right:28;" onclick="runSpeechRecognition('Sxolia');"></a>
			</div>
		</div>	
 

 
 <br>
</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="IDTameiakis" id="IDTameiakis"   value="<?= $IDTameiakis;?>">
		  <input type="text" name="Tameiaki_Updated" id="Tameiaki_Updated" value="<?= $Tameiaki_Updated;?>">
		  <input type="text" name="Tameiaki_Voucher" id="Tameiaki_Voucher" value="<?= $Tameiaki_Voucher;?>">
		  <input type="text" name="POS_Connected" id="POS_Connected" value="<?= $POS_Connected;?>">
		  <input type="text" name="PageName" id="PageName" value="<?= $MyFormName.'.php';?>">
		  <input type="text" name="tblName" id="tblName" value="<?= $tblName;?>">
		  <input type="text" name="IDcField" id="IDcField" value="<?= $IDcField;?>">
		  <input type="text" name="IDc" id="IDc" value="<?= $IDc;?>">
		  <input type="text" name="CloseType" id="CloseType" value="<?= $CloseType;?>">
	 </div>	
</form>

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

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

  var ep = document.getElementById("Pelatis_Eponymia");
ep.addEventListener("keypress", function(event) {
  if (event.key === 'Enter') {
	   event.preventDefault(); 
	    pelatis_select(ep.value);
   }
});
 
function myBlurFunction() {
   alert("Δεν έχει γίνει αποθήκευση της καρτέλας. Να γίνει αποθήκευση της καρτέλλας; ");
}
 

 
</script>
 
<script type="text/javascript" src="js/mycheck.js"></script>
<script type="text/javascript" src="js/datepicker.js"></script>  
<script language="JavaScript" type="text/JavaScript">
function pel_upd(){ 
pelatis_update(document.getElementById("IDPelati").value);
//eponymia_upd();
}
function opendoc(e) {
	window.open(e.value);
}
 
function cboPosModelChange() {
	
}
</script>
<?php 
 include 'include/footer2020.php';
?> 
</html>

 
 