<?php	

$pilot = Auth::$userinfo;

$time = '01.50';
		$split_time = explode('.', $time);
		$hours = $split_time[0];
		$minutes = $split_time[1];
		
		//convert hours to minutes. 
		$hours_to_minutes = $hours * 60;
		$total_minutes = $minutes + $hours_to_minutes;
		
		//Pay per minute. 
		$pay_per_minute = $pilot->payrate / 60;
		$total_pay_per_minute = round($pay_per_minute * $total_minutes);
		
		echo "Pilot rank payscale: $pilot->payrate";
		echo "<br>";
		echo "Flight Time: $time";
		echo "<br>";
		echo "Pay per minute: $pay_per_minute"; 
		echo "<br>";
		echo "Total Pay per minute: $total_pay_per_minute";
		echo "<br>";
		echo "Total pay (old method): " . ($pilot->payrate * $time);
		
?>
