<script src="lib/jquery-1.8.2.min.js"></script>
<script src="lib/jquery.validate.js" type="text/javascript"></script>

<!DOCTYPE html>   
<html lang="en">

<head>
<style>
.slider-bar{
        display:block; width:80px; background-color:darkred; position:relative;
    }

    .slider, .slider-bar{
        height:30px;
    }
</style>      
<meta charset="utf-8">   
<title>Passenger Queue</title>   
<meta name="description" content="Twitter Bootstrap Version2.0 form error example from w3resource.com.">   
<link href="twitter-bootstrap-v2/docs/assets/css/bootstrap.css" rel="stylesheet">  
</head>  
<body>  
<!--<p class="brand">Airline and Travel Agents can search for passengers flying with the Flight selected in the previous page. Airline will see a list of passengers with their PhoneNumber, Name and email address. Airline and Travel Agents can check out the passenger location by clicking on the passenger Name and will find the Geo-Location of that passenger. With this information in hand Airlines will be able to manage seats and send Airfare deals to potential future passengers.AirlineTracker is a flight management system for Airline companies to boost their profits</p>-->
	<form method="POST" action="http://thetaxiapp.herokuapp.com/passqueuesearch" class="form-horizontal" id="passqueuesearch_form" data-ajax="false">  
		<fieldset>  
          <legend>Search for Passengers</legend>  
          <div class="control-group success">  
            <label class="control-label" for="driverlat">Driver Latitude</label>  
            <div class="controls">  
              <input type="text" name="driverlat" id="driverlat" value="0">  
              <span class="help-inline">Latitude should be auto populated</span>  
            </div>  
          </div>  
          <div class="control-group success">  
            <label class="control-label" for="driverlong">Driver Longitude</label>  
            <div class="controls">  
              <input type="text" name="driverlong" id="driverlong" value="0">  
              <span class="help-inline">Longitude should be auto populated</span>  
            </div>  
          </div>  

			<div data-role="fieldcontain">
				<fieldset data-role="controlgroup">  
						<label class="control-label" for="miles">Range (in miles):</label>
						<input type="range" name="miles" id="miles" min="0" max="50" value="50">
				</fieldset>
			</div>
			
         </fieldset>
         <input type="hidden" name="departureTaxiPlatformFsCode" value=<%= departureTaxiPlatformFsCode %>>
         <input type="hidden" name="arrivalTaxiPlatformFsCode" value=<%= arrivalTaxiPlatformFsCode %>>
         <input type="hidden" name="departureTime" value=<%= departureTime %>>
         <input type="hidden" name="arrivalTime" value=<%= arrivalTime %>>
         <input type="hidden" name="arrivalTerminal" value=<%= arrivalTerminal %>>
         <input type="hidden" name="carrierFsCode" value=<%= carrierFsCode %>>
         <input type="hidden" name="flightNumber" value=<%= flightNumber %>>
         <input type="hidden" name="driverId" value=<%= driverId %>>
         <input type="hidden" name="currentDate" value=<%= currentDate %>>
         <input type="hidden" name="lat" value=<%= lat %>>
         <input type="hidden" name="long" value=<%= long %>>
         
    	<div class="controls">  
			<p><button type="submit" class="btn btn-success">Track Passengers</button>
      	</div>
	</form>  
</body>  

   <div id="extra">
      <p><strong>cheap ticket plane ticket plane tickets</strong></p>
      <p>cheapest flights cheapest flight last minute flights reservation</p>
    </div>
   <div id="ad1">
     <p><strong>Airline hotel reservation airline ticket</strong></p>
     <ul>
       <li><a href="https://play.google.com/store/search?q=airlinestracker%20and%20deals">british airlines air fare</a></li>
       <li><a href="https://play.google.com/store/search?q=airlinestracker%20and%20deals">airfare Airfare Travel airline</a></li>
       <li><a href="https://play.google.com/store/search?q=airlinestracker%20and%20deals">flights american airlines airfare</a></li>
       <li><a href="https://play.google.com/store/search?q=airlinestracker%20and%20deals">fare qatar Qatar Airlines sky airlines</a></li>
     </ul>
   </div>
 
   <div id="ad2">
     <p><strong>passenger Taxi malaysia airlines Indian Airlines</strong></p>
     <ul>
       <li><a href="https://play.google.com/store/search?q=airlinestracker%20and%20deals">Jet Airways air india southwest</a></li>
       <li><a href="https://play.google.com/store/search?q=airlinestracker%20and%20deals">ticket airline flights flight tracker</a></li>
       <li><a href="https://play.google.com/store/search?q=airlinestracker%20and%20deals">schedule Deals departure al arabia airlines</a></li>
       <li><a href="https://play.google.com/store/search?q=airlinestracker%20and%20deals">cancelled tickets saudi airlines</a></li>
     </ul>
   </div>
 
   <div id="ad3">
     <p><strong>track fly Airport Gate Airlines time air weather cancellation</strong></p>
     <ul>
       <li><a href="https://play.google.com/store/search?q=airlinestracker%20and%20deals">book from to AA American air</a></li>
       <li><a href="https://play.google.com/store/search?q=airlinestracker%20and%20deals">book from to AA American air</a></li>
       <li><a href="https://play.google.com/store/search?q=airlinestracker%20and%20deals">book from to AA American air</a></li>
       <li><a href="https://play.google.com/store/search?q=airlinestracker%20and%20deals">book from to AA American air</a></li>
     </ul>
   </div>

</html>  

<script>

function getLocation(location){
	console.log("I know where you are", location.coords.latitude, location.coords.longitude);
	
	var long = $(driverlat), lat = $(driverlong)

	long.val(location.coords.longitude);
	lat.val(location.coords.latitude);

}
</script>

<script>
 function notify () {
 var self = this, args = Array.prototype.slice.call(arguments);
 if (window.webkitNotifications) {
 return window.webkitNotifications.createNotification.apply(window.webkitNotifications, args);//(arguments[0], arguments[1], arguments[2]);
 }
 else {
 //TODO do an html notification here
 return { show: function() {
 alert.apply(self, args.reverse());
 } };
 }
 }
 
 if (window.webkitNotifications) {
 console.log('Notifications are supported!');
 if (window.webkitNotifications.checkPermission() != 0) window.webkitNotifications.requestPermission();
 } else {
 console.log('Notifications are not supported!');
 }
 
 var createPassCancelNotificationInstance = function (options) {
 return notify(
 '/img/logo.png',
 'PASSENGER CANCELLED',
 'The passenger cancelled the fare and we are taking you back to the queue...'
 );
 };
 
 var createDriverCancelNotificationInstance = function (options) {
 return notify(
 '/img/logo.png',
 'DRIVER CANCELLED',
 'The driver cancelled and your fare is back in the queue...'
 );
};
 var createDriverAcceptanceNotificationInstance = function (options) {
 return notify(
 '/img/logo.png',
 'DRIVER ACCEPTANCE',
'A driver just accepted your fare...'
 )
 };

(function($){
if('<%= carrierFsCode %>' == 'accepted')
{
 console.log("fare is in accepted status "); 
// ManojNot - createDriverCancelNotificationInstance({notificationType:'simple'}).show();
}

console.log("PassQueueView fare status ", '<%= carrierFsCode %>');
 	console.log( 'Pass Search View');
	navigator.geolocation.getCurrentPosition(getLocation); // Asks the user for their GPS

  (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
	  (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
		  m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
			  })(window,document,'script','//www.google-analytics.com/analytics.js','ga');

				  ga('create', 'UA-48099344-1', 'airlinestracker.com');
					  ga('send', 'pageview');

})(jQuery);
						</script>

