<? include("../settings.php"); ?>
<? include("session.php"); ?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>SP Admin Panel</title>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <!-- Include all CSS/JS -->
        <!-- Bootstrap -->
 <script type="text/javascript" src="https://www.google.com/jsapi"></script>
	 <!--[if IE]><script language="javascript" type="text/javascript" src="excanvas.pack.js"></script><![endif]-->
    <!-- End of all CSS/JS -->
   </head>
<body>


			<br><br>
			<div id="piechart_div"></div><? include("nav_menu.php"); ?>
      <div class="well">
<div class="content" bgcolor="#FFFFD0">
<div class="col-12 feature">
<div class="panelCheck">
    <div class="panel-heading">
        <h3 class "panel-title"><strong>SP Admin Panel</strong></h3>
    </div>

    
    <div class="well well-lg">
        <script type="text/javascript">
				
				  // Load the Visualization API and the piechart package.
				  google.load('visualization', '1.0', {'packages':['corechart']});
				  
				  // Set a callback to run when the Google Visualization API is loaded.
				  google.setOnLoadCallback(drawChart);
				  
				  // Callback that creates and populates a data table, 
				  // instantiates the pie chart, passes in the data and
				  // draws it.
				  function drawChart() {

				  // Create the data table.
				  var data = new google.visualization.DataTable();
				  data.addColumn('string', 'Attendance');
				  data.addColumn('number', 'Description');
				  data.addRows([
					['Turned Up', 5],
					['Absent', 5],
				   ]);

				  // Set chart options
				  var options = {'title':'Attendance',
								 'width':500,
								 'height':400};

				  // Instantiate and draw our chart, passing in some options.
				  var chart1 = new google.visualization.PieChart(document.getElementById('piechart_div'));
				  chart1.draw(data, options);
			   }
			</script>
        <script type='text/javascript'>google.load('visualization', '1.0', {'packages':['corechart']});google.setOnLoadCallback(drawChart4);function drawChart4() {var data = new google.visualization.DataTable();data.addColumn('string', 'Attendance');data.addColumn('number', 'Description');data.addRows([['Turned Up',5],['Absent', 5,]]); var options = {'title':'Attendance','width':50,'height':40};var chart4 = new google.visualization.PieChart(document.getElementById('piechart_div4'));chart4.draw(data, options);}</script><div id='piechart_div4'></div>
        
    </div>
<?
	function tablescript($tbl_id){
        global $db;
        $bind = array(":search1"=>$tbl_id);
        $results = $db->select("tbl_registrant","table_id =:search1",$bind);
		$total_guest = count($results);
        $results = $db->select("tbl_registrant as a, tbl_registrant_attendance as b","a.table_id =:search1 AND a.registrant_id=b.registrant_id",$bind);
		$present_guest = count($results);
		$empty_seats = $total_guest - ($present_guest);
		return "$empty_seats,$present_guest";
	}


?>
<!-- /.modal -->
</div>
</div>
</div>
</div>
</body>
</html>

