<?include_once("../settings.php");?>

<table id='usertable' class='table-CSS3'>
<thead><tr><th>Registrant ID</th><th>Full Name</th><th>Organisation</th><th>Table Number</th><th>RSVP</th></tr></thead>
<tbody>
<?
	$SQL = "SELECT * FROM tbl_registrant;";
	$results=$qry->queryMultiSelect($SQL);
	foreach ($results as $result){
			$i++;
			$SQL = "SELECT count(*) as number FROM tbl_registrant_attendance WHERE registrant_id='".$result['registrant_id']."';";
			$exist = $qry->querySelectSingle($SQL);
			$SQL = "SELECT tbl_name FROM tbl_table WHERE tbl_id='".$result['tbl_id']."';";
			$tablename = $qry->querySelectSingle($SQL);
			$output.="<tr><td>".$result['registrant_id']."</td><td><a href='inc/search_info.php?registrant_id=".$result['registrant_id']."&KeepThis=true&TB_iframe=true&height=600&width=600' class='thickbox'>".$result['registrant_surname']." ".$result['registrant_givenname']."</a></td><td>".$result['registrant_organisation']."</td><td>".$tablename['tbl_name']."</td><td>".$result['registrant_attending']."</td></tr>";
		}
		echo $output;
?>
</tbody>
<tfoot><tr><th>Registrant ID</th><th>Full Name</th><th>Organisation</th><th>Table Number</th><th>RSVP</th></tr></tfoot>
</table>
