 
<?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, $naziv_firme);
		$mail->Subject = $prevodEmailTitle.$naziv_firme;
		
		
		$sql = "UPDATE korisnici SET mejl=1 WHERE id=".$id."";
		$result = $conn->query($sql);
		
	
		$body = "
		<head>
		<style>
			.container{ width:70%; margin:20px auto; margin-bottom:50px; background-color:#fff }
			.konfirmacija{ font-size:40px; line-height:50px; }
			.slogan{font-size:24px; line-height:34px;}
			.mail-left{ width:40%; float:left}
			.mail-right{ width:40%; float:right}
			.container-inner-1{ padding:20px 40px; padding-bottom:0px;}
			.container-inner-2{ padding:40px 40px;}

			@media screen and (max-width:1000px) {
			    .container{width:96%;}
			    .konfirmacija{ font-size:24px; line-height:32px; }
			    .slogan{font-size:18px; line-height:26px;}
			    .mail-left{ width:55%; }
				.mail-right{ width:45%; }
				.container-inner-1 {padding:15px 30px; padding-bottom:0px;}
				.container-inner-2{ padding:30px 30px;}
			}

			@media screen and (max-width:600px) {
			    .container{width:92%;}
			    .konfirmacija{ font-size:22px; line-height:30px; }
			    .slogan{font-size:16px; line-height:24px;}
			    .mail-left{ width:100%; }
				.mail-right{ width:100%; }
				.container-inner-1 {padding:15px 25px; padding-bottom:0px;}
				.container-inner-2{ padding:30px 25px;}
			}
		</style>
		</head>

		<div style='font-size:16px; line-height:26px; color:#555; background-color:#efefef; border:1px solid #efefef'>
 			<div class='konfirmacija' style='color:#000; padding:40px 0px;  text-align:center;'>".($jezik=="de-CH" ? "Ihre Buchung wurde bestätigt!" :"Your booking has been confirmed!")."</div>
			
			<div style='text-align:center;'><img style='height:80px;' height='80' src='https://theswisslimousine.ch//app/images/The-Swiss_n.svg'></div>
		

			<div class='slogan' style='text-align:center; color:#cc1820; '>".$slogan_firme."</div>
		

			<div class='container' style='border-radius:20px;'>
				

				<div class='container-inner-1' >
					<div style='overflow:hidden;'>
						<div class='mail-left' style='margin-top:30px;'>
							<div style='font-size:12px; text-transform:uppercase; line-height:24px; color:#777; margin-bottom:5px;'>".($jezik=="de-CH" ? "Limousinen-Service" : "Limousine service")."</div>
							<div style='font-size:12px; line-height:18px; font-weight:bold; '>".$naziv_firme."</div>
							
							<div style='font-size:12px; line-height:16px; margin-bottom:7px;'>Hohrainlistrasse 1, <br />8302 Кloten, Schweiz</div>
							<div style='font-size:12px; line-height:16px;'><span style='font-weight:bold;'>E-mail:</span> ".$from_email."</div>
							<div style='font-size:12px; line-height:16px;'><span style='font-weight:bold;'>Office:</span> ".$vlasnik_tel."</div>
							<div style='font-size:12px; line-height:16px;'><span style='font-weight:bold;'>Homepage:</span> ".$url_pocetna."</div>
						</div>
						<div class='mail-right' style='margin-top:30px; border-radius:7px; background-color:#f4f4f4;'>
							<div style='margin:15px;'>
								<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>
					</div>
				</div>
				

				<div class='container-inner-2'>
					 
				 	
					<div style='color:#444; font-size:18px; line-height:28px; border-bottom:1px solid #ddd; padding-bottom:15px;'>".($jezik=="de-CH" ? "Buchungsnummer #" :"Order #").$id."</div> 
					<div style='overflow:hidden;'>
						<div class='mail-left'>
							<div style='line-height:20px; margin-top:15px; color:#000'>
								<div style='font-size:12px; text-transform:uppercase; line-height:24px; color:#777; margin-bottom:10px;'>".($jezik=="de-CH" ? "Transfer" :"Transfer")."</div>
								<div style='font-size:13px; 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:13px; font-weight:bold; color:#000; line-height:19px; margin-top:5px;'>
									<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:13px; font-weight:bold; color:#000;  line-height:19px; margin-top:5px;'>
									<span style='font-weight:bold;'>".($jezik=="de-CH" ? "Anzahl der Stunden: " :"Number of Hours/Days: ")."</span>
									<span style='font-weight:normal;'>".$sati_display."</span>
								</div>

								<div style='font-size:13px; font-weight:bold; color:#000; line-height:25px; margin-top:10px;'>
									<span style='font-weight:bold; padding:5px 10px; background-color:#efefef; border-radius:7px'>".$povratak_display."</span>
								</div>

							</div>
						</div>
						<div class='mail-right'>
							<div style='line-height:20px; margin-top:15px; color:#000;'>
								<div style='font-size:12px; text-transform:uppercase; line-height:24px; color:#777; margin-bottom:10px;'>".($jezik=="de-CH" ? "Kosten" : "Cost")."</div>
								<div style='font-size:20px; font-weight:bold; color:#000; line-height:26px; color:#cc0000; '>CHF ".number_format($cijena, 2)."</div>
								<div style='font-size:13px; color:#444; line-height:19px;'>(".$placanje_display.")</div>
							</div>
						</div>
					</div>
					<div style='overflow:hidden; border-top:1px solid #ddd; margin-top:30px; padding-top:15px;'>
						<div class='mail-left'>
							<div style='line-height:20px; margin-top:15px; color:#000'>
								<div style='font-size:12px; text-transform:uppercase; line-height:24px; color:#777; margin-bottom:10px;'>".($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>
								<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>
						<div class='mail-right'>
							<div style='line-height:20px; margin-top:15px; color:#000'>
								<div style='font-size:12px; text-transform:uppercase; line-height:24px; color:#777; margin-bottom:10px;'>".($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>
					</div>
  
				</div>
			</div>
		</div>";
		
		
		//echo $body;

		$mail->MsgHTML($body);
		$address = $email; 
		$mail->AddAddress($address, "");
    	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'; 
?>