<?php
$itemID = $_GET["id"];
$_SESSION["resourceID"] = $itemID;
$getITEM = mysql_query("SELECT * FROM ath_resrc WHERE ath_resrc_id=$itemID");
$ROWgetITEM = mysql_fetch_array($getITEM);
//BEGIN SHOWING WORKS
echo("<tr>");
echo("<td valign=\"top\" height=\"10\">");
echo("</td>");
echo("</tr>");
echo("<tr>");
echo("<td align=\"left\" valign=\"top\" class=\"left\">");
if ($ROWgetITEM["ath_resrc_ownerGROUPID"] == $_SESSION["userGROUPID"]){
echo( "<b>Title: " .
"<a href=\"main.php?menu=viewresrc&act=edit&valign=top&type=res&pid=" . $ROWgetITEM["ath_resrc_id"] . "&id=" . $ROWgetITEM["ath_resrc_id"] . "\">" .
$ROWgetITEM["ath_resrc_title"] . "</a></b><br>");
//GET ALL NOTES UNDER THIS PROJECT
$start = $LIMIT * ($page - 1);
$getNOTES = mysql_query("SELECT * FROM ath_notes WHERE ath_notes_resourceID=$itemID LIMIT $start, $LIMIT");
if (!$getNOTES){
echo("<p class=\"red\">getNOTES failed in viewDETAILS.php</p>");
echo(mysql_error());
exit();
}
else{
echo("<ul>");
}
//PRINT NOTES IN A LIST
while ($ROWgetNOTES = mysql_fetch_array($getNOTES)){
echo( "<li><a href=\"main.php?menu=viewresrc&act=edit&valign=top&type=note&pid=" . $ROWgetITEM["ath_resrc_id"] . "&id=" . $ROWgetNOTES["ath_notes_id"] . "\">" .
$ROWgetNOTES["ath_notes_heading"] . ".</a>");
echo("<dl>");
echo("<dd>" . stripslashes($ROWgetNOTES["ath_notes_text"]));
echo("</dl>");
}
if ($getNOTES){
echo("</ul>");
}
}
else{
echo("<p class=\"red\">You are not allowed to view this item!</p>");
}
?>