 
<?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"];
		$vrijemepolazak=$_POST["vrijemepolazak"];
	 	
	 	include 'language.php';
		include 'obrada_podataka.php';

 		$mail->SetFrom($from_email, "Z-ALS.ch");
		$mail->Subject = $prevodEmailTitleCancel.$naziv_firme;


		$vrijemepolazaktime = getTimeStamp($vrijemepolazak);
		
		//$sql = "UPDATE korisnici SET mejl = 2 WHERE id = ".$id."";
		$sql = "UPDATE korisnici SET mejl = 2, 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 storniert!" :"Your booking has been canceled!")."</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:13px; 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:15px; line-height:23px; color:#111; margin-top:20px; text-align: left;'>".
					($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>".$naziv_firme."</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 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" ? "Taxi-Service" : "Taxi 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();
			//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';

?>