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

if ($_POST)
{
	$SQL = "UPDATE execdir SET 
		firstname = '".secure_user_input($_POST['firstname'])."',
		lastname = '".secure_user_input($_POST['lastname'])."',
		email = '".secure_user_input($_POST['email'])."',
		password = '".secure_user_input($_POST['password'])."'
		WHERE id=".$_SESSION['user_id'];
		$results = llnb_query($SQL);
		header("Location: ./home.php");

}


//fetch ED's info

$SQL="SELECT * FROM execdir WHERE id =". $_SESSION['user_id'];
$results = llnb_query($SQL);
$row = llnb_fetch_assoc($results);




?>

<!doctype html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="en"> <![endif]-->
<!--[if IE 7]>    <html class="no-js lt-ie9 lt-ie8" lang="en"> <![endif]-->
<!--[if IE 8]>    <html class="no-js lt-ie9" lang="en"> <![endif]-->
<!-- Consider adding a manifest.appcache: h5bp.com/d/Offline -->
<!--[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.executivediirector.firstname.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 - Executive Director</h1> 
	<nav id="menu" class="clearfix navmenu"><a href="home.php" class="btn lfl">Home</a><a href="executive_director_overview.php" class="btn lfl">Executive Director Overview</a></nav>
  </header>
  <div role="main" id="main" class="clearfix">
  	<div id="location">
    <H2>Executive Director Profile</H2>
    
    </div> <!-- end of location -->
    <div>
    
    <form class="midform" name="executivediirector" action="executive_director_profile.php" method="POST">
    <div style="float:left;margin-right:10px;">
    <label>First Name:</label>
    <input name="firstname" type="text"   value="<?= $row['firstname'];?>">
    </div>
    <div style="float:left;margin-right:10px;">
    <label>Last Name:</label>
    <input name="lastname" type="text"   value="<?= $row['lastname'];?>">
    </div>
    <div style="clear:both;"></div>

    <div style="float:left;margin-right:10px;">
    <label class="mandatory">Email Address *</label>
    <input name="email" type="text"   value="<?= $row['email'];?>" class="lrg">
    </div>
    <div style="float:left; margin-right:10px;">
    <label class="mandatory">Password *</label>
    <input name="password" type="text"   maxlength="16" value="<?= $row['password'];?>">
    </div>
    <div style="clear:both;"></div>

    	<p class="clearfix">
    	<input type="submit" value="Save  &amp; Close" class="btn lfr">
    	<a href="executive_director_overview.php" class="btn lfr">Cancel</a>
    	</p>
    </form>
    </div>
    
    
    
  </div><!-- end of main -->
  <aside>
	<?php //include('aside.php'); ?>
  </aside>
    <div style="clear:both;"></div>
  <footer>
	<?php include('footer.php'); ?>
  </footer>
  </div> <!-- end of wrap -->


</body>
</html>