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

$tblName='pelates_service';
$FocusField='btnClose'; 
// $PageName= basename($_SERVER['PHP_SELF']);
$MyFormName=str_replace('.php', '', basename($_SERVER['PHP_SELF']));
$RequiredField="HmniaParalabis";
$myTopCaption_Text=" ΕΠΙΣΚΕΥΕΣ - SERVICE ";
$CloseType="Close";
?>
 
<html > 
	<head></head>
	<link rel="shortcut icon"  href="icons/Asthenis_24x24.ico" />
	
<link href="https://fonts.googleapis.com/css?family=Open+Sans+Condensed:300,300italic,700&subset=latin,greek,greek-ext" rel="stylesheet" type="text/css">
<link href="https://fonts.googleapis.com/css?family=Fira+Sans" rel="stylesheet"> 

  <link rel="stylesheet" href="css/vsFormIstoriko.css" />  
  <link rel="stylesheet" href="css/vsButtons.css" />
  <link rel="stylesheet" href="css/myPopUp.css" />  
 
<?php
 //include 'include\Header.php';	

//========================================
//        Patients Record Read
//========================================
date_default_timezone_set('Greece/Athens');
$closeCap=" Επιστροφή ";
$btnSaveStatus="Enabled";
$btnDeleteSaveStatus="Disabled";
$IDcField="IDService";

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

$IDService = 0;$IDc = 0;$IDPelati = 0;$IDApp= 0;
$Eponymia='';$AFM='';$Tilefono='';$Kinito='';$email='';$ApplicationName='';$ApplicationCustomerVer='';
$SerialNo='';$License='';
$ActivateStartDateNum=0;$ActivateEndDateNum=0;$ActivateUses=0;$isActive=0;$Message='';$Sxolia='' ;
$isActiveChk='unckecked';

$HmniaParalabis=date_create('now')->format('d/m/Y');
$OraParalabis=date_create('now')->format('H:i:s');

# echo "======================  " . $OraParalabis;
#date_default_timezone_set('UTC');
#echo (new DateTime())->format('Y-m-d H:i:s') . PHP_EOL;
#date_default_timezone_set('Europe/Athens');
#echo (new DateTime())->format('Y-m-d H:i:s');


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

 
    $rs = mysqli_fetch_assoc($result);
if ($rs){
//print_r  ($rs) ;

$IDService = gConvertField($rs['IDService'],0);
$IDc =$IDService ;
$IDPelati=gConvertField($rs['IDPelati'],0);
$HmniaParalabis=formatMyDate($rs['HmniaParalabis'],"MySqlToGr");
$OraParalabis = safe_time_get($rs['OraParalabis']) ; // date_format($rs['OraParalabis'], 'H:i:s');
$HmniaEpiskeyis=formatMyDate($rs['HmniaEpiskeyis'],"MySqlToGr");
$OraEpiskeyis= $rs['OraEpiskeyis'] ;
 
$EidosSyskeyis=$rs['EidosSyskeyis']; $Model=$rs['Model'];$SerialNo=$rs['SerialNo'];
$Metritis=$rs['Metritis']; 
$PerigrafiSyskeyis=$rs['PerigrafiSyskeyis']; 
$PerigrafiVlavis=$rs['PerigrafiVlavis'];

$ServiceType=$rs['ServiceType'];
$ServiceArSymvasis=$rs['ServiceArSymvasis'];
$PerigrafiErgasion=$rs['PerigrafiErgasion']; 
$EkdosiTimologiouALP=$rs['EkdosiTimologiouALP'];
$ParalabiApoComputer=$rs['ParalabiApoComputer'];
$ParalabiApoXristi= $rs['ParalabiApoXristi'] ;
$OresErgasias = $rs['OresErgasias'];

$Xreosi = gConvertField($rs['Xreosi'],0);
$EnimerosiKiniseon=gConvertField($rs['EnimerosiKiniseon'],0);
$Bag=$rs['Bag'];
$PowerSupply=$rs['PowerSupply'];

$Sxolia=$rs['Sxolia']  ;
$energos1 = $rs['isActive'];
}

$BagChk='unckecked';
$PowerSupplyChk='unckecked';

if($Bag==-1){$Bag_Chk='checked';} 
if($PowerSupply==-1){$PowerSupply_Chk='checked';} 


 
// ============================
  
?> 

<form name="<?php echo $MyFormName;?>" id="<?php echo $MyFormName;?>" method="post" action="_rs.php"> 
 <body  OnLoad="javascript:onLoadFocus();"  >
 <div id="block_container" style="padding-top:20px;"> 
 <div id="bloc1" class="fieldset2" > 
	<h1>ΠΑΡΑΛΑΒΗ</h1>
	<table border="0" width="100%" >
		<tr>
			<td><label for="HmniaParalabis" >Ημερ/νία Παραλαβής</label>	<input type="text" id="HmniaParalabis" name="HmniaParalabis" value="<?php echo $HmniaParalabis;?>"></td>
			<td><label for="OraParalabis">Ώρα</label>	<input type="text" id="OraParalabis" name="OraParalabis" value="<?php echo $OraParalabis;?>"></td>
			<td><label for="ParalabiApoComputer">Τερματικό</label>	<input type="text" id="ParalabiApoComputer" name="ParalabiApoComputer" value="<?php echo $ParalabiApoComputer;?>"></td>
				
		</tr>
</table>
<table border="0" width="100%" >
		<tr>
			<td><label for="EidosSyskeyis">Είδος Συσκευής</label>	<input type="text" id="EidosSyskeyis" name="EidosSyskeyis" value="<?php echo $EidosSyskeyis;?>"></td>
			<td><label for="Model">Model</label>	<input type="text" id="Model" name="Model" value="<?php echo $Model;?>"></td>
		</tr>
			<td colspan="2">
			<label for="PerigrafiSyskeyis">Περιγραφή Συσκευής</label><input type="text" id="PerigrafiSyskeyis" name="PerigrafiSyskeyis"   value="<?php echo $PerigrafiSyskeyis;?>">
			</td>		
		<tr>
			<td><label for="SerialNo">Serial No</label><input type="text" id="SerialNo" name="SerialNo" maxlength="50" value="<?php echo $SerialNo;?>"></td>
			<td><label for="Metritis">Μετρητής</label>	<input type="text" id="Metritis" name="Metritis" value="<?php echo $Metritis;?>"></td>	
		</tr>
		<tr>
			<td colspan="2">
			<label for="PerigrafiVlavis" style="font-weight:300;color:#003972;">Περιγραφή Βλάβης</label>
			<textarea name="PerigrafiVlavis" id="PerigrafiVlavis"  style="height:80px;"  ><?php echo $PerigrafiVlavis;?></textarea>
			</td>
		</tr>
	</table>
 
<table border="1" width="100%" >
	<tr>
		<td style="padding:0px;margin:0px;width:30% ">
			<label for="chk_powerSupply">ΤΡΟΦΟΔΟΤΙΚΟ</label>
			<input type="checkbox" id="chk_powerSupply" name="chk_powerSupply" onchange="javascript:chkUpd('PowerSupply');"  >
		</td>
		<td style="padding:0px;margin:0px;width:30% ">
			<input type="checkbox" id="chk_Bag" name="chk_Bag" onchange="javascript:chkUpd('Bag');"  <?php echo $Bag_Chk;?>  >
			<label for="chk_Bag">ΤΣΑΝΤΑ</label>	
		</td>
		<td style="padding:0px;margin:0px;width:30% ">
		</td>
	 </tr>
</table>
 
</div>

 		<!-- =============================== basika stoixeia part2 =======================-->
<div id="bloc2" class="fieldset2"  > 
<h1>ΕΠΙΣΚΕΥΗ-ΠΑΡΑΔΟΣΗ</h1>
	<table  border="0" >
 
		<tr>
			<td><label for="HmniaEpiskeyis" >Ημ/νία παράδοσης</label>	<input type="text" id="HmniaEpiskeyis" name="HmniaEpiskeyis" value="<?php echo $HmniaEpiskeyis;?>"></td>
			<td><label for="OraEpiskeyis">Ωρα</label>	<input type="text" id="OraEpiskeyis" name="OraEpiskeyis" value="<?php echo $OraEpiskeyis;?>"></td>
			<td><label for="ParalabiApoComputer">ΤΕΡΜΑΤΙΚΟ</label>	<input type="text" id="ParalabiApoComputer" name="ParalabiApoComputer" value="<?php echo $ParalabiApoComputer;?>"></td>	
		</tr>
 	
		<tr>
			<td><label for="OresErgasias">Ώρες εργασίας</label> <input type="text" id="OresErgasias" name="OresErgasias"  value="<?php echo $OresErgasias;?>"></td>
			<td><label for="Xreosi">Χρέωση €</label> <input type="text" id="Xreosi" name="Xreosi"   value="<?php echo $Xreosi;?>"></td>
			<td width="10px"></td>
		</tr>	
  
 		<tr>
			<td colspan="3">
			<label for="PerigrafiErgasion">Περιγραφή εργασιών</label>
			<textarea name="PerigrafiErgasion" id="Sxolia"  style="height:100px;" value="<?php echo $PerigrafiErgasion;?>" ><?php echo $PerigrafiErgasion;?></textarea>
			</td>
		</tr>		
	</table>
</div>

 </div>
 
  </body>
  
 
 
<?php
  include 'include/ButtonsBarDown.php';
?>
	 <Div style="display: none; position:absolute; margin-left:150px; margin-top:-500; top:50; width:15%; float:inline;" >
		  <input type="text" name="Bag" id="Bag" value="<?php echo $Bag;?>">
		  <input type="text" name="PowerSupply" id="PowerSupply" value="<?php echo $PowerSupply;?>">
		  <input type="text" name="IDService" id="IDService"   value="<?php echo $IDService;?>">
		  <input type="text" name="IDPelati" id="IDPelati" value="<?php echo $IDPelati;?>">  
		  <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 'DelYesNo.php';
	if ($ListExist==true){ include 'js\RecsNextPrv.js'; }
 	include 'js\vsFunctions.js';
//	include 'include\Footer2020.php';
?> 
	 
<script language="JavaScript" type="text/JavaScript">
 function confirmExit(){ window.close();}
</script>
 