Location: PHPKode > projects > ProjectPress > projectpress/projects/project.php
<?php 
/**
 * ProjectPress a project's page
 *
 * @package ProjectPress
 * @since 2.0
 */

// Starts the session.
session_start();

define('access',true);

include(dirname(dirname(__FILE__)) . '/config.inc.php');
include(PM_DIR . 'pm-includes/global.inc.php');
require(PM_DIR . 'pm-includes/functions.php');
include(PM_DIR . 'pm-includes/header.php');

// Checks if user is logged in; if not redirect to login page.
if($current_user->hasPermission('access_site') != true) { pm_redirect(PM_URI . '/index.php'); }

// Enable for error checking and troubleshooting.
# display_errors();

$sql = pmdb::connect()->query('SELECT * FROM '.DB.'projects WHERE p_id = '.$_GET['p_id']);

?>


<?php 
while($row = $sql->fetch_array()) { 
$pmem = pmdb::connect()->query("SELECT * FROM ".DB."project_members WHERE pp_id = '".$_GET['p_id']."' AND pm_user = '".$_SESSION['username']."'");
$plead = pmdb::connect()->query("SELECT * FROM ".DB."project_leaders WHERE p_id = '".$_GET['p_id']."' AND pl_user = '".$_SESSION['username']."'");
?>

				<div id="page-title">
					<img src="<?php echo PM_URI; ?>/images/groups.png" alt="" />
					<h1>
						<?php echo $row['project_name']; ?>
						<?php if($current_user->hasPermission('edit_projects')) { echo '<span id="header-link"><a href="edit_project.php?p_id=' . $_GET['p_id'] . '">Edit Project</a></span>'; } ?>
					</h1>
				</div>
				
				<?php if($r = $pmem->fetch_array() || $r = $plead->fetch_array()) { ?>
				<div id="tabs">
					<ul>
						<li <?php if (basename($_SERVER["REQUEST_URI"]) == "project.php?p_id=".$_GET['p_id']) echo "class='active_link'";?>>
							<a href="<?php echo PM_URI ?>/projects/project.php?p_id=<?php echo $_GET['p_id']; ?>"><span>Project</span></a>
						</li>
						<li <?php if (basename($_SERVER["REQUEST_URI"]) == "discussions.php?p_id=".$_GET['p_id']) echo "class='active_link'";?>
							<?php if (basename($_SERVER["REQUEST_URI"]) == "add_ptopic.php?p_id=".$_GET['p_id']) echo "class='active_link'";?>>
							<a href="<?php echo PM_URI ?>/projects/forum/discussions.php?p_id=<?php echo $_GET['p_id']; ?>"><span>Forum</span></a>
						</li>
						<li <?php if (basename($_SERVER["REQUEST_URI"]) == "contact.php?p_id=".$_GET['p_id']) echo "class='active_link'";?>>
							<a href="<?php echo PM_URI ?>/projects/contact.php?p_id=<?php echo $_GET['p_id']; ?>"><span>Email</span></a>
						</li>
						<li <?php if (basename($_SERVER["REQUEST_URI"]) == "project_members.php?p_id=".$_GET['p_id']) echo "class='active_link'";?>>
							<a href="<?php echo PM_URI ?>/projects/project_members.php?p_id=<?php echo $_GET['p_id']; ?>"><span>Members</span></a>
						</li>
					</ul>
				</div>
				<?php } ?>

				<div id="middle">
				<div id="groups-page"> 
					<table cellspacing="0" cellpadding="0">
						<tr class="list">
							<th scope="row"><span class="list-name">Description</span></th>
							<td><?php echo $row['project_description']; ?></td>
						</tr>

						<tr class="list">
							<th scope="row"><span class="list-name">Contact Email</span></th>
							<td><a href="mailto:<?php echo $row['contact_email']; ?>"><?php echo $row['contact_email']; ?></a></td>
						</tr>
						
						<tr class="list">
							<th scope="row"><span class="list-name">Members</span></th>
							<td>This project has <?php get_project_member_count(); ?> members</td>
						</tr>
					</table>

				</div>
				</div>
<?php } ?>


<?php

include(PM_DIR . 'pm-includes/footer.php');
Return current item: ProjectPress