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

$c=$_GET['cid'];
$SQL="SELECT name FROM council WHERE id=".$c;
$results = llnb_query($SQL);
$rcouncil = llnb_fetch_assoc($results);


$SQL="SELECT * FROM coordinator WHERE alive=1 AND council_id=".$c;
$results = llnb_query($SQL);

while($row = llnb_fetch_assoc($results))
{
	$TRs.= "
	      <tr>
	        <td><a href=\"coordinator_overview.php?cid=".$c."&coordid=".$row['id']."\" class=\"btnsml btn\">".$row['firstname']." ".$row['lastname']."</a></td>
	        <td>".dispPhone($row['homephone'])."</td>
	        <td>".dispPhone($row['workphone'])."</td>
	        <td><a  onClick=\"return confirm('Are you sure you want to delete?');\"  href=\"do_delete_coordinator.php?cid=".$c."&frompg=council_coordinator_list&coordid=".$row['id']."\" class=\"btnsml btn\">Delete</a></td>
	      </tr>";
}
?>

<!doctype html>
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->

<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>
</head>
<body onLoad="document.forms.council.councilname.focus()">
<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'] == $_EXECDIR)
    		 	echo "<a href=\"council_list.php\" class=\"btn lfl\">Council List</a>";
    ?>  
    <a href="council_overview.php?cid=<?=$c;?>" class="btn lfl">Council Overview</a></nav>
  </header>
  <div role="main" id="main" class="clearfix">
  	<div id="location">
  	<a href="coordinator_personalinfo.php?mode=new&cid=<?=$c;?>" class="btn lfr" style="position:relative; top: 0; right: 10px;">Add Coordinator</a>
      <H2><span>Council:</span> <?=$rcouncil['name'];?></H2>
    </div>
    <!-- end of location -->
    <div>
    <H2>Coordinator List</H2>


    <table  border="0" cellspacing="0" cellpadding="0" class="infotable">
      <tr>
        <th scope="col">Coordinator</th>
        <th scope="col">Home Phone</th>
        <th scope="col">Work Phone</th>
        <th scope="col">Delete</th>
      </tr>
<?=$TRs;?>
    </table>




  </div>
</div>
<!-- end of main -->
<aside>
</aside>
    <div style="clear:both;"></div>
<footer>
  <?php include('footer.php'); ?>
</footer>
</div>
<!-- end of wrap --> 


</body>
</html>