<?
include('auth.php');
include('common.php');

$tid = $_GET['tid'];
		
$SQL="SELECT * FROM learner WHERE active=1 
	AND id IN (SELECT learner_id from tutor_learner WHERE tutor_id = ".$tid." AND alive=1)";
$results = llnb_query($SQL);
$i=0;
while($row = llnb_fetch_assoc($results))
{
	
	
	if ($i % 2)
		$odd= "class=\"odd\"";
	else
		$odd ="";
	
	$TRs .= "  
		<tr ".$odd.">
		  <td>".$row['llnb_id']."</td>
		  <td><a href=\"learner_overview.php?lid=".$row['id']."\" class=\"btnsml btn\">".$row['firstname']." ".$row['lastname']."</a></td>
		  <td>".dispPhone($row['homephone'])."</td>
		  <td><a class=\"btnsml_m\" rel=\"{handler:'iframe',size:{x:550,y:400}}\" href=\"learner_time_m.php?lid=".$row['id']."&frompg=tutorlearnerlist&tid=".$tid."&c=".$c."\">Add Session</a></td>
		 </tr>";
	$i++;
}


?>





<!doctype html>
<html class="no-js" lang="en">
<head>
  <meta charset="utf-8">

  <!-- Use the .htaccess and remove these lines to avoid edge case issues.
       More info: h5bp.com/i/378 -->
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

  <title>LLNB System</title>
  <meta name="description" content="">

  <!-- Mobile viewport optimized: h5bp.com/viewport -->
  <meta name="viewport" content="width=device-width, maximum-scale=1.0">

  <!-- Place favicon.ico and apple-touch-icon.png in the root directory: mathiasbynens.be/notes/touch-icons -->
  <LINK REL="SHORTCUT ICON" HREF="favicon.ico">

  <link rel="stylesheet" href="css/style.css">
  <link rel="stylesheet" href="css/llnb-style.css">

  <!-- More ideas for your <head> here: h5bp.com/d/head-Tips -->

  <script src="js/libs/modernizr-2.5.3.min.js"></script>
  
	<link href="scripts/SqueezeBox.css" rel="stylesheet" type="text/css" />
	<script src="scripts/mootools.js" type="text/javascript" ></script>
	<script src="scripts/SqueezeBox.js" type="text/javascript"></script>

<script type="text/javascript">

	window.addEvent('domready', function()
	{
		SqueezeBox.assign($$('a.btnsml_m'), {
			parse: 'rel'
		});
	});

</script>

  
</head>
<body>
<div id="wrap">
  <!-- Prompt IE 6 users to install Chrome Frame. Remove this if you support IE 6.
       chromium.org/developers/how-tos/chrome-frame-getting-started -->
  <!--[if lt IE 7]><p class=chromeframe>Your browser is <em>ancient!</em> <a href="http://browsehappy.com/">Upgrade to a different browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to experience this site.</p><![endif]-->
  <header>
  <a href="index.php" class="btn lfr" style="position:relative; top: 15px; right: 0;">Logout</a>
	<h1>Laubach Literacy - <?=uType();?></h1> 
	<h3><?=fetchCouncilName($_SESSION['council_id']);?></h3>
	<nav id="menu" class="clearfix navmenu">
	<a href="home.php" class="btn lfl">Home</a>
	
	<?
	if ($_SESSION['ulevel'] == $_COORD || $_SESSION['ulevel'] == $_EXECDIR)
		echo "	<a href=\"tutor_list.php\" class=\"btn lfl\">Tutor List</a> ";
	?>
	
	
	
	<a href="tutor_overview.php?tid=<?=$tid;?>" class="btn lfl">Tutor Overview</a> </nav>
  </header>
  <div role="main" id="main" class="clearfix">
  	<div id="location">
    <H2><span>Tutor:</span> <?=fetchTutorName($_GET['tid']);?></H2>
    
    </div> <!-- end of location -->
    <div>
	<h2>Learner List</h2>
    <table  border="0" cellspacing="0" cellpadding="0" class="infotable" id="seesiontable">
      <tr>
        <th scope="col">ID</th>
        <th scope="col">Learner</th>
        <th scope="col">Phone</th>
        <th scope="col">Sessions</th>
      </tr>
<?=$TRs;?>
    </table>
<p>


    
    
    
    
    
    </div>
  </div> <!-- end of main -->
<aside>
    <?php //include('aside_tutor_myprofile.php'); ?>

</aside>
    <div style="clear:both;"></div>
<footer>
  <?php include('footer.php'); ?>
</footer>
</div>



</body>
</html>