<?php

// +----------------------------------------------------------------------+
// | OpenConf                                                             |
// +----------------------------------------------------------------------+
// | Copyright (c) 2002-2008 Zakon Group LLC.  All Rights Reserved.       |
// +----------------------------------------------------------------------+
// | This source file is subject to the OpenConf License, available on    |
// | the OpenConf web site: www.OpenConf.com                              |
// +----------------------------------------------------------------------+

require_once "../include.php";

beginChairSession();

printHeader("Review",1);

$q = "SELECT " . OCC_TABLE_PAPERREVIEWER . ".*, CONCAT_WS(' '," . OCC_TABLE_REVIEWER . ".name_first," . OCC_TABLE_REVIEWER . ".name_last) AS name, " . OCC_TABLE_PAPER . ".title FROM " . OCC_TABLE_PAPERREVIEWER . ", " . OCC_TABLE_REVIEWER . ", " . OCC_TABLE_PAPER . " WHERE " . OCC_TABLE_PAPERREVIEWER . ".reviewerid='".$_GET['rid']."' AND " . OCC_TABLE_PAPERREVIEWER . ".paperid='".$_GET['pid']."' AND " . OCC_TABLE_PAPERREVIEWER . ".reviewerid=" . OCC_TABLE_REVIEWER . ".reviewerid AND " . OCC_TABLE_PAPERREVIEWER . ".paperid=" . OCC_TABLE_PAPER . ".paperid";
$r = ocsql_query($q) or err("Unable to get information ".mysql_errno());
if (mysql_num_rows($r)!=1) { err("# of paper/reviewer matches != 1<p>\n"); }
$l = mysql_fetch_array($r);

require_once "../review/review_inc.php";

print '
<p><b>Paper:</b> <a href="show_paper.php?pid='.$_GET['pid'].'">'.$_GET['pid'].' - ' . safeHTMLstr($l['title']) . '</a></p>
<p><b>Reviewer:</b> <a href="show_reviewer.php?rid='.$_GET['rid'].'">'.$_GET['rid'].' - ' . safeHTMLstr($l['name']) . '</a></p>
';

displayReview($l, $_GET['rid']);

printFooter();

?>
