<?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>Attendance</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);
			if ($exist['number']>0)
				$attend = "Yes";
			else
				$attend = "No";
			$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/delegate_attendance_take.php?registrant_id=".$result['registrant_id']."&KeepThis=true&TB_iframe=true&height=300&width=500' class='thickbox'>".$result['registrant_surname']." ".$result['registrant_givenname']."</a></td><td>".$result['registrant_organisation']."</td><td>".$tablename['tbl_name']." (".$result['seat_number'].")</td><td>".$attend."</td></tr>";
		}
		echo $output;
?>
</tbody>
<tfoot><tr><th>Registrant ID</th><th>Full Name</th><th>Organisation</th><th>Table Number</th><th>Attendance</th></tr></tfoot>
</table>


