 
<?php
include 'header2.php';

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






if (!empty($_POST["posaljimejl"])) {
		$id=$_POST["id"];
		$jezik=$_POST["jezik"];
		
		$ime=$_POST["ime"];
		$prezime=$_POST["prezime"];
		$email=$_POST["email"];
		$firma = $_POST["firma"];
		$telefon = $_POST["telefon"];
	 	
	 	include 'language.php';
		include 'obrada_podataka.php';

 		$mail->SetFrom($from_email, $naziv_firme);
		$mail->Subject = $prevodEmailTitleCancel.$naziv_firme;
		
		$sql = "UPDATE korisnici SET mejl = 2 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 storniert!" :"Your booking has been canceled!")."</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='font-size:15px; line-height:23px; color:#111; margin-top:20px;'>".
							($jezik == 'de-CH' ? "Sehr geehrte ".$ime.",<br />
							Vielen Dank für Ihre Anfrage.<br /><br />
							<span style='font-weight:bold;'>Leider sind zum angegebenen Zeitpunkt alle unsere Fahrzeuge ausgebucht.</span><br />
							Wir freuen uns in Zukunft auf neue Anfragen.<br /><br />
							Freundliche Grüsse!<br />
							<strong><span style='text-transform:uppercase;'>".$naziv_firme."</span></strong>"
	 						
	 						:

							"Dear ".$ime.", <br />
							Thank you for your request.<br /><br />
							<span style='font-weight:bold;'>Unfortunately, all our vehicles are fully booked.</span><br />
							We look forward to new inquiries in the future.<br /><br />
							With kind regards!<br />
							<strong>".$naziv_firme."</strong>")."
						 </div>
	  
					</div>
				</div>
	 

			</div>";


		 
		//echo $body;	
		$mail->MsgHTML($body);
		$address = $email;
		$mail->AddAddress($address, "");
		if($mail->Send()){
	     	$mail->ClearAddresses();
 	     	$mail->ClearAttachments();
			//header('Location:' . $url_pocetna.'/app/'.$strana_pregleda.'.php'); 
			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';

?>