<?php

/*



Template Name: Popup

*/



$ctype=$_REQUEST["ctype"];

$fleets_id=$_REQUEST["fleets_id"];

$apiKey="1e1c0a7b9491a4s45238591099254058f9";

$time=date('Ymdhis');



$apiUrl="https://www.globallimos.com/api/search/viewcarpopup.php?apikey=".$apiKey."&time=".$time."&ctype=".$ctype."&fleets_id=".$fleets_id;

//$postdata=$postdata.'&ctype='.$ctype.'';

//$postdata=$postdata.'&fleets_id='.$fleets_id.'';

//echo $apiUrl.$postdata;

if($fleets_id!=''){	

	$resp=file_get_contents($apiUrl);	

	$responseJO=json_decode($resp);

	//print_r($responseJO);

	$fleets_id=$responseJO->fleets_id;

	$sub_category_id=$responseJO->sub_category_id;

	$fleets_title=$responseJO->fleets_title;

	$fleets_desc=stripslashes(nl2br(str_replace('\\','',str_replace('Global','A1',$responseJO->fleets_desc))));

	$fleets_video=$responseJO->fleets_video;

	$imagelist=$responseJO->imagelist;

	/*$post = urldecode($postdata);	

	//echo file_get_contents($apiUrl);

	$curl = curl_init($apiUrl);

	 // Set some options - we are passing in a useragent too here

	curl_setopt($curl, CURLOPT_POST, true);

	curl_setopt($curl, CURLOPT_RETURNTRANSFER, true);

	curl_setopt($curl, CURLOPT_HTTPAUTH, CURLAUTH_BASIC);

	curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, false);

	curl_setopt($curl, CURLOPT_USERAGENT , 'Mozilla 5.0');

	curl_setopt($curl, CURLOPT_POSTFIELDS, $post);

	curl_setopt($curl, CURLOPT_VERBOSE , true);			

	$resp = curl_exec($curl);			

	$responseJO=json_decode($resp);

	print_r($responseJO);*/

}

?>

<!DOCTYPE html>

<html <?php language_attributes(); ?> class="no-js no-svg">

<head>

<meta charset="<?php bloginfo( 'charset' ); ?>">

<link type="image/ico" rel="icon"  href="<?php echo get_template_directory_uri(); ?>/assets/images/favicon.ico">

<meta name="viewport" content="width=device-width, initial-scale=1">

<link rel="profile" href="http://gmpg.org/xfn/11">

<link href="https://fonts.googleapis.com/css?family=Raleway:300,300i,400,400i,500,500i,600,600i,700,700i,800,800i" rel="stylesheet"> 

<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/assets/css/bootstrap.min.css" type="text/css">

<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/assets/css/owl.carousel.css" type="text/css">

<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/style.css" type="text/css">

<link rel="stylesheet" href="<?php echo get_template_directory_uri(); ?>/assets/css/responsive.css" type="text/css">

</head>

<body <?php body_class(); ?>>

<section id="contentPart" class="contentPart innerPageContent">

      <div id="primary" class="content-area">

		<main id="main" class="site-main">

  

 <div class="cotentPart"> <div class="cf">

  

  <div class="col-sm-12">

           <div class="PhotoVideoPopupWrap">

<h2>A1 luxury limo rental</h2>

<div class="PhotoVideoBannerSec">

<h3><?=$fleets_title?></h3>

<p>             <!--<img src="images/pop-slide-img.png" alt="">--></p>

<? 

if($imagelist!=''){

	if(count($imagelist) > 0){?> 

<div class="photovideoslider">

	<? foreach($imagelist as $rowI){?>

		<? if(count($imagelist) == 1){?> 

		<div class="item"><img src="<?=$rowI->imgurl?>" alt="<?=$rowI->alt_img?>" style="width:295px; height:197px;" title="<?=$rowI->alt_img?>"/></div>

		<div class="item"><img src="<?=$rowI->imgurl?>" alt="<?=$rowI->alt_img?>" style="width:295px; height:197px;" title="<?=$rowI->alt_img?>"/></div>

		<? }else{?>

		<div class="item"><img src="<?=$rowI->imgurl?>" alt="<?=$rowI->alt_img?>" style="width:295px; height:197px;" title="<?=$rowI->alt_img?>"/></div>

		<? }?>

	<? }?>

</div>

<? }

}?>

</div>

<? if($fleets_video!=''){?>

<div class="PopupVideoButton"><a href="#" class="videoBtn"> <img class="IconVideo" src="<?php echo get_template_directory_uri(); ?>/assets/images/video-icon.png" alt=""/>Video</a></div>

<div class="videoWrap">

<div class="youtubeVideoWrap"><iframe width="560" height="315" src="https://www.youtube.com/embed/<?=$fleets_video?>" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen></iframe></div>

</div>

<? }else{?>

<p>&nbsp;</p>

<? }?>

<div class="DescriptionWrap">

<h4>The Most Demanding <?=$fleets_title?>:</h4>

<? if($fleets_desc!=''){?>

<p><?=$fleets_desc?></p>

<? }?>

</div>

</div>

              </div>

              </div>

</div>

		</main><!-- .site-main -->

	</div>

   </section> 

<script src="<?php echo get_template_directory_uri(); ?>/assets/js/jquery.js"></script> 

<script src="<?php echo get_template_directory_uri(); ?>/assets/js/owl.carousel.min.js"></script> 

<script src="<?php echo get_template_directory_uri(); ?>/assets/js/general.js"></script>

</body>

</html>