<?php include("menu.php"); ?>
<?php include("dataaccess.php"); ?>
<?php include("functions.php"); ?>
<?php
//' Copyright 2004 Vender-MGT http://www.vender-mgt.com
if(!empty($HTTP_GET_VARS))
{
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"];
}
if(empty($orderby))
{
$orderby = "projectname";
}
if(empty($order))
{
$order = "asc";
}
if ($order == "asc")
$order = "desc";
else if ($order == "desc")
$order = "asc";
else
$order = "asc";
dbConnect();
$result = mysql_query("Select * from cmt_project order by " . $orderby . " " . $order . mysql_error());
?>
<h3 align="center">List Projects</h3>
<BR>
<em>Click on a column title to sort by that column; click again to reverse the sort.</em>
<?php
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"];
$ed=explode("-",$end);
$edate=$ed[1]."-".$ed[2]."-".$ed[0];
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>";
mysql_free_result($result);
mysql_close();
?>
<br><br>
<center>
<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.
?>
</center>
janguyo 0 Newbie Poster
veedeoo 474 Junior Poster Featured Poster
broj1 356 Humble servant Featured Poster
janguyo 0 Newbie Poster
diafol
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.