Location: PHPKode > projects > Kudos > nirap/Milestone.php
<?php
include ("includes/kudos.php");
include ("includes/kudos_cookie.php");

$GroupID = $_GET['group'];
$Category = $_GET['category'];


if (isset($Category) and isset($GroupID)){
$Milestones = mysql_query("Select GroupName, CatName, if(sum(EmpReceiver=EmpID) = 0,0,ifnull(sum(pointvalue),0)) as Points ,ifnull( MS1,'no milestone set') as Milestone1, ifnull(MS2,'no milestone set') as Milestone2, ifnull(MS3, 'no milestone set') as Milestone3 from Team join GroupCategory on Team.GroupID = GroupCategory.GroupID join Category on Category.CatID = GroupCategory.CatID left join History on Category.CatID = History.CatID and History.GroupID = Team.GroupID  join EmployeeGroup on EmployeeGroup.GroupID = Team.GroupID where EmpID = '$employee'  and Team.GroupID='$GroupID' and Category.CatID = '$Category' group by Category.CatID, Team.GroupID;") or die("Could not connect to mysql");
$count = mysql_num_rows($Milestones);
}
elseif (isset($GroupID)){
$Milestones = mysql_query("Select GroupName, CatName, if(sum(EmpReceiver=EmpID) = 0,0,ifnull(sum(pointvalue),0)) as Points ,ifnull( MS1,'no milestone set') as Milestone1, ifnull(MS2,'no milestone set') as Milestone2, ifnull(MS3, 'no milestone set') as Milestone3 from Team join GroupCategory on Team.GroupID = GroupCategory.GroupID join Category on Category.CatID = GroupCategory.CatID left join History on Category.CatID = History.CatID and History.GroupID = Team.GroupID  join EmployeeGroup on EmployeeGroup.GroupID = Team.GroupID where EmpID = '$employee'  and Team.GroupID='$GroupID' group by Category.CatID, Team.GroupID;") or die("Could not connect to mysql");
$count = mysql_num_rows($Milestones);

}

$Category_Results = mysql_query("Select Category.CatID, CatName from Category join GroupCategory on Category.CatID = GroupCategory.CatID where GroupID='$GroupID'");
?>
<html>
<head>
<script src="update.js"></script>
</head>
<body>
<?php if($count == 0){
echo "nothing to display ";
} 
else{ ?>

<table BORDER=0 CELLSPACING=2 CELLPADDING=5 WIDTH="100%">
<tr  align= "center" bgcolor="#000000"><th>Group Name</th><th>Category</th><th>Points</th><th>Target 1</th><th>Target 2</th><th>Target<br>  3</th>
<?php	while($miles = mysql_fetch_array($Milestones)){ ?>

<tr><td><?php echo $miles['GroupName']; ?></td><td><?php echo $miles['CatName']; ?></td><td><?php echo $miles['Points']; ?></td><td><?php echo $miles['Milestone1']; ?></td><td><?php echo $miles['Milestone2']; ?></td><td><?php echo $miles['Milestone3']; ?></td></tr>

<?php } }?>


<?php echo "|"; ?>
			 
				<h2>Group Categories</h2> 
				  <?php while($Category=mysql_fetch_array($Category_Results)) { 
$Cat=$Category['CatID'];?>
				  <a onClick = "getMilestone('Milestone.php?group=' + <?php echo $GroupID ?> + '&category=' + <?php echo $Cat ?> );" ><?php echo $Category['CatName']; ?></a><br>

				  <?php } ?>
				<br> 
</body>
</html>
Return current item: Kudos