
<link rel="stylesheet" href="../css/bootstrap.min.css" />
<?php include '../events/event_menu.php' /** calling of header(to make it uniform in all template file) **/?>
<div class="container home">
		<h3> View all the events</h3>
		<?php include "../connection.php" /** calling of connection.php that has the connection code **/ ?>
		<table class="table table-bordered">
              <thead>
                <tr>
                  <th width="60px">Event ID</th>
                  <th>Title</th>
                  <th>Details</th>
                  <th>Image</th>
				  <th>&nbsp;</th>
				  <th>&nbsp;</th>
                </tr>
              </thead>
              <tbody>
			  <?php 
				$result = mysql_query("SELECT * FROM event ORDER BY created_at DESC");
				
				while($data = mysql_fetch_object($result) ):
			  ?>
                <tr>
                  <td><?php echo $data->event_id ?></td>
                  <td><?php echo $data->event_title ?></td>
                  <td><?php echo $data->event_detail?></td>
				  <td><img src="../events/event_img/<?php echo $data->event_image?>" style="padding:5px"  width="150px"/></td>
				    <td>
					<a href="updatebyId_event.php?event_id=<?php echo $data->event_id ?>">
						<button class="btn btn-info"> Edit </button>
					</a>
				  </td>
				  <td>
					<a href="deleteById_event.php?event_id=<?php echo $data->event_id ?>">
						<button class="btn btn-danger"> Delete </button>
					</a>
				  </td>
				</tr>
			  <?php
				endwhile;
				
			  ?>
              </tbody>
		</table>
		
</div>	
</div>
</body>
</html>
