<?php
if (!isset($_COOKIE["user"]))
{
	header("Location: index.html");
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>Up-coming Event</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/bootstrap.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/responsive.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/style.css" type="text/css" media="screen">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,300' rel='stylesheet' type='text/css'>
<script src="js/jquery.js"></script>
<script src="js/superfish.js"></script>
<script src="js/jquery.easing.1.3.js"></script>
<script src="js/jquery.cookie.js"></script>
<script>
if ($(window).width() > 1024) {
    document.write("<" + "script src='js/jquery.preloader.js'></" + "script>");
}
</script>
<script>
jQuery(window).load(function () {
    $x = $(window).width();
    if ($x > 1024) {
        jQuery("#content .row").preloader();
    }
    jQuery(".list-blog li:last-child").addClass("last");
    jQuery(".list li:last-child").addClass("last");
    jQuery('.spinner').animate({
        'opacity': 0
    }, 200, 'easeOutCubic', function () {
        jQuery(this).css('display', 'none')
    });
});
</script>
<!--[if lt IE 8]>
<div style='text-align:center'><a href="http://www.microsoft.com/windows/internet-explorer/default.aspx?ocid=ie6_countdown_bannercode"><img src="http://www.theie6countdown.com/img/upgrade.jpg"border="0"alt=""/></a></div>  
<![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<!--<![endif]-->
<!--[if lt IE 9]>
<script src="js/html5.js"></script>
<link rel="stylesheet" href="css/docs.css" type="text/css" media="screen">
<link rel="stylesheet" href="css/ie.css" type="text/css" media="screen">
<link href='http://fonts.googleapis.com/css?family=Open+Sans:300' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400' rel='stylesheet' type='text/css'>
<![endif]-->
</head>
<body>
<div class="spinner"></div>
<!--  header  -->
<header>
  <div class="container clearfix">
    <div class="row">
      <div class="span12">
        <div class="navbar navbar_">
          <div class="container">
            <h1 class="brand brand_"><a href="homepage.php"><img alt="" src="img/logoict.png"> </a></h1>
            <a class="btn btn-navbar btn-navbar_" data-toggle="collapse" data-target=".nav-collapse_">Menu <span class="icon-bar"></span> </a>
            <div class="nav-collapse nav-collapse_  collapse">
              <ul class="nav sf-menu">
                <li><a href="homepage.php">Home</a></li>
                <li><a href="photoalbum.php">Gallery</a></li>
                <li class="active"><a href="event.php">Event</a></li>
                <li class="sub-menu"><a href="classmates.php">classmates</a>
                    
                  </ul>
                </li>	
              </ul>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</header>

|<a  href="logout.php">logout</a>|

<div class="bg-content">
  <!--  content  -->
  
    <div class="container">
     <div class="row"> 
			<div id="sidebar"> 
			<div class="sidebar-menu">
			<article class="span4"> 
			<h3> New Class Activitie </h3>	
			
				<form action = "uploadevent.php" method="post">
				<h5> Event : </h5>
				<input type = "text" name = "event"><br>
				<h5> Date : </h5>
				<input type = "date" name = "date"><br>
				<h5> Venue : </h5>
				<input type = "text" name = "venue"><br>
				<h5> Time : </h5>
				<input type = "time" name = "time"><br>
				<input type = "submit" class="btn btn-1  value = "Submit">
				<input type = "reset"  class="btn btn-1 value = "reset"> 
				</form>
		  
</div>
</div>				

<article class="span6"> 
<?php
$con=mysqli_connect("85.10.205.173","sumhohoho04","THMSSsumho04","sumho2017");
// Check connection
	if (mysqli_connect_errno())
		{
			echo "Failed to connect to MySQL: " . mysqli_connect_error();
		}

	$result = mysqli_query($con,"SELECT * FROM event");
?>			
					<table align = "center" border="1" cellspacing = "0" cellpadding="0" width= "500">
					<caption><h3> Your Up-coming Event </h3></caption>
					<tr>
					<th>Event</th>
					<th>Date</th>
					<th>Venue</th>
					<th>Time</th>
					<th>Edit</th>
					</tr>
					<?php
					$i=1;
					while($row = mysqli_fetch_array($result))
					{
					echo"<tr>
						<td> ".$row['event']."</td>
						<td> ".$row['date']."</td>
						<td> ".$row['venue']."</td>
						<td> ".$row['time']."</td>
						<td align = 'center'>
						<a href='#'>Delete</a> 
						<a href='#'>Update</a>   
						</td>
						</tr>";
						$i++;
					}
					?>
				</table>			

      </div>
	 </div>
   </div>
</div>
<!--  footer  -->

<script src="js/bootstrap.js"></script>
</body>
</html>

