<?php session_start(); ?>
<?php
	//If user is not signed in redirect
	if(!$user->signed) redirect("?page=login");	
	
	include(BASE_PATH . "/libs/cooltool/class.coolTool.php"); 
	$ctool = new coolTool($user->data['user_id']);  //initiate cooltool with registry

	$results = $ctool->getSimResults();
	if( !$results ) { 
?>
		<script type="text/javascript">
			$(document).ready(function() {
				$('.uam-report').empty();
				$('.uam-report').append("<ul class=\"msg-error\">" + "<li>Error: <?php echo $ctool->console['errors']['cooltool'][0]; ?></li></ul>");
			});
			
		</script>
<?php
		
	} 
?>


<div class="subcontent">
				<div class="uam-report"></div>
				<h3>Results</h3>
    			<hr  class="breaklightblue" />
                <div class="leftcol" id="result_container" style="width:95%"><?php include 'result_template.php' ?>
                </div><!-- end .leftcol --> 
                <div class="rightcol">
                 <p style="float:right;">
                    	<input onclick="window.location.href='?page=simulate';" type="button"  value="BACK" style="width: 
                        	120px; height: 70px; -webkit-appearance: none; background-color:#00457c; font-weight:bold; 
                            font-size:18px; color:#adafb2; margin-top:20px; margin-bottom:20px; margin-right:10px; display
                            : inline;" /> 
                    </p> 
                </div><!--end .rightcol-->
</div><!-- end .subcontent -->         