<?php include("menu.php"); ?>
<?php include("dataaccess.php"); ?>
<?php include("functions.php"); ?>

//'   Copyright 2004 Vender-MGT  http://www.vender-mgt.com
if (!empty($HTTP_GET_VARS["orderby"]))
    $orderby = $HTTP_GET_VARS["orderby"];
if (!empty($HTTP_GET_VARS["order"]))        
    $order = $HTTP_GET_VARS["order"];
if (!empty($HTTP_GET_VARS["id"]))       
    $categoryid = $HTTP_GET_VARS["id"];

    $orderby = "projectname";
    $order = "asc";
if ($order == "asc") 
    $order = "desc";
else if ($order == "desc") 
    $order = "asc";
    $order = "asc";

$result = mysql_query("Select * from cmt_project order by " . $orderby .  " " . $order . mysql_error());

<h3 align="center">List Projects</h3>
<em>Click on a column title to sort by that column; click again to reverse the sort.</em>
if (!$result) {
   die('Invalid query: ' . mysql_error());
    echo "<p><div align=center>";
    echo "<table width=650 cellspacing=1 cellpadding=5 border=0>";
    echo "<tr bgcolor=#6699CC><th font color=#FFFFFF nowrap><a href='listprojects.php?orderby=projectname&order=" . $order . "'>Project Name</a></th>
   <th colspan =3 ><font color=#FFFFFF size=2>P.I Name</a></th>
   <th colspan =3 ><font color=#FFFFFF size=2>Cordinator Name</a></th>
   <th ><font color=#FFFFFF size=2>Description</a></th>
   <th ><font color=#FFFFFF size=2>Start Date</a></th>
   <th ><font color=#FFFFFF size=2>End Date</a></th>
   <th ><font color=#FFFFFF size=2>Project Length</a></th>
   <th ><font color=#FFFFFF size=2>Period Left</font></th></tr>"; 

while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) {
    $end = $row["enddate"];
   echo "<tr bgcolor=#C3A233><td nowarp><a href='showproject.php?id=" . $row["projectid"] ."'>" . $row["projectname"] . "</a></td>
   <td colspan = 3 nowrap>" . $row["pi_title"] . "." . $row["pi_fname"] . "." . $row["pi_lname"] . "</a></td>
   <td colspan =3 nowrap >" . $row["c_title"] . ". " . $row["c_fname"] . "." . $row["c_lname"] .  "</a></td>
   <td>" . $row["description"]  . "</a></td>
   <td>" . $row["startdate"] . "</a></td>
   <td>" . $row["enddate"] . "</a></td>
   <td>" . $row["length"] . "</a></td>
   <td>" .$timeleft = time_left($end)."</td></tr>";    
    echo "</table></div>";



<p><font color="#000000">Copyright © 2012 Joint Clinical Research Centre. All Rights Reserved </font>
  //This Software Copyright 2012 New Wave Contract Management.  See www.contract-mgt.com for details.
  //This Software is 100% Free and May not be redistributed.
  //or resold.


I think $HTTP_GET_VARS has been deprecated. Just use $_GET[].

The new implementation we are currently using in the last 2 years is this


## deal with the GET method
function process_get(){

## deal with the POST method{

function process_post(){



By using the above processing method, you can pretty much process any form data coming from all points of your website.. Yes, that includes pagination. YOu will just have to write a simple function for it, or a simple processor class.

There are many closing </a> tags without the opening <a> tag in your table cells. Has this error happened during the copy/paste operations? On line 61 you have a typo <td nowarp> should be <td nowrap>.

Thanks veedeo....have coreected that, Thankz broj1 I had just copied and pasted line 61 for eac of those columms.
My issue is I need the timeleft to be displayed in cell ..line68 but it gets displayed on the right side top of my html table.....how can I fix this newbie (have a function time left that calculates time left from End date)... Thanx in advance

Member Avatar
"<td>" .$timeleft = time_left($end)."</td></tr>";

Maybe should be:

"<td>" . time_left($end)."</td></tr>"; 

If the function returns a value.