The HTML part of the main.php script is not complicated. It consists of a table that has three headings:
Below I've highlighted the parts in red: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"><!-- InstanceBegin template="/Templates/PM_Main.dwt.php" codeOutsideHTMLIsLocked="false" --> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <!-- InstanceBeginEditable name="doctitle" --> <title>Untitled Document</title> <!-- InstanceEndEditable --> <!-- InstanceBeginEditable name="head" --><!-- InstanceEndEditable --> <link href="Templates/main.css" rel="stylesheet" type="text/css" /> </head> <body> <table width="100%" border="0"> <tr> <td width="33%"> </td> <td width="28%"> </td> <td width="39%">Logged in: <!-- InstanceBeginEditable name="login" --><? echo $_SESSION['name'];?> | <a href="logout.php">Logout</a><!-- InstanceEndEditable --></td> </tr> <tr> <td colspan="3" bgcolor="#6699CC" class="headertxt">Project Management Software </td> </tr> <tr> <td colspan="3"><!-- InstanceBeginEditable name="main" --> <table width="100%" border="0"> <tr> <td width="37%"><strong>Project Name </strong></td> <td width="34%"><strong>Status</strong></td> <td width="29%"><strong>Date Created</strong> </td> </tr> The next part of the table will be dynamic, because it will be built based on the outcome of the checks that were made in the PHP portion of the page. Just take a look at the code: <?php if($level =="admin"){?>
<?php if($num_admin > 0){ while($rowadmin = mysql_fetch_assoc($results)){ ?> <tr> <td><a href="view_project.php?pid=<?php echo $rowadmin['pid']?>"><?php echo $rowadmin['title'];?></a></td> <td><?php echo $rowadmin['status'];?></td> <td><?php echo $rowadmin['create_dt'];?> </td> </tr> <?php } }else{ ?> <tr> <td colspan="3"><p>There does not seem to be any projects registered in your name. Click on the "Create New Project" link to create a project.</p></td> </tr> <?php }?>
<?php }else{?>
blog comments powered by Disqus |
|
|
|
|
|
|
|