<?php include './header.html'; ?>

<h1>Attendee Professional Interests</h1>

<?php
include './admin/mystri_config.php';

if (!isset($query)) { $query = ''; }

if ($query == '') {

	$my_query = 'SELECT summary_id,summary_group,summary_people FROM ' . $db_tables[2]; 

} else {

	echo '<p>Search results for: <em>' . $query . '</em></p>';
	$my_query = 'SELECT summary_id,summary_group,summary_people,MATCH (summary_text) AGAINST ("' . $query . '") AS score FROM ' . $db_tables[2] . ' WHERE MATCH (summary_text) AGAINST ("' . $query . '") ORDER BY score DESC';

}

$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>Search Results</strong></p>

<p>No matching results found.</p>


<?php

} else {

	$summary_array = array();
	
	while ($row = mysql_fetch_array($res)) {
	
		$summary_array[] = '<a href="summary_detail.php?id=' . $row['summary_id'] . '">' . $row['summary_group'] . '</a><br>' . $row['summary_people'];
	
	}
	
	echo '
	
	<ul>
	<li>' , implode("</li>\n<li>", $summary_array) , '</li>
	</ul>';
	
}

?>


<p><strong>Search</strong></p>

<p>Type in a few keywords to the box below:</p>

<form action="summary_list.php" method="get">

<p><input type="text" name="query" value=""> <input type="submit" value="Search"></p>

</form>


<?php include './footer.html'; ?>