 
<?php
include 'header2.php';	

 
/*SLANJE MEJLA*/
include 'emailsetting.php';
 


if (!empty($_POST["posaljimejl"])) {
		$id = $_POST["id"];
		$jezik = $_POST["jezik"];
		$cijena = $_POST["cijena"];
		$pocetak = $_POST["pocetak"];
		$vrijemepolazak = $_POST["vrijemepolazak"];
		$kraj = $_POST["kraj"];
		$povratak = $_POST["povratak"];
		$vrijemepovratak = $_POST["vrijemepovratak"];
		$distanca = $_POST["distanca"];
		$trajanje = $_POST["trajanje"];
		$klasa = $_POST["klasa"];
		$putnici = $_POST["putnici"];
		$prtljag = $_POST["prtljag"];
		$childseat = $_POST["childseat"];
		$sati = $_POST["sati"];
		
		$ime = $_POST["ime"];
		$prezime = $_POST["prezime"];
		$firma = $_POST["firma"];
		$email = $_POST["email"];
		$telefon = $_POST["telefon"];
		 
		
		$buking = $_POST["buking"];
		$let = $_POST["let"];
		$letboard = $_POST["letboard"];
		
		$placanje=$_POST["placanje"];
		 
		
		include 'language.php';
		include 'obrada_podataka.php';
		
		$mail->SetFrom($from_email, "Z-ALS.ch");
		$mail->Subject = $prevodEmailTitle.$naziv_firme;


		$vrijemepolazaktime = getTimeStamp($vrijemepolazak);
		
		
		$sql = "UPDATE korisnici SET mejl = 1, vrijemepolazaktime = ".$vrijemepolazaktime." WHERE id = ". $id ;
		$result = $conn->query($sql);
		
	
		$body = "
	 

		<div style='font-size:16px; line-height:26px; color:#555; background-color:#0c1315; border:1px solid #0c1315'>
 			<div style='font-size:30px; line-height:40px; color:#fff; margin-top:30px; margin-bottom:10px;  text-align:center; '>".($jezik=="de-CH" ? "Ihre Buchung wurde bestätigt!" :"Your booking has been confirmed!")."</div>
			
			<div style='text-align:center; margin-bottom:20px;'><img style='height:50px;' height='50' src='https://z-als.ch/app/images/logo.svg'></div>
		 
		</div>
	
		<div style='text-align:center; padding:0px 20px;'>
 
 
				
				<div style='margin-top:30px; padding-bottom:0px;'>
					
					<div style='font-size:12px; text-transform:uppercase; line-height:24px; color:#777; margin-bottom:5px;'>".($jezik=="de-CH" ? "Kunde/Kundin" : "Customer")."</div>
					<div style='font-size:14px; line-height:20px; font-weight:bold; margin-bottom:7px;'>".$ime." ".$prezime."</div>
					<div style='".($firma == '' ? "display:none;" : "")." font-size:12px; line-height:16px;'>".$firma."</div>
					<div style='font-size:12px; line-height:16px;'>".$telefon."</div>
					<div style='font-size:12px; line-height:16px;'>".$email."</div>
					
				</div> 

				
				<div style='color:#444; font-size:18px; line-height:28px; padding:10px 0px; margin-top:30px; margin-bottom:30px;'><span style='padding:10px 30px; background-color:#bfa37c; color:#000 '>".($jezik=="de-CH" ? "Buchungsnummer #" :"Order #").$id."</span></div> 
					 
							 
				<div style='font-size:13px; text-transform:uppercase; line-height:24px; color:#777; margin-bottom:15px;'>".($jezik=="de-CH" ? "Transfer" :"Transfer")."</div>
				<div style='font-size:14px; font-weight:bold; color:#000; line-height:19px; '>
					<span style='font-weight:normal;'>".($jezik=="de-CH" ? "Von: " :"From: ")."</span><br />
					<span style='font-weight:bold;'>".$pocetak."</span>
				</div>
				<div style='display: ".($sati != '' ? "none;" : "block;")." font-size:14px; font-weight:bold; color:#000; line-height:19px; margin-top:15px;'>
					<span style='font-weight:normal;'>".($jezik=="de-CH" ? "Nach: " :"To: ")."</span><br />
					<span style='font-weight:bold; '>".$kraj."</span>
				</div>
				<div style='".($sati == '' ? "display:none;" : "")." font-size:14px; font-weight:bold; color:#000; line-height:19px; margin-top:15px;'>
					<span style='font-weight:bold;'>".($jezik == "de-CH" ? "Anzahl der Stunden: " :"Number of Hours/Days: ")."</span>
					<span style='font-weight:normal;'>".$sati."</span>
				</div>

				<div style='font-size:14px; font-weight:bold; color:#000; line-height:25px; margin-top:15px;'>
					<span style='font-weight:bold; padding:5px 10px; background-color:#efefef;'>".$povratak_display."</span>
				</div>
 
						 
				<div style='margin-top:30px; background-color:#bfa37c; padding-top:30px;  padding-bottom:30px;'>			 
					<div style='font-size:13px; text-transform:uppercase; line-height:24px; color:#000; margin-bottom:10px; '>".($jezik=="de-CH" ? "Kosten" : "Cost")."</div>
					<div style='font-size:24px; font-weight:bold; color:#000; line-height:28px; color:#000; '>CHF ".number_format($cijena, 2)."</div>
					<div style='font-size:13px; color:#000; line-height:19px;'>(".$placanje_display.")</div>
				</div>			 
			 

				<div style='overflow:hidden;  padding-top:30px;'>
					 
					 
					<div style='font-size:12px; text-transform:uppercase; line-height:24px; color:#777; margin-bottom:15px;'>".($jezik=="de-CH" ? "Ihre Reisedaten" :"Your travel data")."</div>
					<div style='font-size:13px; font-weight:bold; color:#000;  line-height:19px;'>
						<span style='font-weight:bold;'>".($jezik=="de-CH" ? "Abholzeit: " :"Pickup time: ")."</span>
						<span style='font-weight:normal;'>".$vrijemepolazak."</span>
					</div>
					<div style='".($distanca == 0 ? "display:none;" : "")." font-size:13px; font-weight:bold; color:#000;  line-height:19px;'>
						<span style='font-weight:bold;'>".($jezik=="de-CH" ? "Streckenlänge: " :"Route length: ")."</span>
						<span style='font-weight:normal;'>".$distanca." km</span>
					</div>
					<div style='".($trajanje == 0 ? "display:none;" : "")." font-size:13px; font-weight:bold; color:#000;  line-height:19px;'>
						<span style='font-weight:bold;'>".($jezik=="de-CH" ? "Ungefähre Reisedauer: " :"Approximate travel time: ")."</span>
						<span style='font-weight:normal;'>".$trajanje_display."</span>
					</div>
					
					<div style='".($povratak != 'roundtrip' ? "display:none;" : "")." font-size:13px; font-weight:bold; color:#000;  line-height:19px;'>
						<span style='font-weight:bold;'>".($jezik=="de-CH" ? "Rückholzeit: " :"Pickup time for return: ")."</span>
						<span style='font-weight:normal;'>".$vrijemepovratak."</span>
					</div>
					
					<div style='".($let == '' ? "display:none;" : "")." font-size:13px; font-weight:bold; color:#000;  line-height:19px;'>
						<span style='font-weight:bold;'>".($jezik=="de-CH" ? "Flugnummer: " :"Flight Number: ")."</span>
						<span style='font-weight:normal;'>".$let."</span>
						<div style='font-weight:bold; color:#bd183f; font-size:12px; line-height16px;'>".($jezik=="de-CH" ? "Unser Fahrer wird Ihren Flug verfolgen. Im Falle einer Flugverspätung brauchen Sie sich keine Sorgen zu machen." :"Our driver will track your flight. In case of a flight delay, you don't need to worry.")."</div>
					</div>
					<div style='".($letboard == '' ? "display:none;" : "")." font-size:13px; font-weight:bold; color:#000;  line-height:19px;'>
						<span style='font-weight:bold;'>".($jezik=="de-CH" ? "Nameboard: " :"Nameboard: ")."</span>
						<span style='font-weight:normal;'>".$letboard."</span>
					</div>
					<div style='".($buking == '' ? "display:none;" : "")." font-size:13px; font-weight:bold; color:#000; line-height:19px; margin-top:15px;'>
						<span style='font-weight:bold;'>".($jezik=="de-CH" ? "Buchungshinweise: " :"Booking notes: ")."</span><br />
						<span style='font-weight:normal;'>".$buking."</span>
					</div>
				</div>
						 
					 
						 
				<div style='line-height:20px; margin-top:30px; color:#000'>

					<div style='font-size:12px; text-transform:uppercase; line-height:24px; color:#777; margin-bottom:15px;'>".($jezik=="de-CH" ? "Fahrzeug" :"Vehicle")."</div>
					<div style='font-size:13px; font-weight:bold; color:#000;  line-height:19px;'>
						<span style='font-weight:bold;'>".($jezik=="de-CH" ? "Fahrzeugklasse: " :"Car type: ")."</span>
						<span style='font-weight:normal;'>".$klasa_display."</span>
					</div>
					<div style='font-size:13px; font-weight:bold; color:#000;  line-height:19px;'>
						<span style='font-weight:bold;'>".($jezik=="de-CH" ?  "Passagiere (inkl. Kinder): " : "Passengers (Incl. Children): ")."</span>
						<span style='font-weight:normal;'>".$putnici."</span>
					</div>
					<div style='font-size:13px; font-weight:bold; color:#000;  line-height:19px;'>
						<span style='font-weight:bold;'>".($jezik=="de-CH" ? "Gepäckstück: ": "Luggage: ")."</span>
						<span style='font-weight:normal;'>".$prtljag."</span>
					</div>
				 
					<div style='font-size:13px; font-weight:bold; color:#000;  line-height:19px;'>
						<span style='font-weight:bold;'>".($jezik=="de-CH" ? 'Kindersitz: ' : 'Child seat: ')."</span>
						<span style='font-weight:normal;'>".($childseat == '' ? 'Nein' : $childseat)."</span>
					</div>
					 
				</div>
						 
				 <div style='margin-top:30px; padding-bottom:30px; border-bottom:1px solid #ddd; background-color:#efefef; padding-top:30px;'>
					<div style='font-size:13px; text-transform:uppercase; line-height:24px; color:#333; margin-bottom:15px;'>".($jezik=="de-CH" ? "Limousinen-Service" : "Limousine service")."</div>
					<div style='font-size:15px; line-height:21px; font-weight:bold; '>".$naziv_firme."</div>
					
					<div style='font-size:13px; line-height:18px; margin-bottom:15px;'>Am Balsberg 36, <br />CH-8302 Kloten - Schweiz</div>
					<div style='font-size:13px; line-height:18px;'><span style='font-weight:bold;'>E-mail:</span> ".$reply_email."</div>
					<div style='font-size:13px; line-height:18px;'><span style='font-weight:bold;'>Office:</span> ".$vlasnik_tel."</div>
					<div style='font-size:13px; line-height:18px;'><span style='font-weight:bold;'>Homepage:</span> ".$url_pocetna."</div>
				</div>
   
			 
		</div>";
		
		
		// /echo $body;

		$mail->MsgHTML($body);
		$address = $email;
		$mail->AddAddress($address, "");
		$mail->AddReplyTo($reply_email, $naziv_firme);
    	if($mail->Send()){
    	   	$mail->ClearAddresses();
     	   	$mail->ClearAttachments();
           	//echo 'POSLAT MEJL NARUCIOCU';

           	echo ' <script type="text/javascript"> window.location.href = "'.$url_pocetna.'/app/'.$strana_pregleda.'.php" ; </script>';
	 
        }else{
			$mail->ClearAddresses();
           	$mail->ClearAttachments();
    	   	echo '<div class="decline">'.$error_email.'Web-Administrator</div>';
       	}

	}
 
	exit();



 include 'footer.php'; 
?>