require_once("../include.php"); $redirect = 'index.php'; // where to redirect if the specified project can't be found if (!isset($_GET['id']) || !is_numeric($_GET['id'])) header("Location: $redirect"); $id = $_GET['id']; $dbCon = getConnection(); $sql = "UPDATE project SET hits = hits+1 WHERE id=$id"; // get the project details // note: duplication of the staff tables allows for 2 references to it (without returning 2 rows) $sql = "SELECT p.name, p.description, r.name, p.city, dp.name_first, dp.name_last, pm.name_first, pm.name_last, p.completion_date, p.stats FROM project p LEFT JOIN region r ON (p.region = r.id) LEFT JOIN staff dp ON (p.design_principal = dp.id) LEFT JOIN staff pm ON (p.project_manager = pm.id) WHERE p.id = $id ORDER BY p.name ASC "; $result = doQuery($sql, $dbCon); if (mysql_num_rows($result) > 0) { list($name, $description, $region, $city, $dp_first, $dp_last, $pm_first, $pm_last, $date, $stats) = mysql_fetch_array($result, MYSQL_BOTH); $name = htmlentities(theToFront($name)); $description = str_replace("\r\n\r\n", "\n", $description); // don't show region title if it's already in the city title if (strstr($city, $region) !== false) $region = ''; else $region = ', ' . $region; } else { mysql_close($dbCon); header("Location: $redirect"); die(); } mysql_free_result($result); // get the associated media (but don't include zoom images) $sql = "SELECT m.title, m.location, m.file, mt.name FROM media m, projectxmedia pxm, media_type mt WHERE pxm.project = $id AND pxm.media = m.id AND m.media_type = mt.id AND m.media_type != 8 ORDER BY mt.name ASC, pxm.ordering ASC"; $result = doQuery($sql, $dbCon); $media = array(); $backgrounds = array(); for ($i = 0; $i < mysql_num_rows($result); $i++) { list($title, $location, $file, $type) = mysql_fetch_array($result, MYSQL_BOTH); $media[] = ''. $title .' ('. $type .')'; if ($type == 'Full Experiential Photo') $backgrounds[] = $location.$file; } mysql_close($dbCon); // Page Content Begins --------------------------------- //htmlHeader($title = '', $meta = '', $js = array(), $background = '') { htmlHeader($name, '', '', $backgrounds[rand(0, count($backgrounds)-1)]); require_once("../_superNav.php"); require_once("_nav.php"); ?>
' . $media[$i] . '
'); ?>