<?php
	require_once("components/com_requestforhelp/helpers/requestforhelp.php");	
	require_once ('includes/classes/mysql.class.php');
	
	$real_ip = RequestForHelpHelper::getRealIpAddr();
	$ip = geoip_record_by_name( $real_ip );
	$latitude = $ip['latitude'];
	$longitude = $ip['longitude'];
	
	$app =& JFactory::getApplication();
	$templateName=$app->getTemplate();
	$rfqSession = $app->getUserState('com_requestforhelp');
	$current_url = JURI::current();
	$base_url = JURI::base();
	$params = JComponentHelper::getParams('com_requestforhelp');

	if (!empty($rfqSession)) {
		$app->setUserState('com_requestforhelp', null);
	}
		
	//$sugarDB = &JFactory::getDBO();	
	global $sugarDB;
	$sugarDB = new mysql();
	$sugarDB->server = $params->get('dbhost');
	$sugarDB->base = $params->get('dbname');
	$sugarDB->user = $params->get('dbusr');
	$sugarDB->password = $params->get('dbpswd');
	$sugarDB->connect();
	//$database = &JFactory::getDBO();

	$category = strtolower( JRequest::getVar('utm_campaign','findit') );	
		
	$location_title = "<span style='color: #fff; font-size:0.4em;'>+200 office locations in USA</span> ";
	$location_phone = "800.757.5318";
	$address_city = "Chicago";
	$address_state = "IL";
	$address_street = "8745 W. Higgins Rd., Ste. 110";
	$address_postalcode = "60631";
	////////////////////////////////////
	$sql_where = "";
	////////////////////////////////////
	if( $category != 'findit' ){		
		$tmp_separator= substr( $category, 5, 1 );
		
		if( $tmp_separator == '-'){ 
			//city defined
			$location_state = substr( $category, 0, 2 );
			$category = substr( $category, 6 );
			$sql = "SELECT  address_city, address_state,  IFNULL(phone, '".$location_phone."') as phone, LOWER(REPLACE(`address_city`, ' ', '-')) as acity
						FROM vip_wide_addresses  
					WHERE address_state = '".$location_state."' and REPLACE(`address_city`, ' ', '')  = '".$category."'
			LIMIT 1";			
			
		
			$facility = $sugarDB->getOne($sql);						
			if( $facility['acity'] != '' ){
				$category = $facility['acity'];				

			}else{				
				$category = 'findit';

			}
		}
	}
	
	if( $category == 'findit' || ( substr( $category, 2, 1 ) == '-'  && strlen( $category) == 5 )){	
		///////////////find nearest office location//////////////////////
		if( !empty($latitude) ){
			if( substr( $category, 2, 1 ) == '-'){
				$location_state = substr( $category, 0, 2 );
				$sql_where  = "WHERE  population is not null and address_state = '".$location_state."' ";
			}
			$earthRadius = '3963.0'; // In miles
				$sql = "
							 SELECT  
								 ROUND(  
								 $earthRadius * ACOS(
										 SIN( $latitude*PI()/180 ) * SIN( latitude*PI()/180 )  
										 + COS( $latitude*PI()/180 ) * COS( latitude*PI()/180 )  *  COS( (longitude*PI()/180) - ($longitude*PI()/180) )   )  
								 , 1)  
								 AS distance,  								
						 id,						 
						 address_city, 
						 address_state,						 
						 IFNULL(phone, '".$location_phone."') as phone,
						 latitude,
						 longitude
							 FROM  
								 vip_wide_addresses 
							".$sql_where." 
							 ORDER BY  
								 distance ASC LIMIT 1";  
						
			$facility = $sugarDB->getOne($sql);			
		}
	}
	
	if( $facility['address_city'] != '' ){
		$address_city = $facility['address_city'];
		$address_state = $facility['address_state'];
		$address_street = '';
		$address_postalcode = '';
		$location_phone = $facility['phone'];
	}
	
	$label = $address_city." ".$address_state;

?>

<style type="text/css">	
	h1::after {
		content: " ";
		display: block;
		border-top: 10px solid #fff;		
		margin: 20px 40%;
	}
	ul.check li{
		font-size: 18px;
	}
	ul.check li:before{
		padding-right: 15px;
	}
	.address-image-city .address-image-caption-video{
		top: 70px;
	}
	.address-image-caption {
		position: absolute;
		top: 65px;
		left: 15px;
		background: rgba(0,0,0,.5);
		padding: 0 17px;
		color: #fff;
		line-height: 2em;
		max-width: 100%;
		font-size: 18px;
	}
	
	.address-image-caption p{
		margin: 0 !important;
	}
	.location-information img{
		text-align: center;
	}
	
	.emergency-form .borderWrapper:after {
		top: 65px !important;
	}
	.content-title{
		text-align: center;
	}
	.content-title h1{
		margin-top: 20px;
	}
	.lead{
		color: #fff;
		font-size: 22px;
	}
	.lead a{
		font-size: 18px;
		margin-top: 20px;
	}
	
	.pickup-offer {
		margin: 0;
		color: #fff;
		font-size: 22px;
		text-align: center;
	}
	
	.spotlight{
	  border-bottom: 1px solid #ccc;
	}
	.button{
		cursor: pointer;
	}
	.button.b-close, .button.bClose {
		border-radius: 7px 7px 7px 7px;
		box-shadow: none;
		font: bold 131% sans-serif;
		padding: 0 6px 2px;
		position: absolute;
		right: -7px;
		top: -7px;
		background-color: #2b91af;
	}
	.button.b-close:hover{background-color:#1e1e1e;color:#fff}
	span.df-helper-contents{
		display:none;
	}
	.office-city{
		font-weight: bold;
		font-size: 20px;
	}
	.location-information p{
		margin: 0 0 0 40px;	
	}
	h4{
		font-size: 28px;
		text-align: center;
		font-weight: 700;		
		color:#00b4dc;
	}
	h4::after {
		content: " ";
		display: block;
		border-top: 3px solid #888888;
		margin: 10px 40%;
	}
	.dropoff-buttons{
		padding-top: 10px;
		padding-bottom: 25px;		
	}
	
	.dropoff-buttons a{
		width: 100%;
	}
	.dropoff-btn{
		vertical-align: 10%;
		font-size: 18px;
	}
	#drop-off-button{
		margin-top: 0px; 
	}
</style>
<script type="text/javascript">
(function($){
	$(document).ready(function(){
	   // cache the window object
	   $window = $(window);
	 
	   $('section[data-type="background"]').each(function(){
		 // declare the variable to affect the defined data-type
		 var $scroll = $(this);
						 
		  $(window).scroll(function() {
			// HTML5 proves useful for helping with creating JS functions!
			// also, negative value because we're scrolling upwards
			var yPos = -($window.scrollTop() / $scroll.data('speed'));
			 
			// background position
			var coords = '50% '+ yPos + 'px';
	 
			// move the background
			$scroll.css({ backgroundPosition: coords });   
		  }); // end window scroll
	   });  // end section function
	}); // close out script

	/* Create HTML5 element for IE */
	document.createElement("section");
  })(jQuery);  
</script>

<section id="content-banner" data-speed="2" data-type="background" class="parallax" style="background: url(/images/datarecoup-lab.jpg) 50% 0px;">			
	<div class="container">
		<div class="row">
			<div class="content-title col-md-9 col-sm-6 col-xs-12">
				<h1>We Recover Data</h1>	

					<p class="lead">Recovering your data is our top priority. No recovery is too small or too big for our data recovery team.</p>
					<p class="pickup-offer">Local Same Day Service in <?php echo $address_city.", ".$address_state;?>.</p>
					<p class="lead">
						<a href="tel:18007575318" class="btn btn-danger  ">Call us: <?php echo $location_phone;?></a>
						<a href="/get-free-service" class="btn btn-default  ">Get your free consultation and quote</a>
					</p>
			</div>
			<div class="emergency-form col-md-3 col-sm-6 col-xs-12">
				<div class="borderWrapper">
					<h2 class="title">Get <span style="color:yellow;font-weight:bold;">Free</span> Help Now!</h2>
				</div>

				<div id="get-help-now" class="get-help">  
						<div class="request-help-box">  
							<form id="rfq-step0-form" action="/index.php" method="post">
							<div>
								<input type="hidden" name="option" value="com_requestforhelp" />
								<input type="hidden" name="task" value="step0_submit" />
								<input type="hidden" value="UNITED STATES" id="txt_country_zero" name="txt_country">
			<input type="hidden" name="Itemid" value="<?php echo JRequest::getInt('Itemid'); ?>" />
			<input type="hidden" name="return" value="<?php echo JURI::current(); ?>" />
			
								<?php echo JHtml::_( 'form.token' ); ?>						
							</div>
			<div class="request-help-inputs">
				<div class="row">
					<div class="col-xs-6 first-name"><input type="text" id="txt_first_name_zero" name="txt_first_name" placeholder="First Name" data-validate-actions="required" data-error-message="First name" /></div><div class="col-xs-6 last-name"><input type="text" id="txt_last_name_zero" name="txt_last_name" placeholder="Last Name" data-validate-actions="required" data-error-message="Last name" /></div>
				</div>
					<div class="row">
						<div class="col-xs-8 phone">
											<input type="text" id="txt_phone_zero" name="txt_phone" placeholder="Phone" value="" data-validate-actions="phonefilter,required" data-error-message="Phone number" />
						</div>
						<div class="col-xs-4 phone-ext" style="padding-left:0;">
											<input type="text" id="txt_phone_ext_zero" name="txt_phone_ext" placeholder="Ext." value="" />
						</div>
					</div>
					<div class="row">
						<div class="col-xs-8 phone">
							<input type="text" id="txt_email_zero" name="txt_email" placeholder="Email" value="" data-validate-actions="required,email" data-error-message="Valid email" />
						</div>
						<div class="col-xs-4 phone-ext" style="padding-left:0;">
							<input type="text" id="txt_zip_zero" name="txt_zip" placeholder="ZIP Code" value="" data-validate-actions="required" data-error-message="ZIP code" />
						</div>				
					</div>
								
								
			</div>
							<div class="request-help-send">
								<a id="main_send_request" class="btn btn-primary pricing-btn" title="Request Help" href="" rel="nofollow">REQUEST HELP</a>
							</div>
							</form>
						</div>

				</div>
			</div>
			
		</div>
	</div>	
	<div class="overlay"></div>
</section>


<div class="container" style="margin-top: 40px;">
<div class="row">
	<div class="location-information col-lg-4 col-md-4 col-xs-12 col-sm-6">
		<h3 class="title">Features &amp; Benefits</h3>
		<ul class="check">
			<li>All causes of data loss</li>
			<li>All types of devices</li>			
			<li>Free Initial Diagnostic</li>
			<li>Totally Risk-Free</li>
			<li>Frequent Updates</li>
			<li>Support Available 24x7x365</li>
			<li>Dedicated Customer Service</li>
			<li>Emergency Services</li>
			<li>Discounts</li>
		</ul>
		
	</div>
	<div class="location-information col-lg-4 col-md-4 col-xs-12 col-sm-6">	
		<h3 class="title">Local, Trusted, Certified</h3>
		<img id="dnn_ctl10_imgGoogle" class="fla" src="//maps.googleapis.com/maps/api/staticmap?center=<?php echo $label;?>&amp;zoom=9&amp;size=350x262&amp;maptype=roadmap&amp;markers=color:maroon%7Clabel:%7C<?php echo $label;?>&amp;sensor=false" style="width:90%;">
		<div class="address-image-caption">
			<p><?php echo $address_city.", ".$address_state;?>  Service Location</p>
		</div>
	</div>	
	
	<div class="col-lg-4 col-md-4 col-xs-12">
		<h3 class="title">Why choose us?</h3>
		<div class="address-image-city">
                <img class="local-office-img" src="/images/lab-2.jpg" alt="FileRecoup Data Recovery Services">
                <div class="address-image-caption-video">
                    <div class="caption-inner-wrapper">                        
						<a href="//fast.wistia.net/embed/iframe/yf7z9m1hn4?popover=true" class="wistia-popover[height=360,playerColor=7b796a,width=640]">
                        <p class="caption-video-title">What makes us different?</p>
                        <img class="playbutton" src="/images/play-button.png">
                        <p>Watch Introductory Video!</p>
                        </a>
                    </div>
                </div>
                <div class="address-image-bar">
                    <span>Class 10 ISO 5 Cleanroom</span>
                    <span>FileRecoup - The Choice is Simple</span>
                </div>
           </div>
	</div>
</div>
<div class="row">
	<h4>I am ready to send my media!</h4>
	<p style="font-size:18px; font-style:italic;text-align:center;">Choose one of our three delivery options: <br>
	</p>	
	<div class="row" style="text-align:center;">
		
								<script src="//fast.wistia.com/embed/medias/zb2auaavac.jsonp" async></script>
		<script src="//fast.wistia.com/assets/external/E-v1.js" async></script>
		<span class="wistia_embed wistia_async_zb2auaavac popover=true popoverAnimateThumbnail=true" style="display:inline-block;height:200px;width:356px">&nbsp;</span>	
			<p style="color:#fff; position:relative; bottom:50px;">FREE Secure Courier Pickup <br/>
									Recommended Media Delivery</p>
		</div>
	<div class="row">
		<div class="dropoff-buttons col-lg-4 col-md-4 col-xs-12 text-left">	
			<a href="/delivery-pickup.html" class="btn btn-danger"><i class="fa fa-truck fa-2x">&nbsp;</i> <span class="dropoff-btn">Free Courier Pickup</span></a>      		
			<ul  class="text-left" style="margin-top:15px;padding-left:20px;">
				<li>Recommended way of media delivery</li>
				<li>Easy. You do not have to do anything or go anywhere, we do all the work.</li>			
				<li>Fast. The courier can pick up your media devices in as little as 30 minutes.</li>
				<li>Secure. Your media is secure with our specialized couriers during the delivery process.</li>
				<li>Safe. The media devices are safely delivered to us.</li>
			</ul>
		</div>
		<div class="dropoff-buttons col-lg-4 col-md-4 col-xs-12">	
			<a href="/delivery-ship.html" class="btn btn-danger  "><i class="fa fa-cube fa-2x">&nbsp;</i><span class="dropoff-btn">I Will Ship My Media</span></a>
			<ul style="margin-top:15px;padding-left:20px;">	
				<li>You may choose to ship your media to us</li>
				<li>We will provide a free FedEx shipping label</li>			
				<li>Subject to FedEx office hours</li>
			</ul>
		</div>	
		
		<div class="dropoff-buttons col-lg-4 col-md-4 col-xs-12 text-left">	
			<a href="/delivery-dropoff.html" class="btn btn-danger"><i class="fa fa-calendar fa-2x">&nbsp;</i> <span class="dropoff-btn">Media Drop-off</span></a>
			<ul style="margin-top:15px;padding-left:20px;">
				<li>May be done though not recommended  </li>
				<li>Media can be dropped off by appointments only</li>			
				<li>Subject to office hours</li>
				<li>Parking fees may apply</li>
				<li>Some locations require access pass to enter</li>
			</ul>
		</div>
	</div>
</div>	



<script charset="ISO-8859-1" src="//fast.wistia.com/assets/external/popover-v1.js"></script>
<!-- Element to pop up -->

</div>
