<?php
if (!isset($id)) { $id = ''; }
if ($id == '') {
header("Location: /concord-workshop/abstracts_list.php");
exit;
}
?>

<?php include './header.html'; ?>

<h1>Abstracts of Poster/Demos and Invited Talks</h1>

<?php
include './admin/mystri_config.php';

$my_query = 'SELECT title, abstract, authors, type FROM ' . $db_tables[0] . ' WHERE abstract_id="' . $id . '"'; 

$mysql_conn = mysql_pconnect($db_host, $db_user, $db_password);
mysql_select_db($db_database);

$res = mysql_query($my_query, $mysql_conn);

if (mysql_num_rows($res) < 1) {

?>

<p><strong>Abstract doesn't exist.</strong></p>

<p>Please use your browser's <strong>back</strong> button and make another selection or
use the search feature below.</p>


<?php

} else {

	while ($row = mysql_fetch_array($res)) {
	
		echo '
		<p><big><strong>' . $row['title'] . '</strong></big> <br>
		' . $row['authors'] . '</p>
		
		<p><strong>' . $row['type'] . '</strong></p>
		
		<p>' . nl2br($row['abstract']) . '</p>
		';
	
	}
	
	$my_query2 = 'SELECT material_name, material_link, material_file_name FROM ' . $db_tables[1] . ' WHERE abstract_id="' . $id . '" ORDER BY material_name'; 	
	$res2 = mysql_query($my_query2, $mysql_conn);
	
	if (mysql_num_rows($res2) > 0) {
	
		echo '
		<p><strong>Associated Materials</strong></p>
		
		<ul>
		';
		
		while ($row2 = mysql_fetch_array($res2)) {
		
			if ($row2['material_file_name'] != '') {
			
				echo '<li><a href="materials/' . $row2['material_file_name'] . '">' . $row2['material_name'] . '</a></li>';
			
			} else {
			
				echo '<li><a href="' . $row2['material_link'] . '">' . $row2['material_name'] . '</a></li>';
			
			}
			
		}
		
		echo '
		</ul>
		
		';
	
	}

}?>


<p><strong>Search Abstracts</strong></p>

<form action="abstracts_list.php" method="get">

<p><input type="text" name="query" value=""> <input type="submit" value="Search"></p>

</form>


<?php include './footer.html'; ?>