<?php
include("../session.php");
include("../connect.php");

$user=$_SESSION['admin'];
//echo "admin success!!!";
?>

<html>
<head>
<link href="header.css" rel="stylesheet" type="text/css"/>
<link type="text/css" rel="stylesheet" href="overflow.css" />
<script type="text/javascript" src="jquery.js"></script>
<link rel="stylesheet" type="text/css" href="facebox/facebox.css" />
<script language="javascript" src="facebox/facebox.js"></script>
<script language="javascript">
$(document).ready(function() {
    $('a[rel*=facebox]').facebox();
})
</script>
</head>
<body>
<!-----------------Outer table--------------->
<table align=left width=1200 border=0 cellspacing=10 cellpadding=3 class=outer >
<tr>
	<td colspan=2 class="head">
	<?php include("adminHead.php");?>
	</td>
	</tr>
<tr>
	<td colspan=2>
	<div class=main>&nbsp;&nbsp;>>
			<a href="<?php echo"admin.php";?>">&nbsp;Home&nbsp;</a>>>
			<a href="<?php echo"licenseReport.php";?>">&nbsp;License Report&nbsp;</a>>>
			&nbsp;Summary Report&nbsp;
			</div></td>
	</tr>
<tr>
	<td width=280 valign=top>
	<!-----------Inner table 1----------------->
	<a href="<?php echo"licenseReport.php";?>"><p class=flipSH id=setting>View all</p></a>
				
		<?php
		$year=2012;
		$count=0;
		while($year<2030){
			$query=mysql_query("Select * from licensereport where year='$year'");
			if(mysql_num_rows($query)>0){
				if($count%2==0){
					echo "<a href='licenseYear.php?year=$year'><p class='flipA' id='setting'>$year</a><br/>";
				}else{
					echo "<a href='licenseYear.php?year=$year'><p class='flipB' id='setting'>$year</a><br/>";
				}
			}
			$year++;
			$count++;
		}
		?>
		<?php
			$query=mysql_query("select * from licensereport");
			$total = 0;
			while($display=mysql_fetch_array($query)){
		
			$payment=$display['payment'];
			
			$total = $payment + $total;
			}
			
			echo "<p align=center><b>Total Income :</b><br/>RM ".$total."</p>";
			
			$marketing = $total * 0.25;
			$maintain = $total * 0.1;
			$develop = $total * 0.4;
		?>
	<!-----------------End inner table 1----------------------->
	</td>
	<td valign=top>
	<!--------------------Inner table 2----------------------->
	<table align=center width=500 cellpadding=8>
	<tr class="menu">
		<th colspan=2>Summary Analysis</th>
		</tr>
	<tr class="menu2">
		<td>Marketing (25%)</td>
		<td>RM <?php echo $marketing;?></td>
		</tr>
	<tr class="menu3">
		<td>Agency (25%)</td>
		<td>RM <?php echo $marketing;?></td>
		</tr>
	<tr class="menu2">
		<td>Maintain (10%)</td>
		<td>RM <?php echo $maintain;?></td>
		</tr>
	<tr class="menu3">
		<td>Developer (40%)</td>
		<td>RM <?php echo $develop;?></td>
		</tr>
	<tr class="menu2">
		<td><b>Total </b></td>
		<td><b>RM <?php echo $total;?></b></td>
		</tr>
	</table>
	
	
	
	<!----------------------End inner table 2-------------------->
	
	</td>
	</tr>
</table>
<!-----------------------End outer table-------------------------->




</body>
</html>