<?php	
	$conn = @mysql_connect("localhost","geoide5_joom340","34WP[59[5S");
	if(!$conn){
		echo "<h1>Cannot Access Database?</h1>";
		exit();
	}
	mysql_select_db("geoide5_joom340");
	
	if(isset($_REQUEST['action'])){
		if($_REQUEST['action']=="del"){
			$t1 = $_REQUEST['num'];
			$sql  = "DELETE FROM tb_project WHERE ID = '$t1'";
			
			$result = mysql_query($sql);
			if(!$result){
				echo "<h4>Cannot input data. Please review data?</h4>";
			}
		}
	}
?>
<html>
<head>
	<title>LAN project status - For viewing</title>
	
	<meta name="author" content="Dexter Grageda" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta name="robots" content="noindex,nofollow" />
</head>
<body>
<hr color="#88ff88" />

<table border="0" align="center">
<tr>
	<td colspan="6"><img src="_banner.jpg" align="center"/></td>
</tr>
<tr>
		<td bgcolor="#88ff88">ID</td>
		<td bgcolor="#88ff88">Module name</td>
		<td bgcolor="#88ff88">Status</td>
		<td bgcolor="#88ff88">Completion date</td>
		<td bgcolor="#88ff88">Completion time</td>
		<td bgcolor="#88ff88">Date started</td>
		<td bgcolor="#88ff88" width="400">Task description</td>
</tr>
<?php
	$sql = "SELECT * FROM tb_project";
	$query = mysql_query($sql);
	while($row = mysql_fetch_array($query))
	{
?>
	<tr>
		<td bgcolor="#ff9944"><?php echo $row['ID'];?></td>
		<td><?php echo $row['ModuleName'];?></td>
		<td><?php echo $row['TaskDesc'];?></td>
		<td bgcolor="#568f57"><?php echo $row['Status'];?></td>
		<td><?php echo $row['CompletionDate'];?></td>
		<td><?php echo $row['CompletionTime'];?></td>
		<td><?php echo $row['DateStarted'];?></td>
		<td>
			<a href="?action=del&num=<?php echo $row['ID'];?>" onClick="return confirm('Tangalin and record?');">
			Delete
			</a>
		</td>
	</tr>
<?php
	}
?>
<tr>
		<td bgcolor="#88ff88" colspan="7">&nbsp;</td>
</tr>

</table><br /><br />
<a href="index_programs.php">Back</a>

</body>
</html>
<?php
	mysql_close($conn);
?>